@bitrix24/b24jssdk 0.2.3 → 0.3.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @version @bitrix24/b24jssdk v0.2.3
2
+ * @version @bitrix24/b24jssdk v0.3.0
3
3
  * @copyright (c) 2025 Bitrix24
4
4
  * @licence MIT
5
5
  * @links https://github.com/bitrix24/b24jssdk - GitHub
@@ -1513,13 +1513,17 @@ class RestrictionManager {
1513
1513
 
1514
1514
  const DEFAULT_REQUEST_ID_HEADER_FIELD_NAME = "X-Request-ID";
1515
1515
  const DEFAULT_QUERY_STRING_PARAMETER_NAME = "bx24_request_id";
1516
- const DEFAULT_QUERY_STRING_SDK_PARAMETER_NAME = "bx24_sdk_ver";
1516
+ const DEFAULT_QUERY_STRING_SDK_VER_PARAMETER_NAME = "bx24_sdk_ver";
1517
+ const DEFAULT_QUERY_STRING_SDK_TYPE_PARAMETER_NAME = "bx24_sdk_type";
1517
1518
  class DefaultRequestIdGenerator {
1518
1519
  getQueryStringParameterName() {
1519
1520
  return DEFAULT_QUERY_STRING_PARAMETER_NAME;
1520
1521
  }
1521
1522
  getQueryStringSdkParameterName() {
1522
- return DEFAULT_QUERY_STRING_SDK_PARAMETER_NAME;
1523
+ return DEFAULT_QUERY_STRING_SDK_VER_PARAMETER_NAME;
1524
+ }
1525
+ getQueryStringSdkTypeParameterName() {
1526
+ return DEFAULT_QUERY_STRING_SDK_TYPE_PARAMETER_NAME;
1523
1527
  }
1524
1528
  generate() {
1525
1529
  return Text.getUuidRfc4122();
@@ -1544,7 +1548,7 @@ class Http {
1544
1548
  #clientSideWarningMessage = "";
1545
1549
  constructor(baseURL, authActions, options) {
1546
1550
  const defaultHeaders = {
1547
- // 'X-Sdk': 'b24-js-sdk-v-0.2.3'
1551
+ // 'X-Sdk': 'b24-js-sdk-v-0.3.0'
1548
1552
  };
1549
1553
  this.#clientAxios = axios.create({
1550
1554
  baseURL,
@@ -1953,8 +1957,6 @@ class Http {
1953
1957
  if (this.#logTag.length > 0) {
1954
1958
  result.logTag = this.#logTag;
1955
1959
  }
1956
- result[this.#requestIdGenerator.getQueryStringParameterName()] = this.#requestIdGenerator.getRequestId();
1957
- result[this.#requestIdGenerator.getQueryStringSdkParameterName()] = "0.2.3";
1958
1960
  if (!!result.data && !!result.data.start) {
1959
1961
  delete result.data.start;
1960
1962
  }
@@ -1971,7 +1973,13 @@ class Http {
1971
1973
  * @private
1972
1974
  */
1973
1975
  #prepareMethod(method) {
1974
- return `${encodeURIComponent(method)}.json`;
1976
+ const baseUrl = `${encodeURIComponent(method)}.json`;
1977
+ const queryParams = new URLSearchParams({
1978
+ [this.#requestIdGenerator.getQueryStringParameterName()]: this.#requestIdGenerator.getRequestId(),
1979
+ [this.#requestIdGenerator.getQueryStringSdkParameterName()]: "0.3.0",
1980
+ [this.#requestIdGenerator.getQueryStringSdkTypeParameterName()]: "b24-js-sdk"
1981
+ });
1982
+ return `${baseUrl}?${queryParams.toString()}`;
1975
1983
  }
1976
1984
  /**
1977
1985
  * @inheritDoc