From fcc036ea9aa3829b3ad2a244d1c99223cd370f0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Kubern=C3=A1t?= Date: Wed, 11 Sep 2024 17:44:23 +0200 Subject: [PATCH] Add accessGrantForMethodCall --- package.json | 2 +- src/ws-client.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index b6b86ca..c192954 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "libshv-js", - "version": "3.3.2", + "version": "3.3.3", "description": "Typescript implementation of libshv", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", diff --git a/src/ws-client.ts b/src/ws-client.ts index 20b6a2e..881cb8a 100644 --- a/src/ws-client.ts +++ b/src/ws-client.ts @@ -178,6 +178,7 @@ class WsClient { }); } + callRpcMethod(shv_path: '.broker/currentClient', method: 'accessGrantForMethodCall', params: [string, string]): Promise>; callRpcMethod(shv_path: string | undefined, method: 'dir', params?: RpcValue): Promise>; callRpcMethod(shv_path: string | undefined, method: 'ls', params?: RpcValue): Promise>; callRpcMethod(shv_path: string | undefined, method: string, params?: RpcValue): Promise; @@ -268,6 +269,10 @@ class WsClient { }); } + accessGrantForMethodCall(path: string, method: string) { + return this.callRpcMethod('.broker/currentClient', 'accessGrantForMethodCall', [path, method]); + } + close() { this.websocket.close(); }