refactor: have HandshakeClient extend NetworkClient

This commit is contained in:
Derrick Hammer 2023-07-23 13:42:43 -04:00
parent 193aca0dc1
commit 49a3518efe
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
3 changed files with 18 additions and 25 deletions

29
npm-shrinkwrap.json generated
View File

@ -8,7 +8,7 @@
"name": "@lumeweb/kernel-handshake-client", "name": "@lumeweb/kernel-handshake-client",
"version": "0.0.2-develop.10", "version": "0.0.2-develop.10",
"dependencies": { "dependencies": {
"@lumeweb/libkernel": "^0.1.0-develop.16" "@lumeweb/libkernel": "^0.1.0-develop.27"
}, },
"devDependencies": { "devDependencies": {
"@lumeweb/node-library-preset": "^0.2.7", "@lumeweb/node-library-preset": "^0.2.7",
@ -1660,12 +1660,13 @@
} }
}, },
"node_modules/@lumeweb/libkernel": { "node_modules/@lumeweb/libkernel": {
"version": "0.1.0-develop.16", "version": "0.1.0-develop.27",
"resolved": "https://registry.npmjs.org/@lumeweb/libkernel/-/libkernel-0.1.0-develop.16.tgz", "resolved": "https://registry.npmjs.org/@lumeweb/libkernel/-/libkernel-0.1.0-develop.27.tgz",
"integrity": "sha512-wYAgWl/FW8QgMfd9byuvd/DZSIouhGHhOXBay12Koqwf/nxXjYysxagQp9c4WWS2ZDAsUx9jK9bKPlT4t6sSlw==", "integrity": "sha512-XkO16wzr2k1j9CrraVrL5vm5ysY+wJGwfJf9/PAknpLGko8j8Z/TbO5h/Q43iNjYjLlwBL2cGngX8orCZBWVDA==",
"dependencies": { "dependencies": {
"@lumeweb/libweb": "0.2.0-develop.22", "@lumeweb/libweb": "0.2.0-develop.27",
"emittery": "^1.0.1" "emittery": "^1.0.1",
"p-defer": "^4.0.0"
} }
}, },
"node_modules/@lumeweb/libkernel/node_modules/emittery": { "node_modules/@lumeweb/libkernel/node_modules/emittery": {
@ -1680,9 +1681,9 @@
} }
}, },
"node_modules/@lumeweb/libportal": { "node_modules/@lumeweb/libportal": {
"version": "0.2.0-develop.12", "version": "0.2.0-develop.16",
"resolved": "https://registry.npmjs.org/@lumeweb/libportal/-/libportal-0.2.0-develop.12.tgz", "resolved": "https://registry.npmjs.org/@lumeweb/libportal/-/libportal-0.2.0-develop.16.tgz",
"integrity": "sha512-FKdMzeOvi8viXwFbKLeD7c4SadLDaz/ZvSLaAumuyXiJCKk0gVM0aPO8mTkibDtJG5JfeFHef0jI9aOSMYWfXw==", "integrity": "sha512-wyzza/ttvU6I1gIs4tnYSkcT6s7MIBnUdJSNAbe6k6NsQ1w4bhBVJhEKbBru/lAEASO/PAhHGBwaOCv20rZZfA==",
"dependencies": { "dependencies": {
"@lumeweb/node-library-preset": "git+https://git.lumeweb.com/LumeWeb/node-library-preset.git", "@lumeweb/node-library-preset": "git+https://git.lumeweb.com/LumeWeb/node-library-preset.git",
"@noble/curves": "^1.1.0", "@noble/curves": "^1.1.0",
@ -1714,13 +1715,13 @@
} }
}, },
"node_modules/@lumeweb/libweb": { "node_modules/@lumeweb/libweb": {
"version": "0.2.0-develop.22", "version": "0.2.0-develop.27",
"resolved": "https://registry.npmjs.org/@lumeweb/libweb/-/libweb-0.2.0-develop.22.tgz", "resolved": "https://registry.npmjs.org/@lumeweb/libweb/-/libweb-0.2.0-develop.27.tgz",
"integrity": "sha512-HKh0csOCC82vXqc0Keszymt4Mnu/xgD9GaBjarLclNkCK4mxxBmOuU9OmuOkANndQjl2dhMnmYJHT0bmseBj9Q==", "integrity": "sha512-obS4a6mcHJNoWXy5fCDuGAIVMee0ivK8q/q0semqoS3v0PS7t7sUmRX5ajyCwGbACXYqEdq3vU7RwzxhUkuNGg==",
"dependencies": { "dependencies": {
"@lumeweb/community-portals": "^0.1.0-develop.6", "@lumeweb/community-portals": "^0.1.0-develop.6",
"@lumeweb/libportal": "^0.2.0-develop.12", "@lumeweb/libportal": "^0.2.0-develop.16",
"@lumeweb/node-library-preset": "git+https://git.lumeweb.com/LumeWeb/node-library-preset.git", "@lumeweb/node-library-preset": "0.2.7",
"@noble/curves": "^1.1.0", "@noble/curves": "^1.1.0",
"@noble/hashes": "^1.3.1" "@noble/hashes": "^1.3.1"
} }

View File

@ -18,7 +18,7 @@
"semantic-release": "semantic-release" "semantic-release": "semantic-release"
}, },
"dependencies": { "dependencies": {
"@lumeweb/libkernel": "^0.1.0-develop.16" "@lumeweb/libkernel": "^0.1.0-develop.27"
}, },
"files": [ "files": [
"lib" "lib"

View File

@ -1,4 +1,4 @@
import { Client, factory } from "@lumeweb/libkernel/module"; import {factory, NetworkClient} from "@lumeweb/libkernel/module";
export const MODULE = "zduS4q1t6q5tLtANmRaUuAJNDqTggfwtV9hhK6wMRg1v891z5ts7iyobnw"; export const MODULE = "zduS4q1t6q5tLtANmRaUuAJNDqTggfwtV9hhK6wMRg1v891z5ts7iyobnw";
@ -8,18 +8,10 @@ export interface Response {
result: any; result: any;
} }
export class HandshakeClient extends Client { export class HandshakeClient extends NetworkClient {
public async ready(): Promise<void> {
return this.callModuleReturn("ready");
}
public async query(method: string, params: any): Promise<Response> { public async query(method: string, params: any): Promise<Response> {
return this.callModuleReturn("query", { method, params }); return this.callModuleReturn("query", { method, params });
} }
public async register(){
return this.callModuleReturn("register");
}
} }
export const createClient = factory<HandshakeClient>(HandshakeClient, MODULE); export const createClient = factory<HandshakeClient>(HandshakeClient, MODULE);