shrub/pkg/npm/api/term/lib.ts
tomholford 02545a7309 api: fix term/lib imports
Before this change, `term/lib` was importing the Poke type from the `http-api` package. This was causing the rollup build output to place the `term` exported types in a separate path (`dist/api/term`). By switching to the relative import, it is now exported at the expected path (`dist/term`). This fixes imports in consuming projects (e.g., `import {  Belt, pokeTask, pokeBelt } from '@urbit/api/term';`).

Also, remove the extraneous `Scry` import.
2022-07-25 10:23:05 -05:00

22 lines
564 B
TypeScript

import { Poke } from '../lib'
import { Belt, Task, SessionTask } from './types';
export const pokeTask = (session: string, task: Task): Poke<SessionTask> => ({
app: 'herm',
mark: 'herm-task',
json: { session, ...task }
});
export const pokeBelt = (
session: string,
belt: Belt
): Poke<SessionTask> => pokeTask(session, { belt });
//NOTE scry will return string[]
// export const scrySessions = (): Scry => ({
// app: 'herm',
// path: `/sessions`
// });
//TODO remove stub once new backend lands
export const scrySessions = (): string[] => [''];