@bitrix24/b24jssdk 0.4.0 → 0.4.1

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.4.0
2
+ * @version @bitrix24/b24jssdk v0.4.1
3
3
  * @copyright (c) 2025 Bitrix24
4
4
  * @licence MIT
5
5
  * @links https://github.com/bitrix24/b24jssdk - GitHub
@@ -8539,10 +8539,19 @@
8539
8539
  }
8540
8540
 
8541
8541
  const _state = {};
8542
+ function getCrypto() {
8543
+ if (typeof window !== "undefined" && window.crypto) {
8544
+ return window.crypto;
8545
+ }
8546
+ if (typeof globalThis.crypto !== "undefined") {
8547
+ return globalThis.crypto;
8548
+ }
8549
+ throw new Error("Crypto API not available");
8550
+ }
8542
8551
  function initRng() {
8543
- const crypto = window.crypto || window.msCrypto;
8552
+ const crypto = getCrypto();
8544
8553
  if (!crypto?.getRandomValues) {
8545
- throw new Error("Web Crypto API not available");
8554
+ throw new Error("Crypto API not available");
8546
8555
  }
8547
8556
  return {
8548
8557
  rng: () => {
@@ -14090,7 +14099,7 @@ ${this.stack}`;
14090
14099
  #clientSideWarningMessage = "";
14091
14100
  constructor(baseURL, authActions, options) {
14092
14101
  const defaultHeaders = {
14093
- // 'X-Sdk': 'b24-js-sdk-v-0.4.0'
14102
+ // 'X-Sdk': 'b24-js-sdk-v-0.4.1'
14094
14103
  };
14095
14104
  this.#clientAxios = axios.create({
14096
14105
  baseURL,
@@ -14518,7 +14527,7 @@ ${this.stack}`;
14518
14527
  const baseUrl = `${encodeURIComponent(method)}.json`;
14519
14528
  const queryParams = new URLSearchParams({
14520
14529
  [this.#requestIdGenerator.getQueryStringParameterName()]: this.#requestIdGenerator.getRequestId(),
14521
- [this.#requestIdGenerator.getQueryStringSdkParameterName()]: "0.4.0",
14530
+ [this.#requestIdGenerator.getQueryStringSdkParameterName()]: "0.4.1",
14522
14531
  [this.#requestIdGenerator.getQueryStringSdkTypeParameterName()]: "b24-js-sdk"
14523
14532
  });
14524
14533
  return `${baseUrl}?${queryParams.toString()}`;