From ad426dafb19be8f79c64bb11c1c014b1031c96d0 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 31 Jan 2023 05:07:55 -0500 Subject: [PATCH] *Add dist --- dist/index.d.ts | 12 ++++++++++++ dist/index.d.ts.map | 1 + dist/index.js | 21 +++++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 dist/index.d.ts create mode 100644 dist/index.d.ts.map create mode 100644 dist/index.js diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..237f051 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,12 @@ +import { Client } from "@lumeweb/libkernel-universal"; +import type { Peer } from "@lumeweb/peer-discovery"; +export declare class PeerDiscoveryClient extends Client { + register(source: string): Promise; + remove(name: string): Promise; + removeAll(): Promise; + exists(name: string): Promise; + discover(pubkey: string): Promise; +} +export declare const createClient: (...args: any) => PeerDiscoveryClient; +export { Peer }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/dist/index.d.ts.map b/dist/index.d.ts.map new file mode 100644 index 0000000..0d7c3d2 --- /dev/null +++ b/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAW,MAAM,8BAA8B,CAAC;AAC/D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACpD,qBAAa,mBAAoB,SAAQ,MAAM;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMvC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAItC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAI1B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAGtC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC;CAG/D;AAED,eAAO,MAAM,YAAY,uCAGxB,CAAC;AAEF,OAAO,EAAE,IAAI,EAAE,CAAC"} \ No newline at end of file diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..c705065 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,21 @@ +import { Client, factory } from "@lumeweb/libkernel-universal"; +export class PeerDiscoveryClient extends Client { + async register(source) { + const bag = await this.loadBound(source); + const ret = await bag.callModule("register"); + this.handleError(ret); + } + async remove(name) { + return await this.callModuleReturn("remove", { name }); + } + async removeAll() { + await this.callModuleReturn("removeAll"); + } + async exists(name) { + return await this.callModuleReturn("remove", { name }); + } + async discover(pubkey) { + return await this.callModuleReturn("discover", { pubkey }); + } +} +export const createClient = factory(PeerDiscoveryClient, "FACTQhR-sNQ0K9Nh5QlHlkp5q57rxBdc2DGgacoTdwtIoA");