@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.
@@ -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
@@ -1544,7 +1544,7 @@ class Http {
1544
1544
  #clientSideWarningMessage = "";
1545
1545
  constructor(baseURL, authActions, options) {
1546
1546
  const defaultHeaders = {
1547
- // 'X-Sdk': 'b24-js-sdk-v-0.2.2'
1547
+ // 'X-Sdk': 'b24-js-sdk-v-0.2.3'
1548
1548
  };
1549
1549
  this.#clientAxios = axios.create({
1550
1550
  baseURL,
@@ -1954,7 +1954,7 @@ class Http {
1954
1954
  result.logTag = this.#logTag;
1955
1955
  }
1956
1956
  result[this.#requestIdGenerator.getQueryStringParameterName()] = this.#requestIdGenerator.getRequestId();
1957
- result[this.#requestIdGenerator.getQueryStringSdkParameterName()] = "0.2.2";
1957
+ result[this.#requestIdGenerator.getQueryStringSdkParameterName()] = "0.2.3";
1958
1958
  if (!!result.data && !!result.data.start) {
1959
1959
  delete result.data.start;
1960
1960
  }
@@ -3172,22 +3172,28 @@ class MessageManager {
3172
3172
  timeoutId: null
3173
3173
  };
3174
3174
  const keyPromise = this.#setCallbackPromise(promiseHandler);
3175
- const paramsSend = omit(params || {}, ["callBack", "isSafely", "safelyTime"]);
3176
- const { callBack } = params || {};
3175
+ let paramsSend = null;
3176
+ const optionsSend = omit(params || {}, ["singleOption", "callBack", "isSafely", "safelyTime"]);
3177
+ const { callBack, singleOption } = params || {};
3177
3178
  if (callBack) {
3178
3179
  this.#callbackSingletone.set(keyPromise, callBack);
3179
3180
  }
3181
+ if (singleOption) {
3182
+ paramsSend = singleOption;
3183
+ } else if (Object.keys(optionsSend).length > 0) {
3184
+ paramsSend = { ...optionsSend };
3185
+ }
3180
3186
  if (command.toString().includes(":")) {
3181
3187
  cmd = {
3182
3188
  method: command.toString(),
3183
- params: paramsSend ?? "",
3189
+ params: paramsSend || "",
3184
3190
  callback: keyPromise,
3185
3191
  appSid: this.#appFrame.getAppSid()
3186
3192
  };
3187
3193
  } else {
3188
3194
  cmd = command.toString();
3189
3195
  const listParams = [
3190
- params ? JSON.stringify(paramsSend) : null,
3196
+ paramsSend ? JSON.stringify(paramsSend) : "",
3191
3197
  keyPromise,
3192
3198
  this.#appFrame.getAppSid()
3193
3199
  ];
@@ -4005,6 +4011,30 @@ class PlacementManager {
4005
4011
  }
4006
4012
  );
4007
4013
  }
4014
+ /**
4015
+ * Set Up the Interface Event Handler
4016
+ * @param {string} command
4017
+ * @param {null | string | Record<string, any>} parameters
4018
+ * @param {(...args: any[]) => void} callBack
4019
+ *
4020
+ * @return {Promise<any>}
4021
+ */
4022
+ async callCustomBind(command, parameters = null, callBack) {
4023
+ let options = {};
4024
+ if (Type.isString(parameters)) {
4025
+ options["singleOption"] = parameters;
4026
+ } else if (Type.isObjectLike(parameters)) {
4027
+ options = { ...parameters };
4028
+ }
4029
+ return this.#messageManager.send(
4030
+ command,
4031
+ {
4032
+ ...options,
4033
+ callBack,
4034
+ isSafely: true
4035
+ }
4036
+ );
4037
+ }
4008
4038
  }
4009
4039
 
4010
4040
  class B24Frame extends AbstractB24 {