@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
@@ -1498,13 +1498,17 @@ class RestrictionManager {
1498
1498
 
1499
1499
  const DEFAULT_REQUEST_ID_HEADER_FIELD_NAME = "X-Request-ID";
1500
1500
  const DEFAULT_QUERY_STRING_PARAMETER_NAME = "bx24_request_id";
1501
- const DEFAULT_QUERY_STRING_SDK_PARAMETER_NAME = "bx24_sdk_ver";
1501
+ const DEFAULT_QUERY_STRING_SDK_VER_PARAMETER_NAME = "bx24_sdk_ver";
1502
+ const DEFAULT_QUERY_STRING_SDK_TYPE_PARAMETER_NAME = "bx24_sdk_type";
1502
1503
  class DefaultRequestIdGenerator {
1503
1504
  getQueryStringParameterName() {
1504
1505
  return DEFAULT_QUERY_STRING_PARAMETER_NAME;
1505
1506
  }
1506
1507
  getQueryStringSdkParameterName() {
1507
- return DEFAULT_QUERY_STRING_SDK_PARAMETER_NAME;
1508
+ return DEFAULT_QUERY_STRING_SDK_VER_PARAMETER_NAME;
1509
+ }
1510
+ getQueryStringSdkTypeParameterName() {
1511
+ return DEFAULT_QUERY_STRING_SDK_TYPE_PARAMETER_NAME;
1508
1512
  }
1509
1513
  generate() {
1510
1514
  return Text.getUuidRfc4122();
@@ -1529,7 +1533,7 @@ class Http {
1529
1533
  #clientSideWarningMessage = "";
1530
1534
  constructor(baseURL, authActions, options) {
1531
1535
  const defaultHeaders = {
1532
- // 'X-Sdk': 'b24-js-sdk-v-0.2.3'
1536
+ // 'X-Sdk': 'b24-js-sdk-v-0.3.0'
1533
1537
  };
1534
1538
  this.#clientAxios = axios.create({
1535
1539
  baseURL,
@@ -1938,8 +1942,6 @@ class Http {
1938
1942
  if (this.#logTag.length > 0) {
1939
1943
  result.logTag = this.#logTag;
1940
1944
  }
1941
- result[this.#requestIdGenerator.getQueryStringParameterName()] = this.#requestIdGenerator.getRequestId();
1942
- result[this.#requestIdGenerator.getQueryStringSdkParameterName()] = "0.2.3";
1943
1945
  if (!!result.data && !!result.data.start) {
1944
1946
  delete result.data.start;
1945
1947
  }
@@ -1956,7 +1958,13 @@ class Http {
1956
1958
  * @private
1957
1959
  */
1958
1960
  #prepareMethod(method) {
1959
- return `${encodeURIComponent(method)}.json`;
1961
+ const baseUrl = `${encodeURIComponent(method)}.json`;
1962
+ const queryParams = new URLSearchParams({
1963
+ [this.#requestIdGenerator.getQueryStringParameterName()]: this.#requestIdGenerator.getRequestId(),
1964
+ [this.#requestIdGenerator.getQueryStringSdkParameterName()]: "0.3.0",
1965
+ [this.#requestIdGenerator.getQueryStringSdkTypeParameterName()]: "b24-js-sdk"
1966
+ });
1967
+ return `${baseUrl}?${queryParams.toString()}`;
1960
1968
  }
1961
1969
  /**
1962
1970
  * @inheritDoc