shrub/pkg/npm/api
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
..
contacts interface: fix sharing private profile 2021-09-23 12:11:05 +10:00
docket grid: autoally on leap 2021-10-04 16:01:35 +10:00
graph interface: improving channel load time/ordering 2022-03-22 19:05:24 -05:00
groups npm: fix issue caused by set var in groups/lib.ts 2022-04-26 13:42:18 -05:00
hark npm: fix HarkBody type def for time 2022-03-31 11:49:21 -05:00
hood npm/api: updating build to use rollup for better distribution 2021-11-08 18:44:04 -06:00
invite @urbit/api: fix build 2021-07-02 10:40:56 +10:00
lib npm: add preSig func to npm lib 2022-03-10 14:15:49 -06:00
metadata interface: fix tsc errors 2021-08-30 10:54:09 +10:00
s3 npm: Updated http-api and api packages 2021-04-22 07:17:39 -07:00
settings settings-store: query by desk 2021-09-09 11:35:57 +10:00
term api: fix term/lib imports 2022-07-25 10:23:05 -05:00
.babelrc api,http-api: updating babel usage and fixing tests 2021-11-09 13:16:48 -06:00
.eslintrc.js npm/api: correct metadata resource interface 2021-07-07 12:24:52 -04:00
.gitignore npm: removing intermediate ts files from pkg, fixing more bad references 2021-11-10 17:54:31 -06:00
deps.d.ts npm/api: updating build to use rollup for better distribution 2021-11-08 18:44:04 -06:00
index.ts api: export term types 2022-07-25 10:22:56 -05:00
package-lock.json api: export term types 2022-07-25 10:22:56 -05:00
package.json api: make same dist updates as http-api 2022-04-27 11:17:57 -05:00
README.md npm: Updated http-api and api packages 2021-04-22 07:17:39 -07:00
rollup.config.ts api: make same dist updates as http-api 2022-04-27 11:17:57 -05:00
tsconfig.json npm: removing intermediate ts files from pkg, fixing more bad references 2021-11-10 17:54:31 -06:00

Urbit API in JavaScript

This package simplifies the process of working with Urbit's APIs into fluent, typed functions organized by app. Pairs well with @urbit/http-api. Compare:

Without:

import UrbitInterface from '@urbit/http-api';
const api: UrbitInterface = useApi();
api.poke({
  app: 'settings-store',
  mark: 'settings-event',
  json: {
    'put-entry': {
      'bucket-key': bucket,
      'entry-key': key,
      'value': value
    }
  }
});

With:

import UrbitInterface from '@urbit/http-api';
import { settings } from '@urbit/api';
const api: UrbitInterface = useApi();
api.poke(setings.putEntry(bucket, key, value));

You may import single functions

import { putEntry } from '@urbit/api';

or whole apps:

import { settings } from '@urbit/api';

This package also provides types and utilities for working with Urbit's internal data structures, such as Nouns, Das, Tas, and so forth.

This package was originally developed as part of Tlon's Landscape client and therefore the best reference material exists there.