feat: initial version

This commit is contained in:
Derrick Hammer 2023-07-19 11:33:50 -04:00
parent adc49ad9f0
commit 8dab108187
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
4 changed files with 18490 additions and 0 deletions

5
.presetterrc.json Normal file
View File

@ -0,0 +1,5 @@
{
"preset": [
"@lumeweb/node-library-preset"
]
}

18426
npm-shrinkwrap.json generated Normal file

File diff suppressed because it is too large Load Diff

30
package.json Normal file
View File

@ -0,0 +1,30 @@
{
"name": "@lumeweb/kernel-network-registry-client",
"version": "0.1.0",
"type": "module",
"main": "lib/index.js",
"repository": {
"type": "git",
"url": "gitea@git.lumeweb.com:LumeWeb/kernel-network-registry-client.git"
},
"devDependencies": {
"@lumeweb/node-library-preset": "^0.2.7",
"presetter": "*"
},
"readme": "ERROR: No README data found!",
"_id": "@lumeweb/kernel-network-registry-client@0.1.0",
"scripts": {
"prepare": "presetter bootstrap",
"build": "run build",
"semantic-release": "semantic-release"
},
"dependencies": {
"@lumeweb/libkernel": "^0.1.0-develop.20"
},
"files": [
"lib"
],
"publishConfig": {
"access": "public"
}
}

29
src/index.ts Normal file
View File

@ -0,0 +1,29 @@
import { Client, factory } from "@lumeweb/libkernel/module";
const MODULE = "zduFYRFUur1hBiW1u18dqQsn2w7AiQhBmgd7PiXsX71AtAJHykhNXsUUpw";
export class NetworkRegistryClient extends Client {
public async registerType(name: string) {
return this.callModuleReturn("registerType", name);
}
public async getTypes() {
return this.callModuleReturn("getTypes");
}
public async getNetworkTypes(module: string) {
return this.callModuleReturn("getNetworkTypes", { module });
}
public async registerNetwork(module: string) {
const bag = this.getBound(module);
const ret = await bag.callModule("register");
this.handleError(ret);
}
}
export const createClient = factory<NetworkRegistryClient>(
NetworkRegistryClient,
MODULE,
);