refactor: have HandshakeClient extend NetworkClient
This commit is contained in:
parent
193aca0dc1
commit
49a3518efe
|
@ -8,7 +8,7 @@
|
|||
"name": "@lumeweb/kernel-handshake-client",
|
||||
"version": "0.0.2-develop.10",
|
||||
"dependencies": {
|
||||
"@lumeweb/libkernel": "^0.1.0-develop.16"
|
||||
"@lumeweb/libkernel": "^0.1.0-develop.27"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@lumeweb/node-library-preset": "^0.2.7",
|
||||
|
@ -1660,12 +1660,13 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@lumeweb/libkernel": {
|
||||
"version": "0.1.0-develop.16",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libkernel/-/libkernel-0.1.0-develop.16.tgz",
|
||||
"integrity": "sha512-wYAgWl/FW8QgMfd9byuvd/DZSIouhGHhOXBay12Koqwf/nxXjYysxagQp9c4WWS2ZDAsUx9jK9bKPlT4t6sSlw==",
|
||||
"version": "0.1.0-develop.27",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libkernel/-/libkernel-0.1.0-develop.27.tgz",
|
||||
"integrity": "sha512-XkO16wzr2k1j9CrraVrL5vm5ysY+wJGwfJf9/PAknpLGko8j8Z/TbO5h/Q43iNjYjLlwBL2cGngX8orCZBWVDA==",
|
||||
"dependencies": {
|
||||
"@lumeweb/libweb": "0.2.0-develop.22",
|
||||
"emittery": "^1.0.1"
|
||||
"@lumeweb/libweb": "0.2.0-develop.27",
|
||||
"emittery": "^1.0.1",
|
||||
"p-defer": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@lumeweb/libkernel/node_modules/emittery": {
|
||||
|
@ -1680,9 +1681,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@lumeweb/libportal": {
|
||||
"version": "0.2.0-develop.12",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libportal/-/libportal-0.2.0-develop.12.tgz",
|
||||
"integrity": "sha512-FKdMzeOvi8viXwFbKLeD7c4SadLDaz/ZvSLaAumuyXiJCKk0gVM0aPO8mTkibDtJG5JfeFHef0jI9aOSMYWfXw==",
|
||||
"version": "0.2.0-develop.16",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libportal/-/libportal-0.2.0-develop.16.tgz",
|
||||
"integrity": "sha512-wyzza/ttvU6I1gIs4tnYSkcT6s7MIBnUdJSNAbe6k6NsQ1w4bhBVJhEKbBru/lAEASO/PAhHGBwaOCv20rZZfA==",
|
||||
"dependencies": {
|
||||
"@lumeweb/node-library-preset": "git+https://git.lumeweb.com/LumeWeb/node-library-preset.git",
|
||||
"@noble/curves": "^1.1.0",
|
||||
|
@ -1714,13 +1715,13 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@lumeweb/libweb": {
|
||||
"version": "0.2.0-develop.22",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libweb/-/libweb-0.2.0-develop.22.tgz",
|
||||
"integrity": "sha512-HKh0csOCC82vXqc0Keszymt4Mnu/xgD9GaBjarLclNkCK4mxxBmOuU9OmuOkANndQjl2dhMnmYJHT0bmseBj9Q==",
|
||||
"version": "0.2.0-develop.27",
|
||||
"resolved": "https://registry.npmjs.org/@lumeweb/libweb/-/libweb-0.2.0-develop.27.tgz",
|
||||
"integrity": "sha512-obS4a6mcHJNoWXy5fCDuGAIVMee0ivK8q/q0semqoS3v0PS7t7sUmRX5ajyCwGbACXYqEdq3vU7RwzxhUkuNGg==",
|
||||
"dependencies": {
|
||||
"@lumeweb/community-portals": "^0.1.0-develop.6",
|
||||
"@lumeweb/libportal": "^0.2.0-develop.12",
|
||||
"@lumeweb/node-library-preset": "git+https://git.lumeweb.com/LumeWeb/node-library-preset.git",
|
||||
"@lumeweb/libportal": "^0.2.0-develop.16",
|
||||
"@lumeweb/node-library-preset": "0.2.7",
|
||||
"@noble/curves": "^1.1.0",
|
||||
"@noble/hashes": "^1.3.1"
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
"semantic-release": "semantic-release"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lumeweb/libkernel": "^0.1.0-develop.16"
|
||||
"@lumeweb/libkernel": "^0.1.0-develop.27"
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
|
|
12
src/index.ts
12
src/index.ts
|
@ -1,4 +1,4 @@
|
|||
import { Client, factory } from "@lumeweb/libkernel/module";
|
||||
import {factory, NetworkClient} from "@lumeweb/libkernel/module";
|
||||
|
||||
export const MODULE = "zduS4q1t6q5tLtANmRaUuAJNDqTggfwtV9hhK6wMRg1v891z5ts7iyobnw";
|
||||
|
||||
|
@ -8,18 +8,10 @@ export interface Response {
|
|||
result: any;
|
||||
}
|
||||
|
||||
export class HandshakeClient extends Client {
|
||||
public async ready(): Promise<void> {
|
||||
return this.callModuleReturn("ready");
|
||||
}
|
||||
|
||||
export class HandshakeClient extends NetworkClient {
|
||||
public async query(method: string, params: any): Promise<Response> {
|
||||
return this.callModuleReturn("query", { method, params });
|
||||
}
|
||||
|
||||
public async register(){
|
||||
return this.callModuleReturn("register");
|
||||
}
|
||||
}
|
||||
|
||||
export const createClient = factory<HandshakeClient>(HandshakeClient, MODULE);
|
||||
|
|
Loading…
Reference in New Issue