@membranehq/sdk 0.8.0 → 0.8.2
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 +346 -118
- package/dist/bundle.js +410 -235
- package/dist/bundle.js.map +1 -1
- package/dist/dts/accessors/action-instances-accessors.d.ts +1 -2
- 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/sse/workspace-elements.d.ts +7 -0
- 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 +334 -8
- package/dist/dts/workspace-elements/api/data-source-instances-api.d.ts +1 -1
- package/dist/dts/workspace-elements/api/data-sources-api.d.ts +4 -4
- package/dist/dts/workspace-elements/api/field-mapping-instances-api.d.ts +2 -2
- package/dist/dts/workspace-elements/api/field-mappings-api.d.ts +4 -4
- 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} +8 -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/data-sources/index.d.ts +2 -2
- package/dist/dts/workspace-elements/base/field-mappings/index.d.ts +2 -2
- 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 +26 -1
- package/dist/index.browser.d.mts +742 -453
- package/dist/index.browser.d.ts +742 -453
- package/dist/index.browser.js +139 -127
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +128 -121
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.mts +742 -453
- package/dist/index.node.d.ts +742 -453
- package/dist/index.node.js +139 -127
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +128 -121
- 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,
|
|
@@ -7952,7 +7952,7 @@
|
|
|
7952
7952
|
return new RegExp(`^${regex}$`);
|
|
7953
7953
|
};
|
|
7954
7954
|
const integer = /^\d+$/;
|
|
7955
|
-
const number$
|
|
7955
|
+
const number$2 = /^-?\d+(?:\.\d+)?/i;
|
|
7956
7956
|
const boolean$1 = /true|false/i;
|
|
7957
7957
|
// regex for string with no uppercase letters
|
|
7958
7958
|
const lowercase = /^[^A-Z]*$/;
|
|
@@ -8861,7 +8861,7 @@
|
|
|
8861
8861
|
});
|
|
8862
8862
|
const $ZodNumber = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => {
|
|
8863
8863
|
$ZodType.init(inst, def);
|
|
8864
|
-
inst._zod.pattern = inst._zod.bag.pattern ?? number$
|
|
8864
|
+
inst._zod.pattern = inst._zod.bag.pattern ?? number$2;
|
|
8865
8865
|
inst._zod.parse = (payload, _ctx) => {
|
|
8866
8866
|
if (def.coerce)
|
|
8867
8867
|
try {
|
|
@@ -10012,6 +10012,14 @@
|
|
|
10012
10012
|
...normalizeParams(params),
|
|
10013
10013
|
});
|
|
10014
10014
|
}
|
|
10015
|
+
function _coercedNumber(Class, params) {
|
|
10016
|
+
return new Class({
|
|
10017
|
+
type: "number",
|
|
10018
|
+
coerce: true,
|
|
10019
|
+
checks: [],
|
|
10020
|
+
...normalizeParams(params),
|
|
10021
|
+
});
|
|
10022
|
+
}
|
|
10015
10023
|
function _int(Class, params) {
|
|
10016
10024
|
return new Class({
|
|
10017
10025
|
type: "number",
|
|
@@ -10578,7 +10586,7 @@
|
|
|
10578
10586
|
inst.isFinite = true;
|
|
10579
10587
|
inst.format = bag.format ?? null;
|
|
10580
10588
|
});
|
|
10581
|
-
function number(params) {
|
|
10589
|
+
function number$1(params) {
|
|
10582
10590
|
return _number(ZodNumber, params);
|
|
10583
10591
|
}
|
|
10584
10592
|
const ZodNumberFormat = /*@__PURE__*/ $constructor("ZodNumberFormat", (inst, def) => {
|
|
@@ -10909,6 +10917,15 @@
|
|
|
10909
10917
|
function superRefine(fn) {
|
|
10910
10918
|
return _superRefine(fn);
|
|
10911
10919
|
}
|
|
10920
|
+
// preprocess
|
|
10921
|
+
// /** @deprecated Use `z.pipe()` and `z.transform()` instead. */
|
|
10922
|
+
function preprocess(fn, schema) {
|
|
10923
|
+
return pipe(transform(fn), schema);
|
|
10924
|
+
}
|
|
10925
|
+
|
|
10926
|
+
function number(params) {
|
|
10927
|
+
return _coercedNumber(ZodNumber, params);
|
|
10928
|
+
}
|
|
10912
10929
|
|
|
10913
10930
|
var ErrorType;
|
|
10914
10931
|
(function (ErrorType) {
|
|
@@ -11078,9 +11095,9 @@
|
|
|
11078
11095
|
});
|
|
11079
11096
|
const FlowRunNode = object({
|
|
11080
11097
|
state: _enum(FlowRunNodeState),
|
|
11081
|
-
runs: number().optional(),
|
|
11082
|
-
erroredRuns: number().optional(),
|
|
11083
|
-
outputs: number().optional(),
|
|
11098
|
+
runs: number$1().optional(),
|
|
11099
|
+
erroredRuns: number$1().optional(),
|
|
11100
|
+
outputs: number$1().optional(),
|
|
11084
11101
|
});
|
|
11085
11102
|
object({
|
|
11086
11103
|
id: string(),
|
|
@@ -11219,6 +11236,42 @@
|
|
|
11219
11236
|
}
|
|
11220
11237
|
}
|
|
11221
11238
|
|
|
11239
|
+
const zodBooleanCoercion = () => preprocess((val) => {
|
|
11240
|
+
if (typeof val === 'boolean')
|
|
11241
|
+
return val;
|
|
11242
|
+
if (typeof val === 'string') {
|
|
11243
|
+
const lower = val.toLowerCase();
|
|
11244
|
+
if (lower === 'true' || lower === '1')
|
|
11245
|
+
return true;
|
|
11246
|
+
if (lower === 'false' || lower === '0')
|
|
11247
|
+
return false;
|
|
11248
|
+
return Boolean(val);
|
|
11249
|
+
}
|
|
11250
|
+
if (typeof val === 'number')
|
|
11251
|
+
return Boolean(val);
|
|
11252
|
+
return Boolean(val);
|
|
11253
|
+
}, boolean());
|
|
11254
|
+
const IncludeArchivedQuery = object({
|
|
11255
|
+
includeArchived: zodBooleanCoercion().optional(),
|
|
11256
|
+
});
|
|
11257
|
+
const SearchQuery = object({
|
|
11258
|
+
search: string().optional(),
|
|
11259
|
+
});
|
|
11260
|
+
const PaginationQuery = object({
|
|
11261
|
+
limit: number().int().min(1).max(1000).optional(),
|
|
11262
|
+
cursor: string().optional(),
|
|
11263
|
+
});
|
|
11264
|
+
const CommonListElementsQuery = SearchQuery.merge(PaginationQuery).merge(IncludeArchivedQuery);
|
|
11265
|
+
CommonListElementsQuery.extend({
|
|
11266
|
+
userId: string().optional(),
|
|
11267
|
+
instanceKey: string().optional(),
|
|
11268
|
+
});
|
|
11269
|
+
object({
|
|
11270
|
+
connectionId: string().optional(),
|
|
11271
|
+
integrationId: string().optional(),
|
|
11272
|
+
integrationKey: string().optional(),
|
|
11273
|
+
});
|
|
11274
|
+
|
|
11222
11275
|
var ConfigurationState;
|
|
11223
11276
|
(function (ConfigurationState) {
|
|
11224
11277
|
ConfigurationState["CONFIGURED"] = "CONFIGURED";
|
|
@@ -11233,7 +11286,7 @@
|
|
|
11233
11286
|
WorkspaceElementType["FlowInstance"] = "flow-instance";
|
|
11234
11287
|
WorkspaceElementType["FlowRun"] = "flow-run";
|
|
11235
11288
|
WorkspaceElementType["Action"] = "action";
|
|
11236
|
-
WorkspaceElementType["
|
|
11289
|
+
WorkspaceElementType["Package"] = "package";
|
|
11237
11290
|
WorkspaceElementType["ActionInstance"] = "action-instance";
|
|
11238
11291
|
WorkspaceElementType["Connection"] = "connection";
|
|
11239
11292
|
WorkspaceElementType["FieldMapping"] = "field-mapping";
|
|
@@ -11306,6 +11359,18 @@
|
|
|
11306
11359
|
const BaseIntegrationLevelMembraneInterfaceReadOnlyProperties = BaseMembraneInterfaceReadOnlyProperties.extend({
|
|
11307
11360
|
isCustomized: boolean().optional(),
|
|
11308
11361
|
});
|
|
11362
|
+
const IntegrationLevelMembraneInterfaceSelectorQuery = object({
|
|
11363
|
+
integrationKey: string().optional(),
|
|
11364
|
+
connectionId: string().optional(),
|
|
11365
|
+
instanceKey: string().optional(),
|
|
11366
|
+
});
|
|
11367
|
+
IntegrationLevelMembraneInterfaceSelectorQuery.extend(CommonListElementsQuery.shape).extend({
|
|
11368
|
+
layer: _enum(['universal', 'integration', 'connection']).optional(),
|
|
11369
|
+
integrationId: string().optional(),
|
|
11370
|
+
parentId: string().optional(),
|
|
11371
|
+
universalParentId: string().optional(),
|
|
11372
|
+
userId: string().optional(),
|
|
11373
|
+
});
|
|
11309
11374
|
BaseMembraneInterface.merge(BaseIntegrationLevelMembraneInterfaceEditableProperties).merge(BaseIntegrationLevelMembraneInterfaceReadOnlyProperties);
|
|
11310
11375
|
|
|
11311
11376
|
const MAX_POLLING_ERRORS = 10;
|
|
@@ -12017,17 +12082,17 @@
|
|
|
12017
12082
|
}
|
|
12018
12083
|
}
|
|
12019
12084
|
|
|
12020
|
-
class
|
|
12085
|
+
class PackagesAccessor extends ElementListAccessor {
|
|
12021
12086
|
constructor(client) {
|
|
12022
|
-
super(client, '
|
|
12087
|
+
super(client, 'packages');
|
|
12023
12088
|
}
|
|
12024
12089
|
}
|
|
12025
|
-
class
|
|
12090
|
+
class PackageAccessor extends ElementAccessor {
|
|
12026
12091
|
constructor(client, selector) {
|
|
12027
12092
|
super({
|
|
12028
12093
|
client,
|
|
12029
12094
|
selector,
|
|
12030
|
-
path: '
|
|
12095
|
+
path: 'package',
|
|
12031
12096
|
});
|
|
12032
12097
|
}
|
|
12033
12098
|
}
|
|
@@ -12203,7 +12268,7 @@
|
|
|
12203
12268
|
}
|
|
12204
12269
|
}
|
|
12205
12270
|
|
|
12206
|
-
/*! Axios v1.
|
|
12271
|
+
/*! Axios v1.12.2 Copyright (c) 2025 Matt Zabriskie and contributors */
|
|
12207
12272
|
function bind(fn, thisArg) {
|
|
12208
12273
|
return function wrap() {
|
|
12209
12274
|
return fn.apply(thisArg, arguments);
|
|
@@ -12255,7 +12320,7 @@
|
|
|
12255
12320
|
*/
|
|
12256
12321
|
function isBuffer(val) {
|
|
12257
12322
|
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
|
|
12258
|
-
&& isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
12323
|
+
&& isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
12259
12324
|
}
|
|
12260
12325
|
|
|
12261
12326
|
/**
|
|
@@ -12300,7 +12365,7 @@
|
|
|
12300
12365
|
* @param {*} val The value to test
|
|
12301
12366
|
* @returns {boolean} True if value is a Function, otherwise false
|
|
12302
12367
|
*/
|
|
12303
|
-
const isFunction = typeOfTest('function');
|
|
12368
|
+
const isFunction$1 = typeOfTest('function');
|
|
12304
12369
|
|
|
12305
12370
|
/**
|
|
12306
12371
|
* Determine if a value is a Number
|
|
@@ -12344,6 +12409,27 @@
|
|
|
12344
12409
|
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
|
|
12345
12410
|
};
|
|
12346
12411
|
|
|
12412
|
+
/**
|
|
12413
|
+
* Determine if a value is an empty object (safely handles Buffers)
|
|
12414
|
+
*
|
|
12415
|
+
* @param {*} val The value to test
|
|
12416
|
+
*
|
|
12417
|
+
* @returns {boolean} True if value is an empty object, otherwise false
|
|
12418
|
+
*/
|
|
12419
|
+
const isEmptyObject = (val) => {
|
|
12420
|
+
// Early return for non-objects or Buffers to prevent RangeError
|
|
12421
|
+
if (!isObject(val) || isBuffer(val)) {
|
|
12422
|
+
return false;
|
|
12423
|
+
}
|
|
12424
|
+
|
|
12425
|
+
try {
|
|
12426
|
+
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
|
|
12427
|
+
} catch (e) {
|
|
12428
|
+
// Fallback for any other objects that might cause RangeError with Object.keys()
|
|
12429
|
+
return false;
|
|
12430
|
+
}
|
|
12431
|
+
};
|
|
12432
|
+
|
|
12347
12433
|
/**
|
|
12348
12434
|
* Determine if a value is a Date
|
|
12349
12435
|
*
|
|
@@ -12387,7 +12473,7 @@
|
|
|
12387
12473
|
*
|
|
12388
12474
|
* @returns {boolean} True if value is a Stream, otherwise false
|
|
12389
12475
|
*/
|
|
12390
|
-
const isStream = (val) => isObject(val) && isFunction(val.pipe);
|
|
12476
|
+
const isStream = (val) => isObject(val) && isFunction$1(val.pipe);
|
|
12391
12477
|
|
|
12392
12478
|
/**
|
|
12393
12479
|
* Determine if a value is a FormData
|
|
@@ -12400,10 +12486,10 @@
|
|
|
12400
12486
|
let kind;
|
|
12401
12487
|
return thing && (
|
|
12402
12488
|
(typeof FormData === 'function' && thing instanceof FormData) || (
|
|
12403
|
-
isFunction(thing.append) && (
|
|
12489
|
+
isFunction$1(thing.append) && (
|
|
12404
12490
|
(kind = kindOf(thing)) === 'formdata' ||
|
|
12405
12491
|
// detect form-data instance
|
|
12406
|
-
(kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
|
|
12492
|
+
(kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
|
|
12407
12493
|
)
|
|
12408
12494
|
)
|
|
12409
12495
|
)
|
|
@@ -12466,6 +12552,11 @@
|
|
|
12466
12552
|
fn.call(null, obj[i], i, obj);
|
|
12467
12553
|
}
|
|
12468
12554
|
} else {
|
|
12555
|
+
// Buffer check
|
|
12556
|
+
if (isBuffer(obj)) {
|
|
12557
|
+
return;
|
|
12558
|
+
}
|
|
12559
|
+
|
|
12469
12560
|
// Iterate over object keys
|
|
12470
12561
|
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
|
12471
12562
|
const len = keys.length;
|
|
@@ -12479,6 +12570,10 @@
|
|
|
12479
12570
|
}
|
|
12480
12571
|
|
|
12481
12572
|
function findKey(obj, key) {
|
|
12573
|
+
if (isBuffer(obj)){
|
|
12574
|
+
return null;
|
|
12575
|
+
}
|
|
12576
|
+
|
|
12482
12577
|
key = key.toLowerCase();
|
|
12483
12578
|
const keys = Object.keys(obj);
|
|
12484
12579
|
let i = keys.length;
|
|
@@ -12519,7 +12614,7 @@
|
|
|
12519
12614
|
* @returns {Object} Result of all merge properties
|
|
12520
12615
|
*/
|
|
12521
12616
|
function merge(/* obj1, obj2, obj3, ... */) {
|
|
12522
|
-
const {caseless} = isContextDefined(this) && this || {};
|
|
12617
|
+
const {caseless, skipUndefined} = isContextDefined(this) && this || {};
|
|
12523
12618
|
const result = {};
|
|
12524
12619
|
const assignValue = (val, key) => {
|
|
12525
12620
|
const targetKey = caseless && findKey(result, key) || key;
|
|
@@ -12529,7 +12624,7 @@
|
|
|
12529
12624
|
result[targetKey] = merge({}, val);
|
|
12530
12625
|
} else if (isArray(val)) {
|
|
12531
12626
|
result[targetKey] = val.slice();
|
|
12532
|
-
} else {
|
|
12627
|
+
} else if (!skipUndefined || !isUndefined(val)) {
|
|
12533
12628
|
result[targetKey] = val;
|
|
12534
12629
|
}
|
|
12535
12630
|
};
|
|
@@ -12552,7 +12647,7 @@
|
|
|
12552
12647
|
*/
|
|
12553
12648
|
const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
|
|
12554
12649
|
forEach(b, (val, key) => {
|
|
12555
|
-
if (thisArg && isFunction(val)) {
|
|
12650
|
+
if (thisArg && isFunction$1(val)) {
|
|
12556
12651
|
a[key] = bind(val, thisArg);
|
|
12557
12652
|
} else {
|
|
12558
12653
|
a[key] = val;
|
|
@@ -12768,13 +12863,13 @@
|
|
|
12768
12863
|
const freezeMethods = (obj) => {
|
|
12769
12864
|
reduceDescriptors(obj, (descriptor, name) => {
|
|
12770
12865
|
// skip restricted props in strict mode
|
|
12771
|
-
if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
|
|
12866
|
+
if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
|
|
12772
12867
|
return false;
|
|
12773
12868
|
}
|
|
12774
12869
|
|
|
12775
12870
|
const value = obj[name];
|
|
12776
12871
|
|
|
12777
|
-
if (!isFunction(value)) return;
|
|
12872
|
+
if (!isFunction$1(value)) return;
|
|
12778
12873
|
|
|
12779
12874
|
descriptor.enumerable = false;
|
|
12780
12875
|
|
|
@@ -12811,6 +12906,8 @@
|
|
|
12811
12906
|
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
12812
12907
|
};
|
|
12813
12908
|
|
|
12909
|
+
|
|
12910
|
+
|
|
12814
12911
|
/**
|
|
12815
12912
|
* If the thing is a FormData object, return true, otherwise return false.
|
|
12816
12913
|
*
|
|
@@ -12819,7 +12916,7 @@
|
|
|
12819
12916
|
* @returns {boolean}
|
|
12820
12917
|
*/
|
|
12821
12918
|
function isSpecCompliantForm(thing) {
|
|
12822
|
-
return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
|
|
12919
|
+
return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
|
|
12823
12920
|
}
|
|
12824
12921
|
|
|
12825
12922
|
const toJSONObject = (obj) => {
|
|
@@ -12832,6 +12929,11 @@
|
|
|
12832
12929
|
return;
|
|
12833
12930
|
}
|
|
12834
12931
|
|
|
12932
|
+
//Buffer check
|
|
12933
|
+
if (isBuffer(source)) {
|
|
12934
|
+
return source;
|
|
12935
|
+
}
|
|
12936
|
+
|
|
12835
12937
|
if(!('toJSON' in source)) {
|
|
12836
12938
|
stack[i] = source;
|
|
12837
12939
|
const target = isArray(source) ? [] : {};
|
|
@@ -12856,7 +12958,7 @@
|
|
|
12856
12958
|
const isAsyncFn = kindOfTest('AsyncFunction');
|
|
12857
12959
|
|
|
12858
12960
|
const isThenable = (thing) =>
|
|
12859
|
-
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
|
12961
|
+
thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
|
|
12860
12962
|
|
|
12861
12963
|
// original code
|
|
12862
12964
|
// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
|
|
@@ -12880,7 +12982,7 @@
|
|
|
12880
12982
|
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
12881
12983
|
})(
|
|
12882
12984
|
typeof setImmediate === 'function',
|
|
12883
|
-
isFunction(_global.postMessage)
|
|
12985
|
+
isFunction$1(_global.postMessage)
|
|
12884
12986
|
);
|
|
12885
12987
|
|
|
12886
12988
|
const asap = typeof queueMicrotask !== 'undefined' ?
|
|
@@ -12889,7 +12991,7 @@
|
|
|
12889
12991
|
// *********************
|
|
12890
12992
|
|
|
12891
12993
|
|
|
12892
|
-
const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
|
|
12994
|
+
const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
|
|
12893
12995
|
|
|
12894
12996
|
|
|
12895
12997
|
const utils$1 = {
|
|
@@ -12903,6 +13005,7 @@
|
|
|
12903
13005
|
isBoolean,
|
|
12904
13006
|
isObject,
|
|
12905
13007
|
isPlainObject,
|
|
13008
|
+
isEmptyObject,
|
|
12906
13009
|
isReadableStream,
|
|
12907
13010
|
isRequest,
|
|
12908
13011
|
isResponse,
|
|
@@ -12912,7 +13015,7 @@
|
|
|
12912
13015
|
isFile,
|
|
12913
13016
|
isBlob,
|
|
12914
13017
|
isRegExp,
|
|
12915
|
-
isFunction,
|
|
13018
|
+
isFunction: isFunction$1,
|
|
12916
13019
|
isStream,
|
|
12917
13020
|
isURLSearchParams,
|
|
12918
13021
|
isTypedArray,
|
|
@@ -13038,11 +13141,18 @@
|
|
|
13038
13141
|
return prop !== 'isAxiosError';
|
|
13039
13142
|
});
|
|
13040
13143
|
|
|
13041
|
-
|
|
13144
|
+
const msg = error && error.message ? error.message : 'Error';
|
|
13042
13145
|
|
|
13043
|
-
|
|
13146
|
+
// Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)
|
|
13147
|
+
const errCode = code == null && error ? error.code : code;
|
|
13148
|
+
AxiosError$1.call(axiosError, msg, errCode, config, request, response);
|
|
13044
13149
|
|
|
13045
|
-
|
|
13150
|
+
// Chain the original error on the standard field; non-enumerable to avoid JSON noise
|
|
13151
|
+
if (error && axiosError.cause == null) {
|
|
13152
|
+
Object.defineProperty(axiosError, 'cause', { value: error, configurable: true });
|
|
13153
|
+
}
|
|
13154
|
+
|
|
13155
|
+
axiosError.name = (error && error.name) || 'Error';
|
|
13046
13156
|
|
|
13047
13157
|
customProps && Object.assign(axiosError, customProps);
|
|
13048
13158
|
|
|
@@ -13333,9 +13443,7 @@
|
|
|
13333
13443
|
replace(/%3A/gi, ':').
|
|
13334
13444
|
replace(/%24/g, '$').
|
|
13335
13445
|
replace(/%2C/gi, ',').
|
|
13336
|
-
replace(/%20/g, '+')
|
|
13337
|
-
replace(/%5B/gi, '[').
|
|
13338
|
-
replace(/%5D/gi, ']');
|
|
13446
|
+
replace(/%20/g, '+');
|
|
13339
13447
|
}
|
|
13340
13448
|
|
|
13341
13449
|
/**
|
|
@@ -13534,7 +13642,7 @@
|
|
|
13534
13642
|
};
|
|
13535
13643
|
|
|
13536
13644
|
function toURLEncodedForm(data, options) {
|
|
13537
|
-
return toFormData$1(data, new platform.classes.URLSearchParams(),
|
|
13645
|
+
return toFormData$1(data, new platform.classes.URLSearchParams(), {
|
|
13538
13646
|
visitor: function(value, key, path, helpers) {
|
|
13539
13647
|
if (platform.isNode && utils$1.isBuffer(value)) {
|
|
13540
13648
|
this.append(key, value.toString('base64'));
|
|
@@ -13542,8 +13650,9 @@
|
|
|
13542
13650
|
}
|
|
13543
13651
|
|
|
13544
13652
|
return helpers.defaultVisitor.apply(this, arguments);
|
|
13545
|
-
}
|
|
13546
|
-
|
|
13653
|
+
},
|
|
13654
|
+
...options
|
|
13655
|
+
});
|
|
13547
13656
|
}
|
|
13548
13657
|
|
|
13549
13658
|
/**
|
|
@@ -13739,7 +13848,7 @@
|
|
|
13739
13848
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
13740
13849
|
|
|
13741
13850
|
try {
|
|
13742
|
-
return JSON.parse(data);
|
|
13851
|
+
return JSON.parse(data, this.parseReviver);
|
|
13743
13852
|
} catch (e) {
|
|
13744
13853
|
if (strictJSONParsing) {
|
|
13745
13854
|
if (e.name === 'SyntaxError') {
|
|
@@ -14296,7 +14405,7 @@
|
|
|
14296
14405
|
clearTimeout(timer);
|
|
14297
14406
|
timer = null;
|
|
14298
14407
|
}
|
|
14299
|
-
fn
|
|
14408
|
+
fn(...args);
|
|
14300
14409
|
};
|
|
14301
14410
|
|
|
14302
14411
|
const throttled = (...args) => {
|
|
@@ -14552,7 +14661,7 @@
|
|
|
14552
14661
|
headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
|
|
14553
14662
|
};
|
|
14554
14663
|
|
|
14555
|
-
utils$1.forEach(Object.keys(
|
|
14664
|
+
utils$1.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
|
|
14556
14665
|
const merge = mergeMap[prop] || mergeDeepProperties;
|
|
14557
14666
|
const configValue = merge(config1[prop], config2[prop], prop);
|
|
14558
14667
|
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
@@ -14564,7 +14673,7 @@
|
|
|
14564
14673
|
const resolveConfig = (config) => {
|
|
14565
14674
|
const newConfig = mergeConfig$1({}, config);
|
|
14566
14675
|
|
|
14567
|
-
let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
|
|
14676
|
+
let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
|
|
14568
14677
|
|
|
14569
14678
|
newConfig.headers = headers = AxiosHeaders$2.from(headers);
|
|
14570
14679
|
|
|
@@ -14577,17 +14686,21 @@
|
|
|
14577
14686
|
);
|
|
14578
14687
|
}
|
|
14579
14688
|
|
|
14580
|
-
let contentType;
|
|
14581
|
-
|
|
14582
14689
|
if (utils$1.isFormData(data)) {
|
|
14583
14690
|
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
14584
|
-
headers.setContentType(undefined); //
|
|
14585
|
-
} else if ((
|
|
14586
|
-
//
|
|
14587
|
-
const
|
|
14588
|
-
headers
|
|
14691
|
+
headers.setContentType(undefined); // browser handles it
|
|
14692
|
+
} else if (utils$1.isFunction(data.getHeaders)) {
|
|
14693
|
+
// Node.js FormData (like form-data package)
|
|
14694
|
+
const formHeaders = data.getHeaders();
|
|
14695
|
+
// Only set safe headers to avoid overwriting security headers
|
|
14696
|
+
const allowedHeaders = ['content-type', 'content-length'];
|
|
14697
|
+
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
14698
|
+
if (allowedHeaders.includes(key.toLowerCase())) {
|
|
14699
|
+
headers.set(key, val);
|
|
14700
|
+
}
|
|
14701
|
+
});
|
|
14589
14702
|
}
|
|
14590
|
-
}
|
|
14703
|
+
}
|
|
14591
14704
|
|
|
14592
14705
|
// Add xsrf header
|
|
14593
14706
|
// This is only done if running in a standard browser environment.
|
|
@@ -14704,15 +14817,18 @@
|
|
|
14704
14817
|
};
|
|
14705
14818
|
|
|
14706
14819
|
// Handle low level network errors
|
|
14707
|
-
|
|
14708
|
-
|
|
14709
|
-
|
|
14710
|
-
|
|
14711
|
-
|
|
14712
|
-
|
|
14713
|
-
|
|
14820
|
+
request.onerror = function handleError(event) {
|
|
14821
|
+
// Browsers deliver a ProgressEvent in XHR onerror
|
|
14822
|
+
// (message may be empty; when present, surface it)
|
|
14823
|
+
// See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
|
|
14824
|
+
const msg = event && event.message ? event.message : 'Network Error';
|
|
14825
|
+
const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
|
|
14826
|
+
// attach the underlying event for consumers who want details
|
|
14827
|
+
err.event = event || null;
|
|
14828
|
+
reject(err);
|
|
14829
|
+
request = null;
|
|
14714
14830
|
};
|
|
14715
|
-
|
|
14831
|
+
|
|
14716
14832
|
// Handle timeout
|
|
14717
14833
|
request.ontimeout = function handleTimeout() {
|
|
14718
14834
|
let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
@@ -14928,14 +15044,18 @@
|
|
|
14928
15044
|
})
|
|
14929
15045
|
};
|
|
14930
15046
|
|
|
14931
|
-
const
|
|
14932
|
-
|
|
15047
|
+
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
15048
|
+
|
|
15049
|
+
const {isFunction} = utils$1;
|
|
15050
|
+
|
|
15051
|
+
const globalFetchAPI = (({Request, Response}) => ({
|
|
15052
|
+
Request, Response
|
|
15053
|
+
}))(utils$1.global);
|
|
15054
|
+
|
|
15055
|
+
const {
|
|
15056
|
+
ReadableStream: ReadableStream$1, TextEncoder
|
|
15057
|
+
} = utils$1.global;
|
|
14933
15058
|
|
|
14934
|
-
// used only inside the fetch adapter
|
|
14935
|
-
const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
|
|
14936
|
-
((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
|
|
14937
|
-
async (str) => new Uint8Array(await new Response(str).arrayBuffer())
|
|
14938
|
-
);
|
|
14939
15059
|
|
|
14940
15060
|
const test = (fn, ...args) => {
|
|
14941
15061
|
try {
|
|
@@ -14945,211 +15065,268 @@
|
|
|
14945
15065
|
}
|
|
14946
15066
|
};
|
|
14947
15067
|
|
|
14948
|
-
const
|
|
14949
|
-
|
|
15068
|
+
const factory = (env) => {
|
|
15069
|
+
env = utils$1.merge.call({
|
|
15070
|
+
skipUndefined: true
|
|
15071
|
+
}, globalFetchAPI, env);
|
|
14950
15072
|
|
|
14951
|
-
const
|
|
14952
|
-
|
|
14953
|
-
|
|
14954
|
-
|
|
14955
|
-
duplexAccessed = true;
|
|
14956
|
-
return 'half';
|
|
14957
|
-
},
|
|
14958
|
-
}).headers.has('Content-Type');
|
|
15073
|
+
const {fetch: envFetch, Request, Response} = env;
|
|
15074
|
+
const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
|
|
15075
|
+
const isRequestSupported = isFunction(Request);
|
|
15076
|
+
const isResponseSupported = isFunction(Response);
|
|
14959
15077
|
|
|
14960
|
-
|
|
14961
|
-
|
|
15078
|
+
if (!isFetchSupported) {
|
|
15079
|
+
return false;
|
|
15080
|
+
}
|
|
14962
15081
|
|
|
14963
|
-
|
|
15082
|
+
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
|
|
14964
15083
|
|
|
14965
|
-
|
|
14966
|
-
|
|
15084
|
+
const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
|
|
15085
|
+
((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
|
|
15086
|
+
async (str) => new Uint8Array(await new Request(str).arrayBuffer())
|
|
15087
|
+
);
|
|
14967
15088
|
|
|
15089
|
+
const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
|
|
15090
|
+
let duplexAccessed = false;
|
|
14968
15091
|
|
|
14969
|
-
|
|
14970
|
-
|
|
14971
|
-
|
|
15092
|
+
const hasContentType = new Request(platform.origin, {
|
|
15093
|
+
body: new ReadableStream$1(),
|
|
15094
|
+
method: 'POST',
|
|
15095
|
+
get duplex() {
|
|
15096
|
+
duplexAccessed = true;
|
|
15097
|
+
return 'half';
|
|
15098
|
+
},
|
|
15099
|
+
}).headers.has('Content-Type');
|
|
14972
15100
|
|
|
14973
|
-
|
|
14974
|
-
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
|
|
14975
|
-
!resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() :
|
|
14976
|
-
(_, config) => {
|
|
14977
|
-
throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
|
|
14978
|
-
});
|
|
15101
|
+
return duplexAccessed && !hasContentType;
|
|
14979
15102
|
});
|
|
14980
|
-
})(new Response));
|
|
14981
15103
|
|
|
14982
|
-
|
|
14983
|
-
|
|
14984
|
-
return 0;
|
|
14985
|
-
}
|
|
15104
|
+
const supportsResponseStream = isResponseSupported && isReadableStreamSupported &&
|
|
15105
|
+
test(() => utils$1.isReadableStream(new Response('').body));
|
|
14986
15106
|
|
|
14987
|
-
|
|
14988
|
-
|
|
14989
|
-
}
|
|
15107
|
+
const resolvers = {
|
|
15108
|
+
stream: supportsResponseStream && ((res) => res.body)
|
|
15109
|
+
};
|
|
14990
15110
|
|
|
14991
|
-
|
|
14992
|
-
|
|
14993
|
-
|
|
14994
|
-
|
|
15111
|
+
isFetchSupported && ((() => {
|
|
15112
|
+
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
|
|
15113
|
+
!resolvers[type] && (resolvers[type] = (res, config) => {
|
|
15114
|
+
let method = res && res[type];
|
|
15115
|
+
|
|
15116
|
+
if (method) {
|
|
15117
|
+
return method.call(res);
|
|
15118
|
+
}
|
|
15119
|
+
|
|
15120
|
+
throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
|
|
15121
|
+
});
|
|
14995
15122
|
});
|
|
14996
|
-
|
|
14997
|
-
}
|
|
15123
|
+
})());
|
|
14998
15124
|
|
|
14999
|
-
|
|
15000
|
-
|
|
15001
|
-
|
|
15125
|
+
const getBodyLength = async (body) => {
|
|
15126
|
+
if (body == null) {
|
|
15127
|
+
return 0;
|
|
15128
|
+
}
|
|
15002
15129
|
|
|
15003
|
-
|
|
15004
|
-
|
|
15005
|
-
|
|
15130
|
+
if (utils$1.isBlob(body)) {
|
|
15131
|
+
return body.size;
|
|
15132
|
+
}
|
|
15006
15133
|
|
|
15007
|
-
|
|
15008
|
-
|
|
15009
|
-
|
|
15010
|
-
|
|
15134
|
+
if (utils$1.isSpecCompliantForm(body)) {
|
|
15135
|
+
const _request = new Request(platform.origin, {
|
|
15136
|
+
method: 'POST',
|
|
15137
|
+
body,
|
|
15138
|
+
});
|
|
15139
|
+
return (await _request.arrayBuffer()).byteLength;
|
|
15140
|
+
}
|
|
15011
15141
|
|
|
15012
|
-
|
|
15013
|
-
|
|
15142
|
+
if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
|
|
15143
|
+
return body.byteLength;
|
|
15144
|
+
}
|
|
15014
15145
|
|
|
15015
|
-
|
|
15016
|
-
|
|
15146
|
+
if (utils$1.isURLSearchParams(body)) {
|
|
15147
|
+
body = body + '';
|
|
15148
|
+
}
|
|
15017
15149
|
|
|
15018
|
-
|
|
15019
|
-
|
|
15020
|
-
|
|
15021
|
-
|
|
15022
|
-
data,
|
|
15023
|
-
signal,
|
|
15024
|
-
cancelToken,
|
|
15025
|
-
timeout,
|
|
15026
|
-
onDownloadProgress,
|
|
15027
|
-
onUploadProgress,
|
|
15028
|
-
responseType,
|
|
15029
|
-
headers,
|
|
15030
|
-
withCredentials = 'same-origin',
|
|
15031
|
-
fetchOptions
|
|
15032
|
-
} = resolveConfig(config);
|
|
15150
|
+
if (utils$1.isString(body)) {
|
|
15151
|
+
return (await encodeText(body)).byteLength;
|
|
15152
|
+
}
|
|
15153
|
+
};
|
|
15033
15154
|
|
|
15034
|
-
|
|
15155
|
+
const resolveBodyLength = async (headers, body) => {
|
|
15156
|
+
const length = utils$1.toFiniteNumber(headers.getContentLength());
|
|
15035
15157
|
|
|
15036
|
-
|
|
15158
|
+
return length == null ? getBodyLength(body) : length;
|
|
15159
|
+
};
|
|
15160
|
+
|
|
15161
|
+
return async (config) => {
|
|
15162
|
+
let {
|
|
15163
|
+
url,
|
|
15164
|
+
method,
|
|
15165
|
+
data,
|
|
15166
|
+
signal,
|
|
15167
|
+
cancelToken,
|
|
15168
|
+
timeout,
|
|
15169
|
+
onDownloadProgress,
|
|
15170
|
+
onUploadProgress,
|
|
15171
|
+
responseType,
|
|
15172
|
+
headers,
|
|
15173
|
+
withCredentials = 'same-origin',
|
|
15174
|
+
fetchOptions
|
|
15175
|
+
} = resolveConfig(config);
|
|
15176
|
+
|
|
15177
|
+
let _fetch = envFetch || fetch;
|
|
15178
|
+
|
|
15179
|
+
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
|
15037
15180
|
|
|
15038
|
-
|
|
15181
|
+
let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
15039
15182
|
|
|
15040
|
-
|
|
15183
|
+
let request = null;
|
|
15184
|
+
|
|
15185
|
+
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
15041
15186
|
composedSignal.unsubscribe();
|
|
15042
|
-
|
|
15187
|
+
});
|
|
15043
15188
|
|
|
15044
|
-
|
|
15189
|
+
let requestContentLength;
|
|
15045
15190
|
|
|
15046
|
-
|
|
15047
|
-
|
|
15048
|
-
|
|
15049
|
-
|
|
15050
|
-
|
|
15051
|
-
|
|
15052
|
-
|
|
15053
|
-
|
|
15054
|
-
|
|
15055
|
-
|
|
15191
|
+
try {
|
|
15192
|
+
if (
|
|
15193
|
+
onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
|
|
15194
|
+
(requestContentLength = await resolveBodyLength(headers, data)) !== 0
|
|
15195
|
+
) {
|
|
15196
|
+
let _request = new Request(url, {
|
|
15197
|
+
method: 'POST',
|
|
15198
|
+
body: data,
|
|
15199
|
+
duplex: "half"
|
|
15200
|
+
});
|
|
15056
15201
|
|
|
15057
|
-
|
|
15202
|
+
let contentTypeHeader;
|
|
15058
15203
|
|
|
15059
|
-
|
|
15060
|
-
|
|
15061
|
-
|
|
15204
|
+
if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
|
|
15205
|
+
headers.setContentType(contentTypeHeader);
|
|
15206
|
+
}
|
|
15062
15207
|
|
|
15063
|
-
|
|
15064
|
-
|
|
15065
|
-
|
|
15066
|
-
|
|
15067
|
-
|
|
15208
|
+
if (_request.body) {
|
|
15209
|
+
const [onProgress, flush] = progressEventDecorator(
|
|
15210
|
+
requestContentLength,
|
|
15211
|
+
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
15212
|
+
);
|
|
15068
15213
|
|
|
15069
|
-
|
|
15214
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
15215
|
+
}
|
|
15070
15216
|
}
|
|
15071
|
-
}
|
|
15072
15217
|
|
|
15073
|
-
|
|
15074
|
-
|
|
15075
|
-
|
|
15218
|
+
if (!utils$1.isString(withCredentials)) {
|
|
15219
|
+
withCredentials = withCredentials ? 'include' : 'omit';
|
|
15220
|
+
}
|
|
15076
15221
|
|
|
15077
|
-
|
|
15078
|
-
|
|
15079
|
-
|
|
15080
|
-
request = new Request(url, {
|
|
15081
|
-
...fetchOptions,
|
|
15082
|
-
signal: composedSignal,
|
|
15083
|
-
method: method.toUpperCase(),
|
|
15084
|
-
headers: headers.normalize().toJSON(),
|
|
15085
|
-
body: data,
|
|
15086
|
-
duplex: "half",
|
|
15087
|
-
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
15088
|
-
});
|
|
15222
|
+
// Cloudflare Workers throws when credentials are defined
|
|
15223
|
+
// see https://github.com/cloudflare/workerd/issues/902
|
|
15224
|
+
const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
|
|
15089
15225
|
|
|
15090
|
-
|
|
15226
|
+
const resolvedOptions = {
|
|
15227
|
+
...fetchOptions,
|
|
15228
|
+
signal: composedSignal,
|
|
15229
|
+
method: method.toUpperCase(),
|
|
15230
|
+
headers: headers.normalize().toJSON(),
|
|
15231
|
+
body: data,
|
|
15232
|
+
duplex: "half",
|
|
15233
|
+
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
15234
|
+
};
|
|
15091
15235
|
|
|
15092
|
-
|
|
15236
|
+
request = isRequestSupported && new Request(url, resolvedOptions);
|
|
15093
15237
|
|
|
15094
|
-
|
|
15095
|
-
const options = {};
|
|
15238
|
+
let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
|
|
15096
15239
|
|
|
15097
|
-
|
|
15098
|
-
options[prop] = response[prop];
|
|
15099
|
-
});
|
|
15240
|
+
const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
|
15100
15241
|
|
|
15101
|
-
|
|
15242
|
+
if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
|
|
15243
|
+
const options = {};
|
|
15102
15244
|
|
|
15103
|
-
|
|
15104
|
-
|
|
15105
|
-
|
|
15106
|
-
) || [];
|
|
15245
|
+
['status', 'statusText', 'headers'].forEach(prop => {
|
|
15246
|
+
options[prop] = response[prop];
|
|
15247
|
+
});
|
|
15107
15248
|
|
|
15108
|
-
|
|
15109
|
-
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
15110
|
-
flush && flush();
|
|
15111
|
-
unsubscribe && unsubscribe();
|
|
15112
|
-
}),
|
|
15113
|
-
options
|
|
15114
|
-
);
|
|
15115
|
-
}
|
|
15249
|
+
const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
|
|
15116
15250
|
|
|
15117
|
-
|
|
15251
|
+
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
|
15252
|
+
responseContentLength,
|
|
15253
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
15254
|
+
) || [];
|
|
15118
15255
|
|
|
15119
|
-
|
|
15256
|
+
response = new Response(
|
|
15257
|
+
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
15258
|
+
flush && flush();
|
|
15259
|
+
unsubscribe && unsubscribe();
|
|
15260
|
+
}),
|
|
15261
|
+
options
|
|
15262
|
+
);
|
|
15263
|
+
}
|
|
15120
15264
|
|
|
15121
|
-
|
|
15265
|
+
responseType = responseType || 'text';
|
|
15122
15266
|
|
|
15123
|
-
|
|
15124
|
-
settle(resolve, reject, {
|
|
15125
|
-
data: responseData,
|
|
15126
|
-
headers: AxiosHeaders$2.from(response.headers),
|
|
15127
|
-
status: response.status,
|
|
15128
|
-
statusText: response.statusText,
|
|
15129
|
-
config,
|
|
15130
|
-
request
|
|
15131
|
-
});
|
|
15132
|
-
})
|
|
15133
|
-
} catch (err) {
|
|
15134
|
-
unsubscribe && unsubscribe();
|
|
15267
|
+
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
|
|
15135
15268
|
|
|
15136
|
-
|
|
15137
|
-
|
|
15138
|
-
|
|
15139
|
-
{
|
|
15140
|
-
|
|
15141
|
-
|
|
15142
|
-
|
|
15269
|
+
!isStreamResponse && unsubscribe && unsubscribe();
|
|
15270
|
+
|
|
15271
|
+
return await new Promise((resolve, reject) => {
|
|
15272
|
+
settle(resolve, reject, {
|
|
15273
|
+
data: responseData,
|
|
15274
|
+
headers: AxiosHeaders$2.from(response.headers),
|
|
15275
|
+
status: response.status,
|
|
15276
|
+
statusText: response.statusText,
|
|
15277
|
+
config,
|
|
15278
|
+
request
|
|
15279
|
+
});
|
|
15280
|
+
})
|
|
15281
|
+
} catch (err) {
|
|
15282
|
+
unsubscribe && unsubscribe();
|
|
15283
|
+
|
|
15284
|
+
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
|
15285
|
+
throw Object.assign(
|
|
15286
|
+
new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request),
|
|
15287
|
+
{
|
|
15288
|
+
cause: err.cause || err
|
|
15289
|
+
}
|
|
15290
|
+
)
|
|
15291
|
+
}
|
|
15292
|
+
|
|
15293
|
+
throw AxiosError$1.from(err, err && err.code, config, request);
|
|
15143
15294
|
}
|
|
15295
|
+
}
|
|
15296
|
+
};
|
|
15297
|
+
|
|
15298
|
+
const seedCache = new Map();
|
|
15299
|
+
|
|
15300
|
+
const getFetch = (config) => {
|
|
15301
|
+
let env = config ? config.env : {};
|
|
15302
|
+
const {fetch, Request, Response} = env;
|
|
15303
|
+
const seeds = [
|
|
15304
|
+
Request, Response, fetch
|
|
15305
|
+
];
|
|
15306
|
+
|
|
15307
|
+
let len = seeds.length, i = len,
|
|
15308
|
+
seed, target, map = seedCache;
|
|
15144
15309
|
|
|
15145
|
-
|
|
15310
|
+
while (i--) {
|
|
15311
|
+
seed = seeds[i];
|
|
15312
|
+
target = map.get(seed);
|
|
15313
|
+
|
|
15314
|
+
target === undefined && map.set(seed, target = (i ? new Map() : factory(env)));
|
|
15315
|
+
|
|
15316
|
+
map = target;
|
|
15146
15317
|
}
|
|
15147
|
-
|
|
15318
|
+
|
|
15319
|
+
return target;
|
|
15320
|
+
};
|
|
15321
|
+
|
|
15322
|
+
getFetch();
|
|
15148
15323
|
|
|
15149
15324
|
const knownAdapters = {
|
|
15150
15325
|
http: httpAdapter,
|
|
15151
15326
|
xhr: xhrAdapter,
|
|
15152
|
-
fetch:
|
|
15327
|
+
fetch: {
|
|
15328
|
+
get: getFetch,
|
|
15329
|
+
}
|
|
15153
15330
|
};
|
|
15154
15331
|
|
|
15155
15332
|
utils$1.forEach(knownAdapters, (fn, value) => {
|
|
@@ -15168,7 +15345,7 @@
|
|
|
15168
15345
|
const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
|
15169
15346
|
|
|
15170
15347
|
const adapters = {
|
|
15171
|
-
getAdapter: (adapters) => {
|
|
15348
|
+
getAdapter: (adapters, config) => {
|
|
15172
15349
|
adapters = utils$1.isArray(adapters) ? adapters : [adapters];
|
|
15173
15350
|
|
|
15174
15351
|
const {length} = adapters;
|
|
@@ -15191,7 +15368,7 @@
|
|
|
15191
15368
|
}
|
|
15192
15369
|
}
|
|
15193
15370
|
|
|
15194
|
-
if (adapter) {
|
|
15371
|
+
if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
|
|
15195
15372
|
break;
|
|
15196
15373
|
}
|
|
15197
15374
|
|
|
@@ -15259,7 +15436,7 @@
|
|
|
15259
15436
|
config.headers.setContentType('application/x-www-form-urlencoded', false);
|
|
15260
15437
|
}
|
|
15261
15438
|
|
|
15262
|
-
const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
|
|
15439
|
+
const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter, config);
|
|
15263
15440
|
|
|
15264
15441
|
return adapter(config).then(function onAdapterResolution(response) {
|
|
15265
15442
|
throwIfCancellationRequested(config);
|
|
@@ -15293,7 +15470,7 @@
|
|
|
15293
15470
|
});
|
|
15294
15471
|
}
|
|
15295
15472
|
|
|
15296
|
-
const VERSION$1 = "1.
|
|
15473
|
+
const VERSION$1 = "1.12.2";
|
|
15297
15474
|
|
|
15298
15475
|
const validators$1 = {};
|
|
15299
15476
|
|
|
@@ -15532,8 +15709,8 @@
|
|
|
15532
15709
|
|
|
15533
15710
|
if (!synchronousRequestInterceptors) {
|
|
15534
15711
|
const chain = [dispatchRequest.bind(this), undefined];
|
|
15535
|
-
chain.unshift
|
|
15536
|
-
chain.push
|
|
15712
|
+
chain.unshift(...requestInterceptorChain);
|
|
15713
|
+
chain.push(...responseInterceptorChain);
|
|
15537
15714
|
len = chain.length;
|
|
15538
15715
|
|
|
15539
15716
|
promise = Promise.resolve(config);
|
|
@@ -15549,8 +15726,6 @@
|
|
|
15549
15726
|
|
|
15550
15727
|
let newConfig = config;
|
|
15551
15728
|
|
|
15552
|
-
i = 0;
|
|
15553
|
-
|
|
15554
15729
|
while (i < len) {
|
|
15555
15730
|
const onFulfilled = requestInterceptorChain[i++];
|
|
15556
15731
|
const onRejected = requestInterceptorChain[i++];
|
|
@@ -16282,11 +16457,11 @@
|
|
|
16282
16457
|
get customers() {
|
|
16283
16458
|
return new CustomersAccessor(this);
|
|
16284
16459
|
}
|
|
16285
|
-
|
|
16286
|
-
return new
|
|
16460
|
+
package(selector) {
|
|
16461
|
+
return new PackageAccessor(this, selector);
|
|
16287
16462
|
}
|
|
16288
|
-
get
|
|
16289
|
-
return new
|
|
16463
|
+
get packages() {
|
|
16464
|
+
return new PackagesAccessor(this);
|
|
16290
16465
|
}
|
|
16291
16466
|
async createEventSource(uri, queryParams) {
|
|
16292
16467
|
return super.createEventSource(uri, queryParams);
|