@bitrix24/b24jssdk 1.0.5 → 1.1.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.
- package/README-AI.md +26 -3
- package/dist/esm/_virtual/_commonjsHelpers.mjs +1 -1
- package/dist/esm/_virtual/protobuf.mjs +1 -1
- package/dist/esm/_virtual/protobuf2.mjs +1 -1
- package/dist/esm/core/abstract-b24.mjs +1 -1
- package/dist/esm/core/actions/abstract-action.mjs +1 -1
- package/dist/esm/core/actions/abstract-batch.mjs +1 -1
- package/dist/esm/core/actions/manager.mjs +1 -1
- package/dist/esm/core/actions/v2/batch-by-chunk.mjs +1 -1
- package/dist/esm/core/actions/v2/batch.mjs +1 -1
- package/dist/esm/core/actions/v2/call-list.mjs +7 -3
- package/dist/esm/core/actions/v2/call-list.mjs.map +1 -1
- package/dist/esm/core/actions/v2/call.mjs +1 -1
- package/dist/esm/core/actions/v2/fetch-list.mjs +7 -3
- package/dist/esm/core/actions/v2/fetch-list.mjs.map +1 -1
- package/dist/esm/core/actions/v2/manager-v2.mjs +1 -1
- package/dist/esm/core/actions/v3/batch-by-chunk.mjs +1 -1
- package/dist/esm/core/actions/v3/batch.mjs +1 -1
- package/dist/esm/core/actions/v3/call-list.mjs +9 -5
- package/dist/esm/core/actions/v3/call-list.mjs.map +1 -1
- package/dist/esm/core/actions/v3/call.mjs +1 -1
- package/dist/esm/core/actions/v3/fetch-list.mjs +9 -5
- package/dist/esm/core/actions/v3/fetch-list.mjs.map +1 -1
- package/dist/esm/core/actions/v3/manager-v3.mjs +1 -1
- package/dist/esm/core/http/abstract-http.mjs +2 -2
- package/dist/esm/core/http/ajax-error.mjs +1 -1
- package/dist/esm/core/http/ajax-result.mjs +44 -4
- package/dist/esm/core/http/ajax-result.mjs.map +1 -1
- package/dist/esm/core/http/limiters/adaptive-delayer.mjs +1 -1
- package/dist/esm/core/http/limiters/manager.mjs +1 -1
- package/dist/esm/core/http/limiters/operating-limiter.mjs +1 -1
- package/dist/esm/core/http/limiters/params-factory.mjs +1 -1
- package/dist/esm/core/http/limiters/rate-limiter.mjs +1 -1
- package/dist/esm/core/http/v2.mjs +2 -2
- package/dist/esm/core/http/v3.mjs +2 -2
- package/dist/esm/core/interaction/batch/abstract-interaction-batch.mjs +1 -1
- package/dist/esm/core/interaction/batch/parse-row.mjs +1 -1
- package/dist/esm/core/interaction/batch/processing/interface-strategy.mjs +1 -1
- package/dist/esm/core/interaction/batch/processing/v2/abstract-processing.mjs +1 -1
- package/dist/esm/core/interaction/batch/processing/v2/abstract-processing.mjs.map +1 -1
- package/dist/esm/core/interaction/batch/processing/v2/as-array.mjs +1 -1
- package/dist/esm/core/interaction/batch/processing/v2/as-object.mjs +1 -1
- package/dist/esm/core/interaction/batch/processing/v3/abstract-processing.mjs +1 -1
- package/dist/esm/core/interaction/batch/processing/v3/abstract-processing.mjs.map +1 -1
- package/dist/esm/core/interaction/batch/processing/v3/as-array.mjs +1 -1
- package/dist/esm/core/interaction/batch/processing/v3/as-object.mjs +1 -1
- package/dist/esm/core/interaction/batch/v2.mjs +1 -1
- package/dist/esm/core/interaction/batch/v3.mjs +1 -1
- package/dist/esm/core/language/list.mjs +1 -1
- package/dist/esm/core/request-id-generator.mjs +1 -1
- package/dist/esm/core/result.mjs +1 -1
- package/dist/esm/core/sdk-error.mjs +1 -1
- package/dist/esm/core/tools/abstract-tool.mjs +1 -1
- package/dist/esm/core/tools/healthcheck.mjs +1 -1
- package/dist/esm/core/tools/manager.mjs +1 -1
- package/dist/esm/core/tools/ping.mjs +1 -1
- package/dist/esm/core/version-manager.mjs +1 -1
- package/dist/esm/frame/auth.mjs +1 -1
- package/dist/esm/frame/b24.mjs +1 -1
- package/dist/esm/frame/dialog.mjs +45 -5
- package/dist/esm/frame/dialog.mjs.map +1 -1
- package/dist/esm/frame/frame.mjs +1 -1
- package/dist/esm/frame/message/commands.mjs +1 -1
- package/dist/esm/frame/message/controller.mjs +1 -1
- package/dist/esm/frame/options.mjs +1 -1
- package/dist/esm/frame/parent.mjs +1 -1
- package/dist/esm/frame/placement.mjs +32 -9
- package/dist/esm/frame/placement.mjs.map +1 -1
- package/dist/esm/frame/slider.mjs +1 -1
- package/dist/esm/helper/abstract-helper.mjs +1 -1
- package/dist/esm/helper/app-manager.mjs +1 -1
- package/dist/esm/helper/currency-manager.mjs +1 -1
- package/dist/esm/helper/helper-manager.mjs +2 -2
- package/dist/esm/helper/license-manager.mjs +1 -1
- package/dist/esm/helper/options-manager.mjs +1 -1
- package/dist/esm/helper/payment-manager.mjs +1 -1
- package/dist/esm/helper/profile-manager.mjs +1 -1
- package/dist/esm/helper/use-b24-helper.mjs +1 -1
- package/dist/esm/hook/auth.mjs +1 -1
- package/dist/esm/hook/b24.mjs +1 -1
- package/dist/esm/index.d.mts +109 -13
- package/dist/esm/index.d.ts +109 -13
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/loader-b24frame.mjs +1 -1
- package/dist/esm/logger/abstract-logger.mjs +1 -1
- package/dist/esm/logger/browser.mjs +1 -1
- package/dist/esm/logger/formatter/abstract-formatter.mjs +1 -1
- package/dist/esm/logger/formatter/json-formatter.mjs +1 -1
- package/dist/esm/logger/formatter/line-formatter.mjs +1 -1
- package/dist/esm/logger/formatter/telegram-formatter.mjs +1 -1
- package/dist/esm/logger/handler/abstract-handler.mjs +1 -1
- package/dist/esm/logger/handler/consola-adapter.mjs +1 -1
- package/dist/esm/logger/handler/console-handler.mjs +1 -1
- package/dist/esm/logger/handler/console-v2-handler.mjs +1 -1
- package/dist/esm/logger/handler/memory-handler.mjs +1 -1
- package/dist/esm/logger/handler/stream-handler.mjs +1 -1
- package/dist/esm/logger/handler/telegram-handler.mjs +1 -1
- package/dist/esm/logger/handler/winston-adapter.mjs +1 -1
- package/dist/esm/logger/logger-factory.mjs +1 -1
- package/dist/esm/logger/logger.mjs +1 -1
- package/dist/esm/logger/null-logger.mjs +1 -1
- package/dist/esm/logger/processor/memory-usage-processor.mjs +1 -1
- package/dist/esm/logger/processor/pid-processor.mjs +1 -1
- package/dist/esm/oauth/auth.mjs +1 -1
- package/dist/esm/oauth/b24.mjs +1 -1
- package/dist/esm/oauth/refresh-token-error.mjs +1 -1
- package/dist/esm/pullClient/abstract-connector.mjs +1 -1
- package/dist/esm/pullClient/channel-manager.mjs +1 -1
- package/dist/esm/pullClient/channel-manager.mjs.map +1 -1
- package/dist/esm/pullClient/client.mjs +1 -1
- package/dist/esm/pullClient/errors.mjs +1 -1
- package/dist/esm/pullClient/json-rpc.mjs +1 -1
- package/dist/esm/pullClient/long-polling-connector.mjs +1 -1
- package/dist/esm/pullClient/protobuf/index.mjs +1 -1
- package/dist/esm/pullClient/protobuf/model.mjs +1 -1
- package/dist/esm/pullClient/protobuf/protobuf.mjs +1 -1
- package/dist/esm/pullClient/shared-config.mjs +1 -1
- package/dist/esm/pullClient/storage-manager.mjs +1 -1
- package/dist/esm/pullClient/web-socket-connector.mjs +1 -1
- package/dist/esm/tools/browser.mjs +1 -1
- package/dist/esm/tools/environment.mjs +1 -1
- package/dist/esm/tools/formatters/iban.mjs +1 -1
- package/dist/esm/tools/formatters/numbers.mjs +1 -1
- package/dist/esm/tools/index.mjs +1 -1
- package/dist/esm/tools/scroll-size.mjs +1 -1
- package/dist/esm/tools/text.mjs +1 -1
- package/dist/esm/tools/type.mjs +1 -1
- package/dist/esm/tools/use-formatters.mjs +1 -1
- package/dist/esm/tools/uuidv7.mjs +1 -1
- package/dist/esm/types/b24-helper.mjs +1 -1
- package/dist/esm/types/b24.mjs +1 -1
- package/dist/esm/types/bizproc/index.mjs +1 -1
- package/dist/esm/types/catalog/index.mjs +1 -1
- package/dist/esm/types/common.mjs +1 -1
- package/dist/esm/types/crm/entity-type.mjs +1 -1
- package/dist/esm/types/crm/productrow.mjs +1 -1
- package/dist/esm/types/logger.mjs +1 -1
- package/dist/esm/types/pull.mjs +1 -1
- package/dist/umd/index.js +1321 -846
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/index.min.js +37 -34
- package/dist/umd/index.min.js.map +1 -1
- package/package.json +5 -5
package/dist/umd/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package @bitrix24/b24jssdk
|
|
3
|
-
* @version 1.0
|
|
3
|
+
* @version 1.1.0
|
|
4
4
|
* @copyright (c) 2026 Bitrix24
|
|
5
5
|
* @license MIT
|
|
6
6
|
* @see https://github.com/bitrix24/b24jssdk
|
|
@@ -10644,8 +10644,6 @@ ${this.stack}`;
|
|
|
10644
10644
|
const payload = this._data;
|
|
10645
10645
|
return Object.freeze({
|
|
10646
10646
|
result: payload.result,
|
|
10647
|
-
next: "next" in payload ? payload.next : void 0,
|
|
10648
|
-
total: "total" in payload ? payload.total : void 0,
|
|
10649
10647
|
time: payload.time
|
|
10650
10648
|
});
|
|
10651
10649
|
}
|
|
@@ -10702,10 +10700,27 @@ ${this.stack}`;
|
|
|
10702
10700
|
}
|
|
10703
10701
|
/**
|
|
10704
10702
|
* Alias for isMore
|
|
10703
|
+
*
|
|
10704
|
+
* @deprecated Will be removed in `2.0.0`. Tied to the `restApi:v2` envelope
|
|
10705
|
+
* field `next`, which `restApi:v3` does not return. Use the SDK's list
|
|
10706
|
+
* helpers — they hide pagination entirely:
|
|
10707
|
+
* - `restApi:v2`: {@link CallListV2.make `b24.actions.v2.callList.make`} or {@link FetchListV2.make `b24.actions.v2.fetchList.make`}
|
|
10708
|
+
* - `restApi:v3`: {@link CallListV3.make `b24.actions.v3.callList.make`} or {@link FetchListV3.make `b24.actions.v3.fetchList.make`}
|
|
10709
|
+
*
|
|
10710
|
+
* @removed 2.0.0
|
|
10705
10711
|
*/
|
|
10706
10712
|
hasMore() {
|
|
10707
10713
|
return this.isMore();
|
|
10708
10714
|
}
|
|
10715
|
+
/**
|
|
10716
|
+
* @deprecated Will be removed in `2.0.0`. Tied to the `restApi:v2` envelope
|
|
10717
|
+
* field `next`, which `restApi:v3` does not return. Use the SDK's list
|
|
10718
|
+
* helpers — they hide pagination entirely:
|
|
10719
|
+
* - `restApi:v2`: {@link CallListV2.make `b24.actions.v2.callList.make`} or {@link FetchListV2.make `b24.actions.v2.fetchList.make`}
|
|
10720
|
+
* - `restApi:v3`: {@link CallListV3.make `b24.actions.v3.callList.make`} or {@link FetchListV3.make `b24.actions.v3.fetchList.make`}
|
|
10721
|
+
*
|
|
10722
|
+
* @removed 2.0.0
|
|
10723
|
+
*/
|
|
10709
10724
|
isMore() {
|
|
10710
10725
|
if (!this.isSuccess) {
|
|
10711
10726
|
return false;
|
|
@@ -10714,6 +10729,15 @@ ${this.stack}`;
|
|
|
10714
10729
|
const nextValue = "next" in payload ? payload.next : void 0;
|
|
10715
10730
|
return Type.isNumber(nextValue);
|
|
10716
10731
|
}
|
|
10732
|
+
/**
|
|
10733
|
+
* @deprecated Will be removed in `2.0.0`. Tied to the `restApi:v2` envelope
|
|
10734
|
+
* field `total`, which `restApi:v3` does not return. For `restApi:v3` the
|
|
10735
|
+
* SDK exposes element counts via the `aggregate` action (`count` /
|
|
10736
|
+
* `countDistinct`); for `restApi:v2` use the list helpers, which iterate
|
|
10737
|
+
* without exposing `total`.
|
|
10738
|
+
*
|
|
10739
|
+
* @removed 2.0.0
|
|
10740
|
+
*/
|
|
10717
10741
|
getTotal() {
|
|
10718
10742
|
if (!this.isSuccess) {
|
|
10719
10743
|
return 0;
|
|
@@ -10732,7 +10756,13 @@ ${this.stack}`;
|
|
|
10732
10756
|
* Alias for getNext
|
|
10733
10757
|
* @param http
|
|
10734
10758
|
*
|
|
10735
|
-
* @
|
|
10759
|
+
* @deprecated Will be removed in `2.0.0`. `restApi:v3` does not support
|
|
10760
|
+
* `getNext()` (the v2 envelope field `next` does not exist). Use the SDK's
|
|
10761
|
+
* list helpers instead — they hide pagination entirely:
|
|
10762
|
+
* - `restApi:v2`: {@link CallListV2.make `b24.actions.v2.callList.make`} or {@link FetchListV2.make `b24.actions.v2.fetchList.make`}
|
|
10763
|
+
* - `restApi:v3`: {@link CallListV3.make `b24.actions.v3.callList.make`} or {@link FetchListV3.make `b24.actions.v3.fetchList.make`}
|
|
10764
|
+
*
|
|
10765
|
+
* @removed 2.0.0
|
|
10736
10766
|
*/
|
|
10737
10767
|
async fetchNext(http) {
|
|
10738
10768
|
const data = await this.getNext(http);
|
|
@@ -10741,6 +10771,16 @@ ${this.stack}`;
|
|
|
10741
10771
|
}
|
|
10742
10772
|
return data;
|
|
10743
10773
|
}
|
|
10774
|
+
/**
|
|
10775
|
+
* @deprecated Will be removed in `2.0.0`. Throws on `restApi:v3` because the
|
|
10776
|
+
* v2 envelope field `next` is not part of the v3 protocol. Use the SDK's
|
|
10777
|
+
* list helpers instead — they hide pagination entirely:
|
|
10778
|
+
* - `restApi:v2`: {@link CallListV2.make `b24.actions.v2.callList.make`} or {@link FetchListV2.make `b24.actions.v2.fetchList.make`}
|
|
10779
|
+
* - `restApi:v3`: {@link CallListV3.make `b24.actions.v3.callList.make`} or {@link FetchListV3.make `b24.actions.v3.fetchList.make`}
|
|
10780
|
+
*
|
|
10781
|
+
* @throws {SdkError} `JSSDK_CORE_METHOD_NOT_SUPPORT_IN_API_V3` when called against a `restApi:v3` HTTP client. This throw is preserved until `2.0.0`.
|
|
10782
|
+
* @removed 2.0.0
|
|
10783
|
+
*/
|
|
10744
10784
|
async getNext(http) {
|
|
10745
10785
|
if (http.apiVersion === ApiVersion.v3) {
|
|
10746
10786
|
throw new SdkError({
|
|
@@ -12131,10 +12171,14 @@ ${JSON.stringify({
|
|
|
12131
12171
|
const idKey = options?.idKey ?? "ID";
|
|
12132
12172
|
const customKeyForResult = options?.customKeyForResult ?? null;
|
|
12133
12173
|
const params = options?.params ?? {};
|
|
12174
|
+
if ("order" in params && params["order"]) {
|
|
12175
|
+
this._logger.warning("callList.make: user-provided `order` parameter is ignored because cursor-based pagination requires ordering by idKey. Use `filter` to narrow results instead.");
|
|
12176
|
+
}
|
|
12134
12177
|
const moreIdKey = `>${idKey}`;
|
|
12178
|
+
const { order: _ignoredOrder, ...restParams } = params;
|
|
12135
12179
|
const requestParams = {
|
|
12136
|
-
...
|
|
12137
|
-
order: {
|
|
12180
|
+
...restParams,
|
|
12181
|
+
order: { [idKey]: "ASC" },
|
|
12138
12182
|
filter: { ...params["filter"] || {}, [moreIdKey]: 0 },
|
|
12139
12183
|
start: -1
|
|
12140
12184
|
};
|
|
@@ -12252,10 +12296,14 @@ ${JSON.stringify({
|
|
|
12252
12296
|
const idKey = options?.idKey ?? "ID";
|
|
12253
12297
|
const customKeyForResult = options?.customKeyForResult ?? null;
|
|
12254
12298
|
const params = options?.params ?? {};
|
|
12299
|
+
if ("order" in params && params["order"]) {
|
|
12300
|
+
this._logger.warning("fetchList.make: user-provided `order` parameter is ignored because cursor-based pagination requires ordering by idKey. Use `filter` to narrow results instead.");
|
|
12301
|
+
}
|
|
12255
12302
|
const moreIdKey = `>${idKey}`;
|
|
12303
|
+
const { order: _ignoredOrder, ...restParams } = params;
|
|
12256
12304
|
const requestParams = {
|
|
12257
|
-
...
|
|
12258
|
-
order: {
|
|
12305
|
+
...restParams,
|
|
12306
|
+
order: { [idKey]: "ASC" },
|
|
12259
12307
|
filter: { ...params["filter"] || {}, [moreIdKey]: 0 },
|
|
12260
12308
|
start: -1
|
|
12261
12309
|
};
|
|
@@ -12741,9 +12789,13 @@ ${JSON.stringify({
|
|
|
12741
12789
|
const idKey = options?.idKey ?? "id";
|
|
12742
12790
|
const customKeyForResult = options?.customKeyForResult ?? null;
|
|
12743
12791
|
const params = options?.params ?? {};
|
|
12792
|
+
if ("order" in params && params["order"]) {
|
|
12793
|
+
this._logger.warning("callList.make: user-provided `order` parameter is ignored because cursor-based pagination requires ordering by idKey. Use `filter` to narrow results instead.");
|
|
12794
|
+
}
|
|
12795
|
+
const { order: _ignoredOrder, ...restParams } = params;
|
|
12744
12796
|
const requestParams = {
|
|
12745
|
-
...
|
|
12746
|
-
order: {
|
|
12797
|
+
...restParams,
|
|
12798
|
+
order: { [idKey]: "ASC" },
|
|
12747
12799
|
filter: [...params["filter"] || []],
|
|
12748
12800
|
pagination: { page: 0, limit: batchSize }
|
|
12749
12801
|
};
|
|
@@ -12751,11 +12803,11 @@ ${JSON.stringify({
|
|
|
12751
12803
|
let isContinue = true;
|
|
12752
12804
|
let nextId = 0;
|
|
12753
12805
|
do {
|
|
12754
|
-
const sendParams = { ...requestParams };
|
|
12806
|
+
const sendParams = { ...requestParams, filter: [...requestParams.filter] };
|
|
12755
12807
|
sendParams.filter.push([idKey, ">", nextId]);
|
|
12756
12808
|
const response = await this._b24.actions.v3.call.make({
|
|
12757
12809
|
method: options.method,
|
|
12758
|
-
params:
|
|
12810
|
+
params: sendParams,
|
|
12759
12811
|
requestId: options.requestId
|
|
12760
12812
|
});
|
|
12761
12813
|
if (!response.isSuccess) {
|
|
@@ -12856,20 +12908,24 @@ ${JSON.stringify({
|
|
|
12856
12908
|
const idKey = options?.idKey ?? "id";
|
|
12857
12909
|
const customKeyForResult = options?.customKeyForResult ?? null;
|
|
12858
12910
|
const params = options?.params ?? {};
|
|
12911
|
+
if ("order" in params && params["order"]) {
|
|
12912
|
+
this._logger.warning("fetchList.make: user-provided `order` parameter is ignored because cursor-based pagination requires ordering by idKey. Use `filter` to narrow results instead.");
|
|
12913
|
+
}
|
|
12914
|
+
const { order: _ignoredOrder, ...restParams } = params;
|
|
12859
12915
|
const requestParams = {
|
|
12860
|
-
...
|
|
12861
|
-
order: {
|
|
12916
|
+
...restParams,
|
|
12917
|
+
order: { [idKey]: "ASC" },
|
|
12862
12918
|
filter: [...params["filter"] || []],
|
|
12863
12919
|
pagination: { page: 0, limit: batchSize }
|
|
12864
12920
|
};
|
|
12865
12921
|
let isContinue = true;
|
|
12866
12922
|
let nextId = 0;
|
|
12867
12923
|
do {
|
|
12868
|
-
const sendParams = { ...requestParams };
|
|
12924
|
+
const sendParams = { ...requestParams, filter: [...requestParams.filter] };
|
|
12869
12925
|
sendParams.filter.push([idKey, ">", nextId]);
|
|
12870
12926
|
const response = await this._b24.actions.v3.call.make({
|
|
12871
12927
|
method: options.method,
|
|
12872
|
-
params:
|
|
12928
|
+
params: sendParams,
|
|
12873
12929
|
requestId: options.requestId
|
|
12874
12930
|
});
|
|
12875
12931
|
if (!response.isSuccess) {
|
|
@@ -13709,7 +13765,7 @@ ${JSON.stringify({
|
|
|
13709
13765
|
*
|
|
13710
13766
|
* @returns {boolean} True if the value is undefined, otherwise false
|
|
13711
13767
|
*/
|
|
13712
|
-
const isUndefined = typeOfTest(
|
|
13768
|
+
const isUndefined = typeOfTest('undefined');
|
|
13713
13769
|
|
|
13714
13770
|
/**
|
|
13715
13771
|
* Determine if a value is a Buffer
|
|
@@ -13736,7 +13792,7 @@ ${JSON.stringify({
|
|
|
13736
13792
|
*
|
|
13737
13793
|
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
|
|
13738
13794
|
*/
|
|
13739
|
-
const isArrayBuffer = kindOfTest(
|
|
13795
|
+
const isArrayBuffer = kindOfTest('ArrayBuffer');
|
|
13740
13796
|
|
|
13741
13797
|
/**
|
|
13742
13798
|
* Determine if a value is a view on an ArrayBuffer
|
|
@@ -13747,7 +13803,7 @@ ${JSON.stringify({
|
|
|
13747
13803
|
*/
|
|
13748
13804
|
function isArrayBufferView(val) {
|
|
13749
13805
|
let result;
|
|
13750
|
-
if (typeof ArrayBuffer !==
|
|
13806
|
+
if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {
|
|
13751
13807
|
result = ArrayBuffer.isView(val);
|
|
13752
13808
|
} else {
|
|
13753
13809
|
result = val && val.buffer && isArrayBuffer(val.buffer);
|
|
@@ -13762,7 +13818,7 @@ ${JSON.stringify({
|
|
|
13762
13818
|
*
|
|
13763
13819
|
* @returns {boolean} True if value is a String, otherwise false
|
|
13764
13820
|
*/
|
|
13765
|
-
const isString = typeOfTest(
|
|
13821
|
+
const isString = typeOfTest('string');
|
|
13766
13822
|
|
|
13767
13823
|
/**
|
|
13768
13824
|
* Determine if a value is a Function
|
|
@@ -13770,7 +13826,7 @@ ${JSON.stringify({
|
|
|
13770
13826
|
* @param {*} val The value to test
|
|
13771
13827
|
* @returns {boolean} True if value is a Function, otherwise false
|
|
13772
13828
|
*/
|
|
13773
|
-
const isFunction$1 = typeOfTest(
|
|
13829
|
+
const isFunction$1 = typeOfTest('function');
|
|
13774
13830
|
|
|
13775
13831
|
/**
|
|
13776
13832
|
* Determine if a value is a Number
|
|
@@ -13779,7 +13835,7 @@ ${JSON.stringify({
|
|
|
13779
13835
|
*
|
|
13780
13836
|
* @returns {boolean} True if value is a Number, otherwise false
|
|
13781
13837
|
*/
|
|
13782
|
-
const isNumber = typeOfTest(
|
|
13838
|
+
const isNumber = typeOfTest('number');
|
|
13783
13839
|
|
|
13784
13840
|
/**
|
|
13785
13841
|
* Determine if a value is an Object
|
|
@@ -13788,7 +13844,7 @@ ${JSON.stringify({
|
|
|
13788
13844
|
*
|
|
13789
13845
|
* @returns {boolean} True if value is an Object, otherwise false
|
|
13790
13846
|
*/
|
|
13791
|
-
const isObject = (thing) => thing !== null && typeof thing ===
|
|
13847
|
+
const isObject = (thing) => thing !== null && typeof thing === 'object';
|
|
13792
13848
|
|
|
13793
13849
|
/**
|
|
13794
13850
|
* Determine if a value is a Boolean
|
|
@@ -13806,7 +13862,7 @@ ${JSON.stringify({
|
|
|
13806
13862
|
* @returns {boolean} True if value is a plain Object, otherwise false
|
|
13807
13863
|
*/
|
|
13808
13864
|
const isPlainObject = (val) => {
|
|
13809
|
-
if (kindOf(val) !==
|
|
13865
|
+
if (kindOf(val) !== 'object') {
|
|
13810
13866
|
return false;
|
|
13811
13867
|
}
|
|
13812
13868
|
|
|
@@ -13834,10 +13890,7 @@ ${JSON.stringify({
|
|
|
13834
13890
|
}
|
|
13835
13891
|
|
|
13836
13892
|
try {
|
|
13837
|
-
return (
|
|
13838
|
-
Object.keys(val).length === 0 &&
|
|
13839
|
-
Object.getPrototypeOf(val) === Object.prototype
|
|
13840
|
-
);
|
|
13893
|
+
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
|
|
13841
13894
|
} catch (e) {
|
|
13842
13895
|
// Fallback for any other objects that might cause RangeError with Object.keys()
|
|
13843
13896
|
return false;
|
|
@@ -13851,7 +13904,7 @@ ${JSON.stringify({
|
|
|
13851
13904
|
*
|
|
13852
13905
|
* @returns {boolean} True if value is a Date, otherwise false
|
|
13853
13906
|
*/
|
|
13854
|
-
const isDate = kindOfTest(
|
|
13907
|
+
const isDate = kindOfTest('Date');
|
|
13855
13908
|
|
|
13856
13909
|
/**
|
|
13857
13910
|
* Determine if a value is a File
|
|
@@ -13860,7 +13913,32 @@ ${JSON.stringify({
|
|
|
13860
13913
|
*
|
|
13861
13914
|
* @returns {boolean} True if value is a File, otherwise false
|
|
13862
13915
|
*/
|
|
13863
|
-
const isFile = kindOfTest(
|
|
13916
|
+
const isFile = kindOfTest('File');
|
|
13917
|
+
|
|
13918
|
+
/**
|
|
13919
|
+
* Determine if a value is a React Native Blob
|
|
13920
|
+
* React Native "blob": an object with a `uri` attribute. Optionally, it can
|
|
13921
|
+
* also have a `name` and `type` attribute to specify filename and content type
|
|
13922
|
+
*
|
|
13923
|
+
* @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71
|
|
13924
|
+
*
|
|
13925
|
+
* @param {*} value The value to test
|
|
13926
|
+
*
|
|
13927
|
+
* @returns {boolean} True if value is a React Native Blob, otherwise false
|
|
13928
|
+
*/
|
|
13929
|
+
const isReactNativeBlob = (value) => {
|
|
13930
|
+
return !!(value && typeof value.uri !== 'undefined');
|
|
13931
|
+
};
|
|
13932
|
+
|
|
13933
|
+
/**
|
|
13934
|
+
* Determine if environment is React Native
|
|
13935
|
+
* ReactNative `FormData` has a non-standard `getParts()` method
|
|
13936
|
+
*
|
|
13937
|
+
* @param {*} formData The formData to test
|
|
13938
|
+
*
|
|
13939
|
+
* @returns {boolean} True if environment is React Native, otherwise false
|
|
13940
|
+
*/
|
|
13941
|
+
const isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined';
|
|
13864
13942
|
|
|
13865
13943
|
/**
|
|
13866
13944
|
* Determine if a value is a Blob
|
|
@@ -13869,7 +13947,7 @@ ${JSON.stringify({
|
|
|
13869
13947
|
*
|
|
13870
13948
|
* @returns {boolean} True if value is a Blob, otherwise false
|
|
13871
13949
|
*/
|
|
13872
|
-
const isBlob = kindOfTest(
|
|
13950
|
+
const isBlob = kindOfTest('Blob');
|
|
13873
13951
|
|
|
13874
13952
|
/**
|
|
13875
13953
|
* Determine if a value is a FileList
|
|
@@ -13878,7 +13956,7 @@ ${JSON.stringify({
|
|
|
13878
13956
|
*
|
|
13879
13957
|
* @returns {boolean} True if value is a File, otherwise false
|
|
13880
13958
|
*/
|
|
13881
|
-
const isFileList = kindOfTest(
|
|
13959
|
+
const isFileList = kindOfTest('FileList');
|
|
13882
13960
|
|
|
13883
13961
|
/**
|
|
13884
13962
|
* Determine if a value is a Stream
|
|
@@ -13896,18 +13974,28 @@ ${JSON.stringify({
|
|
|
13896
13974
|
*
|
|
13897
13975
|
* @returns {boolean} True if value is an FormData, otherwise false
|
|
13898
13976
|
*/
|
|
13977
|
+
function getGlobal() {
|
|
13978
|
+
if (typeof globalThis !== 'undefined') return globalThis;
|
|
13979
|
+
if (typeof self !== 'undefined') return self;
|
|
13980
|
+
if (typeof window !== 'undefined') return window;
|
|
13981
|
+
if (typeof global !== 'undefined') return global;
|
|
13982
|
+
return {};
|
|
13983
|
+
}
|
|
13984
|
+
|
|
13985
|
+
const G = getGlobal();
|
|
13986
|
+
const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;
|
|
13987
|
+
|
|
13899
13988
|
const isFormData = (thing) => {
|
|
13900
|
-
|
|
13901
|
-
return
|
|
13902
|
-
|
|
13903
|
-
|
|
13904
|
-
|
|
13905
|
-
|
|
13906
|
-
|
|
13907
|
-
|
|
13908
|
-
|
|
13909
|
-
|
|
13910
|
-
);
|
|
13989
|
+
if (!thing) return false;
|
|
13990
|
+
if (FormDataCtor && thing instanceof FormDataCtor) return true;
|
|
13991
|
+
// Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData (GHSA-6chq-wfr3-2hj9).
|
|
13992
|
+
const proto = getPrototypeOf(thing);
|
|
13993
|
+
if (!proto || proto === Object.prototype) return false;
|
|
13994
|
+
if (!isFunction$1(thing.append)) return false;
|
|
13995
|
+
const kind = kindOf(thing);
|
|
13996
|
+
return kind === 'formdata' ||
|
|
13997
|
+
// detect form-data instance
|
|
13998
|
+
(kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]');
|
|
13911
13999
|
};
|
|
13912
14000
|
|
|
13913
14001
|
/**
|
|
@@ -13917,13 +14005,13 @@ ${JSON.stringify({
|
|
|
13917
14005
|
*
|
|
13918
14006
|
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
|
|
13919
14007
|
*/
|
|
13920
|
-
const isURLSearchParams = kindOfTest(
|
|
14008
|
+
const isURLSearchParams = kindOfTest('URLSearchParams');
|
|
13921
14009
|
|
|
13922
14010
|
const [isReadableStream, isRequest, isResponse, isHeaders] = [
|
|
13923
|
-
|
|
13924
|
-
|
|
13925
|
-
|
|
13926
|
-
|
|
14011
|
+
'ReadableStream',
|
|
14012
|
+
'Request',
|
|
14013
|
+
'Response',
|
|
14014
|
+
'Headers',
|
|
13927
14015
|
].map(kindOfTest);
|
|
13928
14016
|
|
|
13929
14017
|
/**
|
|
@@ -13933,9 +14021,9 @@ ${JSON.stringify({
|
|
|
13933
14021
|
*
|
|
13934
14022
|
* @returns {String} The String freed of excess whitespace
|
|
13935
14023
|
*/
|
|
13936
|
-
const trim = (str) =>
|
|
13937
|
-
str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
|
|
13938
|
-
|
|
14024
|
+
const trim = (str) => {
|
|
14025
|
+
return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
|
|
14026
|
+
};
|
|
13939
14027
|
/**
|
|
13940
14028
|
* Iterate over an Array or an Object invoking a function for each item.
|
|
13941
14029
|
*
|
|
@@ -13954,7 +14042,7 @@ ${JSON.stringify({
|
|
|
13954
14042
|
*/
|
|
13955
14043
|
function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
13956
14044
|
// Don't bother if no value provided
|
|
13957
|
-
if (obj === null || typeof obj ===
|
|
14045
|
+
if (obj === null || typeof obj === 'undefined') {
|
|
13958
14046
|
return;
|
|
13959
14047
|
}
|
|
13960
14048
|
|
|
@@ -13962,7 +14050,7 @@ ${JSON.stringify({
|
|
|
13962
14050
|
let l;
|
|
13963
14051
|
|
|
13964
14052
|
// Force an array if not already something iterable
|
|
13965
|
-
if (typeof obj !==
|
|
14053
|
+
if (typeof obj !== 'object') {
|
|
13966
14054
|
/*eslint no-param-reassign:0*/
|
|
13967
14055
|
obj = [obj];
|
|
13968
14056
|
}
|
|
@@ -13979,9 +14067,7 @@ ${JSON.stringify({
|
|
|
13979
14067
|
}
|
|
13980
14068
|
|
|
13981
14069
|
// Iterate over object keys
|
|
13982
|
-
const keys = allOwnKeys
|
|
13983
|
-
? Object.getOwnPropertyNames(obj)
|
|
13984
|
-
: Object.keys(obj);
|
|
14070
|
+
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
|
13985
14071
|
const len = keys.length;
|
|
13986
14072
|
let key;
|
|
13987
14073
|
|
|
@@ -13992,6 +14078,14 @@ ${JSON.stringify({
|
|
|
13992
14078
|
}
|
|
13993
14079
|
}
|
|
13994
14080
|
|
|
14081
|
+
/**
|
|
14082
|
+
* Finds a key in an object, case-insensitive, returning the actual key name.
|
|
14083
|
+
* Returns null if the object is a Buffer or if no match is found.
|
|
14084
|
+
*
|
|
14085
|
+
* @param {Object} obj - The object to search.
|
|
14086
|
+
* @param {string} key - The key to find (case-insensitive).
|
|
14087
|
+
* @returns {?string} The actual key name if found, otherwise null.
|
|
14088
|
+
*/
|
|
13995
14089
|
function findKey(obj, key) {
|
|
13996
14090
|
if (isBuffer$1(obj)) {
|
|
13997
14091
|
return null;
|
|
@@ -14012,16 +14106,11 @@ ${JSON.stringify({
|
|
|
14012
14106
|
|
|
14013
14107
|
const _global = (() => {
|
|
14014
14108
|
/*eslint no-undef:0*/
|
|
14015
|
-
if (typeof globalThis !==
|
|
14016
|
-
return typeof self !==
|
|
14017
|
-
? self
|
|
14018
|
-
: typeof window !== "undefined"
|
|
14019
|
-
? window
|
|
14020
|
-
: global;
|
|
14109
|
+
if (typeof globalThis !== 'undefined') return globalThis;
|
|
14110
|
+
return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : global;
|
|
14021
14111
|
})();
|
|
14022
14112
|
|
|
14023
|
-
const isContextDefined = (context) =>
|
|
14024
|
-
!isUndefined(context) && context !== _global;
|
|
14113
|
+
const isContextDefined = (context) => !isUndefined(context) && context !== _global;
|
|
14025
14114
|
|
|
14026
14115
|
/**
|
|
14027
14116
|
* Accepts varargs expecting each argument to be an object, then
|
|
@@ -14046,7 +14135,7 @@ ${JSON.stringify({
|
|
|
14046
14135
|
const result = {};
|
|
14047
14136
|
const assignValue = (val, key) => {
|
|
14048
14137
|
// Skip dangerous property names to prevent prototype pollution
|
|
14049
|
-
if (key ===
|
|
14138
|
+
if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
|
|
14050
14139
|
return;
|
|
14051
14140
|
}
|
|
14052
14141
|
|
|
@@ -14099,7 +14188,7 @@ ${JSON.stringify({
|
|
|
14099
14188
|
});
|
|
14100
14189
|
}
|
|
14101
14190
|
},
|
|
14102
|
-
{ allOwnKeys }
|
|
14191
|
+
{ allOwnKeys }
|
|
14103
14192
|
);
|
|
14104
14193
|
return a;
|
|
14105
14194
|
};
|
|
@@ -14128,17 +14217,14 @@ ${JSON.stringify({
|
|
|
14128
14217
|
* @returns {void}
|
|
14129
14218
|
*/
|
|
14130
14219
|
const inherits = (constructor, superConstructor, props, descriptors) => {
|
|
14131
|
-
constructor.prototype = Object.create(
|
|
14132
|
-
|
|
14133
|
-
descriptors,
|
|
14134
|
-
);
|
|
14135
|
-
Object.defineProperty(constructor.prototype, "constructor", {
|
|
14220
|
+
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
|
|
14221
|
+
Object.defineProperty(constructor.prototype, 'constructor', {
|
|
14136
14222
|
value: constructor,
|
|
14137
14223
|
writable: true,
|
|
14138
14224
|
enumerable: false,
|
|
14139
14225
|
configurable: true,
|
|
14140
14226
|
});
|
|
14141
|
-
Object.defineProperty(constructor,
|
|
14227
|
+
Object.defineProperty(constructor, 'super', {
|
|
14142
14228
|
value: superConstructor.prototype,
|
|
14143
14229
|
});
|
|
14144
14230
|
props && Object.assign(constructor.prototype, props);
|
|
@@ -14168,20 +14254,13 @@ ${JSON.stringify({
|
|
|
14168
14254
|
i = props.length;
|
|
14169
14255
|
while (i-- > 0) {
|
|
14170
14256
|
prop = props[i];
|
|
14171
|
-
if (
|
|
14172
|
-
(!propFilter || propFilter(prop, sourceObj, destObj)) &&
|
|
14173
|
-
!merged[prop]
|
|
14174
|
-
) {
|
|
14257
|
+
if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
|
|
14175
14258
|
destObj[prop] = sourceObj[prop];
|
|
14176
14259
|
merged[prop] = true;
|
|
14177
14260
|
}
|
|
14178
14261
|
}
|
|
14179
14262
|
sourceObj = filter !== false && getPrototypeOf(sourceObj);
|
|
14180
|
-
} while (
|
|
14181
|
-
sourceObj &&
|
|
14182
|
-
(!filter || filter(sourceObj, destObj)) &&
|
|
14183
|
-
sourceObj !== Object.prototype
|
|
14184
|
-
);
|
|
14263
|
+
} while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
|
|
14185
14264
|
|
|
14186
14265
|
return destObj;
|
|
14187
14266
|
};
|
|
@@ -14238,7 +14317,7 @@ ${JSON.stringify({
|
|
|
14238
14317
|
return (thing) => {
|
|
14239
14318
|
return TypedArray && thing instanceof TypedArray;
|
|
14240
14319
|
};
|
|
14241
|
-
})(typeof Uint8Array !==
|
|
14320
|
+
})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
|
|
14242
14321
|
|
|
14243
14322
|
/**
|
|
14244
14323
|
* For each entry in the object, call the function with the key and value.
|
|
@@ -14281,14 +14360,12 @@ ${JSON.stringify({
|
|
|
14281
14360
|
};
|
|
14282
14361
|
|
|
14283
14362
|
/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
|
|
14284
|
-
const isHTMLForm = kindOfTest(
|
|
14363
|
+
const isHTMLForm = kindOfTest('HTMLFormElement');
|
|
14285
14364
|
|
|
14286
14365
|
const toCamelCase = (str) => {
|
|
14287
|
-
return str
|
|
14288
|
-
.
|
|
14289
|
-
|
|
14290
|
-
return p1.toUpperCase() + p2;
|
|
14291
|
-
});
|
|
14366
|
+
return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
|
|
14367
|
+
return p1.toUpperCase() + p2;
|
|
14368
|
+
});
|
|
14292
14369
|
};
|
|
14293
14370
|
|
|
14294
14371
|
/* Creating a function that will check if an object has a property. */
|
|
@@ -14305,7 +14382,7 @@ ${JSON.stringify({
|
|
|
14305
14382
|
*
|
|
14306
14383
|
* @returns {boolean} True if value is a RegExp object, otherwise false
|
|
14307
14384
|
*/
|
|
14308
|
-
const isRegExp = kindOfTest(
|
|
14385
|
+
const isRegExp = kindOfTest('RegExp');
|
|
14309
14386
|
|
|
14310
14387
|
const reduceDescriptors = (obj, reducer) => {
|
|
14311
14388
|
const descriptors = Object.getOwnPropertyDescriptors(obj);
|
|
@@ -14329,10 +14406,7 @@ ${JSON.stringify({
|
|
|
14329
14406
|
const freezeMethods = (obj) => {
|
|
14330
14407
|
reduceDescriptors(obj, (descriptor, name) => {
|
|
14331
14408
|
// skip restricted props in strict mode
|
|
14332
|
-
if (
|
|
14333
|
-
isFunction$1(obj) &&
|
|
14334
|
-
["arguments", "caller", "callee"].indexOf(name) !== -1
|
|
14335
|
-
) {
|
|
14409
|
+
if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
|
|
14336
14410
|
return false;
|
|
14337
14411
|
}
|
|
14338
14412
|
|
|
@@ -14342,7 +14416,7 @@ ${JSON.stringify({
|
|
|
14342
14416
|
|
|
14343
14417
|
descriptor.enumerable = false;
|
|
14344
14418
|
|
|
14345
|
-
if (
|
|
14419
|
+
if ('writable' in descriptor) {
|
|
14346
14420
|
descriptor.writable = false;
|
|
14347
14421
|
return;
|
|
14348
14422
|
}
|
|
@@ -14355,6 +14429,14 @@ ${JSON.stringify({
|
|
|
14355
14429
|
});
|
|
14356
14430
|
};
|
|
14357
14431
|
|
|
14432
|
+
/**
|
|
14433
|
+
* Converts an array or a delimited string into an object set with values as keys and true as values.
|
|
14434
|
+
* Useful for fast membership checks.
|
|
14435
|
+
*
|
|
14436
|
+
* @param {Array|string} arrayOrString - The array or string to convert.
|
|
14437
|
+
* @param {string} delimiter - The delimiter to use if input is a string.
|
|
14438
|
+
* @returns {Object} An object with keys from the array or string, values set to true.
|
|
14439
|
+
*/
|
|
14358
14440
|
const toObjectSet = (arrayOrString, delimiter) => {
|
|
14359
14441
|
const obj = {};
|
|
14360
14442
|
|
|
@@ -14364,9 +14446,7 @@ ${JSON.stringify({
|
|
|
14364
14446
|
});
|
|
14365
14447
|
};
|
|
14366
14448
|
|
|
14367
|
-
isArray$2(arrayOrString)
|
|
14368
|
-
? define(arrayOrString)
|
|
14369
|
-
: define(String(arrayOrString).split(delimiter));
|
|
14449
|
+
isArray$2(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
|
|
14370
14450
|
|
|
14371
14451
|
return obj;
|
|
14372
14452
|
};
|
|
@@ -14374,9 +14454,7 @@ ${JSON.stringify({
|
|
|
14374
14454
|
const noop = () => {};
|
|
14375
14455
|
|
|
14376
14456
|
const toFiniteNumber = (value, defaultValue) => {
|
|
14377
|
-
return value != null && Number.isFinite((value = +value))
|
|
14378
|
-
? value
|
|
14379
|
-
: defaultValue;
|
|
14457
|
+
return value != null && Number.isFinite((value = +value)) ? value : defaultValue;
|
|
14380
14458
|
};
|
|
14381
14459
|
|
|
14382
14460
|
/**
|
|
@@ -14390,11 +14468,17 @@ ${JSON.stringify({
|
|
|
14390
14468
|
return !!(
|
|
14391
14469
|
thing &&
|
|
14392
14470
|
isFunction$1(thing.append) &&
|
|
14393
|
-
thing[toStringTag] ===
|
|
14471
|
+
thing[toStringTag] === 'FormData' &&
|
|
14394
14472
|
thing[iterator]
|
|
14395
14473
|
);
|
|
14396
14474
|
}
|
|
14397
14475
|
|
|
14476
|
+
/**
|
|
14477
|
+
* Recursively converts an object to a JSON-compatible object, handling circular references and Buffers.
|
|
14478
|
+
*
|
|
14479
|
+
* @param {Object} obj - The object to convert.
|
|
14480
|
+
* @returns {Object} The JSON-compatible object.
|
|
14481
|
+
*/
|
|
14398
14482
|
const toJSONObject = (obj) => {
|
|
14399
14483
|
const stack = new Array(10);
|
|
14400
14484
|
|
|
@@ -14409,7 +14493,7 @@ ${JSON.stringify({
|
|
|
14409
14493
|
return source;
|
|
14410
14494
|
}
|
|
14411
14495
|
|
|
14412
|
-
if (!(
|
|
14496
|
+
if (!('toJSON' in source)) {
|
|
14413
14497
|
stack[i] = source;
|
|
14414
14498
|
const target = isArray$2(source) ? [] : {};
|
|
14415
14499
|
|
|
@@ -14430,8 +14514,20 @@ ${JSON.stringify({
|
|
|
14430
14514
|
return visit(obj, 0);
|
|
14431
14515
|
};
|
|
14432
14516
|
|
|
14433
|
-
|
|
14517
|
+
/**
|
|
14518
|
+
* Determines if a value is an async function.
|
|
14519
|
+
*
|
|
14520
|
+
* @param {*} thing - The value to test.
|
|
14521
|
+
* @returns {boolean} True if value is an async function, otherwise false.
|
|
14522
|
+
*/
|
|
14523
|
+
const isAsyncFn = kindOfTest('AsyncFunction');
|
|
14434
14524
|
|
|
14525
|
+
/**
|
|
14526
|
+
* Determines if a value is thenable (has then and catch methods).
|
|
14527
|
+
*
|
|
14528
|
+
* @param {*} thing - The value to test.
|
|
14529
|
+
* @returns {boolean} True if value is thenable, otherwise false.
|
|
14530
|
+
*/
|
|
14435
14531
|
const isThenable = (thing) =>
|
|
14436
14532
|
thing &&
|
|
14437
14533
|
(isObject(thing) || isFunction$1(thing)) &&
|
|
@@ -14441,6 +14537,14 @@ ${JSON.stringify({
|
|
|
14441
14537
|
// original code
|
|
14442
14538
|
// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
|
|
14443
14539
|
|
|
14540
|
+
/**
|
|
14541
|
+
* Provides a cross-platform setImmediate implementation.
|
|
14542
|
+
* Uses native setImmediate if available, otherwise falls back to postMessage or setTimeout.
|
|
14543
|
+
*
|
|
14544
|
+
* @param {boolean} setImmediateSupported - Whether setImmediate is supported.
|
|
14545
|
+
* @param {boolean} postMessageSupported - Whether postMessage is supported.
|
|
14546
|
+
* @returns {Function} A function to schedule a callback asynchronously.
|
|
14547
|
+
*/
|
|
14444
14548
|
const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
14445
14549
|
if (setImmediateSupported) {
|
|
14446
14550
|
return setImmediate;
|
|
@@ -14449,27 +14553,33 @@ ${JSON.stringify({
|
|
|
14449
14553
|
return postMessageSupported
|
|
14450
14554
|
? ((token, callbacks) => {
|
|
14451
14555
|
_global.addEventListener(
|
|
14452
|
-
|
|
14556
|
+
'message',
|
|
14453
14557
|
({ source, data }) => {
|
|
14454
14558
|
if (source === _global && data === token) {
|
|
14455
14559
|
callbacks.length && callbacks.shift()();
|
|
14456
14560
|
}
|
|
14457
14561
|
},
|
|
14458
|
-
false
|
|
14562
|
+
false
|
|
14459
14563
|
);
|
|
14460
14564
|
|
|
14461
14565
|
return (cb) => {
|
|
14462
14566
|
callbacks.push(cb);
|
|
14463
|
-
_global.postMessage(token,
|
|
14567
|
+
_global.postMessage(token, '*');
|
|
14464
14568
|
};
|
|
14465
14569
|
})(`axios@${Math.random()}`, [])
|
|
14466
14570
|
: (cb) => setTimeout(cb);
|
|
14467
|
-
})(typeof setImmediate ===
|
|
14571
|
+
})(typeof setImmediate === 'function', isFunction$1(_global.postMessage));
|
|
14468
14572
|
|
|
14573
|
+
/**
|
|
14574
|
+
* Schedules a microtask or asynchronous callback as soon as possible.
|
|
14575
|
+
* Uses queueMicrotask if available, otherwise falls back to process.nextTick or _setImmediate.
|
|
14576
|
+
*
|
|
14577
|
+
* @type {Function}
|
|
14578
|
+
*/
|
|
14469
14579
|
const asap =
|
|
14470
|
-
typeof queueMicrotask !==
|
|
14580
|
+
typeof queueMicrotask !== 'undefined'
|
|
14471
14581
|
? queueMicrotask.bind(_global)
|
|
14472
|
-
: (typeof process !==
|
|
14582
|
+
: (typeof process !== 'undefined' && process.nextTick) || _setImmediate;
|
|
14473
14583
|
|
|
14474
14584
|
// *********************
|
|
14475
14585
|
|
|
@@ -14494,6 +14604,8 @@ ${JSON.stringify({
|
|
|
14494
14604
|
isUndefined,
|
|
14495
14605
|
isDate,
|
|
14496
14606
|
isFile,
|
|
14607
|
+
isReactNativeBlob,
|
|
14608
|
+
isReactNative,
|
|
14497
14609
|
isBlob,
|
|
14498
14610
|
isRegExp,
|
|
14499
14611
|
isFunction: isFunction$1,
|
|
@@ -14536,57 +14648,74 @@ ${JSON.stringify({
|
|
|
14536
14648
|
};
|
|
14537
14649
|
|
|
14538
14650
|
let AxiosError$1 = class AxiosError extends Error {
|
|
14539
|
-
|
|
14540
|
-
|
|
14541
|
-
|
|
14542
|
-
|
|
14543
|
-
customProps && Object.assign(axiosError, customProps);
|
|
14544
|
-
return axiosError;
|
|
14545
|
-
}
|
|
14651
|
+
static from(error, code, config, request, response, customProps) {
|
|
14652
|
+
const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
|
|
14653
|
+
axiosError.cause = error;
|
|
14654
|
+
axiosError.name = error.name;
|
|
14546
14655
|
|
|
14547
|
-
|
|
14548
|
-
|
|
14549
|
-
|
|
14550
|
-
* @param {string} message The error message.
|
|
14551
|
-
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
14552
|
-
* @param {Object} [config] The config.
|
|
14553
|
-
* @param {Object} [request] The request.
|
|
14554
|
-
* @param {Object} [response] The response.
|
|
14555
|
-
*
|
|
14556
|
-
* @returns {Error} The created error.
|
|
14557
|
-
*/
|
|
14558
|
-
constructor(message, code, config, request, response) {
|
|
14559
|
-
super(message);
|
|
14560
|
-
this.name = 'AxiosError';
|
|
14561
|
-
this.isAxiosError = true;
|
|
14562
|
-
code && (this.code = code);
|
|
14563
|
-
config && (this.config = config);
|
|
14564
|
-
request && (this.request = request);
|
|
14565
|
-
if (response) {
|
|
14566
|
-
this.response = response;
|
|
14567
|
-
this.status = response.status;
|
|
14568
|
-
}
|
|
14656
|
+
// Preserve status from the original error if not already set from response
|
|
14657
|
+
if (error.status != null && axiosError.status == null) {
|
|
14658
|
+
axiosError.status = error.status;
|
|
14569
14659
|
}
|
|
14570
14660
|
|
|
14571
|
-
|
|
14572
|
-
|
|
14573
|
-
|
|
14574
|
-
|
|
14575
|
-
|
|
14576
|
-
|
|
14577
|
-
|
|
14578
|
-
|
|
14579
|
-
|
|
14580
|
-
|
|
14581
|
-
|
|
14582
|
-
|
|
14583
|
-
|
|
14584
|
-
|
|
14585
|
-
|
|
14586
|
-
|
|
14587
|
-
|
|
14588
|
-
|
|
14661
|
+
customProps && Object.assign(axiosError, customProps);
|
|
14662
|
+
return axiosError;
|
|
14663
|
+
}
|
|
14664
|
+
|
|
14665
|
+
/**
|
|
14666
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
14667
|
+
*
|
|
14668
|
+
* @param {string} message The error message.
|
|
14669
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
14670
|
+
* @param {Object} [config] The config.
|
|
14671
|
+
* @param {Object} [request] The request.
|
|
14672
|
+
* @param {Object} [response] The response.
|
|
14673
|
+
*
|
|
14674
|
+
* @returns {Error} The created error.
|
|
14675
|
+
*/
|
|
14676
|
+
constructor(message, code, config, request, response) {
|
|
14677
|
+
super(message);
|
|
14678
|
+
|
|
14679
|
+
// Make message enumerable to maintain backward compatibility
|
|
14680
|
+
// The native Error constructor sets message as non-enumerable,
|
|
14681
|
+
// but axios < v1.13.3 had it as enumerable
|
|
14682
|
+
Object.defineProperty(this, 'message', {
|
|
14683
|
+
value: message,
|
|
14684
|
+
enumerable: true,
|
|
14685
|
+
writable: true,
|
|
14686
|
+
configurable: true,
|
|
14687
|
+
});
|
|
14688
|
+
|
|
14689
|
+
this.name = 'AxiosError';
|
|
14690
|
+
this.isAxiosError = true;
|
|
14691
|
+
code && (this.code = code);
|
|
14692
|
+
config && (this.config = config);
|
|
14693
|
+
request && (this.request = request);
|
|
14694
|
+
if (response) {
|
|
14695
|
+
this.response = response;
|
|
14696
|
+
this.status = response.status;
|
|
14589
14697
|
}
|
|
14698
|
+
}
|
|
14699
|
+
|
|
14700
|
+
toJSON() {
|
|
14701
|
+
return {
|
|
14702
|
+
// Standard
|
|
14703
|
+
message: this.message,
|
|
14704
|
+
name: this.name,
|
|
14705
|
+
// Microsoft
|
|
14706
|
+
description: this.description,
|
|
14707
|
+
number: this.number,
|
|
14708
|
+
// Mozilla
|
|
14709
|
+
fileName: this.fileName,
|
|
14710
|
+
lineNumber: this.lineNumber,
|
|
14711
|
+
columnNumber: this.columnNumber,
|
|
14712
|
+
stack: this.stack,
|
|
14713
|
+
// Axios
|
|
14714
|
+
config: utils$1.toJSONObject(this.config),
|
|
14715
|
+
code: this.code,
|
|
14716
|
+
status: this.status,
|
|
14717
|
+
};
|
|
14718
|
+
}
|
|
14590
14719
|
};
|
|
14591
14720
|
|
|
14592
14721
|
// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
|
|
@@ -14602,6 +14731,7 @@ ${JSON.stringify({
|
|
|
14602
14731
|
AxiosError$1.ERR_CANCELED = 'ERR_CANCELED';
|
|
14603
14732
|
AxiosError$1.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
|
|
14604
14733
|
AxiosError$1.ERR_INVALID_URL = 'ERR_INVALID_URL';
|
|
14734
|
+
AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
|
|
14605
14735
|
|
|
14606
14736
|
// eslint-disable-next-line strict
|
|
14607
14737
|
const httpAdapter = null;
|
|
@@ -14639,11 +14769,14 @@ ${JSON.stringify({
|
|
|
14639
14769
|
*/
|
|
14640
14770
|
function renderKey(path, key, dots) {
|
|
14641
14771
|
if (!path) return key;
|
|
14642
|
-
return path
|
|
14643
|
-
|
|
14644
|
-
|
|
14645
|
-
|
|
14646
|
-
|
|
14772
|
+
return path
|
|
14773
|
+
.concat(key)
|
|
14774
|
+
.map(function each(token, i) {
|
|
14775
|
+
// eslint-disable-next-line no-param-reassign
|
|
14776
|
+
token = removeBrackets(token);
|
|
14777
|
+
return !dots && i ? '[' + token + ']' : token;
|
|
14778
|
+
})
|
|
14779
|
+
.join(dots ? '.' : '');
|
|
14647
14780
|
}
|
|
14648
14781
|
|
|
14649
14782
|
/**
|
|
@@ -14693,21 +14826,27 @@ ${JSON.stringify({
|
|
|
14693
14826
|
formData = formData || new (FormData)();
|
|
14694
14827
|
|
|
14695
14828
|
// eslint-disable-next-line no-param-reassign
|
|
14696
|
-
options = utils$1.toFlatObject(
|
|
14697
|
-
|
|
14698
|
-
|
|
14699
|
-
|
|
14700
|
-
|
|
14701
|
-
|
|
14702
|
-
|
|
14703
|
-
|
|
14829
|
+
options = utils$1.toFlatObject(
|
|
14830
|
+
options,
|
|
14831
|
+
{
|
|
14832
|
+
metaTokens: true,
|
|
14833
|
+
dots: false,
|
|
14834
|
+
indexes: false,
|
|
14835
|
+
},
|
|
14836
|
+
false,
|
|
14837
|
+
function defined(option, source) {
|
|
14838
|
+
// eslint-disable-next-line no-eq-null,eqeqeq
|
|
14839
|
+
return !utils$1.isUndefined(source[option]);
|
|
14840
|
+
}
|
|
14841
|
+
);
|
|
14704
14842
|
|
|
14705
14843
|
const metaTokens = options.metaTokens;
|
|
14706
14844
|
// eslint-disable-next-line no-use-before-define
|
|
14707
14845
|
const visitor = options.visitor || defaultVisitor;
|
|
14708
14846
|
const dots = options.dots;
|
|
14709
14847
|
const indexes = options.indexes;
|
|
14710
|
-
const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
|
|
14848
|
+
const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
|
|
14849
|
+
const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
|
|
14711
14850
|
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
14712
14851
|
|
|
14713
14852
|
if (!utils$1.isFunction(visitor)) {
|
|
@@ -14749,6 +14888,11 @@ ${JSON.stringify({
|
|
|
14749
14888
|
function defaultVisitor(value, key, path) {
|
|
14750
14889
|
let arr = value;
|
|
14751
14890
|
|
|
14891
|
+
if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
|
|
14892
|
+
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
14893
|
+
return false;
|
|
14894
|
+
}
|
|
14895
|
+
|
|
14752
14896
|
if (value && !path && typeof value === 'object') {
|
|
14753
14897
|
if (utils$1.endsWith(key, '{}')) {
|
|
14754
14898
|
// eslint-disable-next-line no-param-reassign
|
|
@@ -14757,17 +14901,22 @@ ${JSON.stringify({
|
|
|
14757
14901
|
value = JSON.stringify(value);
|
|
14758
14902
|
} else if (
|
|
14759
14903
|
(utils$1.isArray(value) && isFlatArray(value)) ||
|
|
14760
|
-
((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
|
|
14761
|
-
|
|
14904
|
+
((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)))
|
|
14905
|
+
) {
|
|
14762
14906
|
// eslint-disable-next-line no-param-reassign
|
|
14763
14907
|
key = removeBrackets(key);
|
|
14764
14908
|
|
|
14765
14909
|
arr.forEach(function each(el, index) {
|
|
14766
|
-
!(utils$1.isUndefined(el) || el === null) &&
|
|
14767
|
-
|
|
14768
|
-
|
|
14769
|
-
|
|
14770
|
-
|
|
14910
|
+
!(utils$1.isUndefined(el) || el === null) &&
|
|
14911
|
+
formData.append(
|
|
14912
|
+
// eslint-disable-next-line no-nested-ternary
|
|
14913
|
+
indexes === true
|
|
14914
|
+
? renderKey([key], index, dots)
|
|
14915
|
+
: indexes === null
|
|
14916
|
+
? key
|
|
14917
|
+
: key + '[]',
|
|
14918
|
+
convertValue(el)
|
|
14919
|
+
);
|
|
14771
14920
|
});
|
|
14772
14921
|
return false;
|
|
14773
14922
|
}
|
|
@@ -14787,12 +14936,19 @@ ${JSON.stringify({
|
|
|
14787
14936
|
const exposedHelpers = Object.assign(predicates, {
|
|
14788
14937
|
defaultVisitor,
|
|
14789
14938
|
convertValue,
|
|
14790
|
-
isVisitable
|
|
14939
|
+
isVisitable,
|
|
14791
14940
|
});
|
|
14792
14941
|
|
|
14793
|
-
function build(value, path) {
|
|
14942
|
+
function build(value, path, depth = 0) {
|
|
14794
14943
|
if (utils$1.isUndefined(value)) return;
|
|
14795
14944
|
|
|
14945
|
+
if (depth > maxDepth) {
|
|
14946
|
+
throw new AxiosError$1(
|
|
14947
|
+
'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
|
|
14948
|
+
AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
14949
|
+
);
|
|
14950
|
+
}
|
|
14951
|
+
|
|
14796
14952
|
if (stack.indexOf(value) !== -1) {
|
|
14797
14953
|
throw Error('Circular reference detected in ' + path.join('.'));
|
|
14798
14954
|
}
|
|
@@ -14800,12 +14956,12 @@ ${JSON.stringify({
|
|
|
14800
14956
|
stack.push(value);
|
|
14801
14957
|
|
|
14802
14958
|
utils$1.forEach(value, function each(el, key) {
|
|
14803
|
-
const result =
|
|
14804
|
-
|
|
14805
|
-
|
|
14959
|
+
const result =
|
|
14960
|
+
!(utils$1.isUndefined(el) || el === null) &&
|
|
14961
|
+
visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
|
|
14806
14962
|
|
|
14807
14963
|
if (result === true) {
|
|
14808
|
-
build(el, path ? path.concat(key) : [key]);
|
|
14964
|
+
build(el, path ? path.concat(key) : [key], depth + 1);
|
|
14809
14965
|
}
|
|
14810
14966
|
});
|
|
14811
14967
|
|
|
@@ -14837,9 +14993,8 @@ ${JSON.stringify({
|
|
|
14837
14993
|
')': '%29',
|
|
14838
14994
|
'~': '%7E',
|
|
14839
14995
|
'%20': '+',
|
|
14840
|
-
'%00': '\x00'
|
|
14841
14996
|
};
|
|
14842
|
-
return encodeURIComponent(str).replace(/[!'()~]|%20
|
|
14997
|
+
return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
|
|
14843
14998
|
return charMap[match];
|
|
14844
14999
|
});
|
|
14845
15000
|
}
|
|
@@ -14865,29 +15020,33 @@ ${JSON.stringify({
|
|
|
14865
15020
|
};
|
|
14866
15021
|
|
|
14867
15022
|
prototype.toString = function toString(encoder) {
|
|
14868
|
-
const _encode = encoder
|
|
14869
|
-
|
|
14870
|
-
|
|
15023
|
+
const _encode = encoder
|
|
15024
|
+
? function (value) {
|
|
15025
|
+
return encoder.call(this, value, encode$2);
|
|
15026
|
+
}
|
|
15027
|
+
: encode$2;
|
|
14871
15028
|
|
|
14872
|
-
return this._pairs
|
|
14873
|
-
|
|
14874
|
-
|
|
15029
|
+
return this._pairs
|
|
15030
|
+
.map(function each(pair) {
|
|
15031
|
+
return _encode(pair[0]) + '=' + _encode(pair[1]);
|
|
15032
|
+
}, '')
|
|
15033
|
+
.join('&');
|
|
14875
15034
|
};
|
|
14876
15035
|
|
|
14877
15036
|
/**
|
|
14878
|
-
* It replaces
|
|
14879
|
-
*
|
|
15037
|
+
* It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
|
|
15038
|
+
* their plain counterparts (`:`, `$`, `,`, `+`).
|
|
14880
15039
|
*
|
|
14881
15040
|
* @param {string} val The value to be encoded.
|
|
14882
15041
|
*
|
|
14883
15042
|
* @returns {string} The encoded value.
|
|
14884
15043
|
*/
|
|
14885
15044
|
function encode$1(val) {
|
|
14886
|
-
return encodeURIComponent(val)
|
|
14887
|
-
replace(/%3A/gi, ':')
|
|
14888
|
-
replace(/%24/g, '$')
|
|
14889
|
-
replace(/%2C/gi, ',')
|
|
14890
|
-
replace(/%20/g, '+');
|
|
15045
|
+
return encodeURIComponent(val)
|
|
15046
|
+
.replace(/%3A/gi, ':')
|
|
15047
|
+
.replace(/%24/g, '$')
|
|
15048
|
+
.replace(/%2C/gi, ',')
|
|
15049
|
+
.replace(/%20/g, '+');
|
|
14891
15050
|
}
|
|
14892
15051
|
|
|
14893
15052
|
/**
|
|
@@ -14904,11 +15063,13 @@ ${JSON.stringify({
|
|
|
14904
15063
|
return url;
|
|
14905
15064
|
}
|
|
14906
15065
|
|
|
14907
|
-
const _encode = options && options.encode || encode$1;
|
|
15066
|
+
const _encode = (options && options.encode) || encode$1;
|
|
14908
15067
|
|
|
14909
|
-
const _options = utils$1.isFunction(options)
|
|
14910
|
-
|
|
14911
|
-
|
|
15068
|
+
const _options = utils$1.isFunction(options)
|
|
15069
|
+
? {
|
|
15070
|
+
serialize: options,
|
|
15071
|
+
}
|
|
15072
|
+
: options;
|
|
14912
15073
|
|
|
14913
15074
|
const serializeFn = _options && _options.serialize;
|
|
14914
15075
|
|
|
@@ -14917,13 +15078,13 @@ ${JSON.stringify({
|
|
|
14917
15078
|
if (serializeFn) {
|
|
14918
15079
|
serializedParams = serializeFn(params, _options);
|
|
14919
15080
|
} else {
|
|
14920
|
-
serializedParams = utils$1.isURLSearchParams(params)
|
|
14921
|
-
params.toString()
|
|
14922
|
-
new AxiosURLSearchParams(params, _options).toString(_encode);
|
|
15081
|
+
serializedParams = utils$1.isURLSearchParams(params)
|
|
15082
|
+
? params.toString()
|
|
15083
|
+
: new AxiosURLSearchParams(params, _options).toString(_encode);
|
|
14923
15084
|
}
|
|
14924
15085
|
|
|
14925
15086
|
if (serializedParams) {
|
|
14926
|
-
const hashmarkIndex = url.indexOf(
|
|
15087
|
+
const hashmarkIndex = url.indexOf('#');
|
|
14927
15088
|
|
|
14928
15089
|
if (hashmarkIndex !== -1) {
|
|
14929
15090
|
url = url.slice(0, hashmarkIndex);
|
|
@@ -14953,7 +15114,7 @@ ${JSON.stringify({
|
|
|
14953
15114
|
fulfilled,
|
|
14954
15115
|
rejected,
|
|
14955
15116
|
synchronous: options ? options.synchronous : false,
|
|
14956
|
-
runWhen: options ? options.runWhen : null
|
|
15117
|
+
runWhen: options ? options.runWhen : null,
|
|
14957
15118
|
});
|
|
14958
15119
|
return this.handlers.length - 1;
|
|
14959
15120
|
}
|
|
@@ -15005,7 +15166,7 @@ ${JSON.stringify({
|
|
|
15005
15166
|
silentJSONParsing: true,
|
|
15006
15167
|
forcedJSONParsing: true,
|
|
15007
15168
|
clarifyTimeoutError: false,
|
|
15008
|
-
legacyInterceptorReqResOrdering: true
|
|
15169
|
+
legacyInterceptorReqResOrdering: true,
|
|
15009
15170
|
};
|
|
15010
15171
|
|
|
15011
15172
|
const URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
|
|
@@ -15019,14 +15180,14 @@ ${JSON.stringify({
|
|
|
15019
15180
|
classes: {
|
|
15020
15181
|
URLSearchParams: URLSearchParams$1,
|
|
15021
15182
|
FormData: FormData$1,
|
|
15022
|
-
Blob: Blob$1
|
|
15183
|
+
Blob: Blob$1,
|
|
15023
15184
|
},
|
|
15024
|
-
protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
|
|
15185
|
+
protocols: ['http', 'https', 'file', 'blob', 'url', 'data'],
|
|
15025
15186
|
};
|
|
15026
15187
|
|
|
15027
15188
|
const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
15028
15189
|
|
|
15029
|
-
const _navigator = typeof navigator === 'object' && navigator || undefined;
|
|
15190
|
+
const _navigator = (typeof navigator === 'object' && navigator) || undefined;
|
|
15030
15191
|
|
|
15031
15192
|
/**
|
|
15032
15193
|
* Determine if we're running in a standard browser environment
|
|
@@ -15045,7 +15206,8 @@ ${JSON.stringify({
|
|
|
15045
15206
|
*
|
|
15046
15207
|
* @returns {boolean}
|
|
15047
15208
|
*/
|
|
15048
|
-
const hasStandardBrowserEnv =
|
|
15209
|
+
const hasStandardBrowserEnv =
|
|
15210
|
+
hasBrowserEnv &&
|
|
15049
15211
|
(!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
|
|
15050
15212
|
|
|
15051
15213
|
/**
|
|
@@ -15066,7 +15228,7 @@ ${JSON.stringify({
|
|
|
15066
15228
|
);
|
|
15067
15229
|
})();
|
|
15068
15230
|
|
|
15069
|
-
const origin = hasBrowserEnv && window.location.href || 'http://localhost';
|
|
15231
|
+
const origin = (hasBrowserEnv && window.location.href) || 'http://localhost';
|
|
15070
15232
|
|
|
15071
15233
|
const utils = {
|
|
15072
15234
|
__proto__: null,
|
|
@@ -15079,12 +15241,12 @@ ${JSON.stringify({
|
|
|
15079
15241
|
|
|
15080
15242
|
const platform = {
|
|
15081
15243
|
...utils,
|
|
15082
|
-
...platform$1
|
|
15244
|
+
...platform$1,
|
|
15083
15245
|
};
|
|
15084
15246
|
|
|
15085
15247
|
function toURLEncodedForm(data, options) {
|
|
15086
15248
|
return toFormData$1(data, new platform.classes.URLSearchParams(), {
|
|
15087
|
-
visitor: function(value, key, path, helpers) {
|
|
15249
|
+
visitor: function (value, key, path, helpers) {
|
|
15088
15250
|
if (platform.isNode && utils$1.isBuffer(value)) {
|
|
15089
15251
|
this.append(key, value.toString('base64'));
|
|
15090
15252
|
return false;
|
|
@@ -15092,7 +15254,7 @@ ${JSON.stringify({
|
|
|
15092
15254
|
|
|
15093
15255
|
return helpers.defaultVisitor.apply(this, arguments);
|
|
15094
15256
|
},
|
|
15095
|
-
...options
|
|
15257
|
+
...options,
|
|
15096
15258
|
});
|
|
15097
15259
|
}
|
|
15098
15260
|
|
|
@@ -15108,7 +15270,7 @@ ${JSON.stringify({
|
|
|
15108
15270
|
// foo.x.y.z
|
|
15109
15271
|
// foo-x-y-z
|
|
15110
15272
|
// foo x y z
|
|
15111
|
-
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
|
|
15273
|
+
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
|
|
15112
15274
|
return match[0] === '[]' ? '' : match[1] || match[0];
|
|
15113
15275
|
});
|
|
15114
15276
|
}
|
|
@@ -15152,7 +15314,9 @@ ${JSON.stringify({
|
|
|
15152
15314
|
|
|
15153
15315
|
if (isLast) {
|
|
15154
15316
|
if (utils$1.hasOwnProp(target, name)) {
|
|
15155
|
-
target[name] =
|
|
15317
|
+
target[name] = utils$1.isArray(target[name])
|
|
15318
|
+
? target[name].concat(value)
|
|
15319
|
+
: [target[name], value];
|
|
15156
15320
|
} else {
|
|
15157
15321
|
target[name] = value;
|
|
15158
15322
|
}
|
|
@@ -15186,6 +15350,8 @@ ${JSON.stringify({
|
|
|
15186
15350
|
return null;
|
|
15187
15351
|
}
|
|
15188
15352
|
|
|
15353
|
+
const own = (obj, key) => (obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined);
|
|
15354
|
+
|
|
15189
15355
|
/**
|
|
15190
15356
|
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
|
|
15191
15357
|
* of the input
|
|
@@ -15212,96 +15378,110 @@ ${JSON.stringify({
|
|
|
15212
15378
|
}
|
|
15213
15379
|
|
|
15214
15380
|
const defaults$1 = {
|
|
15215
|
-
|
|
15216
15381
|
transitional: transitionalDefaults,
|
|
15217
15382
|
|
|
15218
15383
|
adapter: ['xhr', 'http', 'fetch'],
|
|
15219
15384
|
|
|
15220
|
-
transformRequest: [
|
|
15221
|
-
|
|
15222
|
-
|
|
15223
|
-
|
|
15385
|
+
transformRequest: [
|
|
15386
|
+
function transformRequest(data, headers) {
|
|
15387
|
+
const contentType = headers.getContentType() || '';
|
|
15388
|
+
const hasJSONContentType = contentType.indexOf('application/json') > -1;
|
|
15389
|
+
const isObjectPayload = utils$1.isObject(data);
|
|
15224
15390
|
|
|
15225
|
-
|
|
15226
|
-
|
|
15227
|
-
|
|
15228
|
-
|
|
15229
|
-
const isFormData = utils$1.isFormData(data);
|
|
15230
|
-
|
|
15231
|
-
if (isFormData) {
|
|
15232
|
-
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
15233
|
-
}
|
|
15391
|
+
if (isObjectPayload && utils$1.isHTMLForm(data)) {
|
|
15392
|
+
data = new FormData(data);
|
|
15393
|
+
}
|
|
15234
15394
|
|
|
15235
|
-
|
|
15236
|
-
utils$1.isBuffer(data) ||
|
|
15237
|
-
utils$1.isStream(data) ||
|
|
15238
|
-
utils$1.isFile(data) ||
|
|
15239
|
-
utils$1.isBlob(data) ||
|
|
15240
|
-
utils$1.isReadableStream(data)
|
|
15241
|
-
) {
|
|
15242
|
-
return data;
|
|
15243
|
-
}
|
|
15244
|
-
if (utils$1.isArrayBufferView(data)) {
|
|
15245
|
-
return data.buffer;
|
|
15246
|
-
}
|
|
15247
|
-
if (utils$1.isURLSearchParams(data)) {
|
|
15248
|
-
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
|
|
15249
|
-
return data.toString();
|
|
15250
|
-
}
|
|
15395
|
+
const isFormData = utils$1.isFormData(data);
|
|
15251
15396
|
|
|
15252
|
-
|
|
15397
|
+
if (isFormData) {
|
|
15398
|
+
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
15399
|
+
}
|
|
15253
15400
|
|
|
15254
|
-
|
|
15255
|
-
|
|
15256
|
-
|
|
15401
|
+
if (
|
|
15402
|
+
utils$1.isArrayBuffer(data) ||
|
|
15403
|
+
utils$1.isBuffer(data) ||
|
|
15404
|
+
utils$1.isStream(data) ||
|
|
15405
|
+
utils$1.isFile(data) ||
|
|
15406
|
+
utils$1.isBlob(data) ||
|
|
15407
|
+
utils$1.isReadableStream(data)
|
|
15408
|
+
) {
|
|
15409
|
+
return data;
|
|
15410
|
+
}
|
|
15411
|
+
if (utils$1.isArrayBufferView(data)) {
|
|
15412
|
+
return data.buffer;
|
|
15413
|
+
}
|
|
15414
|
+
if (utils$1.isURLSearchParams(data)) {
|
|
15415
|
+
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
|
|
15416
|
+
return data.toString();
|
|
15257
15417
|
}
|
|
15258
15418
|
|
|
15259
|
-
|
|
15260
|
-
const _FormData = this.env && this.env.FormData;
|
|
15419
|
+
let isFileList;
|
|
15261
15420
|
|
|
15262
|
-
|
|
15263
|
-
|
|
15264
|
-
|
|
15265
|
-
|
|
15266
|
-
|
|
15421
|
+
if (isObjectPayload) {
|
|
15422
|
+
const formSerializer = own(this, 'formSerializer');
|
|
15423
|
+
if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
|
|
15424
|
+
return toURLEncodedForm(data, formSerializer).toString();
|
|
15425
|
+
}
|
|
15426
|
+
|
|
15427
|
+
if (
|
|
15428
|
+
(isFileList = utils$1.isFileList(data)) ||
|
|
15429
|
+
contentType.indexOf('multipart/form-data') > -1
|
|
15430
|
+
) {
|
|
15431
|
+
const env = own(this, 'env');
|
|
15432
|
+
const _FormData = env && env.FormData;
|
|
15433
|
+
|
|
15434
|
+
return toFormData$1(
|
|
15435
|
+
isFileList ? { 'files[]': data } : data,
|
|
15436
|
+
_FormData && new _FormData(),
|
|
15437
|
+
formSerializer
|
|
15438
|
+
);
|
|
15439
|
+
}
|
|
15267
15440
|
}
|
|
15268
|
-
}
|
|
15269
15441
|
|
|
15270
|
-
|
|
15271
|
-
|
|
15272
|
-
|
|
15273
|
-
|
|
15442
|
+
if (isObjectPayload || hasJSONContentType) {
|
|
15443
|
+
headers.setContentType('application/json', false);
|
|
15444
|
+
return stringifySafely(data);
|
|
15445
|
+
}
|
|
15274
15446
|
|
|
15275
|
-
|
|
15276
|
-
|
|
15447
|
+
return data;
|
|
15448
|
+
},
|
|
15449
|
+
],
|
|
15277
15450
|
|
|
15278
|
-
transformResponse: [
|
|
15279
|
-
|
|
15280
|
-
|
|
15281
|
-
|
|
15451
|
+
transformResponse: [
|
|
15452
|
+
function transformResponse(data) {
|
|
15453
|
+
const transitional = own(this, 'transitional') || defaults$1.transitional;
|
|
15454
|
+
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
15455
|
+
const responseType = own(this, 'responseType');
|
|
15456
|
+
const JSONRequested = responseType === 'json';
|
|
15282
15457
|
|
|
15283
|
-
|
|
15284
|
-
|
|
15285
|
-
|
|
15458
|
+
if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
|
|
15459
|
+
return data;
|
|
15460
|
+
}
|
|
15286
15461
|
|
|
15287
|
-
|
|
15288
|
-
|
|
15289
|
-
|
|
15462
|
+
if (
|
|
15463
|
+
data &&
|
|
15464
|
+
utils$1.isString(data) &&
|
|
15465
|
+
((forcedJSONParsing && !responseType) || JSONRequested)
|
|
15466
|
+
) {
|
|
15467
|
+
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
15468
|
+
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
15290
15469
|
|
|
15291
|
-
|
|
15292
|
-
|
|
15293
|
-
|
|
15294
|
-
|
|
15295
|
-
|
|
15296
|
-
|
|
15470
|
+
try {
|
|
15471
|
+
return JSON.parse(data, own(this, 'parseReviver'));
|
|
15472
|
+
} catch (e) {
|
|
15473
|
+
if (strictJSONParsing) {
|
|
15474
|
+
if (e.name === 'SyntaxError') {
|
|
15475
|
+
throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
|
|
15476
|
+
}
|
|
15477
|
+
throw e;
|
|
15297
15478
|
}
|
|
15298
|
-
throw e;
|
|
15299
15479
|
}
|
|
15300
15480
|
}
|
|
15301
|
-
}
|
|
15302
15481
|
|
|
15303
|
-
|
|
15304
|
-
|
|
15482
|
+
return data;
|
|
15483
|
+
},
|
|
15484
|
+
],
|
|
15305
15485
|
|
|
15306
15486
|
/**
|
|
15307
15487
|
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
@@ -15317,7 +15497,7 @@ ${JSON.stringify({
|
|
|
15317
15497
|
|
|
15318
15498
|
env: {
|
|
15319
15499
|
FormData: platform.classes.FormData,
|
|
15320
|
-
Blob: platform.classes.Blob
|
|
15500
|
+
Blob: platform.classes.Blob,
|
|
15321
15501
|
},
|
|
15322
15502
|
|
|
15323
15503
|
validateStatus: function validateStatus(status) {
|
|
@@ -15326,10 +15506,10 @@ ${JSON.stringify({
|
|
|
15326
15506
|
|
|
15327
15507
|
headers: {
|
|
15328
15508
|
common: {
|
|
15329
|
-
|
|
15330
|
-
'Content-Type': undefined
|
|
15331
|
-
}
|
|
15332
|
-
}
|
|
15509
|
+
Accept: 'application/json, text/plain, */*',
|
|
15510
|
+
'Content-Type': undefined,
|
|
15511
|
+
},
|
|
15512
|
+
},
|
|
15333
15513
|
};
|
|
15334
15514
|
|
|
15335
15515
|
utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
|
@@ -15339,10 +15519,23 @@ ${JSON.stringify({
|
|
|
15339
15519
|
// RawAxiosHeaders whose duplicates are ignored by node
|
|
15340
15520
|
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
|
15341
15521
|
const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
15342
|
-
'age',
|
|
15343
|
-
'
|
|
15344
|
-
'
|
|
15345
|
-
'
|
|
15522
|
+
'age',
|
|
15523
|
+
'authorization',
|
|
15524
|
+
'content-length',
|
|
15525
|
+
'content-type',
|
|
15526
|
+
'etag',
|
|
15527
|
+
'expires',
|
|
15528
|
+
'from',
|
|
15529
|
+
'host',
|
|
15530
|
+
'if-modified-since',
|
|
15531
|
+
'if-unmodified-since',
|
|
15532
|
+
'last-modified',
|
|
15533
|
+
'location',
|
|
15534
|
+
'max-forwards',
|
|
15535
|
+
'proxy-authorization',
|
|
15536
|
+
'referer',
|
|
15537
|
+
'retry-after',
|
|
15538
|
+
'user-agent',
|
|
15346
15539
|
]);
|
|
15347
15540
|
|
|
15348
15541
|
/**
|
|
@@ -15359,47 +15552,81 @@ ${JSON.stringify({
|
|
|
15359
15552
|
*
|
|
15360
15553
|
* @returns {Object} Headers parsed into an object
|
|
15361
15554
|
*/
|
|
15362
|
-
const parseHeaders = rawHeaders => {
|
|
15555
|
+
const parseHeaders = (rawHeaders) => {
|
|
15363
15556
|
const parsed = {};
|
|
15364
15557
|
let key;
|
|
15365
15558
|
let val;
|
|
15366
15559
|
let i;
|
|
15367
15560
|
|
|
15368
|
-
rawHeaders &&
|
|
15369
|
-
|
|
15370
|
-
|
|
15371
|
-
|
|
15561
|
+
rawHeaders &&
|
|
15562
|
+
rawHeaders.split('\n').forEach(function parser(line) {
|
|
15563
|
+
i = line.indexOf(':');
|
|
15564
|
+
key = line.substring(0, i).trim().toLowerCase();
|
|
15565
|
+
val = line.substring(i + 1).trim();
|
|
15372
15566
|
|
|
15373
|
-
|
|
15374
|
-
|
|
15375
|
-
|
|
15567
|
+
if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
|
|
15568
|
+
return;
|
|
15569
|
+
}
|
|
15376
15570
|
|
|
15377
|
-
|
|
15378
|
-
|
|
15379
|
-
|
|
15571
|
+
if (key === 'set-cookie') {
|
|
15572
|
+
if (parsed[key]) {
|
|
15573
|
+
parsed[key].push(val);
|
|
15574
|
+
} else {
|
|
15575
|
+
parsed[key] = [val];
|
|
15576
|
+
}
|
|
15380
15577
|
} else {
|
|
15381
|
-
parsed[key] = [val
|
|
15578
|
+
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
15382
15579
|
}
|
|
15383
|
-
}
|
|
15384
|
-
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
15385
|
-
}
|
|
15386
|
-
});
|
|
15580
|
+
});
|
|
15387
15581
|
|
|
15388
15582
|
return parsed;
|
|
15389
15583
|
};
|
|
15390
15584
|
|
|
15391
15585
|
const $internals = Symbol('internals');
|
|
15392
15586
|
|
|
15587
|
+
const INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
|
|
15588
|
+
|
|
15589
|
+
function trimSPorHTAB(str) {
|
|
15590
|
+
let start = 0;
|
|
15591
|
+
let end = str.length;
|
|
15592
|
+
|
|
15593
|
+
while (start < end) {
|
|
15594
|
+
const code = str.charCodeAt(start);
|
|
15595
|
+
|
|
15596
|
+
if (code !== 0x09 && code !== 0x20) {
|
|
15597
|
+
break;
|
|
15598
|
+
}
|
|
15599
|
+
|
|
15600
|
+
start += 1;
|
|
15601
|
+
}
|
|
15602
|
+
|
|
15603
|
+
while (end > start) {
|
|
15604
|
+
const code = str.charCodeAt(end - 1);
|
|
15605
|
+
|
|
15606
|
+
if (code !== 0x09 && code !== 0x20) {
|
|
15607
|
+
break;
|
|
15608
|
+
}
|
|
15609
|
+
|
|
15610
|
+
end -= 1;
|
|
15611
|
+
}
|
|
15612
|
+
|
|
15613
|
+
return start === 0 && end === str.length ? str : str.slice(start, end);
|
|
15614
|
+
}
|
|
15615
|
+
|
|
15393
15616
|
function normalizeHeader(header) {
|
|
15394
15617
|
return header && String(header).trim().toLowerCase();
|
|
15395
15618
|
}
|
|
15396
15619
|
|
|
15620
|
+
function sanitizeHeaderValue(str) {
|
|
15621
|
+
return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ''));
|
|
15622
|
+
}
|
|
15623
|
+
|
|
15397
15624
|
function normalizeValue(value) {
|
|
15398
15625
|
if (value === false || value == null) {
|
|
15399
15626
|
return value;
|
|
15400
15627
|
}
|
|
15401
15628
|
|
|
15402
|
-
return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
|
|
15629
|
+
return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
|
|
15403
15630
|
}
|
|
15404
15631
|
|
|
15405
15632
|
function parseTokens(str) {
|
|
@@ -15437,8 +15664,10 @@ ${JSON.stringify({
|
|
|
15437
15664
|
}
|
|
15438
15665
|
|
|
15439
15666
|
function formatHeader(header) {
|
|
15440
|
-
return header
|
|
15441
|
-
.
|
|
15667
|
+
return header
|
|
15668
|
+
.trim()
|
|
15669
|
+
.toLowerCase()
|
|
15670
|
+
.replace(/([a-z\d])(\w*)/g, (w, char, str) => {
|
|
15442
15671
|
return char.toUpperCase() + str;
|
|
15443
15672
|
});
|
|
15444
15673
|
}
|
|
@@ -15446,12 +15675,12 @@ ${JSON.stringify({
|
|
|
15446
15675
|
function buildAccessors(obj, header) {
|
|
15447
15676
|
const accessorName = utils$1.toCamelCase(' ' + header);
|
|
15448
15677
|
|
|
15449
|
-
['get', 'set', 'has'].forEach(methodName => {
|
|
15678
|
+
['get', 'set', 'has'].forEach((methodName) => {
|
|
15450
15679
|
Object.defineProperty(obj, methodName + accessorName, {
|
|
15451
|
-
value: function(arg1, arg2, arg3) {
|
|
15680
|
+
value: function (arg1, arg2, arg3) {
|
|
15452
15681
|
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
15453
15682
|
},
|
|
15454
|
-
configurable: true
|
|
15683
|
+
configurable: true,
|
|
15455
15684
|
});
|
|
15456
15685
|
});
|
|
15457
15686
|
}
|
|
@@ -15473,7 +15702,12 @@ ${JSON.stringify({
|
|
|
15473
15702
|
|
|
15474
15703
|
const key = utils$1.findKey(self, lHeader);
|
|
15475
15704
|
|
|
15476
|
-
if
|
|
15705
|
+
if (
|
|
15706
|
+
!key ||
|
|
15707
|
+
self[key] === undefined ||
|
|
15708
|
+
_rewrite === true ||
|
|
15709
|
+
(_rewrite === undefined && self[key] !== false)
|
|
15710
|
+
) {
|
|
15477
15711
|
self[key || _header] = normalizeValue(_value);
|
|
15478
15712
|
}
|
|
15479
15713
|
}
|
|
@@ -15483,17 +15717,22 @@ ${JSON.stringify({
|
|
|
15483
15717
|
|
|
15484
15718
|
if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
|
|
15485
15719
|
setHeaders(header, valueOrRewrite);
|
|
15486
|
-
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
15720
|
+
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
15487
15721
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
15488
15722
|
} else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
|
|
15489
|
-
let obj = {},
|
|
15723
|
+
let obj = {},
|
|
15724
|
+
dest,
|
|
15725
|
+
key;
|
|
15490
15726
|
for (const entry of header) {
|
|
15491
15727
|
if (!utils$1.isArray(entry)) {
|
|
15492
15728
|
throw TypeError('Object iterator must return a key-value pair');
|
|
15493
15729
|
}
|
|
15494
15730
|
|
|
15495
|
-
obj[key = entry[0]] = (dest = obj[key])
|
|
15496
|
-
|
|
15731
|
+
obj[(key = entry[0])] = (dest = obj[key])
|
|
15732
|
+
? utils$1.isArray(dest)
|
|
15733
|
+
? [...dest, entry[1]]
|
|
15734
|
+
: [dest, entry[1]]
|
|
15735
|
+
: entry[1];
|
|
15497
15736
|
}
|
|
15498
15737
|
|
|
15499
15738
|
setHeaders(obj, valueOrRewrite);
|
|
@@ -15540,7 +15779,11 @@ ${JSON.stringify({
|
|
|
15540
15779
|
if (header) {
|
|
15541
15780
|
const key = utils$1.findKey(this, header);
|
|
15542
15781
|
|
|
15543
|
-
return !!(
|
|
15782
|
+
return !!(
|
|
15783
|
+
key &&
|
|
15784
|
+
this[key] !== undefined &&
|
|
15785
|
+
(!matcher || matchHeaderValue(this, this[key], key, matcher))
|
|
15786
|
+
);
|
|
15544
15787
|
}
|
|
15545
15788
|
|
|
15546
15789
|
return false;
|
|
@@ -15580,7 +15823,7 @@ ${JSON.stringify({
|
|
|
15580
15823
|
|
|
15581
15824
|
while (i--) {
|
|
15582
15825
|
const key = keys[i];
|
|
15583
|
-
if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
15826
|
+
if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
15584
15827
|
delete this[key];
|
|
15585
15828
|
deleted = true;
|
|
15586
15829
|
}
|
|
@@ -15624,7 +15867,9 @@ ${JSON.stringify({
|
|
|
15624
15867
|
const obj = Object.create(null);
|
|
15625
15868
|
|
|
15626
15869
|
utils$1.forEach(this, (value, header) => {
|
|
15627
|
-
value != null &&
|
|
15870
|
+
value != null &&
|
|
15871
|
+
value !== false &&
|
|
15872
|
+
(obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
|
|
15628
15873
|
});
|
|
15629
15874
|
|
|
15630
15875
|
return obj;
|
|
@@ -15635,11 +15880,13 @@ ${JSON.stringify({
|
|
|
15635
15880
|
}
|
|
15636
15881
|
|
|
15637
15882
|
toString() {
|
|
15638
|
-
return Object.entries(this.toJSON())
|
|
15883
|
+
return Object.entries(this.toJSON())
|
|
15884
|
+
.map(([header, value]) => header + ': ' + value)
|
|
15885
|
+
.join('\n');
|
|
15639
15886
|
}
|
|
15640
15887
|
|
|
15641
15888
|
getSetCookie() {
|
|
15642
|
-
return this.get(
|
|
15889
|
+
return this.get('set-cookie') || [];
|
|
15643
15890
|
}
|
|
15644
15891
|
|
|
15645
15892
|
get [Symbol.toStringTag]() {
|
|
@@ -15659,9 +15906,12 @@ ${JSON.stringify({
|
|
|
15659
15906
|
}
|
|
15660
15907
|
|
|
15661
15908
|
static accessor(header) {
|
|
15662
|
-
const internals =
|
|
15663
|
-
|
|
15664
|
-
|
|
15909
|
+
const internals =
|
|
15910
|
+
(this[$internals] =
|
|
15911
|
+
this[$internals] =
|
|
15912
|
+
{
|
|
15913
|
+
accessors: {},
|
|
15914
|
+
});
|
|
15665
15915
|
|
|
15666
15916
|
const accessors = internals.accessors;
|
|
15667
15917
|
const prototype = this.prototype;
|
|
@@ -15681,17 +15931,24 @@ ${JSON.stringify({
|
|
|
15681
15931
|
}
|
|
15682
15932
|
};
|
|
15683
15933
|
|
|
15684
|
-
AxiosHeaders$1.accessor([
|
|
15934
|
+
AxiosHeaders$1.accessor([
|
|
15935
|
+
'Content-Type',
|
|
15936
|
+
'Content-Length',
|
|
15937
|
+
'Accept',
|
|
15938
|
+
'Accept-Encoding',
|
|
15939
|
+
'User-Agent',
|
|
15940
|
+
'Authorization',
|
|
15941
|
+
]);
|
|
15685
15942
|
|
|
15686
15943
|
// reserved names hotfix
|
|
15687
|
-
utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({value}, key) => {
|
|
15944
|
+
utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
|
|
15688
15945
|
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
|
15689
15946
|
return {
|
|
15690
15947
|
get: () => value,
|
|
15691
15948
|
set(headerValue) {
|
|
15692
15949
|
this[mapped] = headerValue;
|
|
15693
|
-
}
|
|
15694
|
-
}
|
|
15950
|
+
},
|
|
15951
|
+
};
|
|
15695
15952
|
});
|
|
15696
15953
|
|
|
15697
15954
|
utils$1.freezeMethods(AxiosHeaders$1);
|
|
@@ -15754,19 +16011,23 @@ ${JSON.stringify({
|
|
|
15754
16011
|
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
15755
16012
|
resolve(response);
|
|
15756
16013
|
} else {
|
|
15757
|
-
reject(
|
|
15758
|
-
|
|
15759
|
-
|
|
15760
|
-
|
|
15761
|
-
|
|
15762
|
-
|
|
15763
|
-
|
|
16014
|
+
reject(
|
|
16015
|
+
new AxiosError$1(
|
|
16016
|
+
'Request failed with status code ' + response.status,
|
|
16017
|
+
[AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][
|
|
16018
|
+
Math.floor(response.status / 100) - 4
|
|
16019
|
+
],
|
|
16020
|
+
response.config,
|
|
16021
|
+
response.request,
|
|
16022
|
+
response
|
|
16023
|
+
)
|
|
16024
|
+
);
|
|
15764
16025
|
}
|
|
15765
16026
|
}
|
|
15766
16027
|
|
|
15767
16028
|
function parseProtocol(url) {
|
|
15768
16029
|
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
15769
|
-
return match && match[1] || '';
|
|
16030
|
+
return (match && match[1]) || '';
|
|
15770
16031
|
}
|
|
15771
16032
|
|
|
15772
16033
|
/**
|
|
@@ -15817,7 +16078,7 @@ ${JSON.stringify({
|
|
|
15817
16078
|
|
|
15818
16079
|
const passed = startedAt && now - startedAt;
|
|
15819
16080
|
|
|
15820
|
-
return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
|
|
16081
|
+
return passed ? Math.round((bytesCount * 1000) / passed) : undefined;
|
|
15821
16082
|
};
|
|
15822
16083
|
}
|
|
15823
16084
|
|
|
@@ -15846,7 +16107,7 @@ ${JSON.stringify({
|
|
|
15846
16107
|
const throttled = (...args) => {
|
|
15847
16108
|
const now = Date.now();
|
|
15848
16109
|
const passed = now - timestamp;
|
|
15849
|
-
if (
|
|
16110
|
+
if (passed >= threshold) {
|
|
15850
16111
|
invoke(args, now);
|
|
15851
16112
|
} else {
|
|
15852
16113
|
lastArgs = args;
|
|
@@ -15868,25 +16129,25 @@ ${JSON.stringify({
|
|
|
15868
16129
|
let bytesNotified = 0;
|
|
15869
16130
|
const _speedometer = speedometer(50, 250);
|
|
15870
16131
|
|
|
15871
|
-
return throttle(e => {
|
|
15872
|
-
const
|
|
16132
|
+
return throttle((e) => {
|
|
16133
|
+
const rawLoaded = e.loaded;
|
|
15873
16134
|
const total = e.lengthComputable ? e.total : undefined;
|
|
15874
|
-
const
|
|
16135
|
+
const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
|
|
16136
|
+
const progressBytes = Math.max(0, loaded - bytesNotified);
|
|
15875
16137
|
const rate = _speedometer(progressBytes);
|
|
15876
|
-
const inRange = loaded <= total;
|
|
15877
16138
|
|
|
15878
|
-
bytesNotified = loaded;
|
|
16139
|
+
bytesNotified = Math.max(bytesNotified, loaded);
|
|
15879
16140
|
|
|
15880
16141
|
const data = {
|
|
15881
16142
|
loaded,
|
|
15882
16143
|
total,
|
|
15883
|
-
progress: total ?
|
|
16144
|
+
progress: total ? loaded / total : undefined,
|
|
15884
16145
|
bytes: progressBytes,
|
|
15885
16146
|
rate: rate ? rate : undefined,
|
|
15886
|
-
estimated: rate && total
|
|
16147
|
+
estimated: rate && total ? (total - loaded) / rate : undefined,
|
|
15887
16148
|
event: e,
|
|
15888
16149
|
lengthComputable: total != null,
|
|
15889
|
-
[isDownloadStream ? 'download' : 'upload']: true
|
|
16150
|
+
[isDownloadStream ? 'download' : 'upload']: true,
|
|
15890
16151
|
};
|
|
15891
16152
|
|
|
15892
16153
|
listener(data);
|
|
@@ -15896,77 +16157,82 @@ ${JSON.stringify({
|
|
|
15896
16157
|
const progressEventDecorator = (total, throttled) => {
|
|
15897
16158
|
const lengthComputable = total != null;
|
|
15898
16159
|
|
|
15899
|
-
return [
|
|
15900
|
-
|
|
15901
|
-
|
|
15902
|
-
|
|
15903
|
-
|
|
16160
|
+
return [
|
|
16161
|
+
(loaded) =>
|
|
16162
|
+
throttled[0]({
|
|
16163
|
+
lengthComputable,
|
|
16164
|
+
total,
|
|
16165
|
+
loaded,
|
|
16166
|
+
}),
|
|
16167
|
+
throttled[1],
|
|
16168
|
+
];
|
|
15904
16169
|
};
|
|
15905
16170
|
|
|
15906
|
-
const asyncDecorator =
|
|
15907
|
-
|
|
15908
|
-
|
|
15909
|
-
|
|
16171
|
+
const asyncDecorator =
|
|
16172
|
+
(fn) =>
|
|
16173
|
+
(...args) =>
|
|
16174
|
+
utils$1.asap(() => fn(...args));
|
|
15910
16175
|
|
|
15911
|
-
|
|
15912
|
-
|
|
15913
|
-
|
|
15914
|
-
(isMSIE || origin.port === url.port)
|
|
15915
|
-
);
|
|
15916
|
-
})(
|
|
15917
|
-
new URL(platform.origin),
|
|
15918
|
-
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
|
15919
|
-
) : () => true;
|
|
16176
|
+
const isURLSameOrigin = platform.hasStandardBrowserEnv
|
|
16177
|
+
? ((origin, isMSIE) => (url) => {
|
|
16178
|
+
url = new URL(url, platform.origin);
|
|
15920
16179
|
|
|
15921
|
-
|
|
16180
|
+
return (
|
|
16181
|
+
origin.protocol === url.protocol &&
|
|
16182
|
+
origin.host === url.host &&
|
|
16183
|
+
(isMSIE || origin.port === url.port)
|
|
16184
|
+
);
|
|
16185
|
+
})(
|
|
16186
|
+
new URL(platform.origin),
|
|
16187
|
+
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
|
16188
|
+
)
|
|
16189
|
+
: () => true;
|
|
15922
16190
|
|
|
15923
|
-
|
|
15924
|
-
|
|
15925
|
-
|
|
15926
|
-
|
|
16191
|
+
const cookies = platform.hasStandardBrowserEnv
|
|
16192
|
+
? // Standard browser envs support document.cookie
|
|
16193
|
+
{
|
|
16194
|
+
write(name, value, expires, path, domain, secure, sameSite) {
|
|
16195
|
+
if (typeof document === 'undefined') return;
|
|
15927
16196
|
|
|
15928
|
-
|
|
16197
|
+
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
15929
16198
|
|
|
15930
|
-
|
|
15931
|
-
|
|
15932
|
-
|
|
15933
|
-
|
|
15934
|
-
|
|
15935
|
-
|
|
15936
|
-
|
|
15937
|
-
|
|
15938
|
-
|
|
15939
|
-
|
|
15940
|
-
|
|
15941
|
-
|
|
15942
|
-
|
|
15943
|
-
|
|
15944
|
-
|
|
16199
|
+
if (utils$1.isNumber(expires)) {
|
|
16200
|
+
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
16201
|
+
}
|
|
16202
|
+
if (utils$1.isString(path)) {
|
|
16203
|
+
cookie.push(`path=${path}`);
|
|
16204
|
+
}
|
|
16205
|
+
if (utils$1.isString(domain)) {
|
|
16206
|
+
cookie.push(`domain=${domain}`);
|
|
16207
|
+
}
|
|
16208
|
+
if (secure === true) {
|
|
16209
|
+
cookie.push('secure');
|
|
16210
|
+
}
|
|
16211
|
+
if (utils$1.isString(sameSite)) {
|
|
16212
|
+
cookie.push(`SameSite=${sameSite}`);
|
|
16213
|
+
}
|
|
15945
16214
|
|
|
15946
|
-
|
|
15947
|
-
|
|
16215
|
+
document.cookie = cookie.join('; ');
|
|
16216
|
+
},
|
|
15948
16217
|
|
|
15949
|
-
|
|
15950
|
-
|
|
15951
|
-
|
|
15952
|
-
|
|
15953
|
-
|
|
16218
|
+
read(name) {
|
|
16219
|
+
if (typeof document === 'undefined') return null;
|
|
16220
|
+
const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
|
|
16221
|
+
return match ? decodeURIComponent(match[1]) : null;
|
|
16222
|
+
},
|
|
15954
16223
|
|
|
15955
|
-
|
|
15956
|
-
|
|
16224
|
+
remove(name) {
|
|
16225
|
+
this.write(name, '', Date.now() - 86400000, '/');
|
|
16226
|
+
},
|
|
15957
16227
|
}
|
|
15958
|
-
|
|
15959
|
-
|
|
15960
|
-
|
|
15961
|
-
|
|
15962
|
-
|
|
15963
|
-
|
|
15964
|
-
|
|
15965
|
-
|
|
15966
|
-
return null;
|
|
15967
|
-
},
|
|
15968
|
-
remove() {}
|
|
15969
|
-
};
|
|
16228
|
+
: // Non-standard browser env (web workers, react-native) lack needed support.
|
|
16229
|
+
{
|
|
16230
|
+
write() {},
|
|
16231
|
+
read() {
|
|
16232
|
+
return null;
|
|
16233
|
+
},
|
|
16234
|
+
remove() {},
|
|
16235
|
+
};
|
|
15970
16236
|
|
|
15971
16237
|
/**
|
|
15972
16238
|
* Determines whether the specified URL is absolute
|
|
@@ -16012,14 +16278,13 @@ ${JSON.stringify({
|
|
|
16012
16278
|
*/
|
|
16013
16279
|
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
16014
16280
|
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
|
16015
|
-
if (baseURL && (isRelativeUrl || allowAbsoluteUrls
|
|
16281
|
+
if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
|
|
16016
16282
|
return combineURLs(baseURL, requestedURL);
|
|
16017
16283
|
}
|
|
16018
16284
|
return requestedURL;
|
|
16019
16285
|
}
|
|
16020
16286
|
|
|
16021
|
-
const headersToObject = (thing) =>
|
|
16022
|
-
thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
|
|
16287
|
+
const headersToObject = (thing) => (thing instanceof AxiosHeaders$1 ? { ...thing } : thing);
|
|
16023
16288
|
|
|
16024
16289
|
/**
|
|
16025
16290
|
* Config-specific merge-function which creates a new config-object
|
|
@@ -16033,7 +16298,18 @@ ${JSON.stringify({
|
|
|
16033
16298
|
function mergeConfig$1(config1, config2) {
|
|
16034
16299
|
// eslint-disable-next-line no-param-reassign
|
|
16035
16300
|
config2 = config2 || {};
|
|
16036
|
-
|
|
16301
|
+
|
|
16302
|
+
// Use a null-prototype object so that downstream reads such as `config.auth`
|
|
16303
|
+
// or `config.baseURL` cannot inherit polluted values from Object.prototype
|
|
16304
|
+
// (see GHSA-q8qp-cvcw-x6jj). `hasOwnProperty` is restored as a non-enumerable
|
|
16305
|
+
// own slot to preserve ergonomics for user code that relies on it.
|
|
16306
|
+
const config = Object.create(null);
|
|
16307
|
+
Object.defineProperty(config, 'hasOwnProperty', {
|
|
16308
|
+
value: Object.prototype.hasOwnProperty,
|
|
16309
|
+
enumerable: false,
|
|
16310
|
+
writable: true,
|
|
16311
|
+
configurable: true,
|
|
16312
|
+
});
|
|
16037
16313
|
|
|
16038
16314
|
function getMergedValue(target, source, prop, caseless) {
|
|
16039
16315
|
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
@@ -16072,9 +16348,9 @@ ${JSON.stringify({
|
|
|
16072
16348
|
|
|
16073
16349
|
// eslint-disable-next-line consistent-return
|
|
16074
16350
|
function mergeDirectKeys(a, b, prop) {
|
|
16075
|
-
if (prop
|
|
16351
|
+
if (utils$1.hasOwnProp(config2, prop)) {
|
|
16076
16352
|
return getMergedValue(a, b);
|
|
16077
|
-
} else if (prop
|
|
16353
|
+
} else if (utils$1.hasOwnProp(config1, prop)) {
|
|
16078
16354
|
return getMergedValue(undefined, a);
|
|
16079
16355
|
}
|
|
16080
16356
|
}
|
|
@@ -16106,29 +16382,21 @@ ${JSON.stringify({
|
|
|
16106
16382
|
httpsAgent: defaultToConfig2,
|
|
16107
16383
|
cancelToken: defaultToConfig2,
|
|
16108
16384
|
socketPath: defaultToConfig2,
|
|
16385
|
+
allowedSocketPaths: defaultToConfig2,
|
|
16109
16386
|
responseEncoding: defaultToConfig2,
|
|
16110
16387
|
validateStatus: mergeDirectKeys,
|
|
16111
16388
|
headers: (a, b, prop) =>
|
|
16112
16389
|
mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),
|
|
16113
16390
|
};
|
|
16114
16391
|
|
|
16115
|
-
utils$1.forEach(
|
|
16116
|
-
|
|
16117
|
-
|
|
16118
|
-
|
|
16119
|
-
|
|
16120
|
-
|
|
16121
|
-
|
|
16122
|
-
|
|
16123
|
-
return;
|
|
16124
|
-
const merge = utils$1.hasOwnProp(mergeMap, prop)
|
|
16125
|
-
? mergeMap[prop]
|
|
16126
|
-
: mergeDeepProperties;
|
|
16127
|
-
const configValue = merge(config1[prop], config2[prop], prop);
|
|
16128
|
-
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) ||
|
|
16129
|
-
(config[prop] = configValue);
|
|
16130
|
-
},
|
|
16131
|
-
);
|
|
16392
|
+
utils$1.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
|
|
16393
|
+
if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;
|
|
16394
|
+
const merge = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
|
|
16395
|
+
const a = utils$1.hasOwnProp(config1, prop) ? config1[prop] : undefined;
|
|
16396
|
+
const b = utils$1.hasOwnProp(config2, prop) ? config2[prop] : undefined;
|
|
16397
|
+
const configValue = merge(a, b, prop);
|
|
16398
|
+
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
16399
|
+
});
|
|
16132
16400
|
|
|
16133
16401
|
return config;
|
|
16134
16402
|
}
|
|
@@ -16136,16 +16404,38 @@ ${JSON.stringify({
|
|
|
16136
16404
|
const resolveConfig = (config) => {
|
|
16137
16405
|
const newConfig = mergeConfig$1({}, config);
|
|
16138
16406
|
|
|
16139
|
-
|
|
16407
|
+
// Read only own properties to prevent prototype pollution gadgets
|
|
16408
|
+
// (e.g. Object.prototype.baseURL = 'https://evil.com'). See GHSA-q8qp-cvcw-x6jj.
|
|
16409
|
+
const own = (key) => (utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : undefined);
|
|
16410
|
+
|
|
16411
|
+
const data = own('data');
|
|
16412
|
+
let withXSRFToken = own('withXSRFToken');
|
|
16413
|
+
const xsrfHeaderName = own('xsrfHeaderName');
|
|
16414
|
+
const xsrfCookieName = own('xsrfCookieName');
|
|
16415
|
+
let headers = own('headers');
|
|
16416
|
+
const auth = own('auth');
|
|
16417
|
+
const baseURL = own('baseURL');
|
|
16418
|
+
const allowAbsoluteUrls = own('allowAbsoluteUrls');
|
|
16419
|
+
const url = own('url');
|
|
16140
16420
|
|
|
16141
16421
|
newConfig.headers = headers = AxiosHeaders$1.from(headers);
|
|
16142
16422
|
|
|
16143
|
-
newConfig.url = buildURL(
|
|
16423
|
+
newConfig.url = buildURL(
|
|
16424
|
+
buildFullPath(baseURL, url, allowAbsoluteUrls),
|
|
16425
|
+
config.params,
|
|
16426
|
+
config.paramsSerializer
|
|
16427
|
+
);
|
|
16144
16428
|
|
|
16145
16429
|
// HTTP basic authentication
|
|
16146
16430
|
if (auth) {
|
|
16147
|
-
headers.set(
|
|
16148
|
-
|
|
16431
|
+
headers.set(
|
|
16432
|
+
'Authorization',
|
|
16433
|
+
'Basic ' +
|
|
16434
|
+
btoa(
|
|
16435
|
+
(auth.username || '') +
|
|
16436
|
+
':' +
|
|
16437
|
+
(auth.password ? unescape(encodeURIComponent(auth.password)) : '')
|
|
16438
|
+
)
|
|
16149
16439
|
);
|
|
16150
16440
|
}
|
|
16151
16441
|
|
|
@@ -16163,17 +16453,25 @@ ${JSON.stringify({
|
|
|
16163
16453
|
}
|
|
16164
16454
|
});
|
|
16165
16455
|
}
|
|
16166
|
-
}
|
|
16456
|
+
}
|
|
16167
16457
|
|
|
16168
16458
|
// Add xsrf header
|
|
16169
16459
|
// This is only done if running in a standard browser environment.
|
|
16170
16460
|
// Specifically not if we're in a web worker, or react-native.
|
|
16171
16461
|
|
|
16172
16462
|
if (platform.hasStandardBrowserEnv) {
|
|
16173
|
-
|
|
16463
|
+
if (utils$1.isFunction(withXSRFToken)) {
|
|
16464
|
+
withXSRFToken = withXSRFToken(newConfig);
|
|
16465
|
+
}
|
|
16466
|
+
|
|
16467
|
+
// Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)
|
|
16468
|
+
// and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking
|
|
16469
|
+
// the XSRF token cross-origin. See GHSA-xx6v-rp6x-q39c.
|
|
16470
|
+
const shouldSendXSRF =
|
|
16471
|
+
withXSRFToken === true ||
|
|
16472
|
+
(withXSRFToken == null && isURLSameOrigin(newConfig.url));
|
|
16174
16473
|
|
|
16175
|
-
if (
|
|
16176
|
-
// Add xsrf header
|
|
16474
|
+
if (shouldSendXSRF) {
|
|
16177
16475
|
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
|
|
16178
16476
|
|
|
16179
16477
|
if (xsrfValue) {
|
|
@@ -16187,196 +16485,218 @@ ${JSON.stringify({
|
|
|
16187
16485
|
|
|
16188
16486
|
const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
|
16189
16487
|
|
|
16190
|
-
const xhrAdapter = isXHRAdapterSupported &&
|
|
16191
|
-
|
|
16192
|
-
|
|
16193
|
-
|
|
16194
|
-
|
|
16195
|
-
|
|
16196
|
-
|
|
16197
|
-
|
|
16198
|
-
|
|
16488
|
+
const xhrAdapter = isXHRAdapterSupported &&
|
|
16489
|
+
function (config) {
|
|
16490
|
+
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
16491
|
+
const _config = resolveConfig(config);
|
|
16492
|
+
let requestData = _config.data;
|
|
16493
|
+
const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
|
|
16494
|
+
let { responseType, onUploadProgress, onDownloadProgress } = _config;
|
|
16495
|
+
let onCanceled;
|
|
16496
|
+
let uploadThrottled, downloadThrottled;
|
|
16497
|
+
let flushUpload, flushDownload;
|
|
16199
16498
|
|
|
16200
|
-
|
|
16201
|
-
|
|
16202
|
-
|
|
16499
|
+
function done() {
|
|
16500
|
+
flushUpload && flushUpload(); // flush events
|
|
16501
|
+
flushDownload && flushDownload(); // flush events
|
|
16203
16502
|
|
|
16204
|
-
|
|
16503
|
+
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
|
16205
16504
|
|
|
16206
|
-
|
|
16207
|
-
|
|
16505
|
+
_config.signal && _config.signal.removeEventListener('abort', onCanceled);
|
|
16506
|
+
}
|
|
16208
16507
|
|
|
16209
|
-
|
|
16508
|
+
let request = new XMLHttpRequest();
|
|
16210
16509
|
|
|
16211
|
-
|
|
16510
|
+
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
16212
16511
|
|
|
16213
|
-
|
|
16214
|
-
|
|
16512
|
+
// Set the request timeout in MS
|
|
16513
|
+
request.timeout = _config.timeout;
|
|
16215
16514
|
|
|
16216
|
-
|
|
16217
|
-
|
|
16218
|
-
|
|
16515
|
+
function onloadend() {
|
|
16516
|
+
if (!request) {
|
|
16517
|
+
return;
|
|
16518
|
+
}
|
|
16519
|
+
// Prepare the response
|
|
16520
|
+
const responseHeaders = AxiosHeaders$1.from(
|
|
16521
|
+
'getAllResponseHeaders' in request && request.getAllResponseHeaders()
|
|
16522
|
+
);
|
|
16523
|
+
const responseData =
|
|
16524
|
+
!responseType || responseType === 'text' || responseType === 'json'
|
|
16525
|
+
? request.responseText
|
|
16526
|
+
: request.response;
|
|
16527
|
+
const response = {
|
|
16528
|
+
data: responseData,
|
|
16529
|
+
status: request.status,
|
|
16530
|
+
statusText: request.statusText,
|
|
16531
|
+
headers: responseHeaders,
|
|
16532
|
+
config,
|
|
16533
|
+
request,
|
|
16534
|
+
};
|
|
16535
|
+
|
|
16536
|
+
settle(
|
|
16537
|
+
function _resolve(value) {
|
|
16538
|
+
resolve(value);
|
|
16539
|
+
done();
|
|
16540
|
+
},
|
|
16541
|
+
function _reject(err) {
|
|
16542
|
+
reject(err);
|
|
16543
|
+
done();
|
|
16544
|
+
},
|
|
16545
|
+
response
|
|
16546
|
+
);
|
|
16547
|
+
|
|
16548
|
+
// Clean up request
|
|
16549
|
+
request = null;
|
|
16219
16550
|
}
|
|
16220
|
-
// Prepare the response
|
|
16221
|
-
const responseHeaders = AxiosHeaders$1.from(
|
|
16222
|
-
'getAllResponseHeaders' in request && request.getAllResponseHeaders()
|
|
16223
|
-
);
|
|
16224
|
-
const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
|
|
16225
|
-
request.responseText : request.response;
|
|
16226
|
-
const response = {
|
|
16227
|
-
data: responseData,
|
|
16228
|
-
status: request.status,
|
|
16229
|
-
statusText: request.statusText,
|
|
16230
|
-
headers: responseHeaders,
|
|
16231
|
-
config,
|
|
16232
|
-
request
|
|
16233
|
-
};
|
|
16234
16551
|
|
|
16235
|
-
|
|
16236
|
-
|
|
16237
|
-
|
|
16238
|
-
}
|
|
16239
|
-
|
|
16240
|
-
|
|
16241
|
-
|
|
16552
|
+
if ('onloadend' in request) {
|
|
16553
|
+
// Use onloadend if available
|
|
16554
|
+
request.onloadend = onloadend;
|
|
16555
|
+
} else {
|
|
16556
|
+
// Listen for ready state to emulate onloadend
|
|
16557
|
+
request.onreadystatechange = function handleLoad() {
|
|
16558
|
+
if (!request || request.readyState !== 4) {
|
|
16559
|
+
return;
|
|
16560
|
+
}
|
|
16242
16561
|
|
|
16243
|
-
|
|
16244
|
-
|
|
16245
|
-
|
|
16562
|
+
// The request errored out and we didn't get a response, this will be
|
|
16563
|
+
// handled by onerror instead
|
|
16564
|
+
// With one exception: request that using file: protocol, most browsers
|
|
16565
|
+
// will return status as 0 even though it's a successful request
|
|
16566
|
+
if (
|
|
16567
|
+
request.status === 0 &&
|
|
16568
|
+
!(request.responseURL && request.responseURL.indexOf('file:') === 0)
|
|
16569
|
+
) {
|
|
16570
|
+
return;
|
|
16571
|
+
}
|
|
16572
|
+
// readystate handler is calling before onerror or ontimeout handlers,
|
|
16573
|
+
// so we should call onloadend on the next 'tick'
|
|
16574
|
+
setTimeout(onloadend);
|
|
16575
|
+
};
|
|
16576
|
+
}
|
|
16246
16577
|
|
|
16247
|
-
|
|
16248
|
-
|
|
16249
|
-
|
|
16250
|
-
} else {
|
|
16251
|
-
// Listen for ready state to emulate onloadend
|
|
16252
|
-
request.onreadystatechange = function handleLoad() {
|
|
16253
|
-
if (!request || request.readyState !== 4) {
|
|
16578
|
+
// Handle browser request cancellation (as opposed to a manual cancellation)
|
|
16579
|
+
request.onabort = function handleAbort() {
|
|
16580
|
+
if (!request) {
|
|
16254
16581
|
return;
|
|
16255
16582
|
}
|
|
16256
16583
|
|
|
16257
|
-
|
|
16258
|
-
|
|
16259
|
-
//
|
|
16260
|
-
|
|
16261
|
-
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
|
|
16262
|
-
return;
|
|
16263
|
-
}
|
|
16264
|
-
// readystate handler is calling before onerror or ontimeout handlers,
|
|
16265
|
-
// so we should call onloadend on the next 'tick'
|
|
16266
|
-
setTimeout(onloadend);
|
|
16584
|
+
reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
|
|
16585
|
+
|
|
16586
|
+
// Clean up request
|
|
16587
|
+
request = null;
|
|
16267
16588
|
};
|
|
16268
|
-
}
|
|
16269
16589
|
|
|
16270
|
-
|
|
16271
|
-
|
|
16272
|
-
|
|
16273
|
-
|
|
16274
|
-
|
|
16590
|
+
// Handle low level network errors
|
|
16591
|
+
request.onerror = function handleError(event) {
|
|
16592
|
+
// Browsers deliver a ProgressEvent in XHR onerror
|
|
16593
|
+
// (message may be empty; when present, surface it)
|
|
16594
|
+
// See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
|
|
16595
|
+
const msg = event && event.message ? event.message : 'Network Error';
|
|
16596
|
+
const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
|
|
16597
|
+
// attach the underlying event for consumers who want details
|
|
16598
|
+
err.event = event || null;
|
|
16599
|
+
reject(err);
|
|
16600
|
+
request = null;
|
|
16601
|
+
};
|
|
16275
16602
|
|
|
16276
|
-
|
|
16603
|
+
// Handle timeout
|
|
16604
|
+
request.ontimeout = function handleTimeout() {
|
|
16605
|
+
let timeoutErrorMessage = _config.timeout
|
|
16606
|
+
? 'timeout of ' + _config.timeout + 'ms exceeded'
|
|
16607
|
+
: 'timeout exceeded';
|
|
16608
|
+
const transitional = _config.transitional || transitionalDefaults;
|
|
16609
|
+
if (_config.timeoutErrorMessage) {
|
|
16610
|
+
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
16611
|
+
}
|
|
16612
|
+
reject(
|
|
16613
|
+
new AxiosError$1(
|
|
16614
|
+
timeoutErrorMessage,
|
|
16615
|
+
transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
|
|
16616
|
+
config,
|
|
16617
|
+
request
|
|
16618
|
+
)
|
|
16619
|
+
);
|
|
16277
16620
|
|
|
16278
|
-
|
|
16279
|
-
|
|
16280
|
-
|
|
16621
|
+
// Clean up request
|
|
16622
|
+
request = null;
|
|
16623
|
+
};
|
|
16281
16624
|
|
|
16282
|
-
|
|
16283
|
-
|
|
16284
|
-
// Browsers deliver a ProgressEvent in XHR onerror
|
|
16285
|
-
// (message may be empty; when present, surface it)
|
|
16286
|
-
// See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
|
|
16287
|
-
const msg = event && event.message ? event.message : 'Network Error';
|
|
16288
|
-
const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
|
|
16289
|
-
// attach the underlying event for consumers who want details
|
|
16290
|
-
err.event = event || null;
|
|
16291
|
-
reject(err);
|
|
16292
|
-
request = null;
|
|
16293
|
-
};
|
|
16294
|
-
|
|
16295
|
-
// Handle timeout
|
|
16296
|
-
request.ontimeout = function handleTimeout() {
|
|
16297
|
-
let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
16298
|
-
const transitional = _config.transitional || transitionalDefaults;
|
|
16299
|
-
if (_config.timeoutErrorMessage) {
|
|
16300
|
-
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
16301
|
-
}
|
|
16302
|
-
reject(new AxiosError$1(
|
|
16303
|
-
timeoutErrorMessage,
|
|
16304
|
-
transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
|
|
16305
|
-
config,
|
|
16306
|
-
request));
|
|
16307
|
-
|
|
16308
|
-
// Clean up request
|
|
16309
|
-
request = null;
|
|
16310
|
-
};
|
|
16625
|
+
// Remove Content-Type if data is undefined
|
|
16626
|
+
requestData === undefined && requestHeaders.setContentType(null);
|
|
16311
16627
|
|
|
16312
|
-
|
|
16313
|
-
|
|
16628
|
+
// Add headers to the request
|
|
16629
|
+
if ('setRequestHeader' in request) {
|
|
16630
|
+
utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
|
16631
|
+
request.setRequestHeader(key, val);
|
|
16632
|
+
});
|
|
16633
|
+
}
|
|
16314
16634
|
|
|
16315
|
-
|
|
16316
|
-
|
|
16317
|
-
|
|
16318
|
-
|
|
16319
|
-
});
|
|
16320
|
-
}
|
|
16635
|
+
// Add withCredentials to request if needed
|
|
16636
|
+
if (!utils$1.isUndefined(_config.withCredentials)) {
|
|
16637
|
+
request.withCredentials = !!_config.withCredentials;
|
|
16638
|
+
}
|
|
16321
16639
|
|
|
16322
|
-
|
|
16323
|
-
|
|
16324
|
-
|
|
16325
|
-
|
|
16640
|
+
// Add responseType to request if needed
|
|
16641
|
+
if (responseType && responseType !== 'json') {
|
|
16642
|
+
request.responseType = _config.responseType;
|
|
16643
|
+
}
|
|
16326
16644
|
|
|
16327
|
-
|
|
16328
|
-
|
|
16329
|
-
|
|
16330
|
-
|
|
16645
|
+
// Handle progress if needed
|
|
16646
|
+
if (onDownloadProgress) {
|
|
16647
|
+
[downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
|
|
16648
|
+
request.addEventListener('progress', downloadThrottled);
|
|
16649
|
+
}
|
|
16331
16650
|
|
|
16332
|
-
|
|
16333
|
-
|
|
16334
|
-
|
|
16335
|
-
request.addEventListener('progress', downloadThrottled);
|
|
16336
|
-
}
|
|
16651
|
+
// Not all browsers support upload events
|
|
16652
|
+
if (onUploadProgress && request.upload) {
|
|
16653
|
+
[uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
|
|
16337
16654
|
|
|
16338
|
-
|
|
16339
|
-
if (onUploadProgress && request.upload) {
|
|
16340
|
-
([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));
|
|
16655
|
+
request.upload.addEventListener('progress', uploadThrottled);
|
|
16341
16656
|
|
|
16342
|
-
|
|
16657
|
+
request.upload.addEventListener('loadend', flushUpload);
|
|
16658
|
+
}
|
|
16343
16659
|
|
|
16344
|
-
|
|
16345
|
-
|
|
16660
|
+
if (_config.cancelToken || _config.signal) {
|
|
16661
|
+
// Handle cancellation
|
|
16662
|
+
// eslint-disable-next-line func-names
|
|
16663
|
+
onCanceled = (cancel) => {
|
|
16664
|
+
if (!request) {
|
|
16665
|
+
return;
|
|
16666
|
+
}
|
|
16667
|
+
reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
|
|
16668
|
+
request.abort();
|
|
16669
|
+
request = null;
|
|
16670
|
+
};
|
|
16346
16671
|
|
|
16347
|
-
|
|
16348
|
-
|
|
16349
|
-
|
|
16350
|
-
|
|
16351
|
-
|
|
16352
|
-
return;
|
|
16672
|
+
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
16673
|
+
if (_config.signal) {
|
|
16674
|
+
_config.signal.aborted
|
|
16675
|
+
? onCanceled()
|
|
16676
|
+
: _config.signal.addEventListener('abort', onCanceled);
|
|
16353
16677
|
}
|
|
16354
|
-
reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
|
|
16355
|
-
request.abort();
|
|
16356
|
-
request = null;
|
|
16357
|
-
};
|
|
16358
|
-
|
|
16359
|
-
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
16360
|
-
if (_config.signal) {
|
|
16361
|
-
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
|
|
16362
16678
|
}
|
|
16363
|
-
}
|
|
16364
16679
|
|
|
16365
|
-
|
|
16366
|
-
|
|
16367
|
-
if (protocol && platform.protocols.indexOf(protocol) === -1) {
|
|
16368
|
-
reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config));
|
|
16369
|
-
return;
|
|
16370
|
-
}
|
|
16680
|
+
const protocol = parseProtocol(_config.url);
|
|
16371
16681
|
|
|
16682
|
+
if (protocol && platform.protocols.indexOf(protocol) === -1) {
|
|
16683
|
+
reject(
|
|
16684
|
+
new AxiosError$1(
|
|
16685
|
+
'Unsupported protocol ' + protocol + ':',
|
|
16686
|
+
AxiosError$1.ERR_BAD_REQUEST,
|
|
16687
|
+
config
|
|
16688
|
+
)
|
|
16689
|
+
);
|
|
16690
|
+
return;
|
|
16691
|
+
}
|
|
16372
16692
|
|
|
16373
|
-
|
|
16374
|
-
|
|
16375
|
-
|
|
16376
|
-
|
|
16693
|
+
// Send the request
|
|
16694
|
+
request.send(requestData || null);
|
|
16695
|
+
});
|
|
16696
|
+
};
|
|
16377
16697
|
|
|
16378
16698
|
const composeSignals = (signals, timeout) => {
|
|
16379
|
-
const {length} = (signals = signals ? signals.filter(Boolean) : []);
|
|
16699
|
+
const { length } = (signals = signals ? signals.filter(Boolean) : []);
|
|
16380
16700
|
|
|
16381
16701
|
if (timeout || length) {
|
|
16382
16702
|
let controller = new AbortController();
|
|
@@ -16388,21 +16708,29 @@ ${JSON.stringify({
|
|
|
16388
16708
|
aborted = true;
|
|
16389
16709
|
unsubscribe();
|
|
16390
16710
|
const err = reason instanceof Error ? reason : this.reason;
|
|
16391
|
-
controller.abort(
|
|
16711
|
+
controller.abort(
|
|
16712
|
+
err instanceof AxiosError$1
|
|
16713
|
+
? err
|
|
16714
|
+
: new CanceledError$1(err instanceof Error ? err.message : err)
|
|
16715
|
+
);
|
|
16392
16716
|
}
|
|
16393
16717
|
};
|
|
16394
16718
|
|
|
16395
|
-
let timer =
|
|
16396
|
-
|
|
16397
|
-
|
|
16398
|
-
|
|
16719
|
+
let timer =
|
|
16720
|
+
timeout &&
|
|
16721
|
+
setTimeout(() => {
|
|
16722
|
+
timer = null;
|
|
16723
|
+
onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
|
|
16724
|
+
}, timeout);
|
|
16399
16725
|
|
|
16400
16726
|
const unsubscribe = () => {
|
|
16401
16727
|
if (signals) {
|
|
16402
16728
|
timer && clearTimeout(timer);
|
|
16403
16729
|
timer = null;
|
|
16404
|
-
signals.forEach(signal => {
|
|
16405
|
-
signal.unsubscribe
|
|
16730
|
+
signals.forEach((signal) => {
|
|
16731
|
+
signal.unsubscribe
|
|
16732
|
+
? signal.unsubscribe(onabort)
|
|
16733
|
+
: signal.removeEventListener('abort', onabort);
|
|
16406
16734
|
});
|
|
16407
16735
|
signals = null;
|
|
16408
16736
|
}
|
|
@@ -16410,7 +16738,7 @@ ${JSON.stringify({
|
|
|
16410
16738
|
|
|
16411
16739
|
signals.forEach((signal) => signal.addEventListener('abort', onabort));
|
|
16412
16740
|
|
|
16413
|
-
const {signal} = controller;
|
|
16741
|
+
const { signal } = controller;
|
|
16414
16742
|
|
|
16415
16743
|
signal.unsubscribe = () => utils$1.asap(unsubscribe);
|
|
16416
16744
|
|
|
@@ -16451,7 +16779,7 @@ ${JSON.stringify({
|
|
|
16451
16779
|
const reader = stream.getReader();
|
|
16452
16780
|
try {
|
|
16453
16781
|
for (;;) {
|
|
16454
|
-
const {done, value} = await reader.read();
|
|
16782
|
+
const { done, value } = await reader.read();
|
|
16455
16783
|
if (done) {
|
|
16456
16784
|
break;
|
|
16457
16785
|
}
|
|
@@ -16474,64 +16802,69 @@ ${JSON.stringify({
|
|
|
16474
16802
|
}
|
|
16475
16803
|
};
|
|
16476
16804
|
|
|
16477
|
-
return new ReadableStream(
|
|
16478
|
-
|
|
16479
|
-
|
|
16480
|
-
|
|
16805
|
+
return new ReadableStream(
|
|
16806
|
+
{
|
|
16807
|
+
async pull(controller) {
|
|
16808
|
+
try {
|
|
16809
|
+
const { done, value } = await iterator.next();
|
|
16481
16810
|
|
|
16482
|
-
|
|
16483
|
-
|
|
16484
|
-
|
|
16485
|
-
|
|
16486
|
-
|
|
16811
|
+
if (done) {
|
|
16812
|
+
_onFinish();
|
|
16813
|
+
controller.close();
|
|
16814
|
+
return;
|
|
16815
|
+
}
|
|
16487
16816
|
|
|
16488
|
-
|
|
16489
|
-
|
|
16490
|
-
|
|
16491
|
-
|
|
16817
|
+
let len = value.byteLength;
|
|
16818
|
+
if (onProgress) {
|
|
16819
|
+
let loadedBytes = (bytes += len);
|
|
16820
|
+
onProgress(loadedBytes);
|
|
16821
|
+
}
|
|
16822
|
+
controller.enqueue(new Uint8Array(value));
|
|
16823
|
+
} catch (err) {
|
|
16824
|
+
_onFinish(err);
|
|
16825
|
+
throw err;
|
|
16492
16826
|
}
|
|
16493
|
-
|
|
16494
|
-
|
|
16495
|
-
_onFinish(
|
|
16496
|
-
|
|
16497
|
-
}
|
|
16827
|
+
},
|
|
16828
|
+
cancel(reason) {
|
|
16829
|
+
_onFinish(reason);
|
|
16830
|
+
return iterator.return();
|
|
16831
|
+
},
|
|
16498
16832
|
},
|
|
16499
|
-
|
|
16500
|
-
|
|
16501
|
-
return iterator.return();
|
|
16833
|
+
{
|
|
16834
|
+
highWaterMark: 2,
|
|
16502
16835
|
}
|
|
16503
|
-
|
|
16504
|
-
highWaterMark: 2
|
|
16505
|
-
})
|
|
16836
|
+
);
|
|
16506
16837
|
};
|
|
16507
16838
|
|
|
16508
16839
|
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
16509
16840
|
|
|
16510
|
-
const {isFunction} = utils$1;
|
|
16841
|
+
const { isFunction } = utils$1;
|
|
16511
16842
|
|
|
16512
|
-
const globalFetchAPI = (({Request, Response}) => ({
|
|
16513
|
-
Request,
|
|
16843
|
+
const globalFetchAPI = (({ Request, Response }) => ({
|
|
16844
|
+
Request,
|
|
16845
|
+
Response,
|
|
16514
16846
|
}))(utils$1.global);
|
|
16515
16847
|
|
|
16516
|
-
const {
|
|
16517
|
-
ReadableStream: ReadableStream$1, TextEncoder
|
|
16518
|
-
} = utils$1.global;
|
|
16519
|
-
|
|
16848
|
+
const { ReadableStream: ReadableStream$1, TextEncoder } = utils$1.global;
|
|
16520
16849
|
|
|
16521
16850
|
const test = (fn, ...args) => {
|
|
16522
16851
|
try {
|
|
16523
16852
|
return !!fn(...args);
|
|
16524
16853
|
} catch (e) {
|
|
16525
|
-
return false
|
|
16854
|
+
return false;
|
|
16526
16855
|
}
|
|
16527
16856
|
};
|
|
16528
16857
|
|
|
16529
16858
|
const factory = (env) => {
|
|
16530
|
-
env = utils$1.merge.call(
|
|
16531
|
-
|
|
16532
|
-
|
|
16859
|
+
env = utils$1.merge.call(
|
|
16860
|
+
{
|
|
16861
|
+
skipUndefined: true,
|
|
16862
|
+
},
|
|
16863
|
+
globalFetchAPI,
|
|
16864
|
+
env
|
|
16865
|
+
);
|
|
16533
16866
|
|
|
16534
|
-
const {fetch: envFetch, Request, Response} = env;
|
|
16867
|
+
const { fetch: envFetch, Request, Response } = env;
|
|
16535
16868
|
const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
|
|
16536
16869
|
const isRequestSupported = isFunction(Request);
|
|
16537
16870
|
const isResponseSupported = isFunction(Response);
|
|
@@ -16542,46 +16875,67 @@ ${JSON.stringify({
|
|
|
16542
16875
|
|
|
16543
16876
|
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
|
|
16544
16877
|
|
|
16545
|
-
const encodeText =
|
|
16546
|
-
|
|
16547
|
-
|
|
16548
|
-
|
|
16878
|
+
const encodeText =
|
|
16879
|
+
isFetchSupported &&
|
|
16880
|
+
(typeof TextEncoder === 'function'
|
|
16881
|
+
? (
|
|
16882
|
+
(encoder) => (str) =>
|
|
16883
|
+
encoder.encode(str)
|
|
16884
|
+
)(new TextEncoder())
|
|
16885
|
+
: async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
|
|
16886
|
+
|
|
16887
|
+
const supportsRequestStream =
|
|
16888
|
+
isRequestSupported &&
|
|
16889
|
+
isReadableStreamSupported &&
|
|
16890
|
+
test(() => {
|
|
16891
|
+
let duplexAccessed = false;
|
|
16892
|
+
|
|
16893
|
+
const request = new Request(platform.origin, {
|
|
16894
|
+
body: new ReadableStream$1(),
|
|
16895
|
+
method: 'POST',
|
|
16896
|
+
get duplex() {
|
|
16897
|
+
duplexAccessed = true;
|
|
16898
|
+
return 'half';
|
|
16899
|
+
},
|
|
16900
|
+
});
|
|
16549
16901
|
|
|
16550
|
-
|
|
16551
|
-
let duplexAccessed = false;
|
|
16902
|
+
const hasContentType = request.headers.has('Content-Type');
|
|
16552
16903
|
|
|
16553
|
-
|
|
16554
|
-
|
|
16555
|
-
|
|
16556
|
-
get duplex() {
|
|
16557
|
-
duplexAccessed = true;
|
|
16558
|
-
return 'half';
|
|
16559
|
-
},
|
|
16560
|
-
}).headers.has('Content-Type');
|
|
16904
|
+
if (request.body != null) {
|
|
16905
|
+
request.body.cancel();
|
|
16906
|
+
}
|
|
16561
16907
|
|
|
16562
|
-
|
|
16563
|
-
|
|
16908
|
+
return duplexAccessed && !hasContentType;
|
|
16909
|
+
});
|
|
16564
16910
|
|
|
16565
|
-
const supportsResponseStream =
|
|
16911
|
+
const supportsResponseStream =
|
|
16912
|
+
isResponseSupported &&
|
|
16913
|
+
isReadableStreamSupported &&
|
|
16566
16914
|
test(() => utils$1.isReadableStream(new Response('').body));
|
|
16567
16915
|
|
|
16568
16916
|
const resolvers = {
|
|
16569
|
-
stream: supportsResponseStream && ((res) => res.body)
|
|
16917
|
+
stream: supportsResponseStream && ((res) => res.body),
|
|
16570
16918
|
};
|
|
16571
16919
|
|
|
16572
|
-
isFetchSupported &&
|
|
16573
|
-
|
|
16574
|
-
|
|
16575
|
-
|
|
16920
|
+
isFetchSupported &&
|
|
16921
|
+
(() => {
|
|
16922
|
+
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach((type) => {
|
|
16923
|
+
!resolvers[type] &&
|
|
16924
|
+
(resolvers[type] = (res, config) => {
|
|
16925
|
+
let method = res && res[type];
|
|
16576
16926
|
|
|
16577
|
-
|
|
16578
|
-
|
|
16579
|
-
|
|
16927
|
+
if (method) {
|
|
16928
|
+
return method.call(res);
|
|
16929
|
+
}
|
|
16580
16930
|
|
|
16581
|
-
|
|
16931
|
+
throw new AxiosError$1(
|
|
16932
|
+
`Response type '${type}' is not supported`,
|
|
16933
|
+
AxiosError$1.ERR_NOT_SUPPORT,
|
|
16934
|
+
config
|
|
16935
|
+
);
|
|
16936
|
+
});
|
|
16582
16937
|
});
|
|
16583
|
-
});
|
|
16584
|
-
})());
|
|
16938
|
+
})();
|
|
16585
16939
|
|
|
16586
16940
|
const getBodyLength = async (body) => {
|
|
16587
16941
|
if (body == null) {
|
|
@@ -16632,32 +16986,41 @@ ${JSON.stringify({
|
|
|
16632
16986
|
responseType,
|
|
16633
16987
|
headers,
|
|
16634
16988
|
withCredentials = 'same-origin',
|
|
16635
|
-
fetchOptions
|
|
16989
|
+
fetchOptions,
|
|
16636
16990
|
} = resolveConfig(config);
|
|
16637
16991
|
|
|
16638
16992
|
let _fetch = envFetch || fetch;
|
|
16639
16993
|
|
|
16640
16994
|
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
|
16641
16995
|
|
|
16642
|
-
let composedSignal = composeSignals(
|
|
16996
|
+
let composedSignal = composeSignals(
|
|
16997
|
+
[signal, cancelToken && cancelToken.toAbortSignal()],
|
|
16998
|
+
timeout
|
|
16999
|
+
);
|
|
16643
17000
|
|
|
16644
17001
|
let request = null;
|
|
16645
17002
|
|
|
16646
|
-
const unsubscribe =
|
|
16647
|
-
composedSignal
|
|
16648
|
-
|
|
17003
|
+
const unsubscribe =
|
|
17004
|
+
composedSignal &&
|
|
17005
|
+
composedSignal.unsubscribe &&
|
|
17006
|
+
(() => {
|
|
17007
|
+
composedSignal.unsubscribe();
|
|
17008
|
+
});
|
|
16649
17009
|
|
|
16650
17010
|
let requestContentLength;
|
|
16651
17011
|
|
|
16652
17012
|
try {
|
|
16653
17013
|
if (
|
|
16654
|
-
onUploadProgress &&
|
|
17014
|
+
onUploadProgress &&
|
|
17015
|
+
supportsRequestStream &&
|
|
17016
|
+
method !== 'get' &&
|
|
17017
|
+
method !== 'head' &&
|
|
16655
17018
|
(requestContentLength = await resolveBodyLength(headers, data)) !== 0
|
|
16656
17019
|
) {
|
|
16657
17020
|
let _request = new Request(url, {
|
|
16658
17021
|
method: 'POST',
|
|
16659
17022
|
body: data,
|
|
16660
|
-
duplex:
|
|
17023
|
+
duplex: 'half',
|
|
16661
17024
|
});
|
|
16662
17025
|
|
|
16663
17026
|
let contentTypeHeader;
|
|
@@ -16682,7 +17045,20 @@ ${JSON.stringify({
|
|
|
16682
17045
|
|
|
16683
17046
|
// Cloudflare Workers throws when credentials are defined
|
|
16684
17047
|
// see https://github.com/cloudflare/workerd/issues/902
|
|
16685
|
-
const isCredentialsSupported = isRequestSupported &&
|
|
17048
|
+
const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype;
|
|
17049
|
+
|
|
17050
|
+
// If data is FormData and Content-Type is multipart/form-data without boundary,
|
|
17051
|
+
// delete it so fetch can set it correctly with the boundary
|
|
17052
|
+
if (utils$1.isFormData(data)) {
|
|
17053
|
+
const contentType = headers.getContentType();
|
|
17054
|
+
if (
|
|
17055
|
+
contentType &&
|
|
17056
|
+
/^multipart\/form-data/i.test(contentType) &&
|
|
17057
|
+
!/boundary=/i.test(contentType)
|
|
17058
|
+
) {
|
|
17059
|
+
headers.delete('content-type');
|
|
17060
|
+
}
|
|
17061
|
+
}
|
|
16686
17062
|
|
|
16687
17063
|
const resolvedOptions = {
|
|
16688
17064
|
...fetchOptions,
|
|
@@ -16690,29 +17066,35 @@ ${JSON.stringify({
|
|
|
16690
17066
|
method: method.toUpperCase(),
|
|
16691
17067
|
headers: headers.normalize().toJSON(),
|
|
16692
17068
|
body: data,
|
|
16693
|
-
duplex:
|
|
16694
|
-
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
17069
|
+
duplex: 'half',
|
|
17070
|
+
credentials: isCredentialsSupported ? withCredentials : undefined,
|
|
16695
17071
|
};
|
|
16696
17072
|
|
|
16697
17073
|
request = isRequestSupported && new Request(url, resolvedOptions);
|
|
16698
17074
|
|
|
16699
|
-
let response = await (isRequestSupported
|
|
17075
|
+
let response = await (isRequestSupported
|
|
17076
|
+
? _fetch(request, fetchOptions)
|
|
17077
|
+
: _fetch(url, resolvedOptions));
|
|
16700
17078
|
|
|
16701
|
-
const isStreamResponse =
|
|
17079
|
+
const isStreamResponse =
|
|
17080
|
+
supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
|
16702
17081
|
|
|
16703
17082
|
if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
|
|
16704
17083
|
const options = {};
|
|
16705
17084
|
|
|
16706
|
-
['status', 'statusText', 'headers'].forEach(prop => {
|
|
17085
|
+
['status', 'statusText', 'headers'].forEach((prop) => {
|
|
16707
17086
|
options[prop] = response[prop];
|
|
16708
17087
|
});
|
|
16709
17088
|
|
|
16710
17089
|
const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
|
|
16711
17090
|
|
|
16712
|
-
const [onProgress, flush] =
|
|
16713
|
-
|
|
16714
|
-
|
|
16715
|
-
|
|
17091
|
+
const [onProgress, flush] =
|
|
17092
|
+
(onDownloadProgress &&
|
|
17093
|
+
progressEventDecorator(
|
|
17094
|
+
responseContentLength,
|
|
17095
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
17096
|
+
)) ||
|
|
17097
|
+
[];
|
|
16716
17098
|
|
|
16717
17099
|
response = new Response(
|
|
16718
17100
|
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
@@ -16725,7 +17107,10 @@ ${JSON.stringify({
|
|
|
16725
17107
|
|
|
16726
17108
|
responseType = responseType || 'text';
|
|
16727
17109
|
|
|
16728
|
-
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](
|
|
17110
|
+
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](
|
|
17111
|
+
response,
|
|
17112
|
+
config
|
|
17113
|
+
);
|
|
16729
17114
|
|
|
16730
17115
|
!isStreamResponse && unsubscribe && unsubscribe();
|
|
16731
17116
|
|
|
@@ -16736,43 +17121,50 @@ ${JSON.stringify({
|
|
|
16736
17121
|
status: response.status,
|
|
16737
17122
|
statusText: response.statusText,
|
|
16738
17123
|
config,
|
|
16739
|
-
request
|
|
17124
|
+
request,
|
|
16740
17125
|
});
|
|
16741
|
-
})
|
|
17126
|
+
});
|
|
16742
17127
|
} catch (err) {
|
|
16743
17128
|
unsubscribe && unsubscribe();
|
|
16744
17129
|
|
|
16745
17130
|
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
|
16746
17131
|
throw Object.assign(
|
|
16747
|
-
new AxiosError$1(
|
|
17132
|
+
new AxiosError$1(
|
|
17133
|
+
'Network Error',
|
|
17134
|
+
AxiosError$1.ERR_NETWORK,
|
|
17135
|
+
config,
|
|
17136
|
+
request,
|
|
17137
|
+
err && err.response
|
|
17138
|
+
),
|
|
16748
17139
|
{
|
|
16749
|
-
cause: err.cause || err
|
|
17140
|
+
cause: err.cause || err,
|
|
16750
17141
|
}
|
|
16751
|
-
)
|
|
17142
|
+
);
|
|
16752
17143
|
}
|
|
16753
17144
|
|
|
16754
17145
|
throw AxiosError$1.from(err, err && err.code, config, request, err && err.response);
|
|
16755
17146
|
}
|
|
16756
|
-
}
|
|
17147
|
+
};
|
|
16757
17148
|
};
|
|
16758
17149
|
|
|
16759
17150
|
const seedCache = new Map();
|
|
16760
17151
|
|
|
16761
17152
|
const getFetch = (config) => {
|
|
16762
17153
|
let env = (config && config.env) || {};
|
|
16763
|
-
const {fetch, Request, Response} = env;
|
|
16764
|
-
const seeds = [
|
|
16765
|
-
Request, Response, fetch
|
|
16766
|
-
];
|
|
17154
|
+
const { fetch, Request, Response } = env;
|
|
17155
|
+
const seeds = [Request, Response, fetch];
|
|
16767
17156
|
|
|
16768
|
-
let len = seeds.length,
|
|
16769
|
-
|
|
17157
|
+
let len = seeds.length,
|
|
17158
|
+
i = len,
|
|
17159
|
+
seed,
|
|
17160
|
+
target,
|
|
17161
|
+
map = seedCache;
|
|
16770
17162
|
|
|
16771
17163
|
while (i--) {
|
|
16772
17164
|
seed = seeds[i];
|
|
16773
17165
|
target = map.get(seed);
|
|
16774
17166
|
|
|
16775
|
-
target === undefined && map.set(seed, target =
|
|
17167
|
+
target === undefined && map.set(seed, (target = i ? new Map() : factory(env)));
|
|
16776
17168
|
|
|
16777
17169
|
map = target;
|
|
16778
17170
|
}
|
|
@@ -16788,7 +17180,7 @@ ${JSON.stringify({
|
|
|
16788
17180
|
* - `http` for Node.js
|
|
16789
17181
|
* - `xhr` for browsers
|
|
16790
17182
|
* - `fetch` for fetch API-based requests
|
|
16791
|
-
*
|
|
17183
|
+
*
|
|
16792
17184
|
* @type {Object<string, Function|Object>}
|
|
16793
17185
|
*/
|
|
16794
17186
|
const knownAdapters = {
|
|
@@ -16796,7 +17188,7 @@ ${JSON.stringify({
|
|
|
16796
17188
|
xhr: xhrAdapter,
|
|
16797
17189
|
fetch: {
|
|
16798
17190
|
get: getFetch,
|
|
16799
|
-
}
|
|
17191
|
+
},
|
|
16800
17192
|
};
|
|
16801
17193
|
|
|
16802
17194
|
// Assign adapter names for easier debugging and identification
|
|
@@ -16813,7 +17205,7 @@ ${JSON.stringify({
|
|
|
16813
17205
|
|
|
16814
17206
|
/**
|
|
16815
17207
|
* Render a rejection reason string for unknown or unsupported adapters
|
|
16816
|
-
*
|
|
17208
|
+
*
|
|
16817
17209
|
* @param {string} reason
|
|
16818
17210
|
* @returns {string}
|
|
16819
17211
|
*/
|
|
@@ -16821,17 +17213,18 @@ ${JSON.stringify({
|
|
|
16821
17213
|
|
|
16822
17214
|
/**
|
|
16823
17215
|
* Check if the adapter is resolved (function, null, or false)
|
|
16824
|
-
*
|
|
17216
|
+
*
|
|
16825
17217
|
* @param {Function|null|false} adapter
|
|
16826
17218
|
* @returns {boolean}
|
|
16827
17219
|
*/
|
|
16828
|
-
const isResolvedHandle = (adapter) =>
|
|
17220
|
+
const isResolvedHandle = (adapter) =>
|
|
17221
|
+
utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
|
16829
17222
|
|
|
16830
17223
|
/**
|
|
16831
17224
|
* Get the first suitable adapter from the provided list.
|
|
16832
17225
|
* Tries each adapter in order until a supported one is found.
|
|
16833
17226
|
* Throws an AxiosError if no adapter is suitable.
|
|
16834
|
-
*
|
|
17227
|
+
*
|
|
16835
17228
|
* @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function.
|
|
16836
17229
|
* @param {Object} config - Axios request configuration
|
|
16837
17230
|
* @throws {AxiosError} If no suitable adapter is available
|
|
@@ -16868,14 +17261,17 @@ ${JSON.stringify({
|
|
|
16868
17261
|
}
|
|
16869
17262
|
|
|
16870
17263
|
if (!adapter) {
|
|
16871
|
-
const reasons = Object.entries(rejectedReasons)
|
|
16872
|
-
|
|
17264
|
+
const reasons = Object.entries(rejectedReasons).map(
|
|
17265
|
+
([id, state]) =>
|
|
17266
|
+
`adapter ${id} ` +
|
|
16873
17267
|
(state === false ? 'is not supported by the environment' : 'is not available in the build')
|
|
16874
|
-
|
|
17268
|
+
);
|
|
16875
17269
|
|
|
16876
|
-
let s = length
|
|
16877
|
-
|
|
16878
|
-
|
|
17270
|
+
let s = length
|
|
17271
|
+
? reasons.length > 1
|
|
17272
|
+
? 'since :\n' + reasons.map(renderReason).join('\n')
|
|
17273
|
+
: ' ' + renderReason(reasons[0])
|
|
17274
|
+
: 'as no adapter specified';
|
|
16879
17275
|
|
|
16880
17276
|
throw new AxiosError$1(
|
|
16881
17277
|
`There is no suitable adapter to dispatch the request ` + s,
|
|
@@ -16900,7 +17296,7 @@ ${JSON.stringify({
|
|
|
16900
17296
|
* Exposes all known adapters
|
|
16901
17297
|
* @type {Object<string, Function|Object>}
|
|
16902
17298
|
*/
|
|
16903
|
-
adapters: knownAdapters
|
|
17299
|
+
adapters: knownAdapters,
|
|
16904
17300
|
};
|
|
16905
17301
|
|
|
16906
17302
|
/**
|
|
@@ -16933,10 +17329,7 @@ ${JSON.stringify({
|
|
|
16933
17329
|
config.headers = AxiosHeaders$1.from(config.headers);
|
|
16934
17330
|
|
|
16935
17331
|
// Transform request data
|
|
16936
|
-
config.data = transformData.call(
|
|
16937
|
-
config,
|
|
16938
|
-
config.transformRequest
|
|
16939
|
-
);
|
|
17332
|
+
config.data = transformData.call(config, config.transformRequest);
|
|
16940
17333
|
|
|
16941
17334
|
if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
|
|
16942
17335
|
config.headers.setContentType('application/x-www-form-urlencoded', false);
|
|
@@ -16944,39 +17337,38 @@ ${JSON.stringify({
|
|
|
16944
17337
|
|
|
16945
17338
|
const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter, config);
|
|
16946
17339
|
|
|
16947
|
-
return adapter(config).then(
|
|
16948
|
-
|
|
16949
|
-
|
|
16950
|
-
// Transform response data
|
|
16951
|
-
response.data = transformData.call(
|
|
16952
|
-
config,
|
|
16953
|
-
config.transformResponse,
|
|
16954
|
-
response
|
|
16955
|
-
);
|
|
16956
|
-
|
|
16957
|
-
response.headers = AxiosHeaders$1.from(response.headers);
|
|
16958
|
-
|
|
16959
|
-
return response;
|
|
16960
|
-
}, function onAdapterRejection(reason) {
|
|
16961
|
-
if (!isCancel$1(reason)) {
|
|
17340
|
+
return adapter(config).then(
|
|
17341
|
+
function onAdapterResolution(response) {
|
|
16962
17342
|
throwIfCancellationRequested(config);
|
|
16963
17343
|
|
|
16964
17344
|
// Transform response data
|
|
16965
|
-
|
|
16966
|
-
|
|
16967
|
-
|
|
16968
|
-
|
|
16969
|
-
|
|
16970
|
-
|
|
16971
|
-
|
|
17345
|
+
response.data = transformData.call(config, config.transformResponse, response);
|
|
17346
|
+
|
|
17347
|
+
response.headers = AxiosHeaders$1.from(response.headers);
|
|
17348
|
+
|
|
17349
|
+
return response;
|
|
17350
|
+
},
|
|
17351
|
+
function onAdapterRejection(reason) {
|
|
17352
|
+
if (!isCancel$1(reason)) {
|
|
17353
|
+
throwIfCancellationRequested(config);
|
|
17354
|
+
|
|
17355
|
+
// Transform response data
|
|
17356
|
+
if (reason && reason.response) {
|
|
17357
|
+
reason.response.data = transformData.call(
|
|
17358
|
+
config,
|
|
17359
|
+
config.transformResponse,
|
|
17360
|
+
reason.response
|
|
17361
|
+
);
|
|
17362
|
+
reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
|
|
17363
|
+
}
|
|
16972
17364
|
}
|
|
16973
|
-
}
|
|
16974
17365
|
|
|
16975
|
-
|
|
16976
|
-
|
|
17366
|
+
return Promise.reject(reason);
|
|
17367
|
+
}
|
|
17368
|
+
);
|
|
16977
17369
|
}
|
|
16978
17370
|
|
|
16979
|
-
const VERSION$1 = "1.
|
|
17371
|
+
const VERSION$1 = "1.15.2";
|
|
16980
17372
|
|
|
16981
17373
|
const validators$1 = {};
|
|
16982
17374
|
|
|
@@ -17000,7 +17392,15 @@ ${JSON.stringify({
|
|
|
17000
17392
|
*/
|
|
17001
17393
|
validators$1.transitional = function transitional(validator, version, message) {
|
|
17002
17394
|
function formatMessage(opt, desc) {
|
|
17003
|
-
return
|
|
17395
|
+
return (
|
|
17396
|
+
'[Axios v' +
|
|
17397
|
+
VERSION$1 +
|
|
17398
|
+
"] Transitional option '" +
|
|
17399
|
+
opt +
|
|
17400
|
+
"'" +
|
|
17401
|
+
desc +
|
|
17402
|
+
(message ? '. ' + message : '')
|
|
17403
|
+
);
|
|
17004
17404
|
}
|
|
17005
17405
|
|
|
17006
17406
|
// eslint-disable-next-line func-names
|
|
@@ -17032,7 +17432,7 @@ ${JSON.stringify({
|
|
|
17032
17432
|
// eslint-disable-next-line no-console
|
|
17033
17433
|
console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
|
|
17034
17434
|
return true;
|
|
17035
|
-
}
|
|
17435
|
+
};
|
|
17036
17436
|
};
|
|
17037
17437
|
|
|
17038
17438
|
/**
|
|
@@ -17053,12 +17453,17 @@ ${JSON.stringify({
|
|
|
17053
17453
|
let i = keys.length;
|
|
17054
17454
|
while (i-- > 0) {
|
|
17055
17455
|
const opt = keys[i];
|
|
17056
|
-
|
|
17456
|
+
// Use hasOwnProperty so a polluted Object.prototype.<opt> cannot supply
|
|
17457
|
+
// a non-function validator and cause a TypeError. See GHSA-q8qp-cvcw-x6jj.
|
|
17458
|
+
const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;
|
|
17057
17459
|
if (validator) {
|
|
17058
17460
|
const value = options[opt];
|
|
17059
17461
|
const result = value === undefined || validator(value, opt, options);
|
|
17060
17462
|
if (result !== true) {
|
|
17061
|
-
throw new AxiosError$1(
|
|
17463
|
+
throw new AxiosError$1(
|
|
17464
|
+
'option ' + opt + ' must be ' + result,
|
|
17465
|
+
AxiosError$1.ERR_BAD_OPTION_VALUE
|
|
17466
|
+
);
|
|
17062
17467
|
}
|
|
17063
17468
|
continue;
|
|
17064
17469
|
}
|
|
@@ -17070,7 +17475,7 @@ ${JSON.stringify({
|
|
|
17070
17475
|
|
|
17071
17476
|
const validator = {
|
|
17072
17477
|
assertOptions,
|
|
17073
|
-
validators: validators$1
|
|
17478
|
+
validators: validators$1,
|
|
17074
17479
|
};
|
|
17075
17480
|
|
|
17076
17481
|
const validators = validator.validators;
|
|
@@ -17087,7 +17492,7 @@ ${JSON.stringify({
|
|
|
17087
17492
|
this.defaults = instanceConfig || {};
|
|
17088
17493
|
this.interceptors = {
|
|
17089
17494
|
request: new InterceptorManager(),
|
|
17090
|
-
response: new InterceptorManager()
|
|
17495
|
+
response: new InterceptorManager(),
|
|
17091
17496
|
};
|
|
17092
17497
|
}
|
|
17093
17498
|
|
|
@@ -17109,13 +17514,29 @@ ${JSON.stringify({
|
|
|
17109
17514
|
Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
|
|
17110
17515
|
|
|
17111
17516
|
// slice off the Error: ... line
|
|
17112
|
-
const stack =
|
|
17517
|
+
const stack = (() => {
|
|
17518
|
+
if (!dummy.stack) {
|
|
17519
|
+
return '';
|
|
17520
|
+
}
|
|
17521
|
+
|
|
17522
|
+
const firstNewlineIndex = dummy.stack.indexOf('\n');
|
|
17523
|
+
|
|
17524
|
+
return firstNewlineIndex === -1 ? '' : dummy.stack.slice(firstNewlineIndex + 1);
|
|
17525
|
+
})();
|
|
17113
17526
|
try {
|
|
17114
17527
|
if (!err.stack) {
|
|
17115
17528
|
err.stack = stack;
|
|
17116
17529
|
// match without the 2 top stack lines
|
|
17117
|
-
} else if (stack
|
|
17118
|
-
|
|
17530
|
+
} else if (stack) {
|
|
17531
|
+
const firstNewlineIndex = stack.indexOf('\n');
|
|
17532
|
+
const secondNewlineIndex =
|
|
17533
|
+
firstNewlineIndex === -1 ? -1 : stack.indexOf('\n', firstNewlineIndex + 1);
|
|
17534
|
+
const stackWithoutTwoTopLines =
|
|
17535
|
+
secondNewlineIndex === -1 ? '' : stack.slice(secondNewlineIndex + 1);
|
|
17536
|
+
|
|
17537
|
+
if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) {
|
|
17538
|
+
err.stack += '\n' + stack;
|
|
17539
|
+
}
|
|
17119
17540
|
}
|
|
17120
17541
|
} catch (e) {
|
|
17121
17542
|
// ignore the case where "stack" is an un-writable property
|
|
@@ -17138,27 +17559,35 @@ ${JSON.stringify({
|
|
|
17138
17559
|
|
|
17139
17560
|
config = mergeConfig$1(this.defaults, config);
|
|
17140
17561
|
|
|
17141
|
-
const {transitional, paramsSerializer, headers} = config;
|
|
17562
|
+
const { transitional, paramsSerializer, headers } = config;
|
|
17142
17563
|
|
|
17143
17564
|
if (transitional !== undefined) {
|
|
17144
|
-
validator.assertOptions(
|
|
17145
|
-
|
|
17146
|
-
|
|
17147
|
-
|
|
17148
|
-
|
|
17149
|
-
|
|
17565
|
+
validator.assertOptions(
|
|
17566
|
+
transitional,
|
|
17567
|
+
{
|
|
17568
|
+
silentJSONParsing: validators.transitional(validators.boolean),
|
|
17569
|
+
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
17570
|
+
clarifyTimeoutError: validators.transitional(validators.boolean),
|
|
17571
|
+
legacyInterceptorReqResOrdering: validators.transitional(validators.boolean),
|
|
17572
|
+
},
|
|
17573
|
+
false
|
|
17574
|
+
);
|
|
17150
17575
|
}
|
|
17151
17576
|
|
|
17152
17577
|
if (paramsSerializer != null) {
|
|
17153
17578
|
if (utils$1.isFunction(paramsSerializer)) {
|
|
17154
17579
|
config.paramsSerializer = {
|
|
17155
|
-
serialize: paramsSerializer
|
|
17580
|
+
serialize: paramsSerializer,
|
|
17156
17581
|
};
|
|
17157
17582
|
} else {
|
|
17158
|
-
validator.assertOptions(
|
|
17159
|
-
|
|
17160
|
-
|
|
17161
|
-
|
|
17583
|
+
validator.assertOptions(
|
|
17584
|
+
paramsSerializer,
|
|
17585
|
+
{
|
|
17586
|
+
encode: validators.function,
|
|
17587
|
+
serialize: validators.function,
|
|
17588
|
+
},
|
|
17589
|
+
true
|
|
17590
|
+
);
|
|
17162
17591
|
}
|
|
17163
17592
|
}
|
|
17164
17593
|
|
|
@@ -17169,26 +17598,25 @@ ${JSON.stringify({
|
|
|
17169
17598
|
config.allowAbsoluteUrls = true;
|
|
17170
17599
|
}
|
|
17171
17600
|
|
|
17172
|
-
validator.assertOptions(
|
|
17173
|
-
|
|
17174
|
-
|
|
17175
|
-
|
|
17601
|
+
validator.assertOptions(
|
|
17602
|
+
config,
|
|
17603
|
+
{
|
|
17604
|
+
baseUrl: validators.spelling('baseURL'),
|
|
17605
|
+
withXsrfToken: validators.spelling('withXSRFToken'),
|
|
17606
|
+
},
|
|
17607
|
+
true
|
|
17608
|
+
);
|
|
17176
17609
|
|
|
17177
17610
|
// Set config.method
|
|
17178
17611
|
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
|
17179
17612
|
|
|
17180
17613
|
// Flatten headers
|
|
17181
|
-
let contextHeaders = headers && utils$1.merge(
|
|
17182
|
-
headers.common,
|
|
17183
|
-
headers[config.method]
|
|
17184
|
-
);
|
|
17614
|
+
let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
|
|
17185
17615
|
|
|
17186
|
-
headers &&
|
|
17187
|
-
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
|
17188
|
-
(method) => {
|
|
17616
|
+
headers &&
|
|
17617
|
+
utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], (method) => {
|
|
17189
17618
|
delete headers[method];
|
|
17190
|
-
}
|
|
17191
|
-
);
|
|
17619
|
+
});
|
|
17192
17620
|
|
|
17193
17621
|
config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
|
|
17194
17622
|
|
|
@@ -17203,7 +17631,8 @@ ${JSON.stringify({
|
|
|
17203
17631
|
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
17204
17632
|
|
|
17205
17633
|
const transitional = config.transitional || transitionalDefaults;
|
|
17206
|
-
const legacyInterceptorReqResOrdering =
|
|
17634
|
+
const legacyInterceptorReqResOrdering =
|
|
17635
|
+
transitional && transitional.legacyInterceptorReqResOrdering;
|
|
17207
17636
|
|
|
17208
17637
|
if (legacyInterceptorReqResOrdering) {
|
|
17209
17638
|
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
@@ -17277,28 +17706,32 @@ ${JSON.stringify({
|
|
|
17277
17706
|
// Provide aliases for supported request methods
|
|
17278
17707
|
utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
|
17279
17708
|
/*eslint func-names:0*/
|
|
17280
|
-
Axios$1.prototype[method] = function(url, config) {
|
|
17281
|
-
return this.request(
|
|
17282
|
-
|
|
17283
|
-
|
|
17284
|
-
|
|
17285
|
-
|
|
17709
|
+
Axios$1.prototype[method] = function (url, config) {
|
|
17710
|
+
return this.request(
|
|
17711
|
+
mergeConfig$1(config || {}, {
|
|
17712
|
+
method,
|
|
17713
|
+
url,
|
|
17714
|
+
data: (config || {}).data,
|
|
17715
|
+
})
|
|
17716
|
+
);
|
|
17286
17717
|
};
|
|
17287
17718
|
});
|
|
17288
17719
|
|
|
17289
17720
|
utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
17290
|
-
/*eslint func-names:0*/
|
|
17291
|
-
|
|
17292
17721
|
function generateHTTPMethod(isForm) {
|
|
17293
17722
|
return function httpMethod(url, data, config) {
|
|
17294
|
-
return this.request(
|
|
17295
|
-
|
|
17296
|
-
|
|
17297
|
-
|
|
17298
|
-
|
|
17299
|
-
|
|
17300
|
-
|
|
17301
|
-
|
|
17723
|
+
return this.request(
|
|
17724
|
+
mergeConfig$1(config || {}, {
|
|
17725
|
+
method,
|
|
17726
|
+
headers: isForm
|
|
17727
|
+
? {
|
|
17728
|
+
'Content-Type': 'multipart/form-data',
|
|
17729
|
+
}
|
|
17730
|
+
: {},
|
|
17731
|
+
url,
|
|
17732
|
+
data,
|
|
17733
|
+
})
|
|
17734
|
+
);
|
|
17302
17735
|
};
|
|
17303
17736
|
}
|
|
17304
17737
|
|
|
@@ -17329,7 +17762,7 @@ ${JSON.stringify({
|
|
|
17329
17762
|
const token = this;
|
|
17330
17763
|
|
|
17331
17764
|
// eslint-disable-next-line func-names
|
|
17332
|
-
this.promise.then(cancel => {
|
|
17765
|
+
this.promise.then((cancel) => {
|
|
17333
17766
|
if (!token._listeners) return;
|
|
17334
17767
|
|
|
17335
17768
|
let i = token._listeners.length;
|
|
@@ -17341,10 +17774,10 @@ ${JSON.stringify({
|
|
|
17341
17774
|
});
|
|
17342
17775
|
|
|
17343
17776
|
// eslint-disable-next-line func-names
|
|
17344
|
-
this.promise.then = onfulfilled => {
|
|
17777
|
+
this.promise.then = (onfulfilled) => {
|
|
17345
17778
|
let _resolve;
|
|
17346
17779
|
// eslint-disable-next-line func-names
|
|
17347
|
-
const promise = new Promise(resolve => {
|
|
17780
|
+
const promise = new Promise((resolve) => {
|
|
17348
17781
|
token.subscribe(resolve);
|
|
17349
17782
|
_resolve = resolve;
|
|
17350
17783
|
}).then(onfulfilled);
|
|
@@ -17432,7 +17865,7 @@ ${JSON.stringify({
|
|
|
17432
17865
|
});
|
|
17433
17866
|
return {
|
|
17434
17867
|
token,
|
|
17435
|
-
cancel
|
|
17868
|
+
cancel,
|
|
17436
17869
|
};
|
|
17437
17870
|
}
|
|
17438
17871
|
};
|
|
@@ -17472,7 +17905,7 @@ ${JSON.stringify({
|
|
|
17472
17905
|
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
|
17473
17906
|
*/
|
|
17474
17907
|
function isAxiosError$1(payload) {
|
|
17475
|
-
return utils$1.isObject(payload) &&
|
|
17908
|
+
return utils$1.isObject(payload) && payload.isAxiosError === true;
|
|
17476
17909
|
}
|
|
17477
17910
|
|
|
17478
17911
|
const HttpStatusCode$1 = {
|
|
@@ -17563,10 +17996,10 @@ ${JSON.stringify({
|
|
|
17563
17996
|
const instance = bind(Axios$1.prototype.request, context);
|
|
17564
17997
|
|
|
17565
17998
|
// Copy axios.prototype to instance
|
|
17566
|
-
utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
|
|
17999
|
+
utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
|
|
17567
18000
|
|
|
17568
18001
|
// Copy context to instance
|
|
17569
|
-
utils$1.extend(instance, context, null, {allOwnKeys: true});
|
|
18002
|
+
utils$1.extend(instance, context, null, { allOwnKeys: true });
|
|
17570
18003
|
|
|
17571
18004
|
// Factory for creating new instances
|
|
17572
18005
|
instance.create = function create(instanceConfig) {
|
|
@@ -17610,7 +18043,7 @@ ${JSON.stringify({
|
|
|
17610
18043
|
|
|
17611
18044
|
axios.AxiosHeaders = AxiosHeaders$1;
|
|
17612
18045
|
|
|
17613
|
-
axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
18046
|
+
axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
17614
18047
|
|
|
17615
18048
|
axios.getAdapter = adapters.getAdapter;
|
|
17616
18049
|
|
|
@@ -17637,7 +18070,7 @@ ${JSON.stringify({
|
|
|
17637
18070
|
HttpStatusCode,
|
|
17638
18071
|
formToJSON,
|
|
17639
18072
|
getAdapter,
|
|
17640
|
-
mergeConfig
|
|
18073
|
+
mergeConfig,
|
|
17641
18074
|
} = axios;
|
|
17642
18075
|
|
|
17643
18076
|
var __defProp$P = Object.defineProperty;
|
|
@@ -17697,7 +18130,7 @@ ${JSON.stringify({
|
|
|
17697
18130
|
this._logger = LoggerFactory.createNullLogger();
|
|
17698
18131
|
const defaultHeaders = {};
|
|
17699
18132
|
if (this.isServerSide()) {
|
|
17700
|
-
defaultHeaders["User-Agent"] = "b24-js-sdk/1.0
|
|
18133
|
+
defaultHeaders["User-Agent"] = "b24-js-sdk/1.1.0";
|
|
17701
18134
|
}
|
|
17702
18135
|
this._authActions = authActions;
|
|
17703
18136
|
this._requestIdGenerator = new RequestIdGenerator();
|
|
@@ -18333,7 +18766,7 @@ ${JSON.stringify({
|
|
|
18333
18766
|
|
|
18334
18767
|
const limit = 1024;
|
|
18335
18768
|
|
|
18336
|
-
const encode = function encode(str,
|
|
18769
|
+
const encode = function encode(str, _defaultEncoder, _kind, format) {
|
|
18337
18770
|
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
|
|
18338
18771
|
// It has been adapted here for stricter adherence to RFC 3986
|
|
18339
18772
|
if (str.length === 0) {
|
|
@@ -18347,12 +18780,6 @@ ${JSON.stringify({
|
|
|
18347
18780
|
string = String(str);
|
|
18348
18781
|
}
|
|
18349
18782
|
|
|
18350
|
-
if (charset === 'iso-8859-1') {
|
|
18351
|
-
return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
|
|
18352
|
-
return '%26%23' + parseInt($0.slice(2), 16) + '%3B'
|
|
18353
|
-
})
|
|
18354
|
-
}
|
|
18355
|
-
|
|
18356
18783
|
let out = '';
|
|
18357
18784
|
for (let j = 0; j < string.length; j += limit) {
|
|
18358
18785
|
const segment = string.length >= limit ? string.slice(j, j + limit) : string;
|
|
@@ -18454,8 +18881,6 @@ ${JSON.stringify({
|
|
|
18454
18881
|
allowDots: false,
|
|
18455
18882
|
allowEmptyArrays: false,
|
|
18456
18883
|
arrayFormat: 'indices',
|
|
18457
|
-
charset: 'utf-8',
|
|
18458
|
-
charsetSentinel: false,
|
|
18459
18884
|
delimiter: '&',
|
|
18460
18885
|
encode: true,
|
|
18461
18886
|
encodeDotInKeys: false,
|
|
@@ -18501,7 +18926,6 @@ ${JSON.stringify({
|
|
|
18501
18926
|
format,
|
|
18502
18927
|
formatter,
|
|
18503
18928
|
encodeValuesOnly,
|
|
18504
|
-
charset,
|
|
18505
18929
|
sideChannel,
|
|
18506
18930
|
) {
|
|
18507
18931
|
let obj = object;
|
|
@@ -18541,7 +18965,7 @@ ${JSON.stringify({
|
|
|
18541
18965
|
if (obj === null) {
|
|
18542
18966
|
if (strictNullHandling) {
|
|
18543
18967
|
return encoder && !encodeValuesOnly
|
|
18544
|
-
? encoder(prefix, defaults.encoder,
|
|
18968
|
+
? encoder(prefix, defaults.encoder, 'key', format)
|
|
18545
18969
|
: prefix
|
|
18546
18970
|
}
|
|
18547
18971
|
|
|
@@ -18552,11 +18976,11 @@ ${JSON.stringify({
|
|
|
18552
18976
|
if (encoder) {
|
|
18553
18977
|
const keyValue = encodeValuesOnly
|
|
18554
18978
|
? prefix
|
|
18555
|
-
: encoder(prefix, defaults.encoder,
|
|
18979
|
+
: encoder(prefix, defaults.encoder, 'key', format);
|
|
18556
18980
|
return [
|
|
18557
18981
|
formatter(keyValue) +
|
|
18558
18982
|
'=' +
|
|
18559
|
-
formatter(encoder(obj, defaults.encoder,
|
|
18983
|
+
formatter(encoder(obj, defaults.encoder, 'value', format)),
|
|
18560
18984
|
]
|
|
18561
18985
|
}
|
|
18562
18986
|
return [formatter(prefix) + '=' + formatter(String(obj))]
|
|
@@ -18628,7 +19052,6 @@ ${JSON.stringify({
|
|
|
18628
19052
|
format,
|
|
18629
19053
|
formatter,
|
|
18630
19054
|
encodeValuesOnly,
|
|
18631
|
-
charset,
|
|
18632
19055
|
valueSideChannel,
|
|
18633
19056
|
),
|
|
18634
19057
|
);
|
|
@@ -18701,24 +19124,13 @@ ${JSON.stringify({
|
|
|
18701
19124
|
options.format,
|
|
18702
19125
|
options.formatter,
|
|
18703
19126
|
options.encodeValuesOnly,
|
|
18704
|
-
options.charset,
|
|
18705
19127
|
sideChannel,
|
|
18706
19128
|
),
|
|
18707
19129
|
);
|
|
18708
19130
|
}
|
|
18709
19131
|
|
|
18710
19132
|
const joined = keys.join(options.delimiter);
|
|
18711
|
-
|
|
18712
|
-
|
|
18713
|
-
if (options.charsetSentinel) {
|
|
18714
|
-
if (options.charset === 'iso-8859-1') {
|
|
18715
|
-
// encodeURIComponent('✓'), the "numeric entity" representation of a checkmark
|
|
18716
|
-
prefix += 'utf8=%26%2310003%3B&';
|
|
18717
|
-
} else {
|
|
18718
|
-
// encodeURIComponent('✓')
|
|
18719
|
-
prefix += 'utf8=%E2%9C%93&';
|
|
18720
|
-
}
|
|
18721
|
-
}
|
|
19133
|
+
const prefix = options.addQueryPrefix === true ? '?' : '';
|
|
18722
19134
|
|
|
18723
19135
|
return joined.length > 0 ? prefix + joined : ''
|
|
18724
19136
|
}
|
|
@@ -18971,7 +19383,7 @@ ${JSON.stringify({
|
|
|
18971
19383
|
}
|
|
18972
19384
|
const queryParams = new URLSearchParams({
|
|
18973
19385
|
[this._requestIdGenerator.getQueryStringParameterName()]: requestId,
|
|
18974
|
-
[this._requestIdGenerator.getQueryStringSdkParameterName()]: "1.0
|
|
19386
|
+
[this._requestIdGenerator.getQueryStringSdkParameterName()]: "1.1.0",
|
|
18975
19387
|
[this._requestIdGenerator.getQueryStringSdkTypeParameterName()]: "b24-js-sdk"
|
|
18976
19388
|
});
|
|
18977
19389
|
return `${baseUrl}${methodUrl}?${queryParams.toString()}`;
|
|
@@ -19218,7 +19630,7 @@ ${JSON.stringify({
|
|
|
19218
19630
|
const methodUrl = `/${encodeURIComponent(method)}`;
|
|
19219
19631
|
const queryParams = new URLSearchParams({
|
|
19220
19632
|
[this._requestIdGenerator.getQueryStringParameterName()]: requestId,
|
|
19221
|
-
[this._requestIdGenerator.getQueryStringSdkParameterName()]: "1.0
|
|
19633
|
+
[this._requestIdGenerator.getQueryStringSdkParameterName()]: "1.1.0",
|
|
19222
19634
|
[this._requestIdGenerator.getQueryStringSdkTypeParameterName()]: "b24-js-sdk"
|
|
19223
19635
|
});
|
|
19224
19636
|
return `${baseUrl}${methodUrl}?${queryParams.toString()}`;
|
|
@@ -20944,19 +21356,59 @@ ${JSON.stringify({
|
|
|
20944
21356
|
});
|
|
20945
21357
|
}
|
|
20946
21358
|
/**
|
|
20947
|
-
*
|
|
21359
|
+
* Invokes the system dialog for selecting CRM entities
|
|
21360
|
+
* (leads, contacts, companies, deals, quotes).
|
|
21361
|
+
*
|
|
21362
|
+
* The resolved `SelectedCRM` object contains a separate bucket per
|
|
21363
|
+
* entity type. Each present bucket is a real `Array`, so consumers can
|
|
21364
|
+
* use `.length`, `.map()`, `for..of`, etc. directly. Buckets for entity
|
|
21365
|
+
* types that were not selected (or not requested via `entityType`) are
|
|
21366
|
+
* left `undefined` rather than being set to an empty array.
|
|
20948
21367
|
*
|
|
20949
|
-
*
|
|
20950
|
-
*
|
|
21368
|
+
* Note: the parent window historically returned each bucket as a
|
|
21369
|
+
* `Record<string, SelectedCRMEntity>` (e.g. `{ 0: {...}, 1: {...} }`).
|
|
21370
|
+
* The SDK normalizes that response to a real array before returning it.
|
|
21371
|
+
*
|
|
21372
|
+
* @param {SelectCRMParams} [params] - Filter and behavior options.
|
|
21373
|
+
* - `entityType`: which entity types are shown in the dialog.
|
|
21374
|
+
* - `multiple`: allow multiple selection (default `false`).
|
|
21375
|
+
* - `value`: pre-selected entities (only applied when `multiple` is `true`).
|
|
21376
|
+
* @return {Promise<SelectedCRM>} Resolves to an object whose properties
|
|
21377
|
+
* (`lead`, `contact`, `company`, `deal`, `quote`) are arrays of
|
|
21378
|
+
* {@link SelectedCRMEntity} objects.
|
|
20951
21379
|
*
|
|
20952
21380
|
* @link https://apidocs.bitrix24.com/sdk/bx24-js-sdk/system-dialogues/bx24-select-crm.html
|
|
20953
21381
|
*/
|
|
20954
21382
|
async selectCRM(params) {
|
|
20955
|
-
|
|
21383
|
+
const response = await this.#messageManager.send(MessageCommands.selectCRM, {
|
|
20956
21384
|
entityType: params?.entityType,
|
|
20957
21385
|
multiple: params?.multiple,
|
|
20958
21386
|
value: params?.value
|
|
20959
21387
|
});
|
|
21388
|
+
const result = {};
|
|
21389
|
+
if (!response) {
|
|
21390
|
+
return result;
|
|
21391
|
+
}
|
|
21392
|
+
const toArray = /* @__PURE__ */ __name$q((bucket) => {
|
|
21393
|
+
if (bucket === void 0 || bucket === null) {
|
|
21394
|
+
return void 0;
|
|
21395
|
+
}
|
|
21396
|
+
if (Array.isArray(bucket)) {
|
|
21397
|
+
return bucket;
|
|
21398
|
+
}
|
|
21399
|
+
return Object.values(bucket);
|
|
21400
|
+
}, "toArray");
|
|
21401
|
+
const lead = toArray(response.lead);
|
|
21402
|
+
if (lead) result.lead = lead;
|
|
21403
|
+
const contact = toArray(response.contact);
|
|
21404
|
+
if (contact) result.contact = contact;
|
|
21405
|
+
const company = toArray(response.company);
|
|
21406
|
+
if (company) result.company = company;
|
|
21407
|
+
const deal = toArray(response.deal);
|
|
21408
|
+
if (deal) result.deal = deal;
|
|
21409
|
+
const quote = toArray(response.quote);
|
|
21410
|
+
if (quote) result.quote = quote;
|
|
21411
|
+
return result;
|
|
20960
21412
|
}
|
|
20961
21413
|
}
|
|
20962
21414
|
|
|
@@ -21177,22 +21629,45 @@ ${JSON.stringify({
|
|
|
21177
21629
|
}
|
|
21178
21630
|
);
|
|
21179
21631
|
}
|
|
21632
|
+
async call(command, parameters = {}) {
|
|
21633
|
+
if (command === "setValue" && !Type.isString(parameters?.["value"])) {
|
|
21634
|
+
throw new TypeError(
|
|
21635
|
+
"placement.call('setValue', { value }) expects `value` to be a JSON-serialized string. Use placement.setValue(value) to serialize automatically, or call JSON.stringify yourself."
|
|
21636
|
+
);
|
|
21637
|
+
}
|
|
21638
|
+
return this.#messageManager.send(
|
|
21639
|
+
command,
|
|
21640
|
+
{
|
|
21641
|
+
...parameters,
|
|
21642
|
+
isSafely: true,
|
|
21643
|
+
isRawValue: ["setValue"].includes(command)
|
|
21644
|
+
}
|
|
21645
|
+
);
|
|
21646
|
+
}
|
|
21180
21647
|
/**
|
|
21181
|
-
*
|
|
21182
|
-
*
|
|
21183
|
-
*
|
|
21648
|
+
* Set Value for the Current Embedding Location
|
|
21649
|
+
*
|
|
21650
|
+
* Convenience wrapper around `placement.call('setValue', ...)` that handles
|
|
21651
|
+
* JSON serialization. Pass any value (string, number, boolean, object, array)
|
|
21652
|
+
* — it will be serialized via `JSON.stringify` before being sent to the
|
|
21653
|
+
* parent window, which performs `JSON.parse` on receipt.
|
|
21654
|
+
*
|
|
21655
|
+
* @param { unknown } value Any JSON-serializable value
|
|
21184
21656
|
* @return { Promise<any> }
|
|
21185
21657
|
*
|
|
21186
21658
|
* @link https://apidocs.bitrix24.com/api-reference/widgets/ui-interaction/bx24-placement-call.html
|
|
21187
|
-
*
|
|
21659
|
+
*
|
|
21660
|
+
* @example
|
|
21661
|
+
* await b24.placement.setValue('test')
|
|
21662
|
+
* await b24.placement.setValue({ id: 1, title: 'demo' })
|
|
21188
21663
|
*/
|
|
21189
|
-
async
|
|
21664
|
+
async setValue(value) {
|
|
21190
21665
|
return this.#messageManager.send(
|
|
21191
|
-
|
|
21666
|
+
"setValue",
|
|
21192
21667
|
{
|
|
21193
|
-
|
|
21668
|
+
value: JSON.stringify(value),
|
|
21194
21669
|
isSafely: true,
|
|
21195
|
-
isRawValue:
|
|
21670
|
+
isRawValue: true
|
|
21196
21671
|
}
|
|
21197
21672
|
);
|
|
21198
21673
|
}
|