@bitrix24/b24jssdk 0.4.5 → 0.4.8

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @version @bitrix24/b24jssdk v0.4.5
2
+ * @version @bitrix24/b24jssdk v0.4.8
3
3
  * @copyright (c) 2025 Bitrix24
4
4
  * @licence MIT
5
5
  * @links https://github.com/bitrix24/b24jssdk - GitHub
@@ -1683,7 +1683,7 @@ class Http {
1683
1683
  #clientSideWarningMessage = "";
1684
1684
  constructor(baseURL, authActions, options) {
1685
1685
  const defaultHeaders = {
1686
- // 'X-Sdk': 'b24-js-sdk-v-0.4.5'
1686
+ // 'X-Sdk': 'b24-js-sdk-v-0.4.8'
1687
1687
  };
1688
1688
  this.#clientAxios = axios.create({
1689
1689
  baseURL,
@@ -2113,7 +2113,7 @@ class Http {
2113
2113
  const baseUrl = `${encodeURIComponent(method)}.json`;
2114
2114
  const queryParams = new URLSearchParams({
2115
2115
  [this.#requestIdGenerator.getQueryStringParameterName()]: this.#requestIdGenerator.getRequestId(),
2116
- [this.#requestIdGenerator.getQueryStringSdkParameterName()]: "0.4.5",
2116
+ [this.#requestIdGenerator.getQueryStringSdkParameterName()]: "0.4.8",
2117
2117
  [this.#requestIdGenerator.getQueryStringSdkTypeParameterName()]: "b24-js-sdk"
2118
2118
  });
2119
2119
  return `${baseUrl}?${queryParams.toString()}`;
@@ -3386,8 +3386,11 @@ class MessageManager {
3386
3386
  };
3387
3387
  } else {
3388
3388
  cmd = command.toString();
3389
+ if (params?.isRawValue !== true && paramsSend) {
3390
+ paramsSend = JSON.stringify(paramsSend);
3391
+ }
3389
3392
  const listParams = [
3390
- paramsSend ? JSON.stringify(paramsSend) : "",
3393
+ paramsSend || "",
3391
3394
  keyPromise,
3392
3395
  this.#appFrame.getAppSid()
3393
3396
  ];
@@ -4190,18 +4193,20 @@ class PlacementManager {
4190
4193
  }
4191
4194
  /**
4192
4195
  * Call the Registered Interface Command
4193
- * @param {string} command
4194
- * @param {Record<string, any>} parameters
4195
- * @return {Promise<any>}
4196
+ * @param { string } command
4197
+ * @param { Record<string, any> } parameters
4198
+ * @return { Promise<any> }
4196
4199
  *
4197
4200
  * @link https://apidocs.bitrix24.com/api-reference/widgets/ui-interaction/bx24-placement-call.html
4201
+ * @memo For the `setValue` command, use the following parameters { value: string }
4198
4202
  */
4199
4203
  async call(command, parameters = {}) {
4200
4204
  return this.#messageManager.send(
4201
4205
  command,
4202
4206
  {
4203
4207
  ...parameters,
4204
- isSafely: true
4208
+ isSafely: true,
4209
+ isRawValue: ["setValue"].includes(command)
4205
4210
  }
4206
4211
  );
4207
4212
  }
@@ -8183,7 +8188,7 @@ function requireProtobuf () {
8183
8188
  } : create_array;
8184
8189
  Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */
8185
8190
  util.Array.prototype.slice;
8186
- Reader.prototype.uint32 = /* @__PURE__ */ function read_uint32_setup() {
8191
+ Reader.prototype.uint32 = /* @__PURE__ */ (function read_uint32_setup() {
8187
8192
  var value = 4294967295;
8188
8193
  return function read_uint32() {
8189
8194
  value = (this.buf[this.pos] & 127) >>> 0;
@@ -8202,7 +8207,7 @@ function requireProtobuf () {
8202
8207
  }
8203
8208
  return value;
8204
8209
  };
8205
- }();
8210
+ })();
8206
8211
  Reader.prototype.int32 = function read_int32() {
8207
8212
  return this.uint32() | 0;
8208
8213
  };
@@ -9656,7 +9661,7 @@ function requireProtobuf () {
9656
9661
  return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;
9657
9662
  return false;
9658
9663
  };
9659
- util.Buffer = function() {
9664
+ util.Buffer = (function() {
9660
9665
  try {
9661
9666
  var Buffer = util.inquire("buffer").Buffer;
9662
9667
  return Buffer.prototype.utf8Write ? Buffer : (
@@ -9666,7 +9671,7 @@ function requireProtobuf () {
9666
9671
  } catch (e) {
9667
9672
  return null;
9668
9673
  }
9669
- }();
9674
+ })();
9670
9675
  util._Buffer_from = null;
9671
9676
  util._Buffer_allocUnsafe = null;
9672
9677
  util.newBuffer = function newBuffer(sizeOrArray) {
@@ -10122,7 +10127,7 @@ const $protobuf = /*@__PURE__*/getDefaultExportFromCjs(protobufExports);
10122
10127
 
10123
10128
  let $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
10124
10129
  const $root = $protobuf.roots["push-server"] || ($protobuf.roots["push-server"] = {});
10125
- $root.RequestBatch = function() {
10130
+ $root.RequestBatch = (function() {
10126
10131
  function RequestBatch(properties) {
10127
10132
  this.requests = [];
10128
10133
  if (properties) {
@@ -10174,8 +10179,8 @@ $root.RequestBatch = function() {
10174
10179
  return message;
10175
10180
  };
10176
10181
  return RequestBatch;
10177
- }();
10178
- $root.Request = function() {
10182
+ })();
10183
+ $root.Request = (function() {
10179
10184
  function Request(properties) {
10180
10185
  if (properties) {
10181
10186
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
@@ -10264,8 +10269,8 @@ $root.Request = function() {
10264
10269
  return message;
10265
10270
  };
10266
10271
  return Request;
10267
- }();
10268
- $root.IncomingMessagesRequest = function() {
10272
+ })();
10273
+ $root.IncomingMessagesRequest = (function() {
10269
10274
  function IncomingMessagesRequest(properties) {
10270
10275
  this.messages = [];
10271
10276
  if (properties) {
@@ -10319,8 +10324,8 @@ $root.IncomingMessagesRequest = function() {
10319
10324
  return message;
10320
10325
  };
10321
10326
  return IncomingMessagesRequest;
10322
- }();
10323
- $root.IncomingMessage = function() {
10327
+ })();
10328
+ $root.IncomingMessage = (function() {
10324
10329
  function IncomingMessage(properties) {
10325
10330
  this.receivers = [];
10326
10331
  if (properties) {
@@ -10415,8 +10420,8 @@ $root.IncomingMessage = function() {
10415
10420
  return message;
10416
10421
  };
10417
10422
  return IncomingMessage;
10418
- }();
10419
- $root.ChannelStatsRequest = function() {
10423
+ })();
10424
+ $root.ChannelStatsRequest = (function() {
10420
10425
  function ChannelStatsRequest(properties) {
10421
10426
  this.channels = [];
10422
10427
  if (properties) {
@@ -10468,8 +10473,8 @@ $root.ChannelStatsRequest = function() {
10468
10473
  return message;
10469
10474
  };
10470
10475
  return ChannelStatsRequest;
10471
- }();
10472
- $root.ChannelId = function() {
10476
+ })();
10477
+ $root.ChannelId = (function() {
10473
10478
  function ChannelId(properties) {
10474
10479
  if (properties) {
10475
10480
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
@@ -10533,8 +10538,8 @@ $root.ChannelId = function() {
10533
10538
  return message;
10534
10539
  };
10535
10540
  return ChannelId;
10536
- }();
10537
- $root.ServerStatsRequest = function() {
10541
+ })();
10542
+ $root.ServerStatsRequest = (function() {
10538
10543
  function ServerStatsRequest(properties) {
10539
10544
  if (properties) {
10540
10545
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
@@ -10568,8 +10573,8 @@ $root.ServerStatsRequest = function() {
10568
10573
  return message;
10569
10574
  };
10570
10575
  return ServerStatsRequest;
10571
- }();
10572
- $root.Sender = function() {
10576
+ })();
10577
+ $root.Sender = (function() {
10573
10578
  function Sender(properties) {
10574
10579
  if (properties) {
10575
10580
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
@@ -10623,15 +10628,15 @@ $root.Sender = function() {
10623
10628
  return message;
10624
10629
  };
10625
10630
  return Sender;
10626
- }();
10627
- $root.SenderType = function() {
10631
+ })();
10632
+ $root.SenderType = (function() {
10628
10633
  var valuesById = {}, values = Object.create(valuesById);
10629
10634
  values[valuesById[0] = "UNKNOWN"] = 0;
10630
10635
  values[valuesById[1] = "CLIENT"] = 1;
10631
10636
  values[valuesById[2] = "BACKEND"] = 2;
10632
10637
  return values;
10633
- }();
10634
- $root.Receiver = function() {
10638
+ })();
10639
+ $root.Receiver = (function() {
10635
10640
  function Receiver(properties) {
10636
10641
  if (properties) {
10637
10642
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
@@ -10695,8 +10700,8 @@ $root.Receiver = function() {
10695
10700
  return message;
10696
10701
  };
10697
10702
  return Receiver;
10698
- }();
10699
- $root.ResponseBatch = function() {
10703
+ })();
10704
+ $root.ResponseBatch = (function() {
10700
10705
  function ResponseBatch(properties) {
10701
10706
  this.responses = [];
10702
10707
  if (properties) {
@@ -10748,8 +10753,8 @@ $root.ResponseBatch = function() {
10748
10753
  return message;
10749
10754
  };
10750
10755
  return ResponseBatch;
10751
- }();
10752
- $root.Response = function() {
10756
+ })();
10757
+ $root.Response = (function() {
10753
10758
  function Response(properties) {
10754
10759
  if (properties) {
10755
10760
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
@@ -10838,8 +10843,8 @@ $root.Response = function() {
10838
10843
  return message;
10839
10844
  };
10840
10845
  return Response;
10841
- }();
10842
- $root.OutgoingMessagesResponse = function() {
10846
+ })();
10847
+ $root.OutgoingMessagesResponse = (function() {
10843
10848
  function OutgoingMessagesResponse(properties) {
10844
10849
  this.messages = [];
10845
10850
  if (properties) {
@@ -10893,8 +10898,8 @@ $root.OutgoingMessagesResponse = function() {
10893
10898
  return message;
10894
10899
  };
10895
10900
  return OutgoingMessagesResponse;
10896
- }();
10897
- $root.OutgoingMessage = function() {
10901
+ })();
10902
+ $root.OutgoingMessage = (function() {
10898
10903
  function OutgoingMessage(properties) {
10899
10904
  if (properties) {
10900
10905
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
@@ -10981,8 +10986,8 @@ $root.OutgoingMessage = function() {
10981
10986
  return message;
10982
10987
  };
10983
10988
  return OutgoingMessage;
10984
- }();
10985
- $root.ChannelStatsResponse = function() {
10989
+ })();
10990
+ $root.ChannelStatsResponse = (function() {
10986
10991
  function ChannelStatsResponse(properties) {
10987
10992
  this.channels = [];
10988
10993
  if (properties) {
@@ -11036,8 +11041,8 @@ $root.ChannelStatsResponse = function() {
11036
11041
  return message;
11037
11042
  };
11038
11043
  return ChannelStatsResponse;
11039
- }();
11040
- $root.ChannelStats = function() {
11044
+ })();
11045
+ $root.ChannelStats = (function() {
11041
11046
  function ChannelStats(properties) {
11042
11047
  if (properties) {
11043
11048
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
@@ -11101,8 +11106,8 @@ $root.ChannelStats = function() {
11101
11106
  return message;
11102
11107
  };
11103
11108
  return ChannelStats;
11104
- }();
11105
- $root.JsonResponse = function() {
11109
+ })();
11110
+ $root.JsonResponse = (function() {
11106
11111
  function JsonResponse(properties) {
11107
11112
  if (properties) {
11108
11113
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
@@ -11146,7 +11151,7 @@ $root.JsonResponse = function() {
11146
11151
  return message;
11147
11152
  };
11148
11153
  return JsonResponse;
11149
- }();
11154
+ })();
11150
11155
 
11151
11156
  const ResponseBatch = $root["ResponseBatch"];
11152
11157
  const RequestBatch = $root["RequestBatch"];
@@ -13458,7 +13463,7 @@ Data string: ${pullEvent}
13458
13463
  }
13459
13464
  trimDuplicates() {
13460
13465
  if (this._session.lastMessageIds.length > MAX_IDS_TO_STORE) {
13461
- this._session.lastMessageIds = this._session.lastMessageIds.slice(-10);
13466
+ this._session.lastMessageIds = this._session.lastMessageIds.slice(-MAX_IDS_TO_STORE);
13462
13467
  }
13463
13468
  }
13464
13469
  // endregion ////