libshv-js 7.1.12 → 7.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rpcvalue.js +1 -1
- package/dist/ws-client.d.ts +1 -0
- package/dist/ws-client.js +6 -3
- package/package.json +3 -3
package/dist/rpcvalue.js
CHANGED
package/dist/ws-client.d.ts
CHANGED
|
@@ -209,6 +209,7 @@ export type CallRpcMethodOptions = {
|
|
|
209
209
|
delayCallback?: (progress: number) => void;
|
|
210
210
|
requestUserId?: boolean;
|
|
211
211
|
beforeSendHook?: (rpcMessage: RpcRequest) => RpcRequest;
|
|
212
|
+
explicitNullParam?: boolean;
|
|
212
213
|
};
|
|
213
214
|
declare enum ShvApiVersion {
|
|
214
215
|
V2 = 0,
|
package/dist/ws-client.js
CHANGED
|
@@ -33,7 +33,7 @@ class RequestHandler {
|
|
|
33
33
|
options;
|
|
34
34
|
constructor(options) {
|
|
35
35
|
this.options = options;
|
|
36
|
-
|
|
36
|
+
// nothing
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
exports.RequestHandler = RequestHandler;
|
|
@@ -480,9 +480,12 @@ class WsClient {
|
|
|
480
480
|
[rpcmessage_1.RPC_MESSAGE_SHV_PATH]: shvPath ?? '',
|
|
481
481
|
...(options?.requestUserId === true && { [rpcmessage_1.RPC_MESSAGE_USER_ID]: '' }),
|
|
482
482
|
}), value);
|
|
483
|
-
|
|
483
|
+
// We will not add an explicit null as a param unless the user requests it. Receivers of RpcCalls should
|
|
484
|
+
// generally handle a missing param the same as if the param was Null.
|
|
485
|
+
const paramRaw = params !== undefined || (options?.explicitNullParam ?? false) ? {
|
|
484
486
|
[rpcmessage_1.RPC_MESSAGE_PARAMS]: params,
|
|
485
|
-
}
|
|
487
|
+
} : {};
|
|
488
|
+
let rq = makeRq((0, rpcvalue_1.makeIMap)(paramRaw));
|
|
486
489
|
if (options?.beforeSendHook !== undefined) {
|
|
487
490
|
rq = options.beforeSendHook(rq);
|
|
488
491
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "libshv-js",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"description": "Typescript implementation of libshv",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"@typescript-eslint/parser": "^8.56.1",
|
|
41
41
|
"@eslint/js": "^10.0.1",
|
|
42
42
|
"eslint": "^10.0.0",
|
|
43
|
-
"eslint-config-xo": "^0.
|
|
43
|
+
"eslint-config-xo": "^1.0.0",
|
|
44
44
|
"eslint-formatter-unix": "^9.0.1",
|
|
45
|
-
"eslint-plugin-unicorn": "^
|
|
45
|
+
"eslint-plugin-unicorn": "^73.0.0",
|
|
46
46
|
"typescript": "^6.0.2",
|
|
47
47
|
"typescript-eslint": "^8.46.1"
|
|
48
48
|
}
|