From 49a3518efeab9e16dd95d657fd376f2eeaee28aa Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 23 Jul 2023 13:42:43 -0400 Subject: [PATCH] refactor: have HandshakeClient extend NetworkClient --- npm-shrinkwrap.json | 29 +++++++++++++++-------------- package.json | 2 +- src/index.ts | 12 ++---------- 3 files changed, 18 insertions(+), 25 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index d661378..a6c854c 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -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" } diff --git a/package.json b/package.json index 0000dbf..9b915ed 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/src/index.ts b/src/index.ts index b161b02..83a59e6 100644 --- a/src/index.ts +++ b/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 { - return this.callModuleReturn("ready"); - } - +export class HandshakeClient extends NetworkClient { public async query(method: string, params: any): Promise { return this.callModuleReturn("query", { method, params }); } - - public async register(){ - return this.callModuleReturn("register"); - } } export const createClient = factory(HandshakeClient, MODULE);