ueberdb2 4.2.92 → 4.2.93
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/index.js +829 -432
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -13691,7 +13691,7 @@ const batchType = {
|
|
|
13691
13691
|
/**
|
|
13692
13692
|
* Abstract class Request
|
|
13693
13693
|
*/
|
|
13694
|
-
let Request$
|
|
13694
|
+
let Request$3=class Request {
|
|
13695
13695
|
constructor() {
|
|
13696
13696
|
this.length = 0;
|
|
13697
13697
|
}
|
|
@@ -13729,7 +13729,7 @@ let Request$2=class Request {
|
|
|
13729
13729
|
* @param {Array} params
|
|
13730
13730
|
* @param options
|
|
13731
13731
|
*/
|
|
13732
|
-
let ExecuteRequest$1=class ExecuteRequest extends Request$
|
|
13732
|
+
let ExecuteRequest$1=class ExecuteRequest extends Request$3 {
|
|
13733
13733
|
/**
|
|
13734
13734
|
* @param {String} query
|
|
13735
13735
|
* @param queryId
|
|
@@ -13907,7 +13907,7 @@ let QueryRequest$1=class QueryRequest extends ExecuteRequest$1 {
|
|
|
13907
13907
|
}
|
|
13908
13908
|
};
|
|
13909
13909
|
|
|
13910
|
-
class PrepareRequest extends Request$
|
|
13910
|
+
class PrepareRequest extends Request$3 {
|
|
13911
13911
|
constructor(query, keyspace) {
|
|
13912
13912
|
super();
|
|
13913
13913
|
this.query = query;
|
|
@@ -13928,7 +13928,7 @@ class PrepareRequest extends Request$2 {
|
|
|
13928
13928
|
}
|
|
13929
13929
|
}
|
|
13930
13930
|
|
|
13931
|
-
class StartupRequest extends Request$
|
|
13931
|
+
class StartupRequest extends Request$3 {
|
|
13932
13932
|
|
|
13933
13933
|
/**
|
|
13934
13934
|
* Creates a new instance of {@link StartupRequest}.
|
|
@@ -13974,7 +13974,7 @@ class StartupRequest extends Request$2 {
|
|
|
13974
13974
|
}
|
|
13975
13975
|
}
|
|
13976
13976
|
|
|
13977
|
-
class RegisterRequest extends Request$
|
|
13977
|
+
class RegisterRequest extends Request$3 {
|
|
13978
13978
|
constructor(events) {
|
|
13979
13979
|
super();
|
|
13980
13980
|
this.events = events;
|
|
@@ -13991,7 +13991,7 @@ class RegisterRequest extends Request$2 {
|
|
|
13991
13991
|
* Represents an AUTH_RESPONSE request
|
|
13992
13992
|
* @param {Buffer} token
|
|
13993
13993
|
*/
|
|
13994
|
-
class AuthResponseRequest extends Request$
|
|
13994
|
+
class AuthResponseRequest extends Request$3 {
|
|
13995
13995
|
constructor(token) {
|
|
13996
13996
|
super();
|
|
13997
13997
|
this.token = token;
|
|
@@ -14007,7 +14007,7 @@ class AuthResponseRequest extends Request$2 {
|
|
|
14007
14007
|
/**
|
|
14008
14008
|
* Represents a protocol v1 CREDENTIALS request message
|
|
14009
14009
|
*/
|
|
14010
|
-
class CredentialsRequest extends Request$
|
|
14010
|
+
class CredentialsRequest extends Request$3 {
|
|
14011
14011
|
constructor(username, password) {
|
|
14012
14012
|
super();
|
|
14013
14013
|
this.username = username;
|
|
@@ -14021,7 +14021,7 @@ class CredentialsRequest extends Request$2 {
|
|
|
14021
14021
|
}
|
|
14022
14022
|
}
|
|
14023
14023
|
|
|
14024
|
-
class BatchRequest extends Request$
|
|
14024
|
+
class BatchRequest extends Request$3 {
|
|
14025
14025
|
/**
|
|
14026
14026
|
* Creates a new instance of BatchRequest.
|
|
14027
14027
|
* @param {Array.<{query, params, [info]}>} queries Array of objects with the properties query and params
|
|
@@ -14129,7 +14129,7 @@ function CancelRequest(operationId) {
|
|
|
14129
14129
|
this.operationId = operationId;
|
|
14130
14130
|
}
|
|
14131
14131
|
|
|
14132
|
-
util$M.inherits(CancelRequest, Request$
|
|
14132
|
+
util$M.inherits(CancelRequest, Request$3);
|
|
14133
14133
|
|
|
14134
14134
|
CancelRequest.prototype.write = function (encoder, streamId) {
|
|
14135
14135
|
const frameWriter = new FrameWriter(types$x.opcodes.cancel);
|
|
@@ -14138,7 +14138,7 @@ CancelRequest.prototype.write = function (encoder, streamId) {
|
|
|
14138
14138
|
return frameWriter.write(encoder.protocolVersion, streamId);
|
|
14139
14139
|
};
|
|
14140
14140
|
|
|
14141
|
-
class OptionsRequest extends Request$
|
|
14141
|
+
class OptionsRequest extends Request$3 {
|
|
14142
14142
|
|
|
14143
14143
|
write(encoder, streamId) {
|
|
14144
14144
|
const frameWriter = new FrameWriter(types$x.opcodes.options);
|
|
@@ -14160,7 +14160,7 @@ requests$7.CredentialsRequest = CredentialsRequest;
|
|
|
14160
14160
|
requests$7.ExecuteRequest = ExecuteRequest$1;
|
|
14161
14161
|
requests$7.PrepareRequest = PrepareRequest;
|
|
14162
14162
|
requests$7.QueryRequest = QueryRequest$1;
|
|
14163
|
-
requests$7.Request = Request$
|
|
14163
|
+
requests$7.Request = Request$3;
|
|
14164
14164
|
requests$7.RegisterRequest = RegisterRequest;
|
|
14165
14165
|
requests$7.StartupRequest = StartupRequest;
|
|
14166
14166
|
requests$7.options = options$1;/*
|
|
@@ -38215,7 +38215,7 @@ var hasSymbols$1 = function hasNativeSymbols() {
|
|
|
38215
38215
|
if (typeof Symbol('bar') !== 'symbol') { return false; }
|
|
38216
38216
|
|
|
38217
38217
|
return hasSymbolSham();
|
|
38218
|
-
};var test = {
|
|
38218
|
+
};var test$1 = {
|
|
38219
38219
|
__proto__: null,
|
|
38220
38220
|
foo: {}
|
|
38221
38221
|
};
|
|
@@ -38225,8 +38225,8 @@ var $Object = Object;
|
|
|
38225
38225
|
/** @type {import('.')} */
|
|
38226
38226
|
var hasProto$1 = function hasProto() {
|
|
38227
38227
|
// @ts-expect-error: TS errors on an inherited property for some reason
|
|
38228
|
-
return { __proto__: test }.foo === test.foo
|
|
38229
|
-
&& !(test instanceof $Object);
|
|
38228
|
+
return { __proto__: test$1 }.foo === test$1.foo
|
|
38229
|
+
&& !(test$1 instanceof $Object);
|
|
38230
38230
|
};/* eslint no-invalid-this: 1 */
|
|
38231
38231
|
|
|
38232
38232
|
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
|
|
@@ -40169,6 +40169,7 @@ var defaults$6 = {
|
|
|
40169
40169
|
parameterLimit: 1000,
|
|
40170
40170
|
parseArrays: true,
|
|
40171
40171
|
plainObjects: false,
|
|
40172
|
+
strictDepth: false,
|
|
40172
40173
|
strictNullHandling: false
|
|
40173
40174
|
};
|
|
40174
40175
|
|
|
@@ -40200,6 +40201,7 @@ var parseValues = function parseQueryStringValues(str, options) {
|
|
|
40200
40201
|
var obj = { __proto__: null };
|
|
40201
40202
|
|
|
40202
40203
|
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
|
40204
|
+
cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');
|
|
40203
40205
|
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
|
40204
40206
|
var parts = cleanStr.split(options.delimiter, limit);
|
|
40205
40207
|
var skipIndex = -1; // Keep track of where the utf8 sentinel was found
|
|
@@ -40270,7 +40272,9 @@ var parseObject = function (chain, val, options, valuesParsed) {
|
|
|
40270
40272
|
var root = chain[i];
|
|
40271
40273
|
|
|
40272
40274
|
if (root === '[]' && options.parseArrays) {
|
|
40273
|
-
obj = options.allowEmptyArrays && leaf === ''
|
|
40275
|
+
obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))
|
|
40276
|
+
? []
|
|
40277
|
+
: [].concat(leaf);
|
|
40274
40278
|
} else {
|
|
40275
40279
|
obj = options.plainObjects ? Object.create(null) : {};
|
|
40276
40280
|
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
|
@@ -40343,9 +40347,12 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesPars
|
|
|
40343
40347
|
keys.push(segment[1]);
|
|
40344
40348
|
}
|
|
40345
40349
|
|
|
40346
|
-
// If there's a remainder, just add whatever is left
|
|
40350
|
+
// If there's a remainder, check strictDepth option for throw, else just add whatever is left
|
|
40347
40351
|
|
|
40348
40352
|
if (segment) {
|
|
40353
|
+
if (options.strictDepth === true) {
|
|
40354
|
+
throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
|
|
40355
|
+
}
|
|
40349
40356
|
keys.push('[' + key.slice(segment.index) + ']');
|
|
40350
40357
|
}
|
|
40351
40358
|
|
|
@@ -40402,6 +40409,7 @@ var normalizeParseOptions = function normalizeParseOptions(opts) {
|
|
|
40402
40409
|
parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults$6.parameterLimit,
|
|
40403
40410
|
parseArrays: opts.parseArrays !== false,
|
|
40404
40411
|
plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults$6.plainObjects,
|
|
40412
|
+
strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults$6.strictDepth,
|
|
40405
40413
|
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$6.strictNullHandling
|
|
40406
40414
|
};
|
|
40407
40415
|
};
|
|
@@ -54513,6 +54521,8 @@ const isFormData = (thing) => {
|
|
|
54513
54521
|
*/
|
|
54514
54522
|
const isURLSearchParams = kindOfTest('URLSearchParams');
|
|
54515
54523
|
|
|
54524
|
+
const [isReadableStream$1, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
|
|
54525
|
+
|
|
54516
54526
|
/**
|
|
54517
54527
|
* Trim excess whitespace off the beginning and end of a string
|
|
54518
54528
|
*
|
|
@@ -54901,8 +54911,7 @@ const toObjectSet = (arrayOrString, delimiter) => {
|
|
|
54901
54911
|
const noop$1 = () => {};
|
|
54902
54912
|
|
|
54903
54913
|
const toFiniteNumber = (value, defaultValue) => {
|
|
54904
|
-
value = +value;
|
|
54905
|
-
return Number.isFinite(value) ? value : defaultValue;
|
|
54914
|
+
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
54906
54915
|
};
|
|
54907
54916
|
|
|
54908
54917
|
const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
|
|
@@ -54972,6 +54981,36 @@ const isAsyncFn = kindOfTest('AsyncFunction');
|
|
|
54972
54981
|
const isThenable = (thing) =>
|
|
54973
54982
|
thing && (isObject$8(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
|
|
54974
54983
|
|
|
54984
|
+
// original code
|
|
54985
|
+
// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
|
|
54986
|
+
|
|
54987
|
+
const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
54988
|
+
if (setImmediateSupported) {
|
|
54989
|
+
return setImmediate;
|
|
54990
|
+
}
|
|
54991
|
+
|
|
54992
|
+
return postMessageSupported ? ((token, callbacks) => {
|
|
54993
|
+
_global.addEventListener("message", ({source, data}) => {
|
|
54994
|
+
if (source === _global && data === token) {
|
|
54995
|
+
callbacks.length && callbacks.shift()();
|
|
54996
|
+
}
|
|
54997
|
+
}, false);
|
|
54998
|
+
|
|
54999
|
+
return (cb) => {
|
|
55000
|
+
callbacks.push(cb);
|
|
55001
|
+
_global.postMessage(token, "*");
|
|
55002
|
+
}
|
|
55003
|
+
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
55004
|
+
})(
|
|
55005
|
+
typeof setImmediate === 'function',
|
|
55006
|
+
isFunction$1(_global.postMessage)
|
|
55007
|
+
);
|
|
55008
|
+
|
|
55009
|
+
const asap = typeof queueMicrotask !== 'undefined' ?
|
|
55010
|
+
queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);
|
|
55011
|
+
|
|
55012
|
+
// *********************
|
|
55013
|
+
|
|
54975
55014
|
const utils$1$1 = {
|
|
54976
55015
|
isArray: isArray$2,
|
|
54977
55016
|
isArrayBuffer: isArrayBuffer$1,
|
|
@@ -54983,6 +55022,10 @@ const utils$1$1 = {
|
|
|
54983
55022
|
isBoolean: isBoolean$2,
|
|
54984
55023
|
isObject: isObject$8,
|
|
54985
55024
|
isPlainObject: isPlainObject$2,
|
|
55025
|
+
isReadableStream: isReadableStream$1,
|
|
55026
|
+
isRequest,
|
|
55027
|
+
isResponse,
|
|
55028
|
+
isHeaders,
|
|
54986
55029
|
isUndefined,
|
|
54987
55030
|
isDate: isDate$1,
|
|
54988
55031
|
isFile,
|
|
@@ -55023,7 +55066,9 @@ const utils$1$1 = {
|
|
|
55023
55066
|
isSpecCompliantForm,
|
|
55024
55067
|
toJSONObject,
|
|
55025
55068
|
isAsyncFn,
|
|
55026
|
-
isThenable
|
|
55069
|
+
isThenable,
|
|
55070
|
+
setImmediate: _setImmediate,
|
|
55071
|
+
asap
|
|
55027
55072
|
};
|
|
55028
55073
|
|
|
55029
55074
|
/**
|
|
@@ -55572,11 +55617,14 @@ const hasStandardBrowserWebWorkerEnv = (() => {
|
|
|
55572
55617
|
);
|
|
55573
55618
|
})();
|
|
55574
55619
|
|
|
55620
|
+
const origin = hasBrowserEnv && window.location.href || 'http://localhost';
|
|
55621
|
+
|
|
55575
55622
|
const utils$d = /*#__PURE__*/Object.freeze({
|
|
55576
55623
|
__proto__: null,
|
|
55577
55624
|
hasBrowserEnv: hasBrowserEnv,
|
|
55578
55625
|
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
|
55579
|
-
hasStandardBrowserEnv: hasStandardBrowserEnv
|
|
55626
|
+
hasStandardBrowserEnv: hasStandardBrowserEnv,
|
|
55627
|
+
origin: origin
|
|
55580
55628
|
});
|
|
55581
55629
|
|
|
55582
55630
|
const platform$2 = {
|
|
@@ -55716,7 +55764,7 @@ const defaults$5 = {
|
|
|
55716
55764
|
|
|
55717
55765
|
transitional: transitionalDefaults,
|
|
55718
55766
|
|
|
55719
|
-
adapter: ['xhr', 'http'],
|
|
55767
|
+
adapter: ['xhr', 'http', 'fetch'],
|
|
55720
55768
|
|
|
55721
55769
|
transformRequest: [function transformRequest(data, headers) {
|
|
55722
55770
|
const contentType = headers.getContentType() || '';
|
|
@@ -55737,7 +55785,8 @@ const defaults$5 = {
|
|
|
55737
55785
|
utils$1$1.isBuffer(data) ||
|
|
55738
55786
|
utils$1$1.isStream(data) ||
|
|
55739
55787
|
utils$1$1.isFile(data) ||
|
|
55740
|
-
utils$1$1.isBlob(data)
|
|
55788
|
+
utils$1$1.isBlob(data) ||
|
|
55789
|
+
utils$1$1.isReadableStream(data)
|
|
55741
55790
|
) {
|
|
55742
55791
|
return data;
|
|
55743
55792
|
}
|
|
@@ -55780,6 +55829,10 @@ const defaults$5 = {
|
|
|
55780
55829
|
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
55781
55830
|
const JSONRequested = this.responseType === 'json';
|
|
55782
55831
|
|
|
55832
|
+
if (utils$1$1.isResponse(data) || utils$1$1.isReadableStream(data)) {
|
|
55833
|
+
return data;
|
|
55834
|
+
}
|
|
55835
|
+
|
|
55783
55836
|
if (data && utils$1$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
|
|
55784
55837
|
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
55785
55838
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
@@ -55983,6 +56036,10 @@ class AxiosHeaders {
|
|
|
55983
56036
|
setHeaders(header, valueOrRewrite);
|
|
55984
56037
|
} else if(utils$1$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
55985
56038
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
56039
|
+
} else if (utils$1$1.isHeaders(header)) {
|
|
56040
|
+
for (const [key, value] of header.entries()) {
|
|
56041
|
+
setHeader(value, key, rewrite);
|
|
56042
|
+
}
|
|
55986
56043
|
} else {
|
|
55987
56044
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
55988
56045
|
}
|
|
@@ -56295,7 +56352,7 @@ function buildFullPath(baseURL, requestedURL) {
|
|
|
56295
56352
|
return requestedURL;
|
|
56296
56353
|
}
|
|
56297
56354
|
|
|
56298
|
-
const VERSION = "1.
|
|
56355
|
+
const VERSION = "1.7.4";
|
|
56299
56356
|
|
|
56300
56357
|
function parseProtocol(url) {
|
|
56301
56358
|
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
@@ -56350,88 +56407,6 @@ function fromDataURI(uri, asBlob, options) {
|
|
|
56350
56407
|
throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT);
|
|
56351
56408
|
}
|
|
56352
56409
|
|
|
56353
|
-
/**
|
|
56354
|
-
* Throttle decorator
|
|
56355
|
-
* @param {Function} fn
|
|
56356
|
-
* @param {Number} freq
|
|
56357
|
-
* @return {Function}
|
|
56358
|
-
*/
|
|
56359
|
-
function throttle(fn, freq) {
|
|
56360
|
-
let timestamp = 0;
|
|
56361
|
-
const threshold = 1000 / freq;
|
|
56362
|
-
let timer = null;
|
|
56363
|
-
return function throttled(force, args) {
|
|
56364
|
-
const now = Date.now();
|
|
56365
|
-
if (force || now - timestamp > threshold) {
|
|
56366
|
-
if (timer) {
|
|
56367
|
-
clearTimeout(timer);
|
|
56368
|
-
timer = null;
|
|
56369
|
-
}
|
|
56370
|
-
timestamp = now;
|
|
56371
|
-
return fn.apply(null, args);
|
|
56372
|
-
}
|
|
56373
|
-
if (!timer) {
|
|
56374
|
-
timer = setTimeout(() => {
|
|
56375
|
-
timer = null;
|
|
56376
|
-
timestamp = Date.now();
|
|
56377
|
-
return fn.apply(null, args);
|
|
56378
|
-
}, threshold - (now - timestamp));
|
|
56379
|
-
}
|
|
56380
|
-
};
|
|
56381
|
-
}
|
|
56382
|
-
|
|
56383
|
-
/**
|
|
56384
|
-
* Calculate data maxRate
|
|
56385
|
-
* @param {Number} [samplesCount= 10]
|
|
56386
|
-
* @param {Number} [min= 1000]
|
|
56387
|
-
* @returns {Function}
|
|
56388
|
-
*/
|
|
56389
|
-
function speedometer(samplesCount, min) {
|
|
56390
|
-
samplesCount = samplesCount || 10;
|
|
56391
|
-
const bytes = new Array(samplesCount);
|
|
56392
|
-
const timestamps = new Array(samplesCount);
|
|
56393
|
-
let head = 0;
|
|
56394
|
-
let tail = 0;
|
|
56395
|
-
let firstSampleTS;
|
|
56396
|
-
|
|
56397
|
-
min = min !== undefined ? min : 1000;
|
|
56398
|
-
|
|
56399
|
-
return function push(chunkLength) {
|
|
56400
|
-
const now = Date.now();
|
|
56401
|
-
|
|
56402
|
-
const startedAt = timestamps[tail];
|
|
56403
|
-
|
|
56404
|
-
if (!firstSampleTS) {
|
|
56405
|
-
firstSampleTS = now;
|
|
56406
|
-
}
|
|
56407
|
-
|
|
56408
|
-
bytes[head] = chunkLength;
|
|
56409
|
-
timestamps[head] = now;
|
|
56410
|
-
|
|
56411
|
-
let i = tail;
|
|
56412
|
-
let bytesCount = 0;
|
|
56413
|
-
|
|
56414
|
-
while (i !== head) {
|
|
56415
|
-
bytesCount += bytes[i++];
|
|
56416
|
-
i = i % samplesCount;
|
|
56417
|
-
}
|
|
56418
|
-
|
|
56419
|
-
head = (head + 1) % samplesCount;
|
|
56420
|
-
|
|
56421
|
-
if (head === tail) {
|
|
56422
|
-
tail = (tail + 1) % samplesCount;
|
|
56423
|
-
}
|
|
56424
|
-
|
|
56425
|
-
if (now - firstSampleTS < min) {
|
|
56426
|
-
return;
|
|
56427
|
-
}
|
|
56428
|
-
|
|
56429
|
-
const passed = startedAt && now - startedAt;
|
|
56430
|
-
|
|
56431
|
-
return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
|
|
56432
|
-
};
|
|
56433
|
-
}
|
|
56434
|
-
|
|
56435
56410
|
const kInternals = Symbol('internals');
|
|
56436
56411
|
|
|
56437
56412
|
class AxiosTransformStream extends stream__default["default"].Transform{
|
|
@@ -56451,12 +56426,8 @@ class AxiosTransformStream extends stream__default["default"].Transform{
|
|
|
56451
56426
|
readableHighWaterMark: options.chunkSize
|
|
56452
56427
|
});
|
|
56453
56428
|
|
|
56454
|
-
const self = this;
|
|
56455
|
-
|
|
56456
56429
|
const internals = this[kInternals] = {
|
|
56457
|
-
length: options.length,
|
|
56458
56430
|
timeWindow: options.timeWindow,
|
|
56459
|
-
ticksRate: options.ticksRate,
|
|
56460
56431
|
chunkSize: options.chunkSize,
|
|
56461
56432
|
maxRate: options.maxRate,
|
|
56462
56433
|
minChunkSize: options.minChunkSize,
|
|
@@ -56468,8 +56439,6 @@ class AxiosTransformStream extends stream__default["default"].Transform{
|
|
|
56468
56439
|
onReadCallback: null
|
|
56469
56440
|
};
|
|
56470
56441
|
|
|
56471
|
-
const _speedometer = speedometer(internals.ticksRate * options.samplesCount, internals.timeWindow);
|
|
56472
|
-
|
|
56473
56442
|
this.on('newListener', event => {
|
|
56474
56443
|
if (event === 'progress') {
|
|
56475
56444
|
if (!internals.isCaptured) {
|
|
@@ -56477,38 +56446,6 @@ class AxiosTransformStream extends stream__default["default"].Transform{
|
|
|
56477
56446
|
}
|
|
56478
56447
|
}
|
|
56479
56448
|
});
|
|
56480
|
-
|
|
56481
|
-
let bytesNotified = 0;
|
|
56482
|
-
|
|
56483
|
-
internals.updateProgress = throttle(function throttledHandler() {
|
|
56484
|
-
const totalBytes = internals.length;
|
|
56485
|
-
const bytesTransferred = internals.bytesSeen;
|
|
56486
|
-
const progressBytes = bytesTransferred - bytesNotified;
|
|
56487
|
-
if (!progressBytes || self.destroyed) return;
|
|
56488
|
-
|
|
56489
|
-
const rate = _speedometer(progressBytes);
|
|
56490
|
-
|
|
56491
|
-
bytesNotified = bytesTransferred;
|
|
56492
|
-
|
|
56493
|
-
process.nextTick(() => {
|
|
56494
|
-
self.emit('progress', {
|
|
56495
|
-
'loaded': bytesTransferred,
|
|
56496
|
-
'total': totalBytes,
|
|
56497
|
-
'progress': totalBytes ? (bytesTransferred / totalBytes) : undefined,
|
|
56498
|
-
'bytes': progressBytes,
|
|
56499
|
-
'rate': rate ? rate : undefined,
|
|
56500
|
-
'estimated': rate && totalBytes && bytesTransferred <= totalBytes ?
|
|
56501
|
-
(totalBytes - bytesTransferred) / rate : undefined
|
|
56502
|
-
});
|
|
56503
|
-
});
|
|
56504
|
-
}, internals.ticksRate);
|
|
56505
|
-
|
|
56506
|
-
const onFinish = () => {
|
|
56507
|
-
internals.updateProgress(true);
|
|
56508
|
-
};
|
|
56509
|
-
|
|
56510
|
-
this.once('end', onFinish);
|
|
56511
|
-
this.once('error', onFinish);
|
|
56512
56449
|
}
|
|
56513
56450
|
|
|
56514
56451
|
_read(size) {
|
|
@@ -56522,7 +56459,6 @@ class AxiosTransformStream extends stream__default["default"].Transform{
|
|
|
56522
56459
|
}
|
|
56523
56460
|
|
|
56524
56461
|
_transform(chunk, encoding, callback) {
|
|
56525
|
-
const self = this;
|
|
56526
56462
|
const internals = this[kInternals];
|
|
56527
56463
|
const maxRate = internals.maxRate;
|
|
56528
56464
|
|
|
@@ -56534,16 +56470,14 @@ class AxiosTransformStream extends stream__default["default"].Transform{
|
|
|
56534
56470
|
const bytesThreshold = (maxRate / divider);
|
|
56535
56471
|
const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
|
|
56536
56472
|
|
|
56537
|
-
|
|
56473
|
+
const pushChunk = (_chunk, _callback) => {
|
|
56538
56474
|
const bytes = Buffer.byteLength(_chunk);
|
|
56539
56475
|
internals.bytesSeen += bytes;
|
|
56540
56476
|
internals.bytes += bytes;
|
|
56541
56477
|
|
|
56542
|
-
|
|
56543
|
-
internals.updateProgress();
|
|
56544
|
-
}
|
|
56478
|
+
internals.isCaptured && this.emit('progress', internals.bytesSeen);
|
|
56545
56479
|
|
|
56546
|
-
if (
|
|
56480
|
+
if (this.push(_chunk)) {
|
|
56547
56481
|
process.nextTick(_callback);
|
|
56548
56482
|
} else {
|
|
56549
56483
|
internals.onReadCallback = () => {
|
|
@@ -56551,7 +56485,7 @@ class AxiosTransformStream extends stream__default["default"].Transform{
|
|
|
56551
56485
|
process.nextTick(_callback);
|
|
56552
56486
|
};
|
|
56553
56487
|
}
|
|
56554
|
-
}
|
|
56488
|
+
};
|
|
56555
56489
|
|
|
56556
56490
|
const transformChunk = (_chunk, _callback) => {
|
|
56557
56491
|
const chunkSize = Buffer.byteLength(_chunk);
|
|
@@ -56608,11 +56542,6 @@ class AxiosTransformStream extends stream__default["default"].Transform{
|
|
|
56608
56542
|
}
|
|
56609
56543
|
});
|
|
56610
56544
|
}
|
|
56611
|
-
|
|
56612
|
-
setLength(length) {
|
|
56613
|
-
this[kInternals].length = +length;
|
|
56614
|
-
return this;
|
|
56615
|
-
}
|
|
56616
56545
|
}
|
|
56617
56546
|
|
|
56618
56547
|
const AxiosTransformStream$1 = AxiosTransformStream;
|
|
@@ -56780,6 +56709,142 @@ const callbackify = (fn, reducer) => {
|
|
|
56780
56709
|
|
|
56781
56710
|
const callbackify$1 = callbackify;
|
|
56782
56711
|
|
|
56712
|
+
/**
|
|
56713
|
+
* Calculate data maxRate
|
|
56714
|
+
* @param {Number} [samplesCount= 10]
|
|
56715
|
+
* @param {Number} [min= 1000]
|
|
56716
|
+
* @returns {Function}
|
|
56717
|
+
*/
|
|
56718
|
+
function speedometer(samplesCount, min) {
|
|
56719
|
+
samplesCount = samplesCount || 10;
|
|
56720
|
+
const bytes = new Array(samplesCount);
|
|
56721
|
+
const timestamps = new Array(samplesCount);
|
|
56722
|
+
let head = 0;
|
|
56723
|
+
let tail = 0;
|
|
56724
|
+
let firstSampleTS;
|
|
56725
|
+
|
|
56726
|
+
min = min !== undefined ? min : 1000;
|
|
56727
|
+
|
|
56728
|
+
return function push(chunkLength) {
|
|
56729
|
+
const now = Date.now();
|
|
56730
|
+
|
|
56731
|
+
const startedAt = timestamps[tail];
|
|
56732
|
+
|
|
56733
|
+
if (!firstSampleTS) {
|
|
56734
|
+
firstSampleTS = now;
|
|
56735
|
+
}
|
|
56736
|
+
|
|
56737
|
+
bytes[head] = chunkLength;
|
|
56738
|
+
timestamps[head] = now;
|
|
56739
|
+
|
|
56740
|
+
let i = tail;
|
|
56741
|
+
let bytesCount = 0;
|
|
56742
|
+
|
|
56743
|
+
while (i !== head) {
|
|
56744
|
+
bytesCount += bytes[i++];
|
|
56745
|
+
i = i % samplesCount;
|
|
56746
|
+
}
|
|
56747
|
+
|
|
56748
|
+
head = (head + 1) % samplesCount;
|
|
56749
|
+
|
|
56750
|
+
if (head === tail) {
|
|
56751
|
+
tail = (tail + 1) % samplesCount;
|
|
56752
|
+
}
|
|
56753
|
+
|
|
56754
|
+
if (now - firstSampleTS < min) {
|
|
56755
|
+
return;
|
|
56756
|
+
}
|
|
56757
|
+
|
|
56758
|
+
const passed = startedAt && now - startedAt;
|
|
56759
|
+
|
|
56760
|
+
return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
|
|
56761
|
+
};
|
|
56762
|
+
}
|
|
56763
|
+
|
|
56764
|
+
/**
|
|
56765
|
+
* Throttle decorator
|
|
56766
|
+
* @param {Function} fn
|
|
56767
|
+
* @param {Number} freq
|
|
56768
|
+
* @return {Function}
|
|
56769
|
+
*/
|
|
56770
|
+
function throttle(fn, freq) {
|
|
56771
|
+
let timestamp = 0;
|
|
56772
|
+
let threshold = 1000 / freq;
|
|
56773
|
+
let lastArgs;
|
|
56774
|
+
let timer;
|
|
56775
|
+
|
|
56776
|
+
const invoke = (args, now = Date.now()) => {
|
|
56777
|
+
timestamp = now;
|
|
56778
|
+
lastArgs = null;
|
|
56779
|
+
if (timer) {
|
|
56780
|
+
clearTimeout(timer);
|
|
56781
|
+
timer = null;
|
|
56782
|
+
}
|
|
56783
|
+
fn.apply(null, args);
|
|
56784
|
+
};
|
|
56785
|
+
|
|
56786
|
+
const throttled = (...args) => {
|
|
56787
|
+
const now = Date.now();
|
|
56788
|
+
const passed = now - timestamp;
|
|
56789
|
+
if ( passed >= threshold) {
|
|
56790
|
+
invoke(args, now);
|
|
56791
|
+
} else {
|
|
56792
|
+
lastArgs = args;
|
|
56793
|
+
if (!timer) {
|
|
56794
|
+
timer = setTimeout(() => {
|
|
56795
|
+
timer = null;
|
|
56796
|
+
invoke(lastArgs);
|
|
56797
|
+
}, threshold - passed);
|
|
56798
|
+
}
|
|
56799
|
+
}
|
|
56800
|
+
};
|
|
56801
|
+
|
|
56802
|
+
const flush = () => lastArgs && invoke(lastArgs);
|
|
56803
|
+
|
|
56804
|
+
return [throttled, flush];
|
|
56805
|
+
}
|
|
56806
|
+
|
|
56807
|
+
const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
56808
|
+
let bytesNotified = 0;
|
|
56809
|
+
const _speedometer = speedometer(50, 250);
|
|
56810
|
+
|
|
56811
|
+
return throttle(e => {
|
|
56812
|
+
const loaded = e.loaded;
|
|
56813
|
+
const total = e.lengthComputable ? e.total : undefined;
|
|
56814
|
+
const progressBytes = loaded - bytesNotified;
|
|
56815
|
+
const rate = _speedometer(progressBytes);
|
|
56816
|
+
const inRange = loaded <= total;
|
|
56817
|
+
|
|
56818
|
+
bytesNotified = loaded;
|
|
56819
|
+
|
|
56820
|
+
const data = {
|
|
56821
|
+
loaded,
|
|
56822
|
+
total,
|
|
56823
|
+
progress: total ? (loaded / total) : undefined,
|
|
56824
|
+
bytes: progressBytes,
|
|
56825
|
+
rate: rate ? rate : undefined,
|
|
56826
|
+
estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
|
|
56827
|
+
event: e,
|
|
56828
|
+
lengthComputable: total != null,
|
|
56829
|
+
[isDownloadStream ? 'download' : 'upload']: true
|
|
56830
|
+
};
|
|
56831
|
+
|
|
56832
|
+
listener(data);
|
|
56833
|
+
}, freq);
|
|
56834
|
+
};
|
|
56835
|
+
|
|
56836
|
+
const progressEventDecorator = (total, throttled) => {
|
|
56837
|
+
const lengthComputable = total != null;
|
|
56838
|
+
|
|
56839
|
+
return [(loaded) => throttled[0]({
|
|
56840
|
+
lengthComputable,
|
|
56841
|
+
total,
|
|
56842
|
+
loaded
|
|
56843
|
+
}), throttled[1]];
|
|
56844
|
+
};
|
|
56845
|
+
|
|
56846
|
+
const asyncDecorator = (fn) => (...args) => utils$1$1.asap(() => fn(...args));
|
|
56847
|
+
|
|
56783
56848
|
const zlibOptions = {
|
|
56784
56849
|
flush: zlib__default["default"].constants.Z_SYNC_FLUSH,
|
|
56785
56850
|
finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH
|
|
@@ -56800,6 +56865,14 @@ const supportedProtocols = platform$2.protocols.map(protocol => {
|
|
|
56800
56865
|
return protocol + ':';
|
|
56801
56866
|
});
|
|
56802
56867
|
|
|
56868
|
+
const flushOnFinish = (stream, [throttled, flush]) => {
|
|
56869
|
+
stream
|
|
56870
|
+
.on('end', flush)
|
|
56871
|
+
.on('error', flush);
|
|
56872
|
+
|
|
56873
|
+
return throttled;
|
|
56874
|
+
};
|
|
56875
|
+
|
|
56803
56876
|
/**
|
|
56804
56877
|
* If the proxy or config beforeRedirects functions are defined, call them with the options
|
|
56805
56878
|
* object.
|
|
@@ -56975,7 +57048,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
56975
57048
|
|
|
56976
57049
|
// Parse url
|
|
56977
57050
|
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
56978
|
-
const parsed = new URL(fullPath,
|
|
57051
|
+
const parsed = new URL(fullPath, utils$1$1.hasBrowserEnv ? platform$2.origin : undefined);
|
|
56979
57052
|
const protocol = parsed.protocol || supportedProtocols[0];
|
|
56980
57053
|
|
|
56981
57054
|
if (protocol === 'data:') {
|
|
@@ -57033,8 +57106,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
57033
57106
|
// Only set header if it hasn't been set in config
|
|
57034
57107
|
headers.set('User-Agent', 'axios/' + VERSION, false);
|
|
57035
57108
|
|
|
57036
|
-
const onDownloadProgress = config
|
|
57037
|
-
const onUploadProgress = config.onUploadProgress;
|
|
57109
|
+
const {onUploadProgress, onDownloadProgress} = config;
|
|
57038
57110
|
const maxRate = config.maxRate;
|
|
57039
57111
|
let maxUploadRate = undefined;
|
|
57040
57112
|
let maxDownloadRate = undefined;
|
|
@@ -57105,15 +57177,16 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
57105
57177
|
}
|
|
57106
57178
|
|
|
57107
57179
|
data = stream__default["default"].pipeline([data, new AxiosTransformStream$1({
|
|
57108
|
-
length: contentLength,
|
|
57109
57180
|
maxRate: utils$1$1.toFiniteNumber(maxUploadRate)
|
|
57110
57181
|
})], utils$1$1.noop);
|
|
57111
57182
|
|
|
57112
|
-
onUploadProgress && data.on('progress',
|
|
57113
|
-
|
|
57114
|
-
|
|
57115
|
-
|
|
57116
|
-
|
|
57183
|
+
onUploadProgress && data.on('progress', flushOnFinish(
|
|
57184
|
+
data,
|
|
57185
|
+
progressEventDecorator(
|
|
57186
|
+
contentLength,
|
|
57187
|
+
progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
|
|
57188
|
+
)
|
|
57189
|
+
));
|
|
57117
57190
|
}
|
|
57118
57191
|
|
|
57119
57192
|
// HTTP basic authentication
|
|
@@ -57212,17 +57285,18 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
57212
57285
|
|
|
57213
57286
|
const responseLength = +res.headers['content-length'];
|
|
57214
57287
|
|
|
57215
|
-
if (onDownloadProgress) {
|
|
57288
|
+
if (onDownloadProgress || maxDownloadRate) {
|
|
57216
57289
|
const transformStream = new AxiosTransformStream$1({
|
|
57217
|
-
length: utils$1$1.toFiniteNumber(responseLength),
|
|
57218
57290
|
maxRate: utils$1$1.toFiniteNumber(maxDownloadRate)
|
|
57219
57291
|
});
|
|
57220
57292
|
|
|
57221
|
-
onDownloadProgress && transformStream.on('progress',
|
|
57222
|
-
|
|
57223
|
-
|
|
57224
|
-
|
|
57225
|
-
|
|
57293
|
+
onDownloadProgress && transformStream.on('progress', flushOnFinish(
|
|
57294
|
+
transformStream,
|
|
57295
|
+
progressEventDecorator(
|
|
57296
|
+
responseLength,
|
|
57297
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
|
|
57298
|
+
)
|
|
57299
|
+
));
|
|
57226
57300
|
|
|
57227
57301
|
streams.push(transformStream);
|
|
57228
57302
|
}
|
|
@@ -57435,6 +57509,69 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
57435
57509
|
});
|
|
57436
57510
|
};
|
|
57437
57511
|
|
|
57512
|
+
const isURLSameOrigin = platform$2.hasStandardBrowserEnv ?
|
|
57513
|
+
|
|
57514
|
+
// Standard browser envs have full support of the APIs needed to test
|
|
57515
|
+
// whether the request URL is of the same origin as current location.
|
|
57516
|
+
(function standardBrowserEnv() {
|
|
57517
|
+
const msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
57518
|
+
const urlParsingNode = document.createElement('a');
|
|
57519
|
+
let originURL;
|
|
57520
|
+
|
|
57521
|
+
/**
|
|
57522
|
+
* Parse a URL to discover its components
|
|
57523
|
+
*
|
|
57524
|
+
* @param {String} url The URL to be parsed
|
|
57525
|
+
* @returns {Object}
|
|
57526
|
+
*/
|
|
57527
|
+
function resolveURL(url) {
|
|
57528
|
+
let href = url;
|
|
57529
|
+
|
|
57530
|
+
if (msie) {
|
|
57531
|
+
// IE needs attribute set twice to normalize properties
|
|
57532
|
+
urlParsingNode.setAttribute('href', href);
|
|
57533
|
+
href = urlParsingNode.href;
|
|
57534
|
+
}
|
|
57535
|
+
|
|
57536
|
+
urlParsingNode.setAttribute('href', href);
|
|
57537
|
+
|
|
57538
|
+
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
|
|
57539
|
+
return {
|
|
57540
|
+
href: urlParsingNode.href,
|
|
57541
|
+
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
|
|
57542
|
+
host: urlParsingNode.host,
|
|
57543
|
+
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
|
|
57544
|
+
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
|
|
57545
|
+
hostname: urlParsingNode.hostname,
|
|
57546
|
+
port: urlParsingNode.port,
|
|
57547
|
+
pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
|
|
57548
|
+
urlParsingNode.pathname :
|
|
57549
|
+
'/' + urlParsingNode.pathname
|
|
57550
|
+
};
|
|
57551
|
+
}
|
|
57552
|
+
|
|
57553
|
+
originURL = resolveURL(window.location.href);
|
|
57554
|
+
|
|
57555
|
+
/**
|
|
57556
|
+
* Determine if a URL shares the same origin as the current location
|
|
57557
|
+
*
|
|
57558
|
+
* @param {String} requestURL The URL to test
|
|
57559
|
+
* @returns {boolean} True if URL shares the same origin, otherwise false
|
|
57560
|
+
*/
|
|
57561
|
+
return function isURLSameOrigin(requestURL) {
|
|
57562
|
+
const parsed = (utils$1$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
|
57563
|
+
return (parsed.protocol === originURL.protocol &&
|
|
57564
|
+
parsed.host === originURL.host);
|
|
57565
|
+
};
|
|
57566
|
+
})() :
|
|
57567
|
+
|
|
57568
|
+
// Non standard browser envs (web workers, react-native) lack needed support.
|
|
57569
|
+
(function nonStandardBrowserEnv() {
|
|
57570
|
+
return function isURLSameOrigin() {
|
|
57571
|
+
return true;
|
|
57572
|
+
};
|
|
57573
|
+
})();
|
|
57574
|
+
|
|
57438
57575
|
const cookies$1 = platform$2.hasStandardBrowserEnv ?
|
|
57439
57576
|
|
|
57440
57577
|
// Standard browser envs support document.cookie
|
|
@@ -57474,143 +57611,183 @@ const cookies$1 = platform$2.hasStandardBrowserEnv ?
|
|
|
57474
57611
|
remove() {}
|
|
57475
57612
|
};
|
|
57476
57613
|
|
|
57477
|
-
const
|
|
57614
|
+
const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
|
|
57478
57615
|
|
|
57479
|
-
|
|
57480
|
-
|
|
57481
|
-
|
|
57482
|
-
|
|
57483
|
-
|
|
57484
|
-
|
|
57616
|
+
/**
|
|
57617
|
+
* Config-specific merge-function which creates a new config-object
|
|
57618
|
+
* by merging two configuration objects together.
|
|
57619
|
+
*
|
|
57620
|
+
* @param {Object} config1
|
|
57621
|
+
* @param {Object} config2
|
|
57622
|
+
*
|
|
57623
|
+
* @returns {Object} New object resulting from merging config2 to config1
|
|
57624
|
+
*/
|
|
57625
|
+
function mergeConfig(config1, config2) {
|
|
57626
|
+
// eslint-disable-next-line no-param-reassign
|
|
57627
|
+
config2 = config2 || {};
|
|
57628
|
+
const config = {};
|
|
57485
57629
|
|
|
57486
|
-
|
|
57487
|
-
|
|
57488
|
-
|
|
57489
|
-
|
|
57490
|
-
|
|
57491
|
-
|
|
57492
|
-
|
|
57493
|
-
|
|
57630
|
+
function getMergedValue(target, source, caseless) {
|
|
57631
|
+
if (utils$1$1.isPlainObject(target) && utils$1$1.isPlainObject(source)) {
|
|
57632
|
+
return utils$1$1.merge.call({caseless}, target, source);
|
|
57633
|
+
} else if (utils$1$1.isPlainObject(source)) {
|
|
57634
|
+
return utils$1$1.merge({}, source);
|
|
57635
|
+
} else if (utils$1$1.isArray(source)) {
|
|
57636
|
+
return source.slice();
|
|
57637
|
+
}
|
|
57638
|
+
return source;
|
|
57639
|
+
}
|
|
57494
57640
|
|
|
57495
|
-
|
|
57496
|
-
|
|
57497
|
-
|
|
57498
|
-
|
|
57499
|
-
|
|
57641
|
+
// eslint-disable-next-line consistent-return
|
|
57642
|
+
function mergeDeepProperties(a, b, caseless) {
|
|
57643
|
+
if (!utils$1$1.isUndefined(b)) {
|
|
57644
|
+
return getMergedValue(a, b, caseless);
|
|
57645
|
+
} else if (!utils$1$1.isUndefined(a)) {
|
|
57646
|
+
return getMergedValue(undefined, a, caseless);
|
|
57647
|
+
}
|
|
57648
|
+
}
|
|
57500
57649
|
|
|
57501
|
-
|
|
57650
|
+
// eslint-disable-next-line consistent-return
|
|
57651
|
+
function valueFromConfig2(a, b) {
|
|
57652
|
+
if (!utils$1$1.isUndefined(b)) {
|
|
57653
|
+
return getMergedValue(undefined, b);
|
|
57654
|
+
}
|
|
57655
|
+
}
|
|
57502
57656
|
|
|
57503
|
-
|
|
57504
|
-
|
|
57505
|
-
|
|
57506
|
-
|
|
57507
|
-
|
|
57508
|
-
|
|
57509
|
-
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
|
|
57510
|
-
hostname: urlParsingNode.hostname,
|
|
57511
|
-
port: urlParsingNode.port,
|
|
57512
|
-
pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
|
|
57513
|
-
urlParsingNode.pathname :
|
|
57514
|
-
'/' + urlParsingNode.pathname
|
|
57515
|
-
};
|
|
57657
|
+
// eslint-disable-next-line consistent-return
|
|
57658
|
+
function defaultToConfig2(a, b) {
|
|
57659
|
+
if (!utils$1$1.isUndefined(b)) {
|
|
57660
|
+
return getMergedValue(undefined, b);
|
|
57661
|
+
} else if (!utils$1$1.isUndefined(a)) {
|
|
57662
|
+
return getMergedValue(undefined, a);
|
|
57516
57663
|
}
|
|
57664
|
+
}
|
|
57517
57665
|
|
|
57518
|
-
|
|
57666
|
+
// eslint-disable-next-line consistent-return
|
|
57667
|
+
function mergeDirectKeys(a, b, prop) {
|
|
57668
|
+
if (prop in config2) {
|
|
57669
|
+
return getMergedValue(a, b);
|
|
57670
|
+
} else if (prop in config1) {
|
|
57671
|
+
return getMergedValue(undefined, a);
|
|
57672
|
+
}
|
|
57673
|
+
}
|
|
57519
57674
|
|
|
57520
|
-
|
|
57521
|
-
|
|
57522
|
-
|
|
57523
|
-
|
|
57524
|
-
|
|
57525
|
-
|
|
57526
|
-
|
|
57527
|
-
|
|
57528
|
-
|
|
57529
|
-
|
|
57530
|
-
|
|
57531
|
-
|
|
57675
|
+
const mergeMap = {
|
|
57676
|
+
url: valueFromConfig2,
|
|
57677
|
+
method: valueFromConfig2,
|
|
57678
|
+
data: valueFromConfig2,
|
|
57679
|
+
baseURL: defaultToConfig2,
|
|
57680
|
+
transformRequest: defaultToConfig2,
|
|
57681
|
+
transformResponse: defaultToConfig2,
|
|
57682
|
+
paramsSerializer: defaultToConfig2,
|
|
57683
|
+
timeout: defaultToConfig2,
|
|
57684
|
+
timeoutMessage: defaultToConfig2,
|
|
57685
|
+
withCredentials: defaultToConfig2,
|
|
57686
|
+
withXSRFToken: defaultToConfig2,
|
|
57687
|
+
adapter: defaultToConfig2,
|
|
57688
|
+
responseType: defaultToConfig2,
|
|
57689
|
+
xsrfCookieName: defaultToConfig2,
|
|
57690
|
+
xsrfHeaderName: defaultToConfig2,
|
|
57691
|
+
onUploadProgress: defaultToConfig2,
|
|
57692
|
+
onDownloadProgress: defaultToConfig2,
|
|
57693
|
+
decompress: defaultToConfig2,
|
|
57694
|
+
maxContentLength: defaultToConfig2,
|
|
57695
|
+
maxBodyLength: defaultToConfig2,
|
|
57696
|
+
beforeRedirect: defaultToConfig2,
|
|
57697
|
+
transport: defaultToConfig2,
|
|
57698
|
+
httpAgent: defaultToConfig2,
|
|
57699
|
+
httpsAgent: defaultToConfig2,
|
|
57700
|
+
cancelToken: defaultToConfig2,
|
|
57701
|
+
socketPath: defaultToConfig2,
|
|
57702
|
+
responseEncoding: defaultToConfig2,
|
|
57703
|
+
validateStatus: mergeDirectKeys,
|
|
57704
|
+
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
|
57705
|
+
};
|
|
57532
57706
|
|
|
57533
|
-
|
|
57534
|
-
|
|
57535
|
-
|
|
57536
|
-
|
|
57537
|
-
|
|
57538
|
-
})();
|
|
57707
|
+
utils$1$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
|
57708
|
+
const merge = mergeMap[prop] || mergeDeepProperties;
|
|
57709
|
+
const configValue = merge(config1[prop], config2[prop], prop);
|
|
57710
|
+
(utils$1$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
57711
|
+
});
|
|
57539
57712
|
|
|
57540
|
-
|
|
57541
|
-
|
|
57542
|
-
const _speedometer = speedometer(50, 250);
|
|
57713
|
+
return config;
|
|
57714
|
+
}
|
|
57543
57715
|
|
|
57544
|
-
|
|
57545
|
-
|
|
57546
|
-
const total = e.lengthComputable ? e.total : undefined;
|
|
57547
|
-
const progressBytes = loaded - bytesNotified;
|
|
57548
|
-
const rate = _speedometer(progressBytes);
|
|
57549
|
-
const inRange = loaded <= total;
|
|
57716
|
+
const resolveConfig = (config) => {
|
|
57717
|
+
const newConfig = mergeConfig({}, config);
|
|
57550
57718
|
|
|
57551
|
-
|
|
57719
|
+
let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
|
|
57552
57720
|
|
|
57553
|
-
|
|
57554
|
-
loaded,
|
|
57555
|
-
total,
|
|
57556
|
-
progress: total ? (loaded / total) : undefined,
|
|
57557
|
-
bytes: progressBytes,
|
|
57558
|
-
rate: rate ? rate : undefined,
|
|
57559
|
-
estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
|
|
57560
|
-
event: e
|
|
57561
|
-
};
|
|
57721
|
+
newConfig.headers = headers = AxiosHeaders$1.from(headers);
|
|
57562
57722
|
|
|
57563
|
-
|
|
57723
|
+
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
|
|
57564
57724
|
|
|
57565
|
-
|
|
57566
|
-
|
|
57567
|
-
|
|
57725
|
+
// HTTP basic authentication
|
|
57726
|
+
if (auth) {
|
|
57727
|
+
headers.set('Authorization', 'Basic ' +
|
|
57728
|
+
btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))
|
|
57729
|
+
);
|
|
57730
|
+
}
|
|
57731
|
+
|
|
57732
|
+
let contentType;
|
|
57733
|
+
|
|
57734
|
+
if (utils$1$1.isFormData(data)) {
|
|
57735
|
+
if (platform$2.hasStandardBrowserEnv || platform$2.hasStandardBrowserWebWorkerEnv) {
|
|
57736
|
+
headers.setContentType(undefined); // Let the browser set it
|
|
57737
|
+
} else if ((contentType = headers.getContentType()) !== false) {
|
|
57738
|
+
// fix semicolon duplication issue for ReactNative FormData implementation
|
|
57739
|
+
const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
|
|
57740
|
+
headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
|
|
57741
|
+
}
|
|
57742
|
+
}
|
|
57743
|
+
|
|
57744
|
+
// Add xsrf header
|
|
57745
|
+
// This is only done if running in a standard browser environment.
|
|
57746
|
+
// Specifically not if we're in a web worker, or react-native.
|
|
57747
|
+
|
|
57748
|
+
if (platform$2.hasStandardBrowserEnv) {
|
|
57749
|
+
withXSRFToken && utils$1$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
|
|
57750
|
+
|
|
57751
|
+
if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {
|
|
57752
|
+
// Add xsrf header
|
|
57753
|
+
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies$1.read(xsrfCookieName);
|
|
57754
|
+
|
|
57755
|
+
if (xsrfValue) {
|
|
57756
|
+
headers.set(xsrfHeaderName, xsrfValue);
|
|
57757
|
+
}
|
|
57758
|
+
}
|
|
57759
|
+
}
|
|
57760
|
+
|
|
57761
|
+
return newConfig;
|
|
57762
|
+
};
|
|
57568
57763
|
|
|
57569
57764
|
const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
|
57570
57765
|
|
|
57571
57766
|
const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
57572
57767
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
57573
|
-
|
|
57574
|
-
|
|
57575
|
-
|
|
57768
|
+
const _config = resolveConfig(config);
|
|
57769
|
+
let requestData = _config.data;
|
|
57770
|
+
const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
|
|
57771
|
+
let {responseType, onUploadProgress, onDownloadProgress} = _config;
|
|
57576
57772
|
let onCanceled;
|
|
57577
|
-
|
|
57578
|
-
|
|
57579
|
-
config.cancelToken.unsubscribe(onCanceled);
|
|
57580
|
-
}
|
|
57773
|
+
let uploadThrottled, downloadThrottled;
|
|
57774
|
+
let flushUpload, flushDownload;
|
|
57581
57775
|
|
|
57582
|
-
|
|
57583
|
-
|
|
57584
|
-
|
|
57585
|
-
}
|
|
57776
|
+
function done() {
|
|
57777
|
+
flushUpload && flushUpload(); // flush events
|
|
57778
|
+
flushDownload && flushDownload(); // flush events
|
|
57586
57779
|
|
|
57587
|
-
|
|
57780
|
+
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
|
57588
57781
|
|
|
57589
|
-
|
|
57590
|
-
if (platform$2.hasStandardBrowserEnv || platform$2.hasStandardBrowserWebWorkerEnv) {
|
|
57591
|
-
requestHeaders.setContentType(false); // Let the browser set it
|
|
57592
|
-
} else if ((contentType = requestHeaders.getContentType()) !== false) {
|
|
57593
|
-
// fix semicolon duplication issue for ReactNative FormData implementation
|
|
57594
|
-
const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
|
|
57595
|
-
requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
|
|
57596
|
-
}
|
|
57782
|
+
_config.signal && _config.signal.removeEventListener('abort', onCanceled);
|
|
57597
57783
|
}
|
|
57598
57784
|
|
|
57599
57785
|
let request = new XMLHttpRequest();
|
|
57600
57786
|
|
|
57601
|
-
|
|
57602
|
-
if (config.auth) {
|
|
57603
|
-
const username = config.auth.username || '';
|
|
57604
|
-
const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
|
|
57605
|
-
requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));
|
|
57606
|
-
}
|
|
57607
|
-
|
|
57608
|
-
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
57609
|
-
|
|
57610
|
-
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
|
|
57787
|
+
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
57611
57788
|
|
|
57612
57789
|
// Set the request timeout in MS
|
|
57613
|
-
request.timeout =
|
|
57790
|
+
request.timeout = _config.timeout;
|
|
57614
57791
|
|
|
57615
57792
|
function onloadend() {
|
|
57616
57793
|
if (!request) {
|
|
@@ -57690,10 +57867,10 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
57690
57867
|
|
|
57691
57868
|
// Handle timeout
|
|
57692
57869
|
request.ontimeout = function handleTimeout() {
|
|
57693
|
-
let timeoutErrorMessage =
|
|
57694
|
-
const transitional =
|
|
57695
|
-
if (
|
|
57696
|
-
timeoutErrorMessage =
|
|
57870
|
+
let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
57871
|
+
const transitional = _config.transitional || transitionalDefaults;
|
|
57872
|
+
if (_config.timeoutErrorMessage) {
|
|
57873
|
+
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
57697
57874
|
}
|
|
57698
57875
|
reject(new AxiosError(
|
|
57699
57876
|
timeoutErrorMessage,
|
|
@@ -57705,22 +57882,6 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
57705
57882
|
request = null;
|
|
57706
57883
|
};
|
|
57707
57884
|
|
|
57708
|
-
// Add xsrf header
|
|
57709
|
-
// This is only done if running in a standard browser environment.
|
|
57710
|
-
// Specifically not if we're in a web worker, or react-native.
|
|
57711
|
-
if(platform$2.hasStandardBrowserEnv) {
|
|
57712
|
-
withXSRFToken && utils$1$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
|
|
57713
|
-
|
|
57714
|
-
if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {
|
|
57715
|
-
// Add xsrf header
|
|
57716
|
-
const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies$1.read(config.xsrfCookieName);
|
|
57717
|
-
|
|
57718
|
-
if (xsrfValue) {
|
|
57719
|
-
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
|
|
57720
|
-
}
|
|
57721
|
-
}
|
|
57722
|
-
}
|
|
57723
|
-
|
|
57724
57885
|
// Remove Content-Type if data is undefined
|
|
57725
57886
|
requestData === undefined && requestHeaders.setContentType(null);
|
|
57726
57887
|
|
|
@@ -57732,26 +57893,31 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
57732
57893
|
}
|
|
57733
57894
|
|
|
57734
57895
|
// Add withCredentials to request if needed
|
|
57735
|
-
if (!utils$1$1.isUndefined(
|
|
57736
|
-
request.withCredentials = !!
|
|
57896
|
+
if (!utils$1$1.isUndefined(_config.withCredentials)) {
|
|
57897
|
+
request.withCredentials = !!_config.withCredentials;
|
|
57737
57898
|
}
|
|
57738
57899
|
|
|
57739
57900
|
// Add responseType to request if needed
|
|
57740
57901
|
if (responseType && responseType !== 'json') {
|
|
57741
|
-
request.responseType =
|
|
57902
|
+
request.responseType = _config.responseType;
|
|
57742
57903
|
}
|
|
57743
57904
|
|
|
57744
57905
|
// Handle progress if needed
|
|
57745
|
-
if (
|
|
57746
|
-
|
|
57906
|
+
if (onDownloadProgress) {
|
|
57907
|
+
([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));
|
|
57908
|
+
request.addEventListener('progress', downloadThrottled);
|
|
57747
57909
|
}
|
|
57748
57910
|
|
|
57749
57911
|
// Not all browsers support upload events
|
|
57750
|
-
if (
|
|
57751
|
-
|
|
57912
|
+
if (onUploadProgress && request.upload) {
|
|
57913
|
+
([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));
|
|
57914
|
+
|
|
57915
|
+
request.upload.addEventListener('progress', uploadThrottled);
|
|
57916
|
+
|
|
57917
|
+
request.upload.addEventListener('loadend', flushUpload);
|
|
57752
57918
|
}
|
|
57753
57919
|
|
|
57754
|
-
if (
|
|
57920
|
+
if (_config.cancelToken || _config.signal) {
|
|
57755
57921
|
// Handle cancellation
|
|
57756
57922
|
// eslint-disable-next-line func-names
|
|
57757
57923
|
onCanceled = cancel => {
|
|
@@ -57763,13 +57929,13 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
57763
57929
|
request = null;
|
|
57764
57930
|
};
|
|
57765
57931
|
|
|
57766
|
-
|
|
57767
|
-
if (
|
|
57768
|
-
|
|
57932
|
+
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
57933
|
+
if (_config.signal) {
|
|
57934
|
+
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
|
|
57769
57935
|
}
|
|
57770
57936
|
}
|
|
57771
57937
|
|
|
57772
|
-
const protocol = parseProtocol(
|
|
57938
|
+
const protocol = parseProtocol(_config.url);
|
|
57773
57939
|
|
|
57774
57940
|
if (protocol && platform$2.protocols.indexOf(protocol) === -1) {
|
|
57775
57941
|
reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
|
|
@@ -57782,9 +57948,339 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
57782
57948
|
});
|
|
57783
57949
|
};
|
|
57784
57950
|
|
|
57951
|
+
const composeSignals = (signals, timeout) => {
|
|
57952
|
+
let controller = new AbortController();
|
|
57953
|
+
|
|
57954
|
+
let aborted;
|
|
57955
|
+
|
|
57956
|
+
const onabort = function (cancel) {
|
|
57957
|
+
if (!aborted) {
|
|
57958
|
+
aborted = true;
|
|
57959
|
+
unsubscribe();
|
|
57960
|
+
const err = cancel instanceof Error ? cancel : this.reason;
|
|
57961
|
+
controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
|
|
57962
|
+
}
|
|
57963
|
+
};
|
|
57964
|
+
|
|
57965
|
+
let timer = timeout && setTimeout(() => {
|
|
57966
|
+
onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
|
|
57967
|
+
}, timeout);
|
|
57968
|
+
|
|
57969
|
+
const unsubscribe = () => {
|
|
57970
|
+
if (signals) {
|
|
57971
|
+
timer && clearTimeout(timer);
|
|
57972
|
+
timer = null;
|
|
57973
|
+
signals.forEach(signal => {
|
|
57974
|
+
signal &&
|
|
57975
|
+
(signal.removeEventListener ? signal.removeEventListener('abort', onabort) : signal.unsubscribe(onabort));
|
|
57976
|
+
});
|
|
57977
|
+
signals = null;
|
|
57978
|
+
}
|
|
57979
|
+
};
|
|
57980
|
+
|
|
57981
|
+
signals.forEach((signal) => signal && signal.addEventListener && signal.addEventListener('abort', onabort));
|
|
57982
|
+
|
|
57983
|
+
const {signal} = controller;
|
|
57984
|
+
|
|
57985
|
+
signal.unsubscribe = unsubscribe;
|
|
57986
|
+
|
|
57987
|
+
return [signal, () => {
|
|
57988
|
+
timer && clearTimeout(timer);
|
|
57989
|
+
timer = null;
|
|
57990
|
+
}];
|
|
57991
|
+
};
|
|
57992
|
+
|
|
57993
|
+
const composeSignals$1 = composeSignals;
|
|
57994
|
+
|
|
57995
|
+
const streamChunk = function* (chunk, chunkSize) {
|
|
57996
|
+
let len = chunk.byteLength;
|
|
57997
|
+
|
|
57998
|
+
if (len < chunkSize) {
|
|
57999
|
+
yield chunk;
|
|
58000
|
+
return;
|
|
58001
|
+
}
|
|
58002
|
+
|
|
58003
|
+
let pos = 0;
|
|
58004
|
+
let end;
|
|
58005
|
+
|
|
58006
|
+
while (pos < len) {
|
|
58007
|
+
end = pos + chunkSize;
|
|
58008
|
+
yield chunk.slice(pos, end);
|
|
58009
|
+
pos = end;
|
|
58010
|
+
}
|
|
58011
|
+
};
|
|
58012
|
+
|
|
58013
|
+
const readBytes = async function* (iterable, chunkSize, encode) {
|
|
58014
|
+
for await (const chunk of iterable) {
|
|
58015
|
+
yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : (await encode(String(chunk))), chunkSize);
|
|
58016
|
+
}
|
|
58017
|
+
};
|
|
58018
|
+
|
|
58019
|
+
const trackStream = (stream, chunkSize, onProgress, onFinish, encode) => {
|
|
58020
|
+
const iterator = readBytes(stream, chunkSize, encode);
|
|
58021
|
+
|
|
58022
|
+
let bytes = 0;
|
|
58023
|
+
let done;
|
|
58024
|
+
let _onFinish = (e) => {
|
|
58025
|
+
if (!done) {
|
|
58026
|
+
done = true;
|
|
58027
|
+
onFinish && onFinish(e);
|
|
58028
|
+
}
|
|
58029
|
+
};
|
|
58030
|
+
|
|
58031
|
+
return new ReadableStream({
|
|
58032
|
+
async pull(controller) {
|
|
58033
|
+
try {
|
|
58034
|
+
const {done, value} = await iterator.next();
|
|
58035
|
+
|
|
58036
|
+
if (done) {
|
|
58037
|
+
_onFinish();
|
|
58038
|
+
controller.close();
|
|
58039
|
+
return;
|
|
58040
|
+
}
|
|
58041
|
+
|
|
58042
|
+
let len = value.byteLength;
|
|
58043
|
+
if (onProgress) {
|
|
58044
|
+
let loadedBytes = bytes += len;
|
|
58045
|
+
onProgress(loadedBytes);
|
|
58046
|
+
}
|
|
58047
|
+
controller.enqueue(new Uint8Array(value));
|
|
58048
|
+
} catch (err) {
|
|
58049
|
+
_onFinish(err);
|
|
58050
|
+
throw err;
|
|
58051
|
+
}
|
|
58052
|
+
},
|
|
58053
|
+
cancel(reason) {
|
|
58054
|
+
_onFinish(reason);
|
|
58055
|
+
return iterator.return();
|
|
58056
|
+
}
|
|
58057
|
+
}, {
|
|
58058
|
+
highWaterMark: 2
|
|
58059
|
+
})
|
|
58060
|
+
};
|
|
58061
|
+
|
|
58062
|
+
const isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';
|
|
58063
|
+
const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';
|
|
58064
|
+
|
|
58065
|
+
// used only inside the fetch adapter
|
|
58066
|
+
const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
|
|
58067
|
+
((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
|
|
58068
|
+
async (str) => new Uint8Array(await new Response(str).arrayBuffer())
|
|
58069
|
+
);
|
|
58070
|
+
|
|
58071
|
+
const test = (fn, ...args) => {
|
|
58072
|
+
try {
|
|
58073
|
+
return !!fn(...args);
|
|
58074
|
+
} catch (e) {
|
|
58075
|
+
return false
|
|
58076
|
+
}
|
|
58077
|
+
};
|
|
58078
|
+
|
|
58079
|
+
const supportsRequestStream = isReadableStreamSupported && test(() => {
|
|
58080
|
+
let duplexAccessed = false;
|
|
58081
|
+
|
|
58082
|
+
const hasContentType = new Request(platform$2.origin, {
|
|
58083
|
+
body: new ReadableStream(),
|
|
58084
|
+
method: 'POST',
|
|
58085
|
+
get duplex() {
|
|
58086
|
+
duplexAccessed = true;
|
|
58087
|
+
return 'half';
|
|
58088
|
+
},
|
|
58089
|
+
}).headers.has('Content-Type');
|
|
58090
|
+
|
|
58091
|
+
return duplexAccessed && !hasContentType;
|
|
58092
|
+
});
|
|
58093
|
+
|
|
58094
|
+
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
58095
|
+
|
|
58096
|
+
const supportsResponseStream = isReadableStreamSupported &&
|
|
58097
|
+
test(() => utils$1$1.isReadableStream(new Response('').body));
|
|
58098
|
+
|
|
58099
|
+
|
|
58100
|
+
const resolvers = {
|
|
58101
|
+
stream: supportsResponseStream && ((res) => res.body)
|
|
58102
|
+
};
|
|
58103
|
+
|
|
58104
|
+
isFetchSupported && (((res) => {
|
|
58105
|
+
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
|
|
58106
|
+
!resolvers[type] && (resolvers[type] = utils$1$1.isFunction(res[type]) ? (res) => res[type]() :
|
|
58107
|
+
(_, config) => {
|
|
58108
|
+
throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
|
|
58109
|
+
});
|
|
58110
|
+
});
|
|
58111
|
+
})(new Response));
|
|
58112
|
+
|
|
58113
|
+
const getBodyLength$1 = async (body) => {
|
|
58114
|
+
if (body == null) {
|
|
58115
|
+
return 0;
|
|
58116
|
+
}
|
|
58117
|
+
|
|
58118
|
+
if(utils$1$1.isBlob(body)) {
|
|
58119
|
+
return body.size;
|
|
58120
|
+
}
|
|
58121
|
+
|
|
58122
|
+
if(utils$1$1.isSpecCompliantForm(body)) {
|
|
58123
|
+
return (await new Request(body).arrayBuffer()).byteLength;
|
|
58124
|
+
}
|
|
58125
|
+
|
|
58126
|
+
if(utils$1$1.isArrayBufferView(body) || utils$1$1.isArrayBuffer(body)) {
|
|
58127
|
+
return body.byteLength;
|
|
58128
|
+
}
|
|
58129
|
+
|
|
58130
|
+
if(utils$1$1.isURLSearchParams(body)) {
|
|
58131
|
+
body = body + '';
|
|
58132
|
+
}
|
|
58133
|
+
|
|
58134
|
+
if(utils$1$1.isString(body)) {
|
|
58135
|
+
return (await encodeText(body)).byteLength;
|
|
58136
|
+
}
|
|
58137
|
+
};
|
|
58138
|
+
|
|
58139
|
+
const resolveBodyLength = async (headers, body) => {
|
|
58140
|
+
const length = utils$1$1.toFiniteNumber(headers.getContentLength());
|
|
58141
|
+
|
|
58142
|
+
return length == null ? getBodyLength$1(body) : length;
|
|
58143
|
+
};
|
|
58144
|
+
|
|
58145
|
+
const fetchAdapter = isFetchSupported && (async (config) => {
|
|
58146
|
+
let {
|
|
58147
|
+
url,
|
|
58148
|
+
method,
|
|
58149
|
+
data,
|
|
58150
|
+
signal,
|
|
58151
|
+
cancelToken,
|
|
58152
|
+
timeout,
|
|
58153
|
+
onDownloadProgress,
|
|
58154
|
+
onUploadProgress,
|
|
58155
|
+
responseType,
|
|
58156
|
+
headers,
|
|
58157
|
+
withCredentials = 'same-origin',
|
|
58158
|
+
fetchOptions
|
|
58159
|
+
} = resolveConfig(config);
|
|
58160
|
+
|
|
58161
|
+
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
|
58162
|
+
|
|
58163
|
+
let [composedSignal, stopTimeout] = (signal || cancelToken || timeout) ?
|
|
58164
|
+
composeSignals$1([signal, cancelToken], timeout) : [];
|
|
58165
|
+
|
|
58166
|
+
let finished, request;
|
|
58167
|
+
|
|
58168
|
+
const onFinish = () => {
|
|
58169
|
+
!finished && setTimeout(() => {
|
|
58170
|
+
composedSignal && composedSignal.unsubscribe();
|
|
58171
|
+
});
|
|
58172
|
+
|
|
58173
|
+
finished = true;
|
|
58174
|
+
};
|
|
58175
|
+
|
|
58176
|
+
let requestContentLength;
|
|
58177
|
+
|
|
58178
|
+
try {
|
|
58179
|
+
if (
|
|
58180
|
+
onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
|
|
58181
|
+
(requestContentLength = await resolveBodyLength(headers, data)) !== 0
|
|
58182
|
+
) {
|
|
58183
|
+
let _request = new Request(url, {
|
|
58184
|
+
method: 'POST',
|
|
58185
|
+
body: data,
|
|
58186
|
+
duplex: "half"
|
|
58187
|
+
});
|
|
58188
|
+
|
|
58189
|
+
let contentTypeHeader;
|
|
58190
|
+
|
|
58191
|
+
if (utils$1$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
|
|
58192
|
+
headers.setContentType(contentTypeHeader);
|
|
58193
|
+
}
|
|
58194
|
+
|
|
58195
|
+
if (_request.body) {
|
|
58196
|
+
const [onProgress, flush] = progressEventDecorator(
|
|
58197
|
+
requestContentLength,
|
|
58198
|
+
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
58199
|
+
);
|
|
58200
|
+
|
|
58201
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush, encodeText);
|
|
58202
|
+
}
|
|
58203
|
+
}
|
|
58204
|
+
|
|
58205
|
+
if (!utils$1$1.isString(withCredentials)) {
|
|
58206
|
+
withCredentials = withCredentials ? 'include' : 'omit';
|
|
58207
|
+
}
|
|
58208
|
+
|
|
58209
|
+
request = new Request(url, {
|
|
58210
|
+
...fetchOptions,
|
|
58211
|
+
signal: composedSignal,
|
|
58212
|
+
method: method.toUpperCase(),
|
|
58213
|
+
headers: headers.normalize().toJSON(),
|
|
58214
|
+
body: data,
|
|
58215
|
+
duplex: "half",
|
|
58216
|
+
credentials: withCredentials
|
|
58217
|
+
});
|
|
58218
|
+
|
|
58219
|
+
let response = await fetch(request);
|
|
58220
|
+
|
|
58221
|
+
const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
|
58222
|
+
|
|
58223
|
+
if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {
|
|
58224
|
+
const options = {};
|
|
58225
|
+
|
|
58226
|
+
['status', 'statusText', 'headers'].forEach(prop => {
|
|
58227
|
+
options[prop] = response[prop];
|
|
58228
|
+
});
|
|
58229
|
+
|
|
58230
|
+
const responseContentLength = utils$1$1.toFiniteNumber(response.headers.get('content-length'));
|
|
58231
|
+
|
|
58232
|
+
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
|
58233
|
+
responseContentLength,
|
|
58234
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
58235
|
+
) || [];
|
|
58236
|
+
|
|
58237
|
+
response = new Response(
|
|
58238
|
+
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
58239
|
+
flush && flush();
|
|
58240
|
+
isStreamResponse && onFinish();
|
|
58241
|
+
}, encodeText),
|
|
58242
|
+
options
|
|
58243
|
+
);
|
|
58244
|
+
}
|
|
58245
|
+
|
|
58246
|
+
responseType = responseType || 'text';
|
|
58247
|
+
|
|
58248
|
+
let responseData = await resolvers[utils$1$1.findKey(resolvers, responseType) || 'text'](response, config);
|
|
58249
|
+
|
|
58250
|
+
!isStreamResponse && onFinish();
|
|
58251
|
+
|
|
58252
|
+
stopTimeout && stopTimeout();
|
|
58253
|
+
|
|
58254
|
+
return await new Promise((resolve, reject) => {
|
|
58255
|
+
settle$1(resolve, reject, {
|
|
58256
|
+
data: responseData,
|
|
58257
|
+
headers: AxiosHeaders$1.from(response.headers),
|
|
58258
|
+
status: response.status,
|
|
58259
|
+
statusText: response.statusText,
|
|
58260
|
+
config,
|
|
58261
|
+
request
|
|
58262
|
+
});
|
|
58263
|
+
})
|
|
58264
|
+
} catch (err) {
|
|
58265
|
+
onFinish();
|
|
58266
|
+
|
|
58267
|
+
if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
|
|
58268
|
+
throw Object.assign(
|
|
58269
|
+
new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
|
|
58270
|
+
{
|
|
58271
|
+
cause: err.cause || err
|
|
58272
|
+
}
|
|
58273
|
+
)
|
|
58274
|
+
}
|
|
58275
|
+
|
|
58276
|
+
throw AxiosError.from(err, err && err.code, config, request);
|
|
58277
|
+
}
|
|
58278
|
+
});
|
|
58279
|
+
|
|
57785
58280
|
const knownAdapters = {
|
|
57786
58281
|
http: httpAdapter,
|
|
57787
|
-
xhr: xhrAdapter
|
|
58282
|
+
xhr: xhrAdapter,
|
|
58283
|
+
fetch: fetchAdapter
|
|
57788
58284
|
};
|
|
57789
58285
|
|
|
57790
58286
|
utils$1$1.forEach(knownAdapters, (fn, value) => {
|
|
@@ -57928,108 +58424,6 @@ function dispatchRequest(config) {
|
|
|
57928
58424
|
});
|
|
57929
58425
|
}
|
|
57930
58426
|
|
|
57931
|
-
const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
|
|
57932
|
-
|
|
57933
|
-
/**
|
|
57934
|
-
* Config-specific merge-function which creates a new config-object
|
|
57935
|
-
* by merging two configuration objects together.
|
|
57936
|
-
*
|
|
57937
|
-
* @param {Object} config1
|
|
57938
|
-
* @param {Object} config2
|
|
57939
|
-
*
|
|
57940
|
-
* @returns {Object} New object resulting from merging config2 to config1
|
|
57941
|
-
*/
|
|
57942
|
-
function mergeConfig(config1, config2) {
|
|
57943
|
-
// eslint-disable-next-line no-param-reassign
|
|
57944
|
-
config2 = config2 || {};
|
|
57945
|
-
const config = {};
|
|
57946
|
-
|
|
57947
|
-
function getMergedValue(target, source, caseless) {
|
|
57948
|
-
if (utils$1$1.isPlainObject(target) && utils$1$1.isPlainObject(source)) {
|
|
57949
|
-
return utils$1$1.merge.call({caseless}, target, source);
|
|
57950
|
-
} else if (utils$1$1.isPlainObject(source)) {
|
|
57951
|
-
return utils$1$1.merge({}, source);
|
|
57952
|
-
} else if (utils$1$1.isArray(source)) {
|
|
57953
|
-
return source.slice();
|
|
57954
|
-
}
|
|
57955
|
-
return source;
|
|
57956
|
-
}
|
|
57957
|
-
|
|
57958
|
-
// eslint-disable-next-line consistent-return
|
|
57959
|
-
function mergeDeepProperties(a, b, caseless) {
|
|
57960
|
-
if (!utils$1$1.isUndefined(b)) {
|
|
57961
|
-
return getMergedValue(a, b, caseless);
|
|
57962
|
-
} else if (!utils$1$1.isUndefined(a)) {
|
|
57963
|
-
return getMergedValue(undefined, a, caseless);
|
|
57964
|
-
}
|
|
57965
|
-
}
|
|
57966
|
-
|
|
57967
|
-
// eslint-disable-next-line consistent-return
|
|
57968
|
-
function valueFromConfig2(a, b) {
|
|
57969
|
-
if (!utils$1$1.isUndefined(b)) {
|
|
57970
|
-
return getMergedValue(undefined, b);
|
|
57971
|
-
}
|
|
57972
|
-
}
|
|
57973
|
-
|
|
57974
|
-
// eslint-disable-next-line consistent-return
|
|
57975
|
-
function defaultToConfig2(a, b) {
|
|
57976
|
-
if (!utils$1$1.isUndefined(b)) {
|
|
57977
|
-
return getMergedValue(undefined, b);
|
|
57978
|
-
} else if (!utils$1$1.isUndefined(a)) {
|
|
57979
|
-
return getMergedValue(undefined, a);
|
|
57980
|
-
}
|
|
57981
|
-
}
|
|
57982
|
-
|
|
57983
|
-
// eslint-disable-next-line consistent-return
|
|
57984
|
-
function mergeDirectKeys(a, b, prop) {
|
|
57985
|
-
if (prop in config2) {
|
|
57986
|
-
return getMergedValue(a, b);
|
|
57987
|
-
} else if (prop in config1) {
|
|
57988
|
-
return getMergedValue(undefined, a);
|
|
57989
|
-
}
|
|
57990
|
-
}
|
|
57991
|
-
|
|
57992
|
-
const mergeMap = {
|
|
57993
|
-
url: valueFromConfig2,
|
|
57994
|
-
method: valueFromConfig2,
|
|
57995
|
-
data: valueFromConfig2,
|
|
57996
|
-
baseURL: defaultToConfig2,
|
|
57997
|
-
transformRequest: defaultToConfig2,
|
|
57998
|
-
transformResponse: defaultToConfig2,
|
|
57999
|
-
paramsSerializer: defaultToConfig2,
|
|
58000
|
-
timeout: defaultToConfig2,
|
|
58001
|
-
timeoutMessage: defaultToConfig2,
|
|
58002
|
-
withCredentials: defaultToConfig2,
|
|
58003
|
-
withXSRFToken: defaultToConfig2,
|
|
58004
|
-
adapter: defaultToConfig2,
|
|
58005
|
-
responseType: defaultToConfig2,
|
|
58006
|
-
xsrfCookieName: defaultToConfig2,
|
|
58007
|
-
xsrfHeaderName: defaultToConfig2,
|
|
58008
|
-
onUploadProgress: defaultToConfig2,
|
|
58009
|
-
onDownloadProgress: defaultToConfig2,
|
|
58010
|
-
decompress: defaultToConfig2,
|
|
58011
|
-
maxContentLength: defaultToConfig2,
|
|
58012
|
-
maxBodyLength: defaultToConfig2,
|
|
58013
|
-
beforeRedirect: defaultToConfig2,
|
|
58014
|
-
transport: defaultToConfig2,
|
|
58015
|
-
httpAgent: defaultToConfig2,
|
|
58016
|
-
httpsAgent: defaultToConfig2,
|
|
58017
|
-
cancelToken: defaultToConfig2,
|
|
58018
|
-
socketPath: defaultToConfig2,
|
|
58019
|
-
responseEncoding: defaultToConfig2,
|
|
58020
|
-
validateStatus: mergeDirectKeys,
|
|
58021
|
-
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
|
58022
|
-
};
|
|
58023
|
-
|
|
58024
|
-
utils$1$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
|
58025
|
-
const merge = mergeMap[prop] || mergeDeepProperties;
|
|
58026
|
-
const configValue = merge(config1[prop], config2[prop], prop);
|
|
58027
|
-
(utils$1$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
58028
|
-
});
|
|
58029
|
-
|
|
58030
|
-
return config;
|
|
58031
|
-
}
|
|
58032
|
-
|
|
58033
58427
|
const validators$1 = {};
|
|
58034
58428
|
|
|
58035
58429
|
// eslint-disable-next-line func-names
|
|
@@ -58154,12 +58548,15 @@ class Axios {
|
|
|
58154
58548
|
|
|
58155
58549
|
// slice off the Error: ... line
|
|
58156
58550
|
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
|
|
58157
|
-
|
|
58158
|
-
|
|
58159
|
-
|
|
58160
|
-
|
|
58161
|
-
|
|
58162
|
-
|
|
58551
|
+
try {
|
|
58552
|
+
if (!err.stack) {
|
|
58553
|
+
err.stack = stack;
|
|
58554
|
+
// match without the 2 top stack lines
|
|
58555
|
+
} else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
|
|
58556
|
+
err.stack += '\n' + stack;
|
|
58557
|
+
}
|
|
58558
|
+
} catch (e) {
|
|
58559
|
+
// ignore the case where "stack" is an un-writable property
|
|
58163
58560
|
}
|
|
58164
58561
|
}
|
|
58165
58562
|
|
|
@@ -58632,7 +59029,7 @@ var description$5 = "The official CouchDB client for Node.js";
|
|
|
58632
59029
|
var license$7 = "Apache-2.0";
|
|
58633
59030
|
var homepage$6 = "http://github.com/apache/couchdb-nano";
|
|
58634
59031
|
var repository$6 = "http://github.com/apache/couchdb-nano";
|
|
58635
|
-
var version$9 = "10.1.
|
|
59032
|
+
var version$9 = "10.1.4";
|
|
58636
59033
|
var author$4 = "Apache CouchDB <dev@couchdb.apache.org> (http://couchdb.apache.org)";
|
|
58637
59034
|
var keywords$6 = [
|
|
58638
59035
|
"couchdb",
|
|
@@ -58645,16 +59042,16 @@ var keywords$6 = [
|
|
|
58645
59042
|
"database"
|
|
58646
59043
|
];
|
|
58647
59044
|
var dependencies$6 = {
|
|
58648
|
-
axios: "^1.
|
|
58649
|
-
qs: "^6.
|
|
58650
|
-
"node-abort-controller": "^3.
|
|
59045
|
+
axios: "^1.7.4",
|
|
59046
|
+
qs: "^6.13.0",
|
|
59047
|
+
"node-abort-controller": "^3.1.1"
|
|
58651
59048
|
};
|
|
58652
59049
|
var devDependencies$6 = {
|
|
58653
|
-
"@types/node": "^
|
|
58654
|
-
jest: "^29.
|
|
58655
|
-
nock: "^13.
|
|
59050
|
+
"@types/node": "^22.3.0",
|
|
59051
|
+
jest: "^29.7.0",
|
|
59052
|
+
nock: "^13.5.4",
|
|
58656
59053
|
standard: "^17.1.0",
|
|
58657
|
-
typescript: "^
|
|
59054
|
+
typescript: "^5.5.4"
|
|
58658
59055
|
};
|
|
58659
59056
|
var scripts$6 = {
|
|
58660
59057
|
standard: "standard --fix",
|
|
@@ -199906,7 +200303,7 @@ const shared$2 = sharedExports;
|
|
|
199906
200303
|
* @fires Request#error
|
|
199907
200304
|
*/
|
|
199908
200305
|
|
|
199909
|
-
let Request$
|
|
200306
|
+
let Request$2=class Request extends EventEmitter$8 {
|
|
199910
200307
|
/**
|
|
199911
200308
|
* Create new Request.
|
|
199912
200309
|
*
|
|
@@ -200523,7 +200920,7 @@ let Request$1=class Request extends EventEmitter$8 {
|
|
|
200523
200920
|
}
|
|
200524
200921
|
};
|
|
200525
200922
|
|
|
200526
|
-
var request$2 = Request$
|
|
200923
|
+
var request$2 = Request$2;var isolationlevel = {
|
|
200527
200924
|
READ_UNCOMMITTED: 0x01,
|
|
200528
200925
|
READ_COMMITTED: 0x02,
|
|
200529
200926
|
REPEATABLE_READ: 0x03,
|
|
@@ -271821,7 +272218,7 @@ const parameterCorrection = function (value) {
|
|
|
271821
272218
|
}
|
|
271822
272219
|
};
|
|
271823
272220
|
|
|
271824
|
-
class Request extends BaseRequest {
|
|
272221
|
+
let Request$1=class Request extends BaseRequest {
|
|
271825
272222
|
/*
|
|
271826
272223
|
Execute specified sql batch.
|
|
271827
272224
|
*/
|
|
@@ -272619,9 +273016,9 @@ class Request extends BaseRequest {
|
|
|
272619
273016
|
this._currentRequest.resume();
|
|
272620
273017
|
}
|
|
272621
273018
|
}
|
|
272622
|
-
}
|
|
273019
|
+
};
|
|
272623
273020
|
|
|
272624
|
-
var request = Request;(function (module) {
|
|
273021
|
+
var request = Request$1;(function (module) {
|
|
272625
273022
|
|
|
272626
273023
|
const base = baseExports;
|
|
272627
273024
|
const ConnectionPool = connectionPool;
|