@ubiquify/cyclone
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

@ubiquify/cyclone

Http(s) client for @ubiquify/relay .

Build

npm run clean
npm install
npm run build
npm run test

Plumbing client

Low level interface to the relay service.

interface RelayClientPlumbing {
  storePush(
    chunkSize: number,
    bytes: Uint8Array
  ): Promise<PlumbingStorePushResponse>;
  storePull(
    chunkSize: number,
    versionStoreId: string
  ): Promise<Uint8Array | undefined>;
  storeResolve(versionStoreId: string): Promise<string | undefined>;
  graphPush(bytes: Uint8Array): Promise<PlumbingGraphPushResponse>;
  graphPull(versionRoot: string): Promise<Uint8Array | undefined>;
  indexPull(versionRoot: string): Promise<Uint8Array | undefined>;
  blocksPush(bytes: Uint8Array): Promise<PlumbingBlocksPushResponse>;
  blocksPull(links: string[]): Promise<Uint8Array | undefined>;
  protocolVersion(): Promise<ProtocolVersion>;
}
const relayClient = relayClientPlumbingFactory({
  baseURL: "https://localhost:3002",
});

Basic client

Coarse interface to the relay service. The relay auto-merges on push.

interface RelayClientBasic {
  push(versionStoreRoot: Link, versionRoot?: Link): Promise<BasicPushResponse>;
  pull(
    versionStoreId: string,
    localVersionStoreRoot?: Link
  ): Promise<
    | { versionStore: VersionStore; graphStore: GraphStore; graph: Graph }
    | undefined
  >;
}
const relayClient = relayClientBasicFactory(
  {
    chunk,
    chunkSize,
    linkCodec,
    valueCodec,
    blockStore,
  },
  {
    baseURL: "https://localhost:3002",
  }
);

Licenses

Licensed under either Apache 2.0 or MIT at your option.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.0
    0
    • latest

Version History

Package Sidebar

Install

npm i @ubiquify/cyclone

Weekly Downloads

0

Version

0.1.0

License

(Apache-2.0 AND MIT)

Unpacked Size

74.8 kB

Total Files

20

Last publish

Collaborators

  • ubiquify