@bitrix24/b24jssdk 0.2.2 → 0.2.3

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/umd/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @version @bitrix24/b24jssdk v0.2.2
2
+ * @version @bitrix24/b24jssdk v0.2.3
3
3
  * @copyright (c) 2025 Bitrix24
4
4
  * @licence MIT
5
5
  * @links https://github.com/bitrix24/b24jssdk - GitHub
@@ -14063,7 +14063,7 @@ ${this.stack}`;
14063
14063
  #clientSideWarningMessage = "";
14064
14064
  constructor(baseURL, authActions, options) {
14065
14065
  const defaultHeaders = {
14066
- // 'X-Sdk': 'b24-js-sdk-v-0.2.2'
14066
+ // 'X-Sdk': 'b24-js-sdk-v-0.2.3'
14067
14067
  };
14068
14068
  this.#clientAxios = axios.create({
14069
14069
  baseURL,
@@ -14473,7 +14473,7 @@ ${this.stack}`;
14473
14473
  result.logTag = this.#logTag;
14474
14474
  }
14475
14475
  result[this.#requestIdGenerator.getQueryStringParameterName()] = this.#requestIdGenerator.getRequestId();
14476
- result[this.#requestIdGenerator.getQueryStringSdkParameterName()] = "0.2.2";
14476
+ result[this.#requestIdGenerator.getQueryStringSdkParameterName()] = "0.2.3";
14477
14477
  if (!!result.data && !!result.data.start) {
14478
14478
  delete result.data.start;
14479
14479
  }
@@ -15691,22 +15691,28 @@ ${this.stack}`;
15691
15691
  timeoutId: null
15692
15692
  };
15693
15693
  const keyPromise = this.#setCallbackPromise(promiseHandler);
15694
- const paramsSend = omit(params || {}, ["callBack", "isSafely", "safelyTime"]);
15695
- const { callBack } = params || {};
15694
+ let paramsSend = null;
15695
+ const optionsSend = omit(params || {}, ["singleOption", "callBack", "isSafely", "safelyTime"]);
15696
+ const { callBack, singleOption } = params || {};
15696
15697
  if (callBack) {
15697
15698
  this.#callbackSingletone.set(keyPromise, callBack);
15698
15699
  }
15700
+ if (singleOption) {
15701
+ paramsSend = singleOption;
15702
+ } else if (Object.keys(optionsSend).length > 0) {
15703
+ paramsSend = { ...optionsSend };
15704
+ }
15699
15705
  if (command.toString().includes(":")) {
15700
15706
  cmd = {
15701
15707
  method: command.toString(),
15702
- params: paramsSend ?? "",
15708
+ params: paramsSend || "",
15703
15709
  callback: keyPromise,
15704
15710
  appSid: this.#appFrame.getAppSid()
15705
15711
  };
15706
15712
  } else {
15707
15713
  cmd = command.toString();
15708
15714
  const listParams = [
15709
- params ? JSON.stringify(paramsSend) : null,
15715
+ paramsSend ? JSON.stringify(paramsSend) : "",
15710
15716
  keyPromise,
15711
15717
  this.#appFrame.getAppSid()
15712
15718
  ];
@@ -16524,6 +16530,30 @@ ${this.stack}`;
16524
16530
  }
16525
16531
  );
16526
16532
  }
16533
+ /**
16534
+ * Set Up the Interface Event Handler
16535
+ * @param {string} command
16536
+ * @param {null | string | Record<string, any>} parameters
16537
+ * @param {(...args: any[]) => void} callBack
16538
+ *
16539
+ * @return {Promise<any>}
16540
+ */
16541
+ async callCustomBind(command, parameters = null, callBack) {
16542
+ let options = {};
16543
+ if (Type.isString(parameters)) {
16544
+ options["singleOption"] = parameters;
16545
+ } else if (Type.isObjectLike(parameters)) {
16546
+ options = { ...parameters };
16547
+ }
16548
+ return this.#messageManager.send(
16549
+ command,
16550
+ {
16551
+ ...options,
16552
+ callBack,
16553
+ isSafely: true
16554
+ }
16555
+ );
16556
+ }
16527
16557
  }
16528
16558
 
16529
16559
  class B24Frame extends AbstractB24 {