@membranehq/sdk 0.7.5 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.d.ts +317 -108
- package/dist/bundle.js +351 -270
- package/dist/bundle.js.map +1 -1
- package/dist/dts/accessors/action-instances-accessors.d.ts +1 -2
- package/dist/dts/accessors/actions-accessors.d.ts +0 -1
- package/dist/dts/accessors/data-sources-accessors.d.ts +0 -1
- package/dist/dts/accessors/field-mappings-accessors.d.ts +0 -1
- package/dist/dts/accessors/flows-accessors.d.ts +0 -1
- package/dist/dts/accessors/scenarios-accessors.d.ts +6 -4
- package/dist/dts/alerts/types.d.ts +3 -1
- package/dist/dts/client.d.ts +3 -3
- package/dist/dts/webhooks/types.d.ts +5 -2
- package/dist/dts/workspace-elements/api/action-run-log-records-api.d.ts +5 -0
- package/dist/dts/workspace-elements/api/actions-api.d.ts +309 -1
- package/dist/dts/workspace-elements/api/index.d.ts +1 -2
- package/dist/dts/workspace-elements/api/{scenarios-api.d.ts → packages-api.d.ts} +11 -7
- package/dist/dts/workspace-elements/base/action-instances/types.d.ts +14 -9
- package/dist/dts/workspace-elements/base/actions/index.d.ts +46 -0
- package/dist/dts/workspace-elements/base/index.d.ts +1 -2
- package/dist/dts/workspace-elements/base/{scenarios → packages}/index.d.ts +8 -8
- package/dist/dts/workspace-elements/types.d.ts +7 -1
- package/dist/dts/workspace-elements-catalog/index.d.ts +2 -0
- package/dist/index.browser.d.mts +894 -648
- package/dist/index.browser.d.ts +894 -648
- package/dist/index.browser.js +146 -131
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +136 -125
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.mts +894 -648
- package/dist/index.node.d.ts +894 -648
- package/dist/index.node.js +146 -131
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +136 -125
- package/dist/index.node.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/dts/workspace-elements/api/action-instances-api.d.ts +0 -94
package/dist/bundle.js
CHANGED
|
@@ -2477,7 +2477,7 @@
|
|
|
2477
2477
|
// Check that value is an object with an inspect function on it
|
|
2478
2478
|
if (ctx.customInspect &&
|
|
2479
2479
|
value &&
|
|
2480
|
-
isFunction$
|
|
2480
|
+
isFunction$2(value.inspect) &&
|
|
2481
2481
|
// Filter out the util module, it's inspect function is special
|
|
2482
2482
|
value.inspect !== inspect &&
|
|
2483
2483
|
// Also filter out any prototype objects using the circular check.
|
|
@@ -2512,7 +2512,7 @@
|
|
|
2512
2512
|
|
|
2513
2513
|
// Some type of object without properties can be shortcutted.
|
|
2514
2514
|
if (keys.length === 0) {
|
|
2515
|
-
if (isFunction$
|
|
2515
|
+
if (isFunction$2(value)) {
|
|
2516
2516
|
var name = value.name ? ': ' + value.name : '';
|
|
2517
2517
|
return ctx.stylize('[Function' + name + ']', 'special');
|
|
2518
2518
|
}
|
|
@@ -2536,7 +2536,7 @@
|
|
|
2536
2536
|
}
|
|
2537
2537
|
|
|
2538
2538
|
// Make functions say that they are functions
|
|
2539
|
-
if (isFunction$
|
|
2539
|
+
if (isFunction$2(value)) {
|
|
2540
2540
|
var n = value.name ? ': ' + value.name : '';
|
|
2541
2541
|
base = ' [Function' + n + ']';
|
|
2542
2542
|
}
|
|
@@ -2758,7 +2758,7 @@
|
|
|
2758
2758
|
(objectToString(e) === '[object Error]' || e instanceof Error);
|
|
2759
2759
|
}
|
|
2760
2760
|
|
|
2761
|
-
function isFunction$
|
|
2761
|
+
function isFunction$2(arg) {
|
|
2762
2762
|
return typeof arg === 'function';
|
|
2763
2763
|
}
|
|
2764
2764
|
|
|
@@ -2929,7 +2929,7 @@
|
|
|
2929
2929
|
log: log,
|
|
2930
2930
|
isBuffer: isBuffer$1,
|
|
2931
2931
|
isPrimitive: isPrimitive,
|
|
2932
|
-
isFunction: isFunction$
|
|
2932
|
+
isFunction: isFunction$2,
|
|
2933
2933
|
isError: isError,
|
|
2934
2934
|
isDate: isDate$1,
|
|
2935
2935
|
isObject: isObject$2,
|
|
@@ -2965,7 +2965,7 @@
|
|
|
2965
2965
|
isBuffer: isBuffer$1,
|
|
2966
2966
|
isDate: isDate$1,
|
|
2967
2967
|
isError: isError,
|
|
2968
|
-
isFunction: isFunction$
|
|
2968
|
+
isFunction: isFunction$2,
|
|
2969
2969
|
isNull: isNull,
|
|
2970
2970
|
isNullOrUndefined: isNullOrUndefined,
|
|
2971
2971
|
isNumber: isNumber$1,
|
|
@@ -6130,11 +6130,6 @@
|
|
|
6130
6130
|
path: 'action',
|
|
6131
6131
|
});
|
|
6132
6132
|
}
|
|
6133
|
-
async apply(integrationKeys) {
|
|
6134
|
-
return await this.options.client.post(this.getPath('apply'), {
|
|
6135
|
-
integrationKeys,
|
|
6136
|
-
});
|
|
6137
|
-
}
|
|
6138
6133
|
async reset() {
|
|
6139
6134
|
return await this.options.client.post(this.getPath('reset'));
|
|
6140
6135
|
}
|
|
@@ -7115,11 +7110,6 @@
|
|
|
7115
7110
|
path: 'data-source',
|
|
7116
7111
|
});
|
|
7117
7112
|
}
|
|
7118
|
-
async apply(integrationKeys) {
|
|
7119
|
-
return await this.options.client.post(this.getPath('apply'), {
|
|
7120
|
-
integrationKeys,
|
|
7121
|
-
});
|
|
7122
|
-
}
|
|
7123
7113
|
async setup() {
|
|
7124
7114
|
await this.options.client.post(this.getPath('setup'));
|
|
7125
7115
|
}
|
|
@@ -10756,20 +10746,6 @@
|
|
|
10756
10746
|
...normalizeParams(params),
|
|
10757
10747
|
});
|
|
10758
10748
|
}
|
|
10759
|
-
/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
|
|
10760
|
-
*
|
|
10761
|
-
* ```ts
|
|
10762
|
-
* enum Colors { red, green, blue }
|
|
10763
|
-
* z.enum(Colors);
|
|
10764
|
-
* ```
|
|
10765
|
-
*/
|
|
10766
|
-
function nativeEnum(entries, params) {
|
|
10767
|
-
return new ZodEnum({
|
|
10768
|
-
type: "enum",
|
|
10769
|
-
entries,
|
|
10770
|
-
...normalizeParams(params),
|
|
10771
|
-
});
|
|
10772
|
-
}
|
|
10773
10749
|
const ZodTransform = /*@__PURE__*/ $constructor("ZodTransform", (inst, def) => {
|
|
10774
10750
|
$ZodTransform.init(inst, def);
|
|
10775
10751
|
ZodType.init(inst, def);
|
|
@@ -10968,7 +10944,7 @@
|
|
|
10968
10944
|
ConcurrencyErrorKey["LOCK_TIMEOUT"] = "lock_timeout";
|
|
10969
10945
|
})(ConcurrencyErrorKey || (ConcurrencyErrorKey = {}));
|
|
10970
10946
|
const ErrorDataSchema = lazy(() => object({
|
|
10971
|
-
type:
|
|
10947
|
+
type: _enum(ErrorType).optional(),
|
|
10972
10948
|
key: string().optional(),
|
|
10973
10949
|
message: string(),
|
|
10974
10950
|
data: any().optional(),
|
|
@@ -11097,11 +11073,11 @@
|
|
|
11097
11073
|
FlowRunLaunchedByTrigger["ExternalEvent"] = "external-event";
|
|
11098
11074
|
})(FlowRunLaunchedByTrigger || (FlowRunLaunchedByTrigger = {}));
|
|
11099
11075
|
const FlowRunLaunchedBy = object({
|
|
11100
|
-
type:
|
|
11076
|
+
type: _enum(FlowRunLaunchedByTrigger),
|
|
11101
11077
|
ids: array(string()).optional(),
|
|
11102
11078
|
});
|
|
11103
11079
|
const FlowRunNode = object({
|
|
11104
|
-
state:
|
|
11080
|
+
state: _enum(FlowRunNodeState),
|
|
11105
11081
|
runs: number().optional(),
|
|
11106
11082
|
erroredRuns: number().optional(),
|
|
11107
11083
|
outputs: number().optional(),
|
|
@@ -11116,7 +11092,7 @@
|
|
|
11116
11092
|
startNodeKey: string(),
|
|
11117
11093
|
userId: string(),
|
|
11118
11094
|
input: any().optional(),
|
|
11119
|
-
state:
|
|
11095
|
+
state: _enum(FlowRunState),
|
|
11120
11096
|
startTime: string(),
|
|
11121
11097
|
endTime: string().optional(),
|
|
11122
11098
|
errors: array(ErrorDataSchema).optional(),
|
|
@@ -11150,7 +11126,7 @@
|
|
|
11150
11126
|
downstreamRuns: array(DownstreamFlowNodeRunSchema),
|
|
11151
11127
|
});
|
|
11152
11128
|
const FlowNodeRunResultSchema = object({
|
|
11153
|
-
status:
|
|
11129
|
+
status: _enum(FlowNodeRunStatus),
|
|
11154
11130
|
logs: array(any()),
|
|
11155
11131
|
outputs: array(FlowNodeRunOutputSchema),
|
|
11156
11132
|
errors: array(ErrorDataSchema),
|
|
@@ -11168,7 +11144,7 @@
|
|
|
11168
11144
|
id: string(),
|
|
11169
11145
|
upstreamRuns: array(UpstreamFlowNodeRunSchema),
|
|
11170
11146
|
input: any(),
|
|
11171
|
-
status:
|
|
11147
|
+
status: _enum(FlowNodeRunStatus),
|
|
11172
11148
|
logs: array(any()),
|
|
11173
11149
|
outputs: array(FlowNodeRunOutputMetadataSchema),
|
|
11174
11150
|
errors: array(ErrorDataSchema),
|
|
@@ -11257,7 +11233,7 @@
|
|
|
11257
11233
|
WorkspaceElementType["FlowInstance"] = "flow-instance";
|
|
11258
11234
|
WorkspaceElementType["FlowRun"] = "flow-run";
|
|
11259
11235
|
WorkspaceElementType["Action"] = "action";
|
|
11260
|
-
WorkspaceElementType["
|
|
11236
|
+
WorkspaceElementType["Package"] = "package";
|
|
11261
11237
|
WorkspaceElementType["ActionInstance"] = "action-instance";
|
|
11262
11238
|
WorkspaceElementType["Connection"] = "connection";
|
|
11263
11239
|
WorkspaceElementType["FieldMapping"] = "field-mapping";
|
|
@@ -11314,7 +11290,7 @@
|
|
|
11314
11290
|
});
|
|
11315
11291
|
const BaseMembraneInterfaceReadOnlyProperties = object({
|
|
11316
11292
|
name: string(),
|
|
11317
|
-
state:
|
|
11293
|
+
state: _enum(WorkspaceElementState).optional(),
|
|
11318
11294
|
errors: array(ErrorDataSchema).optional(),
|
|
11319
11295
|
revision: string().optional(),
|
|
11320
11296
|
createdAt: string().optional(),
|
|
@@ -11330,6 +11306,11 @@
|
|
|
11330
11306
|
const BaseIntegrationLevelMembraneInterfaceReadOnlyProperties = BaseMembraneInterfaceReadOnlyProperties.extend({
|
|
11331
11307
|
isCustomized: boolean().optional(),
|
|
11332
11308
|
});
|
|
11309
|
+
object({
|
|
11310
|
+
integrationKey: string().optional(),
|
|
11311
|
+
connectionId: string().optional(),
|
|
11312
|
+
instanceKey: string().optional(),
|
|
11313
|
+
});
|
|
11333
11314
|
BaseMembraneInterface.merge(BaseIntegrationLevelMembraneInterfaceEditableProperties).merge(BaseIntegrationLevelMembraneInterfaceReadOnlyProperties);
|
|
11334
11315
|
|
|
11335
11316
|
const MAX_POLLING_ERRORS = 10;
|
|
@@ -11884,11 +11865,6 @@
|
|
|
11884
11865
|
path: 'flow',
|
|
11885
11866
|
});
|
|
11886
11867
|
}
|
|
11887
|
-
async apply(integrationKeys) {
|
|
11888
|
-
return await this.options.client.post(this.getPath('apply'), {
|
|
11889
|
-
integrationKeys,
|
|
11890
|
-
});
|
|
11891
|
-
}
|
|
11892
11868
|
async reset() {
|
|
11893
11869
|
return await this.options.client.post(this.getPath('reset'));
|
|
11894
11870
|
}
|
|
@@ -11925,11 +11901,6 @@
|
|
|
11925
11901
|
async getAppSchema() {
|
|
11926
11902
|
return await this.options.client.get(this.getPath('app-schema'));
|
|
11927
11903
|
}
|
|
11928
|
-
async apply(integrationKeys) {
|
|
11929
|
-
return await this.options.client.post(this.getPath('apply'), {
|
|
11930
|
-
integrationKeys,
|
|
11931
|
-
});
|
|
11932
|
-
}
|
|
11933
11904
|
async setup() {
|
|
11934
11905
|
return await this.options.client.post(this.getPath('setup'));
|
|
11935
11906
|
}
|
|
@@ -12051,17 +12022,17 @@
|
|
|
12051
12022
|
}
|
|
12052
12023
|
}
|
|
12053
12024
|
|
|
12054
|
-
class
|
|
12025
|
+
class PackagesAccessor extends ElementListAccessor {
|
|
12055
12026
|
constructor(client) {
|
|
12056
|
-
super(client, '
|
|
12027
|
+
super(client, 'packages');
|
|
12057
12028
|
}
|
|
12058
12029
|
}
|
|
12059
|
-
class
|
|
12030
|
+
class PackageAccessor extends ElementAccessor {
|
|
12060
12031
|
constructor(client, selector) {
|
|
12061
12032
|
super({
|
|
12062
12033
|
client,
|
|
12063
12034
|
selector,
|
|
12064
|
-
path: '
|
|
12035
|
+
path: 'package',
|
|
12065
12036
|
});
|
|
12066
12037
|
}
|
|
12067
12038
|
}
|
|
@@ -12237,7 +12208,7 @@
|
|
|
12237
12208
|
}
|
|
12238
12209
|
}
|
|
12239
12210
|
|
|
12240
|
-
/*! Axios v1.
|
|
12211
|
+
/*! Axios v1.12.2 Copyright (c) 2025 Matt Zabriskie and contributors */
|
|
12241
12212
|
function bind(fn, thisArg) {
|
|
12242
12213
|
return function wrap() {
|
|
12243
12214
|
return fn.apply(thisArg, arguments);
|
|
@@ -12289,7 +12260,7 @@
|
|
|
12289
12260
|
*/
|
|
12290
12261
|
function isBuffer(val) {
|
|
12291
12262
|
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
|
|
12292
|
-
&& isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
12263
|
+
&& isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
12293
12264
|
}
|
|
12294
12265
|
|
|
12295
12266
|
/**
|
|
@@ -12334,7 +12305,7 @@
|
|
|
12334
12305
|
* @param {*} val The value to test
|
|
12335
12306
|
* @returns {boolean} True if value is a Function, otherwise false
|
|
12336
12307
|
*/
|
|
12337
|
-
const isFunction = typeOfTest('function');
|
|
12308
|
+
const isFunction$1 = typeOfTest('function');
|
|
12338
12309
|
|
|
12339
12310
|
/**
|
|
12340
12311
|
* Determine if a value is a Number
|
|
@@ -12378,6 +12349,27 @@
|
|
|
12378
12349
|
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
|
|
12379
12350
|
};
|
|
12380
12351
|
|
|
12352
|
+
/**
|
|
12353
|
+
* Determine if a value is an empty object (safely handles Buffers)
|
|
12354
|
+
*
|
|
12355
|
+
* @param {*} val The value to test
|
|
12356
|
+
*
|
|
12357
|
+
* @returns {boolean} True if value is an empty object, otherwise false
|
|
12358
|
+
*/
|
|
12359
|
+
const isEmptyObject = (val) => {
|
|
12360
|
+
// Early return for non-objects or Buffers to prevent RangeError
|
|
12361
|
+
if (!isObject(val) || isBuffer(val)) {
|
|
12362
|
+
return false;
|
|
12363
|
+
}
|
|
12364
|
+
|
|
12365
|
+
try {
|
|
12366
|
+
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
|
|
12367
|
+
} catch (e) {
|
|
12368
|
+
// Fallback for any other objects that might cause RangeError with Object.keys()
|
|
12369
|
+
return false;
|
|
12370
|
+
}
|
|
12371
|
+
};
|
|
12372
|
+
|
|
12381
12373
|
/**
|
|
12382
12374
|
* Determine if a value is a Date
|
|
12383
12375
|
*
|
|
@@ -12421,7 +12413,7 @@
|
|
|
12421
12413
|
*
|
|
12422
12414
|
* @returns {boolean} True if value is a Stream, otherwise false
|
|
12423
12415
|
*/
|
|
12424
|
-
const isStream = (val) => isObject(val) && isFunction(val.pipe);
|
|
12416
|
+
const isStream = (val) => isObject(val) && isFunction$1(val.pipe);
|
|
12425
12417
|
|
|
12426
12418
|
/**
|
|
12427
12419
|
* Determine if a value is a FormData
|
|
@@ -12434,10 +12426,10 @@
|
|
|
12434
12426
|
let kind;
|
|
12435
12427
|
return thing && (
|
|
12436
12428
|
(typeof FormData === 'function' && thing instanceof FormData) || (
|
|
12437
|
-
isFunction(thing.append) && (
|
|
12429
|
+
isFunction$1(thing.append) && (
|
|
12438
12430
|
(kind = kindOf(thing)) === 'formdata' ||
|
|
12439
12431
|
// detect form-data instance
|
|
12440
|
-
(kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
|
|
12432
|
+
(kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
|
|
12441
12433
|
)
|
|
12442
12434
|
)
|
|
12443
12435
|
)
|
|
@@ -12500,6 +12492,11 @@
|
|
|
12500
12492
|
fn.call(null, obj[i], i, obj);
|
|
12501
12493
|
}
|
|
12502
12494
|
} else {
|
|
12495
|
+
// Buffer check
|
|
12496
|
+
if (isBuffer(obj)) {
|
|
12497
|
+
return;
|
|
12498
|
+
}
|
|
12499
|
+
|
|
12503
12500
|
// Iterate over object keys
|
|
12504
12501
|
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
|
12505
12502
|
const len = keys.length;
|
|
@@ -12513,6 +12510,10 @@
|
|
|
12513
12510
|
}
|
|
12514
12511
|
|
|
12515
12512
|
function findKey(obj, key) {
|
|
12513
|
+
if (isBuffer(obj)){
|
|
12514
|
+
return null;
|
|
12515
|
+
}
|
|
12516
|
+
|
|
12516
12517
|
key = key.toLowerCase();
|
|
12517
12518
|
const keys = Object.keys(obj);
|
|
12518
12519
|
let i = keys.length;
|
|
@@ -12553,7 +12554,7 @@
|
|
|
12553
12554
|
* @returns {Object} Result of all merge properties
|
|
12554
12555
|
*/
|
|
12555
12556
|
function merge(/* obj1, obj2, obj3, ... */) {
|
|
12556
|
-
const {caseless} = isContextDefined(this) && this || {};
|
|
12557
|
+
const {caseless, skipUndefined} = isContextDefined(this) && this || {};
|
|
12557
12558
|
const result = {};
|
|
12558
12559
|
const assignValue = (val, key) => {
|
|
12559
12560
|
const targetKey = caseless && findKey(result, key) || key;
|
|
@@ -12563,7 +12564,7 @@
|
|
|
12563
12564
|
result[targetKey] = merge({}, val);
|
|
12564
12565
|
} else if (isArray(val)) {
|
|
12565
12566
|
result[targetKey] = val.slice();
|
|
12566
|
-
} else {
|
|
12567
|
+
} else if (!skipUndefined || !isUndefined(val)) {
|
|
12567
12568
|
result[targetKey] = val;
|
|
12568
12569
|
}
|
|
12569
12570
|
};
|
|
@@ -12586,7 +12587,7 @@
|
|
|
12586
12587
|
*/
|
|
12587
12588
|
const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
|
|
12588
12589
|
forEach(b, (val, key) => {
|
|
12589
|
-
if (thisArg && isFunction(val)) {
|
|
12590
|
+
if (thisArg && isFunction$1(val)) {
|
|
12590
12591
|
a[key] = bind(val, thisArg);
|
|
12591
12592
|
} else {
|
|
12592
12593
|
a[key] = val;
|
|
@@ -12802,13 +12803,13 @@
|
|
|
12802
12803
|
const freezeMethods = (obj) => {
|
|
12803
12804
|
reduceDescriptors(obj, (descriptor, name) => {
|
|
12804
12805
|
// skip restricted props in strict mode
|
|
12805
|
-
if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
|
|
12806
|
+
if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
|
|
12806
12807
|
return false;
|
|
12807
12808
|
}
|
|
12808
12809
|
|
|
12809
12810
|
const value = obj[name];
|
|
12810
12811
|
|
|
12811
|
-
if (!isFunction(value)) return;
|
|
12812
|
+
if (!isFunction$1(value)) return;
|
|
12812
12813
|
|
|
12813
12814
|
descriptor.enumerable = false;
|
|
12814
12815
|
|
|
@@ -12845,6 +12846,8 @@
|
|
|
12845
12846
|
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
12846
12847
|
};
|
|
12847
12848
|
|
|
12849
|
+
|
|
12850
|
+
|
|
12848
12851
|
/**
|
|
12849
12852
|
* If the thing is a FormData object, return true, otherwise return false.
|
|
12850
12853
|
*
|
|
@@ -12853,7 +12856,7 @@
|
|
|
12853
12856
|
* @returns {boolean}
|
|
12854
12857
|
*/
|
|
12855
12858
|
function isSpecCompliantForm(thing) {
|
|
12856
|
-
return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
|
|
12859
|
+
return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
|
|
12857
12860
|
}
|
|
12858
12861
|
|
|
12859
12862
|
const toJSONObject = (obj) => {
|
|
@@ -12866,6 +12869,11 @@
|
|
|
12866
12869
|
return;
|
|
12867
12870
|
}
|
|
12868
12871
|
|
|
12872
|
+
//Buffer check
|
|
12873
|
+
if (isBuffer(source)) {
|
|
12874
|
+
return source;
|
|
12875
|
+
}
|
|
12876
|
+
|
|
12869
12877
|
if(!('toJSON' in source)) {
|
|
12870
12878
|
stack[i] = source;
|
|
12871
12879
|
const target = isArray(source) ? [] : {};
|
|
@@ -12890,7 +12898,7 @@
|
|
|
12890
12898
|
const isAsyncFn = kindOfTest('AsyncFunction');
|
|
12891
12899
|
|
|
12892
12900
|
const isThenable = (thing) =>
|
|
12893
|
-
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
|
12901
|
+
thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
|
|
12894
12902
|
|
|
12895
12903
|
// original code
|
|
12896
12904
|
// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
|
|
@@ -12914,7 +12922,7 @@
|
|
|
12914
12922
|
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
12915
12923
|
})(
|
|
12916
12924
|
typeof setImmediate === 'function',
|
|
12917
|
-
isFunction(_global.postMessage)
|
|
12925
|
+
isFunction$1(_global.postMessage)
|
|
12918
12926
|
);
|
|
12919
12927
|
|
|
12920
12928
|
const asap = typeof queueMicrotask !== 'undefined' ?
|
|
@@ -12923,7 +12931,7 @@
|
|
|
12923
12931
|
// *********************
|
|
12924
12932
|
|
|
12925
12933
|
|
|
12926
|
-
const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
|
|
12934
|
+
const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
|
|
12927
12935
|
|
|
12928
12936
|
|
|
12929
12937
|
const utils$1 = {
|
|
@@ -12937,6 +12945,7 @@
|
|
|
12937
12945
|
isBoolean,
|
|
12938
12946
|
isObject,
|
|
12939
12947
|
isPlainObject,
|
|
12948
|
+
isEmptyObject,
|
|
12940
12949
|
isReadableStream,
|
|
12941
12950
|
isRequest,
|
|
12942
12951
|
isResponse,
|
|
@@ -12946,7 +12955,7 @@
|
|
|
12946
12955
|
isFile,
|
|
12947
12956
|
isBlob,
|
|
12948
12957
|
isRegExp,
|
|
12949
|
-
isFunction,
|
|
12958
|
+
isFunction: isFunction$1,
|
|
12950
12959
|
isStream,
|
|
12951
12960
|
isURLSearchParams,
|
|
12952
12961
|
isTypedArray,
|
|
@@ -13072,11 +13081,18 @@
|
|
|
13072
13081
|
return prop !== 'isAxiosError';
|
|
13073
13082
|
});
|
|
13074
13083
|
|
|
13075
|
-
|
|
13084
|
+
const msg = error && error.message ? error.message : 'Error';
|
|
13076
13085
|
|
|
13077
|
-
|
|
13086
|
+
// Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)
|
|
13087
|
+
const errCode = code == null && error ? error.code : code;
|
|
13088
|
+
AxiosError$1.call(axiosError, msg, errCode, config, request, response);
|
|
13078
13089
|
|
|
13079
|
-
|
|
13090
|
+
// Chain the original error on the standard field; non-enumerable to avoid JSON noise
|
|
13091
|
+
if (error && axiosError.cause == null) {
|
|
13092
|
+
Object.defineProperty(axiosError, 'cause', { value: error, configurable: true });
|
|
13093
|
+
}
|
|
13094
|
+
|
|
13095
|
+
axiosError.name = (error && error.name) || 'Error';
|
|
13080
13096
|
|
|
13081
13097
|
customProps && Object.assign(axiosError, customProps);
|
|
13082
13098
|
|
|
@@ -13367,9 +13383,7 @@
|
|
|
13367
13383
|
replace(/%3A/gi, ':').
|
|
13368
13384
|
replace(/%24/g, '$').
|
|
13369
13385
|
replace(/%2C/gi, ',').
|
|
13370
|
-
replace(/%20/g, '+')
|
|
13371
|
-
replace(/%5B/gi, '[').
|
|
13372
|
-
replace(/%5D/gi, ']');
|
|
13386
|
+
replace(/%20/g, '+');
|
|
13373
13387
|
}
|
|
13374
13388
|
|
|
13375
13389
|
/**
|
|
@@ -13568,7 +13582,7 @@
|
|
|
13568
13582
|
};
|
|
13569
13583
|
|
|
13570
13584
|
function toURLEncodedForm(data, options) {
|
|
13571
|
-
return toFormData$1(data, new platform.classes.URLSearchParams(),
|
|
13585
|
+
return toFormData$1(data, new platform.classes.URLSearchParams(), {
|
|
13572
13586
|
visitor: function(value, key, path, helpers) {
|
|
13573
13587
|
if (platform.isNode && utils$1.isBuffer(value)) {
|
|
13574
13588
|
this.append(key, value.toString('base64'));
|
|
@@ -13576,8 +13590,9 @@
|
|
|
13576
13590
|
}
|
|
13577
13591
|
|
|
13578
13592
|
return helpers.defaultVisitor.apply(this, arguments);
|
|
13579
|
-
}
|
|
13580
|
-
|
|
13593
|
+
},
|
|
13594
|
+
...options
|
|
13595
|
+
});
|
|
13581
13596
|
}
|
|
13582
13597
|
|
|
13583
13598
|
/**
|
|
@@ -13773,7 +13788,7 @@
|
|
|
13773
13788
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
13774
13789
|
|
|
13775
13790
|
try {
|
|
13776
|
-
return JSON.parse(data);
|
|
13791
|
+
return JSON.parse(data, this.parseReviver);
|
|
13777
13792
|
} catch (e) {
|
|
13778
13793
|
if (strictJSONParsing) {
|
|
13779
13794
|
if (e.name === 'SyntaxError') {
|
|
@@ -14330,7 +14345,7 @@
|
|
|
14330
14345
|
clearTimeout(timer);
|
|
14331
14346
|
timer = null;
|
|
14332
14347
|
}
|
|
14333
|
-
fn
|
|
14348
|
+
fn(...args);
|
|
14334
14349
|
};
|
|
14335
14350
|
|
|
14336
14351
|
const throttled = (...args) => {
|
|
@@ -14586,7 +14601,7 @@
|
|
|
14586
14601
|
headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
|
|
14587
14602
|
};
|
|
14588
14603
|
|
|
14589
|
-
utils$1.forEach(Object.keys(
|
|
14604
|
+
utils$1.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
|
|
14590
14605
|
const merge = mergeMap[prop] || mergeDeepProperties;
|
|
14591
14606
|
const configValue = merge(config1[prop], config2[prop], prop);
|
|
14592
14607
|
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
@@ -14598,7 +14613,7 @@
|
|
|
14598
14613
|
const resolveConfig = (config) => {
|
|
14599
14614
|
const newConfig = mergeConfig$1({}, config);
|
|
14600
14615
|
|
|
14601
|
-
let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
|
|
14616
|
+
let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
|
|
14602
14617
|
|
|
14603
14618
|
newConfig.headers = headers = AxiosHeaders$2.from(headers);
|
|
14604
14619
|
|
|
@@ -14611,17 +14626,21 @@
|
|
|
14611
14626
|
);
|
|
14612
14627
|
}
|
|
14613
14628
|
|
|
14614
|
-
let contentType;
|
|
14615
|
-
|
|
14616
14629
|
if (utils$1.isFormData(data)) {
|
|
14617
14630
|
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
14618
|
-
headers.setContentType(undefined); //
|
|
14619
|
-
} else if ((
|
|
14620
|
-
//
|
|
14621
|
-
const
|
|
14622
|
-
headers
|
|
14631
|
+
headers.setContentType(undefined); // browser handles it
|
|
14632
|
+
} else if (utils$1.isFunction(data.getHeaders)) {
|
|
14633
|
+
// Node.js FormData (like form-data package)
|
|
14634
|
+
const formHeaders = data.getHeaders();
|
|
14635
|
+
// Only set safe headers to avoid overwriting security headers
|
|
14636
|
+
const allowedHeaders = ['content-type', 'content-length'];
|
|
14637
|
+
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
14638
|
+
if (allowedHeaders.includes(key.toLowerCase())) {
|
|
14639
|
+
headers.set(key, val);
|
|
14640
|
+
}
|
|
14641
|
+
});
|
|
14623
14642
|
}
|
|
14624
|
-
}
|
|
14643
|
+
}
|
|
14625
14644
|
|
|
14626
14645
|
// Add xsrf header
|
|
14627
14646
|
// This is only done if running in a standard browser environment.
|
|
@@ -14738,15 +14757,18 @@
|
|
|
14738
14757
|
};
|
|
14739
14758
|
|
|
14740
14759
|
// Handle low level network errors
|
|
14741
|
-
|
|
14742
|
-
|
|
14743
|
-
|
|
14744
|
-
|
|
14745
|
-
|
|
14746
|
-
|
|
14747
|
-
|
|
14760
|
+
request.onerror = function handleError(event) {
|
|
14761
|
+
// Browsers deliver a ProgressEvent in XHR onerror
|
|
14762
|
+
// (message may be empty; when present, surface it)
|
|
14763
|
+
// See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
|
|
14764
|
+
const msg = event && event.message ? event.message : 'Network Error';
|
|
14765
|
+
const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
|
|
14766
|
+
// attach the underlying event for consumers who want details
|
|
14767
|
+
err.event = event || null;
|
|
14768
|
+
reject(err);
|
|
14769
|
+
request = null;
|
|
14748
14770
|
};
|
|
14749
|
-
|
|
14771
|
+
|
|
14750
14772
|
// Handle timeout
|
|
14751
14773
|
request.ontimeout = function handleTimeout() {
|
|
14752
14774
|
let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
@@ -14962,14 +14984,18 @@
|
|
|
14962
14984
|
})
|
|
14963
14985
|
};
|
|
14964
14986
|
|
|
14965
|
-
const
|
|
14966
|
-
|
|
14987
|
+
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
14988
|
+
|
|
14989
|
+
const {isFunction} = utils$1;
|
|
14990
|
+
|
|
14991
|
+
const globalFetchAPI = (({Request, Response}) => ({
|
|
14992
|
+
Request, Response
|
|
14993
|
+
}))(utils$1.global);
|
|
14994
|
+
|
|
14995
|
+
const {
|
|
14996
|
+
ReadableStream: ReadableStream$1, TextEncoder
|
|
14997
|
+
} = utils$1.global;
|
|
14967
14998
|
|
|
14968
|
-
// used only inside the fetch adapter
|
|
14969
|
-
const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
|
|
14970
|
-
((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
|
|
14971
|
-
async (str) => new Uint8Array(await new Response(str).arrayBuffer())
|
|
14972
|
-
);
|
|
14973
14999
|
|
|
14974
15000
|
const test = (fn, ...args) => {
|
|
14975
15001
|
try {
|
|
@@ -14979,211 +15005,268 @@
|
|
|
14979
15005
|
}
|
|
14980
15006
|
};
|
|
14981
15007
|
|
|
14982
|
-
const
|
|
14983
|
-
|
|
15008
|
+
const factory = (env) => {
|
|
15009
|
+
env = utils$1.merge.call({
|
|
15010
|
+
skipUndefined: true
|
|
15011
|
+
}, globalFetchAPI, env);
|
|
14984
15012
|
|
|
14985
|
-
const
|
|
14986
|
-
|
|
14987
|
-
|
|
14988
|
-
|
|
14989
|
-
duplexAccessed = true;
|
|
14990
|
-
return 'half';
|
|
14991
|
-
},
|
|
14992
|
-
}).headers.has('Content-Type');
|
|
15013
|
+
const {fetch: envFetch, Request, Response} = env;
|
|
15014
|
+
const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
|
|
15015
|
+
const isRequestSupported = isFunction(Request);
|
|
15016
|
+
const isResponseSupported = isFunction(Response);
|
|
14993
15017
|
|
|
14994
|
-
|
|
14995
|
-
|
|
15018
|
+
if (!isFetchSupported) {
|
|
15019
|
+
return false;
|
|
15020
|
+
}
|
|
14996
15021
|
|
|
14997
|
-
|
|
15022
|
+
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
|
|
14998
15023
|
|
|
14999
|
-
|
|
15000
|
-
|
|
15024
|
+
const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
|
|
15025
|
+
((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
|
|
15026
|
+
async (str) => new Uint8Array(await new Request(str).arrayBuffer())
|
|
15027
|
+
);
|
|
15001
15028
|
|
|
15029
|
+
const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
|
|
15030
|
+
let duplexAccessed = false;
|
|
15002
15031
|
|
|
15003
|
-
|
|
15004
|
-
|
|
15005
|
-
|
|
15032
|
+
const hasContentType = new Request(platform.origin, {
|
|
15033
|
+
body: new ReadableStream$1(),
|
|
15034
|
+
method: 'POST',
|
|
15035
|
+
get duplex() {
|
|
15036
|
+
duplexAccessed = true;
|
|
15037
|
+
return 'half';
|
|
15038
|
+
},
|
|
15039
|
+
}).headers.has('Content-Type');
|
|
15006
15040
|
|
|
15007
|
-
|
|
15008
|
-
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
|
|
15009
|
-
!resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() :
|
|
15010
|
-
(_, config) => {
|
|
15011
|
-
throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
|
|
15012
|
-
});
|
|
15041
|
+
return duplexAccessed && !hasContentType;
|
|
15013
15042
|
});
|
|
15014
|
-
})(new Response));
|
|
15015
15043
|
|
|
15016
|
-
|
|
15017
|
-
|
|
15018
|
-
return 0;
|
|
15019
|
-
}
|
|
15044
|
+
const supportsResponseStream = isResponseSupported && isReadableStreamSupported &&
|
|
15045
|
+
test(() => utils$1.isReadableStream(new Response('').body));
|
|
15020
15046
|
|
|
15021
|
-
|
|
15022
|
-
|
|
15023
|
-
}
|
|
15047
|
+
const resolvers = {
|
|
15048
|
+
stream: supportsResponseStream && ((res) => res.body)
|
|
15049
|
+
};
|
|
15024
15050
|
|
|
15025
|
-
|
|
15026
|
-
|
|
15027
|
-
|
|
15028
|
-
|
|
15051
|
+
isFetchSupported && ((() => {
|
|
15052
|
+
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
|
|
15053
|
+
!resolvers[type] && (resolvers[type] = (res, config) => {
|
|
15054
|
+
let method = res && res[type];
|
|
15055
|
+
|
|
15056
|
+
if (method) {
|
|
15057
|
+
return method.call(res);
|
|
15058
|
+
}
|
|
15059
|
+
|
|
15060
|
+
throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
|
|
15061
|
+
});
|
|
15029
15062
|
});
|
|
15030
|
-
|
|
15031
|
-
}
|
|
15063
|
+
})());
|
|
15032
15064
|
|
|
15033
|
-
|
|
15034
|
-
|
|
15035
|
-
|
|
15065
|
+
const getBodyLength = async (body) => {
|
|
15066
|
+
if (body == null) {
|
|
15067
|
+
return 0;
|
|
15068
|
+
}
|
|
15036
15069
|
|
|
15037
|
-
|
|
15038
|
-
|
|
15039
|
-
|
|
15070
|
+
if (utils$1.isBlob(body)) {
|
|
15071
|
+
return body.size;
|
|
15072
|
+
}
|
|
15040
15073
|
|
|
15041
|
-
|
|
15042
|
-
|
|
15043
|
-
|
|
15044
|
-
|
|
15074
|
+
if (utils$1.isSpecCompliantForm(body)) {
|
|
15075
|
+
const _request = new Request(platform.origin, {
|
|
15076
|
+
method: 'POST',
|
|
15077
|
+
body,
|
|
15078
|
+
});
|
|
15079
|
+
return (await _request.arrayBuffer()).byteLength;
|
|
15080
|
+
}
|
|
15045
15081
|
|
|
15046
|
-
|
|
15047
|
-
|
|
15082
|
+
if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
|
|
15083
|
+
return body.byteLength;
|
|
15084
|
+
}
|
|
15048
15085
|
|
|
15049
|
-
|
|
15050
|
-
|
|
15086
|
+
if (utils$1.isURLSearchParams(body)) {
|
|
15087
|
+
body = body + '';
|
|
15088
|
+
}
|
|
15051
15089
|
|
|
15052
|
-
|
|
15053
|
-
|
|
15054
|
-
|
|
15055
|
-
|
|
15056
|
-
data,
|
|
15057
|
-
signal,
|
|
15058
|
-
cancelToken,
|
|
15059
|
-
timeout,
|
|
15060
|
-
onDownloadProgress,
|
|
15061
|
-
onUploadProgress,
|
|
15062
|
-
responseType,
|
|
15063
|
-
headers,
|
|
15064
|
-
withCredentials = 'same-origin',
|
|
15065
|
-
fetchOptions
|
|
15066
|
-
} = resolveConfig(config);
|
|
15090
|
+
if (utils$1.isString(body)) {
|
|
15091
|
+
return (await encodeText(body)).byteLength;
|
|
15092
|
+
}
|
|
15093
|
+
};
|
|
15067
15094
|
|
|
15068
|
-
|
|
15095
|
+
const resolveBodyLength = async (headers, body) => {
|
|
15096
|
+
const length = utils$1.toFiniteNumber(headers.getContentLength());
|
|
15069
15097
|
|
|
15070
|
-
|
|
15098
|
+
return length == null ? getBodyLength(body) : length;
|
|
15099
|
+
};
|
|
15071
15100
|
|
|
15072
|
-
|
|
15101
|
+
return async (config) => {
|
|
15102
|
+
let {
|
|
15103
|
+
url,
|
|
15104
|
+
method,
|
|
15105
|
+
data,
|
|
15106
|
+
signal,
|
|
15107
|
+
cancelToken,
|
|
15108
|
+
timeout,
|
|
15109
|
+
onDownloadProgress,
|
|
15110
|
+
onUploadProgress,
|
|
15111
|
+
responseType,
|
|
15112
|
+
headers,
|
|
15113
|
+
withCredentials = 'same-origin',
|
|
15114
|
+
fetchOptions
|
|
15115
|
+
} = resolveConfig(config);
|
|
15116
|
+
|
|
15117
|
+
let _fetch = envFetch || fetch;
|
|
15118
|
+
|
|
15119
|
+
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
|
15120
|
+
|
|
15121
|
+
let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
15122
|
+
|
|
15123
|
+
let request = null;
|
|
15073
15124
|
|
|
15074
|
-
|
|
15125
|
+
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
15075
15126
|
composedSignal.unsubscribe();
|
|
15076
|
-
|
|
15127
|
+
});
|
|
15077
15128
|
|
|
15078
|
-
|
|
15129
|
+
let requestContentLength;
|
|
15079
15130
|
|
|
15080
|
-
|
|
15081
|
-
|
|
15082
|
-
|
|
15083
|
-
|
|
15084
|
-
|
|
15085
|
-
|
|
15086
|
-
|
|
15087
|
-
|
|
15088
|
-
|
|
15089
|
-
|
|
15131
|
+
try {
|
|
15132
|
+
if (
|
|
15133
|
+
onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
|
|
15134
|
+
(requestContentLength = await resolveBodyLength(headers, data)) !== 0
|
|
15135
|
+
) {
|
|
15136
|
+
let _request = new Request(url, {
|
|
15137
|
+
method: 'POST',
|
|
15138
|
+
body: data,
|
|
15139
|
+
duplex: "half"
|
|
15140
|
+
});
|
|
15090
15141
|
|
|
15091
|
-
|
|
15142
|
+
let contentTypeHeader;
|
|
15092
15143
|
|
|
15093
|
-
|
|
15094
|
-
|
|
15095
|
-
|
|
15144
|
+
if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
|
|
15145
|
+
headers.setContentType(contentTypeHeader);
|
|
15146
|
+
}
|
|
15096
15147
|
|
|
15097
|
-
|
|
15098
|
-
|
|
15099
|
-
|
|
15100
|
-
|
|
15101
|
-
|
|
15148
|
+
if (_request.body) {
|
|
15149
|
+
const [onProgress, flush] = progressEventDecorator(
|
|
15150
|
+
requestContentLength,
|
|
15151
|
+
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
15152
|
+
);
|
|
15102
15153
|
|
|
15103
|
-
|
|
15154
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
15155
|
+
}
|
|
15104
15156
|
}
|
|
15105
|
-
}
|
|
15106
15157
|
|
|
15107
|
-
|
|
15108
|
-
|
|
15109
|
-
|
|
15158
|
+
if (!utils$1.isString(withCredentials)) {
|
|
15159
|
+
withCredentials = withCredentials ? 'include' : 'omit';
|
|
15160
|
+
}
|
|
15110
15161
|
|
|
15111
|
-
|
|
15112
|
-
|
|
15113
|
-
|
|
15114
|
-
request = new Request(url, {
|
|
15115
|
-
...fetchOptions,
|
|
15116
|
-
signal: composedSignal,
|
|
15117
|
-
method: method.toUpperCase(),
|
|
15118
|
-
headers: headers.normalize().toJSON(),
|
|
15119
|
-
body: data,
|
|
15120
|
-
duplex: "half",
|
|
15121
|
-
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
15122
|
-
});
|
|
15162
|
+
// Cloudflare Workers throws when credentials are defined
|
|
15163
|
+
// see https://github.com/cloudflare/workerd/issues/902
|
|
15164
|
+
const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
|
|
15123
15165
|
|
|
15124
|
-
|
|
15166
|
+
const resolvedOptions = {
|
|
15167
|
+
...fetchOptions,
|
|
15168
|
+
signal: composedSignal,
|
|
15169
|
+
method: method.toUpperCase(),
|
|
15170
|
+
headers: headers.normalize().toJSON(),
|
|
15171
|
+
body: data,
|
|
15172
|
+
duplex: "half",
|
|
15173
|
+
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
15174
|
+
};
|
|
15125
15175
|
|
|
15126
|
-
|
|
15176
|
+
request = isRequestSupported && new Request(url, resolvedOptions);
|
|
15127
15177
|
|
|
15128
|
-
|
|
15129
|
-
const options = {};
|
|
15178
|
+
let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
|
|
15130
15179
|
|
|
15131
|
-
|
|
15132
|
-
options[prop] = response[prop];
|
|
15133
|
-
});
|
|
15180
|
+
const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
|
15134
15181
|
|
|
15135
|
-
|
|
15182
|
+
if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
|
|
15183
|
+
const options = {};
|
|
15136
15184
|
|
|
15137
|
-
|
|
15138
|
-
|
|
15139
|
-
|
|
15140
|
-
) || [];
|
|
15185
|
+
['status', 'statusText', 'headers'].forEach(prop => {
|
|
15186
|
+
options[prop] = response[prop];
|
|
15187
|
+
});
|
|
15141
15188
|
|
|
15142
|
-
|
|
15143
|
-
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
15144
|
-
flush && flush();
|
|
15145
|
-
unsubscribe && unsubscribe();
|
|
15146
|
-
}),
|
|
15147
|
-
options
|
|
15148
|
-
);
|
|
15149
|
-
}
|
|
15189
|
+
const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
|
|
15150
15190
|
|
|
15151
|
-
|
|
15191
|
+
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
|
15192
|
+
responseContentLength,
|
|
15193
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
15194
|
+
) || [];
|
|
15152
15195
|
|
|
15153
|
-
|
|
15196
|
+
response = new Response(
|
|
15197
|
+
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
15198
|
+
flush && flush();
|
|
15199
|
+
unsubscribe && unsubscribe();
|
|
15200
|
+
}),
|
|
15201
|
+
options
|
|
15202
|
+
);
|
|
15203
|
+
}
|
|
15154
15204
|
|
|
15155
|
-
|
|
15205
|
+
responseType = responseType || 'text';
|
|
15156
15206
|
|
|
15157
|
-
|
|
15158
|
-
settle(resolve, reject, {
|
|
15159
|
-
data: responseData,
|
|
15160
|
-
headers: AxiosHeaders$2.from(response.headers),
|
|
15161
|
-
status: response.status,
|
|
15162
|
-
statusText: response.statusText,
|
|
15163
|
-
config,
|
|
15164
|
-
request
|
|
15165
|
-
});
|
|
15166
|
-
})
|
|
15167
|
-
} catch (err) {
|
|
15168
|
-
unsubscribe && unsubscribe();
|
|
15207
|
+
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
|
|
15169
15208
|
|
|
15170
|
-
|
|
15171
|
-
|
|
15172
|
-
|
|
15173
|
-
{
|
|
15174
|
-
|
|
15175
|
-
|
|
15176
|
-
|
|
15209
|
+
!isStreamResponse && unsubscribe && unsubscribe();
|
|
15210
|
+
|
|
15211
|
+
return await new Promise((resolve, reject) => {
|
|
15212
|
+
settle(resolve, reject, {
|
|
15213
|
+
data: responseData,
|
|
15214
|
+
headers: AxiosHeaders$2.from(response.headers),
|
|
15215
|
+
status: response.status,
|
|
15216
|
+
statusText: response.statusText,
|
|
15217
|
+
config,
|
|
15218
|
+
request
|
|
15219
|
+
});
|
|
15220
|
+
})
|
|
15221
|
+
} catch (err) {
|
|
15222
|
+
unsubscribe && unsubscribe();
|
|
15223
|
+
|
|
15224
|
+
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
|
15225
|
+
throw Object.assign(
|
|
15226
|
+
new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request),
|
|
15227
|
+
{
|
|
15228
|
+
cause: err.cause || err
|
|
15229
|
+
}
|
|
15230
|
+
)
|
|
15231
|
+
}
|
|
15232
|
+
|
|
15233
|
+
throw AxiosError$1.from(err, err && err.code, config, request);
|
|
15177
15234
|
}
|
|
15235
|
+
}
|
|
15236
|
+
};
|
|
15237
|
+
|
|
15238
|
+
const seedCache = new Map();
|
|
15239
|
+
|
|
15240
|
+
const getFetch = (config) => {
|
|
15241
|
+
let env = config ? config.env : {};
|
|
15242
|
+
const {fetch, Request, Response} = env;
|
|
15243
|
+
const seeds = [
|
|
15244
|
+
Request, Response, fetch
|
|
15245
|
+
];
|
|
15246
|
+
|
|
15247
|
+
let len = seeds.length, i = len,
|
|
15248
|
+
seed, target, map = seedCache;
|
|
15178
15249
|
|
|
15179
|
-
|
|
15250
|
+
while (i--) {
|
|
15251
|
+
seed = seeds[i];
|
|
15252
|
+
target = map.get(seed);
|
|
15253
|
+
|
|
15254
|
+
target === undefined && map.set(seed, target = (i ? new Map() : factory(env)));
|
|
15255
|
+
|
|
15256
|
+
map = target;
|
|
15180
15257
|
}
|
|
15181
|
-
|
|
15258
|
+
|
|
15259
|
+
return target;
|
|
15260
|
+
};
|
|
15261
|
+
|
|
15262
|
+
getFetch();
|
|
15182
15263
|
|
|
15183
15264
|
const knownAdapters = {
|
|
15184
15265
|
http: httpAdapter,
|
|
15185
15266
|
xhr: xhrAdapter,
|
|
15186
|
-
fetch:
|
|
15267
|
+
fetch: {
|
|
15268
|
+
get: getFetch,
|
|
15269
|
+
}
|
|
15187
15270
|
};
|
|
15188
15271
|
|
|
15189
15272
|
utils$1.forEach(knownAdapters, (fn, value) => {
|
|
@@ -15202,7 +15285,7 @@
|
|
|
15202
15285
|
const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
|
15203
15286
|
|
|
15204
15287
|
const adapters = {
|
|
15205
|
-
getAdapter: (adapters) => {
|
|
15288
|
+
getAdapter: (adapters, config) => {
|
|
15206
15289
|
adapters = utils$1.isArray(adapters) ? adapters : [adapters];
|
|
15207
15290
|
|
|
15208
15291
|
const {length} = adapters;
|
|
@@ -15225,7 +15308,7 @@
|
|
|
15225
15308
|
}
|
|
15226
15309
|
}
|
|
15227
15310
|
|
|
15228
|
-
if (adapter) {
|
|
15311
|
+
if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
|
|
15229
15312
|
break;
|
|
15230
15313
|
}
|
|
15231
15314
|
|
|
@@ -15293,7 +15376,7 @@
|
|
|
15293
15376
|
config.headers.setContentType('application/x-www-form-urlencoded', false);
|
|
15294
15377
|
}
|
|
15295
15378
|
|
|
15296
|
-
const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
|
|
15379
|
+
const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter, config);
|
|
15297
15380
|
|
|
15298
15381
|
return adapter(config).then(function onAdapterResolution(response) {
|
|
15299
15382
|
throwIfCancellationRequested(config);
|
|
@@ -15327,7 +15410,7 @@
|
|
|
15327
15410
|
});
|
|
15328
15411
|
}
|
|
15329
15412
|
|
|
15330
|
-
const VERSION$1 = "1.
|
|
15413
|
+
const VERSION$1 = "1.12.2";
|
|
15331
15414
|
|
|
15332
15415
|
const validators$1 = {};
|
|
15333
15416
|
|
|
@@ -15566,8 +15649,8 @@
|
|
|
15566
15649
|
|
|
15567
15650
|
if (!synchronousRequestInterceptors) {
|
|
15568
15651
|
const chain = [dispatchRequest.bind(this), undefined];
|
|
15569
|
-
chain.unshift
|
|
15570
|
-
chain.push
|
|
15652
|
+
chain.unshift(...requestInterceptorChain);
|
|
15653
|
+
chain.push(...responseInterceptorChain);
|
|
15571
15654
|
len = chain.length;
|
|
15572
15655
|
|
|
15573
15656
|
promise = Promise.resolve(config);
|
|
@@ -15583,8 +15666,6 @@
|
|
|
15583
15666
|
|
|
15584
15667
|
let newConfig = config;
|
|
15585
15668
|
|
|
15586
|
-
i = 0;
|
|
15587
|
-
|
|
15588
15669
|
while (i < len) {
|
|
15589
15670
|
const onFulfilled = requestInterceptorChain[i++];
|
|
15590
15671
|
const onRejected = requestInterceptorChain[i++];
|
|
@@ -16316,11 +16397,11 @@
|
|
|
16316
16397
|
get customers() {
|
|
16317
16398
|
return new CustomersAccessor(this);
|
|
16318
16399
|
}
|
|
16319
|
-
|
|
16320
|
-
return new
|
|
16400
|
+
package(selector) {
|
|
16401
|
+
return new PackageAccessor(this, selector);
|
|
16321
16402
|
}
|
|
16322
|
-
get
|
|
16323
|
-
return new
|
|
16403
|
+
get packages() {
|
|
16404
|
+
return new PackagesAccessor(this);
|
|
16324
16405
|
}
|
|
16325
16406
|
async createEventSource(uri, queryParams) {
|
|
16326
16407
|
return super.createEventSource(uri, queryParams);
|