libshv-js 7.1.13 → 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.
@@ -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
@@ -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
- let rq = makeRq((0, rpcvalue_1.makeIMap)({
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.1.13",
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",