Skip to content

Commit

Permalink
Add accessGrantForMethodCall
Browse files Browse the repository at this point in the history
  • Loading branch information
syyyr committed Sep 11, 2024
1 parent f0f46bc commit bfd341c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
5 changes: 5 additions & 0 deletions src/ws-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ class WsClient {
});
}

callRpcMethod(shv_path: '.broker/currentClient', method: 'accessGrantForMethodCall', params: [string, string]): Promise<RpcResponse<string>>;
callRpcMethod(shv_path: string | undefined, method: 'dir', params?: RpcValue): Promise<RpcResponse<DirResult>>;
callRpcMethod(shv_path: string | undefined, method: 'ls', params?: RpcValue): Promise<RpcResponse<LsResult>>;
callRpcMethod(shv_path: string | undefined, method: string, params?: RpcValue): Promise<RpcResponse>;
Expand Down Expand Up @@ -268,6 +269,10 @@ class WsClient {
});
}

accessGrantForMethodCall(path: string, method: string) {
return this.callRpcMethod('.broker/currentClient', 'accessGrantForMethodCall', [path, method]);
}

close() {
this.websocket.close();
}
Expand Down

0 comments on commit bfd341c

Please sign in to comment.