@rsdoctor/cli 1.5.0 → 1.5.2-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +99 -108
- package/dist/index.js +98 -107
- package/package.json +9 -9
package/dist/index.cjs
CHANGED
|
@@ -1846,7 +1846,7 @@ var __webpack_modules__ = {
|
|
|
1846
1846
|
},
|
|
1847
1847
|
"./package.json" (module) {
|
|
1848
1848
|
"use strict";
|
|
1849
|
-
module.exports = JSON.parse('{"name":"@rsdoctor/cli","version":"1.5.0","repository":{"type":"git","url":"https://github.com/web-infra-dev/rsdoctor","directory":"packages/cli"},"bin":{"rsdoctor":"./bin/rsdoctor"},"files":["bin","dist"],"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.cjs"}},"license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"dev":"npm run start","build":"rslib build","start":"rslib build -w","test":"rstest run"},"type":"module","dependencies":{"ora":"^5.4.1","@rsdoctor/core":"workspace:*","@rsdoctor/sdk":"workspace:*","@rsdoctor/types":"workspace:*","@rsdoctor/utils":"workspace:*","@rsdoctor/graph":"workspace:*"},"devDependencies":{"@rsdoctor/client":"workspace:*","cac":"^6.7.14","typescript":"^5.9.2","axios":"^1.13.
|
|
1849
|
+
module.exports = JSON.parse('{"name":"@rsdoctor/cli","version":"1.5.2-beta.0","repository":{"type":"git","url":"https://github.com/web-infra-dev/rsdoctor","directory":"packages/cli"},"bin":{"rsdoctor":"./bin/rsdoctor"},"files":["bin","dist"],"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.cjs"}},"license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"dev":"npm run start","build":"rslib build","start":"rslib build -w","test":"rstest run"},"type":"module","dependencies":{"ora":"^5.4.1","@rsdoctor/core":"workspace:*","@rsdoctor/sdk":"workspace:*","@rsdoctor/types":"workspace:*","@rsdoctor/utils":"workspace:*","@rsdoctor/graph":"workspace:*"},"devDependencies":{"@rsdoctor/client":"workspace:*","cac":"^6.7.14","typescript":"^5.9.2","axios":"^1.13.4","picocolors":"^1.1.1"},"peerDependencies":{"@rsdoctor/client":"workspace:*"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"}}');
|
|
1850
1850
|
}
|
|
1851
1851
|
}, __webpack_module_cache__ = {};
|
|
1852
1852
|
function __webpack_require__(moduleId) {
|
|
@@ -2294,14 +2294,29 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
2294
2294
|
return result;
|
|
2295
2295
|
},
|
|
2296
2296
|
extend: (a, b, thisArg, { allOwnKeys } = {})=>(forEach(b, (val, key)=>{
|
|
2297
|
-
thisArg && isFunction(val) ? a
|
|
2297
|
+
thisArg && isFunction(val) ? Object.defineProperty(a, key, {
|
|
2298
|
+
value: bind(val, thisArg),
|
|
2299
|
+
writable: !0,
|
|
2300
|
+
enumerable: !0,
|
|
2301
|
+
configurable: !0
|
|
2302
|
+
}) : Object.defineProperty(a, key, {
|
|
2303
|
+
value: val,
|
|
2304
|
+
writable: !0,
|
|
2305
|
+
enumerable: !0,
|
|
2306
|
+
configurable: !0
|
|
2307
|
+
});
|
|
2298
2308
|
}, {
|
|
2299
2309
|
allOwnKeys
|
|
2300
2310
|
}), a),
|
|
2301
2311
|
trim: (str)=>str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''),
|
|
2302
2312
|
stripBOM: (content)=>(0xFEFF === content.charCodeAt(0) && (content = content.slice(1)), content),
|
|
2303
2313
|
inherits: (constructor, superConstructor, props, descriptors)=>{
|
|
2304
|
-
constructor.prototype = Object.create(superConstructor.prototype, descriptors),
|
|
2314
|
+
constructor.prototype = Object.create(superConstructor.prototype, descriptors), Object.defineProperty(constructor.prototype, 'constructor', {
|
|
2315
|
+
value: constructor,
|
|
2316
|
+
writable: !0,
|
|
2317
|
+
enumerable: !1,
|
|
2318
|
+
configurable: !0
|
|
2319
|
+
}), Object.defineProperty(constructor, 'super', {
|
|
2305
2320
|
value: superConstructor.prototype
|
|
2306
2321
|
}), props && Object.assign(constructor.prototype, props);
|
|
2307
2322
|
},
|
|
@@ -2407,11 +2422,15 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
2407
2422
|
asap,
|
|
2408
2423
|
isIterable: (thing)=>null != thing && isFunction(thing[utils_iterator])
|
|
2409
2424
|
};
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2425
|
+
class AxiosError extends Error {
|
|
2426
|
+
static from(error, code, config, request, response, customProps) {
|
|
2427
|
+
let axiosError = new AxiosError(error.message, code || error.code, config, request, response);
|
|
2428
|
+
return axiosError.cause = error, axiosError.name = error.name, customProps && Object.assign(axiosError, customProps), axiosError;
|
|
2429
|
+
}
|
|
2430
|
+
constructor(message, code, config, request, response){
|
|
2431
|
+
super(message), this.name = 'AxiosError', this.isAxiosError = !0, code && (this.code = code), config && (this.config = config), request && (this.request = request), response && (this.response = response, this.status = response.status);
|
|
2432
|
+
}
|
|
2433
|
+
toJSON() {
|
|
2415
2434
|
return {
|
|
2416
2435
|
message: this.message,
|
|
2417
2436
|
name: this.name,
|
|
@@ -2426,38 +2445,9 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
2426
2445
|
status: this.status
|
|
2427
2446
|
};
|
|
2428
2447
|
}
|
|
2429
|
-
}
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
'ERR_BAD_OPTION_VALUE',
|
|
2433
|
-
'ERR_BAD_OPTION',
|
|
2434
|
-
'ECONNABORTED',
|
|
2435
|
-
'ETIMEDOUT',
|
|
2436
|
-
'ERR_NETWORK',
|
|
2437
|
-
'ERR_FR_TOO_MANY_REDIRECTS',
|
|
2438
|
-
'ERR_DEPRECATED',
|
|
2439
|
-
'ERR_BAD_RESPONSE',
|
|
2440
|
-
'ERR_BAD_REQUEST',
|
|
2441
|
-
'ERR_CANCELED',
|
|
2442
|
-
'ERR_NOT_SUPPORT',
|
|
2443
|
-
'ERR_INVALID_URL'
|
|
2444
|
-
].forEach((code)=>{
|
|
2445
|
-
AxiosError_descriptors[code] = {
|
|
2446
|
-
value: code
|
|
2447
|
-
};
|
|
2448
|
-
}), Object.defineProperties(AxiosError, AxiosError_descriptors), Object.defineProperty(AxiosError_prototype, 'isAxiosError', {
|
|
2449
|
-
value: !0
|
|
2450
|
-
}), AxiosError.from = (error, code, config, request, response, customProps)=>{
|
|
2451
|
-
let axiosError = Object.create(AxiosError_prototype);
|
|
2452
|
-
utils.toFlatObject(error, axiosError, function(obj) {
|
|
2453
|
-
return obj !== Error.prototype;
|
|
2454
|
-
}, (prop)=>'isAxiosError' !== prop);
|
|
2455
|
-
let msg = error && error.message ? error.message : 'Error', errCode = null == code && error ? error.code : code;
|
|
2456
|
-
return AxiosError.call(axiosError, msg, errCode, config, request, response), error && null == axiosError.cause && Object.defineProperty(axiosError, 'cause', {
|
|
2457
|
-
value: error,
|
|
2458
|
-
configurable: !0
|
|
2459
|
-
}), axiosError.name = error && error.name || 'Error', customProps && Object.assign(axiosError, customProps), axiosError;
|
|
2460
|
-
};
|
|
2448
|
+
}
|
|
2449
|
+
AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE', AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION', AxiosError.ECONNABORTED = 'ECONNABORTED', AxiosError.ETIMEDOUT = 'ETIMEDOUT', AxiosError.ERR_NETWORK = 'ERR_NETWORK', AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS', AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED', AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE', AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST', AxiosError.ERR_CANCELED = 'ERR_CANCELED', AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT', AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
|
|
2450
|
+
let core_AxiosError = AxiosError;
|
|
2461
2451
|
var form_data = __webpack_require__("../../node_modules/.pnpm/form-data@4.0.4/node_modules/form-data/lib/form_data.js");
|
|
2462
2452
|
function isVisitable(thing) {
|
|
2463
2453
|
return utils.isPlainObject(thing) || utils.isArray(thing);
|
|
@@ -2487,7 +2477,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
2487
2477
|
if (null === value) return '';
|
|
2488
2478
|
if (utils.isDate(value)) return value.toISOString();
|
|
2489
2479
|
if (utils.isBoolean(value)) return value.toString();
|
|
2490
|
-
if (!useBlob && utils.isBlob(value)) throw new
|
|
2480
|
+
if (!useBlob && utils.isBlob(value)) throw new core_AxiosError('Blob is not supported. Use a Buffer instead.');
|
|
2491
2481
|
return utils.isArrayBuffer(value) || utils.isTypedArray(value) ? useBlob && 'function' == typeof Blob ? new Blob([
|
|
2492
2482
|
value
|
|
2493
2483
|
]) : Buffer.from(value) : value;
|
|
@@ -2546,12 +2536,10 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
2546
2536
|
function buildURL(url, params, options) {
|
|
2547
2537
|
let serializedParams;
|
|
2548
2538
|
if (!params) return url;
|
|
2549
|
-
let _encode = options && options.encode || buildURL_encode
|
|
2550
|
-
utils.isFunction(options) && (options = {
|
|
2539
|
+
let _encode = options && options.encode || buildURL_encode, _options = utils.isFunction(options) ? {
|
|
2551
2540
|
serialize: options
|
|
2552
|
-
}
|
|
2553
|
-
|
|
2554
|
-
if (serializedParams = serializeFn ? serializeFn(params, options) : utils.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode)) {
|
|
2541
|
+
} : options, serializeFn = _options && _options.serialize;
|
|
2542
|
+
if (serializedParams = serializeFn ? serializeFn(params, _options) : utils.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, _options).toString(_encode)) {
|
|
2555
2543
|
let hashmarkIndex = url.indexOf("#");
|
|
2556
2544
|
-1 !== hashmarkIndex && (url = url.slice(0, hashmarkIndex)), url += (-1 === url.indexOf('?') ? '?' : '&') + serializedParams;
|
|
2557
2545
|
}
|
|
@@ -2705,7 +2693,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
2705
2693
|
return JSON.parse(data, this.parseReviver);
|
|
2706
2694
|
} catch (e) {
|
|
2707
2695
|
if (!silentJSONParsing && JSONRequested) {
|
|
2708
|
-
if ('SyntaxError' === e.name) throw
|
|
2696
|
+
if ('SyntaxError' === e.name) throw core_AxiosError.from(e, core_AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
|
|
2709
2697
|
throw e;
|
|
2710
2698
|
}
|
|
2711
2699
|
}
|
|
@@ -2934,21 +2922,6 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
2934
2922
|
function isCancel(value) {
|
|
2935
2923
|
return !!(value && value.__CANCEL__);
|
|
2936
2924
|
}
|
|
2937
|
-
function CanceledError(message, config, request) {
|
|
2938
|
-
AxiosError.call(this, null == message ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request), this.name = 'CanceledError';
|
|
2939
|
-
}
|
|
2940
|
-
function settle(resolve, reject, response) {
|
|
2941
|
-
let validateStatus = response.config.validateStatus;
|
|
2942
|
-
!response.status || !validateStatus || validateStatus(response.status) ? resolve(response) : reject(new AxiosError('Request failed with status code ' + response.status, [
|
|
2943
|
-
AxiosError.ERR_BAD_REQUEST,
|
|
2944
|
-
AxiosError.ERR_BAD_RESPONSE
|
|
2945
|
-
][Math.floor(response.status / 100) - 4], response.config, response.request, response));
|
|
2946
|
-
}
|
|
2947
|
-
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
2948
|
-
var url, baseURL1, relativeURL;
|
|
2949
|
-
let isRelativeUrl = (url = requestedURL, !/^([a-z][a-z\d+\-.]*:)?\/\//i.test(url));
|
|
2950
|
-
return baseURL && (isRelativeUrl || !1 == allowAbsoluteUrls) ? (baseURL1 = baseURL, (relativeURL = requestedURL) ? baseURL1.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL1) : requestedURL;
|
|
2951
|
-
}
|
|
2952
2925
|
AxiosHeaders.accessor([
|
|
2953
2926
|
'Content-Type',
|
|
2954
2927
|
'Content-Length',
|
|
@@ -2964,9 +2937,24 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
2964
2937
|
this[mapped] = headerValue;
|
|
2965
2938
|
}
|
|
2966
2939
|
};
|
|
2967
|
-
}), utils.freezeMethods(AxiosHeaders)
|
|
2968
|
-
|
|
2969
|
-
|
|
2940
|
+
}), utils.freezeMethods(AxiosHeaders);
|
|
2941
|
+
let cancel_CanceledError = class extends core_AxiosError {
|
|
2942
|
+
constructor(message, config, request){
|
|
2943
|
+
super(null == message ? 'canceled' : message, core_AxiosError.ERR_CANCELED, config, request), this.name = 'CanceledError', this.__CANCEL__ = !0;
|
|
2944
|
+
}
|
|
2945
|
+
};
|
|
2946
|
+
function settle(resolve, reject, response) {
|
|
2947
|
+
let validateStatus = response.config.validateStatus;
|
|
2948
|
+
!response.status || !validateStatus || validateStatus(response.status) ? resolve(response) : reject(new core_AxiosError('Request failed with status code ' + response.status, [
|
|
2949
|
+
core_AxiosError.ERR_BAD_REQUEST,
|
|
2950
|
+
core_AxiosError.ERR_BAD_RESPONSE
|
|
2951
|
+
][Math.floor(response.status / 100) - 4], response.config, response.request, response));
|
|
2952
|
+
}
|
|
2953
|
+
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
2954
|
+
var url, baseURL1, relativeURL;
|
|
2955
|
+
let isRelativeUrl = (url = requestedURL, !/^([a-z][a-z\d+\-.]*:)?\/\//i.test(url));
|
|
2956
|
+
return baseURL && (isRelativeUrl || !1 == allowAbsoluteUrls) ? (baseURL1 = baseURL, (relativeURL = requestedURL) ? baseURL1.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL1) : requestedURL;
|
|
2957
|
+
}
|
|
2970
2958
|
var proxy_from_env = __webpack_require__("../../node_modules/.pnpm/proxy-from-env@1.1.0/node_modules/proxy-from-env/index.js"), external_http_ = __webpack_require__("http"), external_https_ = __webpack_require__("https");
|
|
2971
2959
|
let external_http2_namespaceObject = require("http2");
|
|
2972
2960
|
var external_util_ = __webpack_require__("util"), follow_redirects = __webpack_require__("../../node_modules/.pnpm/follow-redirects@1.15.9/node_modules/follow-redirects/index.js");
|
|
@@ -3186,7 +3174,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3186
3174
|
family
|
|
3187
3175
|
}), http2Transport = {
|
|
3188
3176
|
request (options, cb) {
|
|
3189
|
-
let authority = options.protocol + '//' + options.hostname + ':' + (options.port || 80), { http2Options, headers } = options, session = http2Sessions.getSession(authority, http2Options), { HTTP2_HEADER_SCHEME, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_STATUS } = external_http2_namespaceObject.constants, http2Headers = {
|
|
3177
|
+
let authority = options.protocol + '//' + options.hostname + ':' + (options.port || ('https:' === options.protocol ? 443 : 80)), { http2Options, headers } = options, session = http2Sessions.getSession(authority, http2Options), { HTTP2_HEADER_SCHEME, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_STATUS } = external_http2_namespaceObject.constants, http2Headers = {
|
|
3190
3178
|
[HTTP2_HEADER_SCHEME]: options.protocol.replace(':', ''),
|
|
3191
3179
|
[HTTP2_HEADER_METHOD]: options.method,
|
|
3192
3180
|
[HTTP2_HEADER_PATH]: options.path
|
|
@@ -3233,7 +3221,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3233
3221
|
let abortEmitter = new external_events_namespaceObject.EventEmitter();
|
|
3234
3222
|
function abort(reason) {
|
|
3235
3223
|
try {
|
|
3236
|
-
abortEmitter.emit('abort', !reason || reason.type ? new
|
|
3224
|
+
abortEmitter.emit('abort', !reason || reason.type ? new cancel_CanceledError(null, config, req) : reason);
|
|
3237
3225
|
} catch (err) {
|
|
3238
3226
|
console.warn('emit error', err);
|
|
3239
3227
|
}
|
|
@@ -3274,7 +3262,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3274
3262
|
return bytes > 0 ? bytes : 0;
|
|
3275
3263
|
}
|
|
3276
3264
|
return Buffer.byteLength(body, 'utf8');
|
|
3277
|
-
}(String(config.url || fullPath || '')) > config.maxContentLength) return reject(new
|
|
3265
|
+
}(String(config.url || fullPath || '')) > config.maxContentLength) return reject(new core_AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded', core_AxiosError.ERR_BAD_RESPONSE, config));
|
|
3278
3266
|
if ('GET' !== method) return settle(resolve, reject, {
|
|
3279
3267
|
status: 405,
|
|
3280
3268
|
statusText: 'method not allowed',
|
|
@@ -3287,10 +3275,10 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3287
3275
|
if (void 0 === asBlob && _Blob && (asBlob = !0), 'data' === protocol) {
|
|
3288
3276
|
uri = protocol.length ? uri.slice(protocol.length + 1) : uri;
|
|
3289
3277
|
let match = DATA_URL_PATTERN.exec(uri);
|
|
3290
|
-
if (!match) throw new
|
|
3278
|
+
if (!match) throw new core_AxiosError('Invalid URL', core_AxiosError.ERR_INVALID_URL);
|
|
3291
3279
|
let mime = match[1], isBase64 = match[2], body = match[3], buffer = Buffer.from(decodeURIComponent(body), isBase64 ? 'base64' : 'utf8');
|
|
3292
3280
|
if (asBlob) {
|
|
3293
|
-
if (!_Blob) throw new
|
|
3281
|
+
if (!_Blob) throw new core_AxiosError('Blob is not supported', core_AxiosError.ERR_NOT_SUPPORT);
|
|
3294
3282
|
return new _Blob([
|
|
3295
3283
|
buffer
|
|
3296
3284
|
], {
|
|
@@ -3299,12 +3287,12 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3299
3287
|
}
|
|
3300
3288
|
return buffer;
|
|
3301
3289
|
}
|
|
3302
|
-
throw new
|
|
3290
|
+
throw new core_AxiosError('Unsupported protocol ' + protocol, core_AxiosError.ERR_NOT_SUPPORT);
|
|
3303
3291
|
}(config.url, 'blob' === responseType, {
|
|
3304
3292
|
Blob: config.env && config.env.Blob
|
|
3305
3293
|
});
|
|
3306
3294
|
} catch (err) {
|
|
3307
|
-
throw
|
|
3295
|
+
throw core_AxiosError.from(err, core_AxiosError.ERR_BAD_REQUEST, config);
|
|
3308
3296
|
}
|
|
3309
3297
|
return 'text' === responseType ? (convertedData = convertedData.toString(responseEncoding), responseEncoding && 'utf8' !== responseEncoding || (convertedData = utils.stripBOM(convertedData))) : 'stream' === responseType && (convertedData = external_stream_.Readable.from(convertedData)), settle(resolve, reject, {
|
|
3310
3298
|
data: convertedData,
|
|
@@ -3314,9 +3302,9 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3314
3302
|
config
|
|
3315
3303
|
});
|
|
3316
3304
|
}
|
|
3317
|
-
if (-1 === supportedProtocols.indexOf(protocol)) return reject(new
|
|
3305
|
+
if (-1 === supportedProtocols.indexOf(protocol)) return reject(new core_AxiosError('Unsupported protocol ' + protocol, core_AxiosError.ERR_BAD_REQUEST, config));
|
|
3318
3306
|
let headers = AxiosHeaders.from(config.headers).normalize();
|
|
3319
|
-
headers.set('User-Agent', "axios/1.13.
|
|
3307
|
+
headers.set('User-Agent', "axios/1.13.4", !1);
|
|
3320
3308
|
let { onUploadProgress, onDownloadProgress } = config, maxRate = config.maxRate;
|
|
3321
3309
|
if (utils.isSpecCompliantForm(data)) {
|
|
3322
3310
|
let userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
|
|
@@ -3339,7 +3327,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3339
3327
|
})(data, (formHeaders)=>{
|
|
3340
3328
|
headers.set(formHeaders);
|
|
3341
3329
|
}, {
|
|
3342
|
-
tag: "axios-1.13.
|
|
3330
|
+
tag: "axios-1.13.4-boundary",
|
|
3343
3331
|
boundary: userBoundary && userBoundary[1] || void 0
|
|
3344
3332
|
});
|
|
3345
3333
|
} else if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) {
|
|
@@ -3352,10 +3340,10 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3352
3340
|
if (Buffer.isBuffer(data)) ;
|
|
3353
3341
|
else if (utils.isArrayBuffer(data)) data = Buffer.from(new Uint8Array(data));
|
|
3354
3342
|
else {
|
|
3355
|
-
if (!utils.isString(data)) return reject(new
|
|
3343
|
+
if (!utils.isString(data)) return reject(new core_AxiosError('Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', core_AxiosError.ERR_BAD_REQUEST, config));
|
|
3356
3344
|
data = Buffer.from(data, 'utf-8');
|
|
3357
3345
|
}
|
|
3358
|
-
if (headers.setContentLength(data.length, !1), config.maxBodyLength > -1 && data.length > config.maxBodyLength) return reject(new
|
|
3346
|
+
if (headers.setContentLength(data.length, !1), config.maxBodyLength > -1 && data.length > config.maxBodyLength) return reject(new core_AxiosError('Request body larger than maxBodyLength limit', core_AxiosError.ERR_BAD_REQUEST, config));
|
|
3359
3347
|
}
|
|
3360
3348
|
let contentLength = utils.toFiniteNumber(headers.getContentLength());
|
|
3361
3349
|
utils.isArray(maxRate) ? (maxUploadRate = maxRate[0], maxDownloadRate = maxRate[1]) : maxUploadRate = maxDownloadRate = maxRate, data && (onUploadProgress || maxUploadRate) && (utils.isStream(data) || (data = external_stream_.Readable.from(data, {
|
|
@@ -3396,7 +3384,10 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3396
3384
|
}
|
|
3397
3385
|
if (proxy) {
|
|
3398
3386
|
if (proxy.username && (proxy.auth = (proxy.username || '') + ':' + (proxy.password || '')), proxy.auth) {
|
|
3399
|
-
(proxy.auth.username || proxy.auth.password)
|
|
3387
|
+
if (proxy.auth.username || proxy.auth.password) proxy.auth = (proxy.auth.username || '') + ':' + (proxy.auth.password || '');
|
|
3388
|
+
else if ('object' == typeof proxy.auth) throw new core_AxiosError('Invalid proxy authorization', core_AxiosError.ERR_BAD_OPTION, {
|
|
3389
|
+
proxy
|
|
3390
|
+
});
|
|
3400
3391
|
let base64 = Buffer.from(proxy.auth, 'utf8').toString('base64');
|
|
3401
3392
|
options.headers['Proxy-Authorization'] = 'Basic ' + base64;
|
|
3402
3393
|
}
|
|
@@ -3446,19 +3437,19 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3446
3437
|
else {
|
|
3447
3438
|
let responseBuffer = [], totalResponseBytes = 0;
|
|
3448
3439
|
responseStream.on('data', function(chunk) {
|
|
3449
|
-
responseBuffer.push(chunk), totalResponseBytes += chunk.length, config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength && (rejected = !0, responseStream.destroy(), abort(new
|
|
3440
|
+
responseBuffer.push(chunk), totalResponseBytes += chunk.length, config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength && (rejected = !0, responseStream.destroy(), abort(new core_AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded', core_AxiosError.ERR_BAD_RESPONSE, config, lastRequest)));
|
|
3450
3441
|
}), responseStream.on('aborted', function() {
|
|
3451
3442
|
if (rejected) return;
|
|
3452
|
-
let err = new
|
|
3443
|
+
let err = new core_AxiosError('stream has been aborted', core_AxiosError.ERR_BAD_RESPONSE, config, lastRequest);
|
|
3453
3444
|
responseStream.destroy(err), reject(err);
|
|
3454
3445
|
}), responseStream.on('error', function(err) {
|
|
3455
|
-
req.destroyed || reject(
|
|
3446
|
+
req.destroyed || reject(core_AxiosError.from(err, null, config, lastRequest));
|
|
3456
3447
|
}), responseStream.on('end', function() {
|
|
3457
3448
|
try {
|
|
3458
3449
|
let responseData = 1 === responseBuffer.length ? responseBuffer[0] : Buffer.concat(responseBuffer);
|
|
3459
3450
|
'arraybuffer' !== responseType && (responseData = responseData.toString(responseEncoding), responseEncoding && 'utf8' !== responseEncoding || (responseData = utils.stripBOM(responseData))), response.data = responseData;
|
|
3460
3451
|
} catch (err) {
|
|
3461
|
-
return reject(
|
|
3452
|
+
return reject(core_AxiosError.from(err, null, config, response.request, response));
|
|
3462
3453
|
}
|
|
3463
3454
|
settle(resolve, reject, response);
|
|
3464
3455
|
});
|
|
@@ -3469,16 +3460,16 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3469
3460
|
}), abortEmitter.once('abort', (err)=>{
|
|
3470
3461
|
req.close ? req.close() : req.destroy(err);
|
|
3471
3462
|
}), req.on('error', function(err) {
|
|
3472
|
-
reject(
|
|
3463
|
+
reject(core_AxiosError.from(err, null, config, req));
|
|
3473
3464
|
}), req.on('socket', function(socket) {
|
|
3474
3465
|
socket.setKeepAlive(!0, 60000);
|
|
3475
3466
|
}), config.timeout) {
|
|
3476
3467
|
let timeout = parseInt(config.timeout, 10);
|
|
3477
|
-
if (Number.isNaN(timeout)) return void abort(new
|
|
3468
|
+
if (Number.isNaN(timeout)) return void abort(new core_AxiosError('error trying to parse `config.timeout` to int', core_AxiosError.ERR_BAD_OPTION_VALUE, config, req));
|
|
3478
3469
|
req.setTimeout(timeout, function() {
|
|
3479
3470
|
if (isDone) return;
|
|
3480
3471
|
let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded', transitional = config.transitional || defaults_transitional;
|
|
3481
|
-
config.timeoutErrorMessage && (timeoutErrorMessage = config.timeoutErrorMessage), abort(new
|
|
3472
|
+
config.timeoutErrorMessage && (timeoutErrorMessage = config.timeoutErrorMessage), abort(new core_AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? core_AxiosError.ETIMEDOUT : core_AxiosError.ECONNABORTED, config, req));
|
|
3482
3473
|
});
|
|
3483
3474
|
} else req.setTimeout(0);
|
|
3484
3475
|
if (utils.isStream(data)) {
|
|
@@ -3488,7 +3479,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3488
3479
|
}), data.once('error', (err)=>{
|
|
3489
3480
|
errored = !0, req.destroy(err);
|
|
3490
3481
|
}), data.on('close', ()=>{
|
|
3491
|
-
ended || errored || abort(new
|
|
3482
|
+
ended || errored || abort(new cancel_CanceledError('Request stream has been aborted', config, req));
|
|
3492
3483
|
}), data.pipe(req);
|
|
3493
3484
|
} else data && req.write(data), req.end();
|
|
3494
3485
|
}, new Promise((resolve, reject)=>{
|
|
@@ -3628,20 +3619,20 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3628
3619
|
request.open(_config.method.toUpperCase(), _config.url, !0), request.timeout = _config.timeout, 'onloadend' in request ? request.onloadend = onloadend : request.onreadystatechange = function() {
|
|
3629
3620
|
!request || 4 !== request.readyState || (0 !== request.status || request.responseURL && 0 === request.responseURL.indexOf('file:')) && setTimeout(onloadend);
|
|
3630
3621
|
}, request.onabort = function() {
|
|
3631
|
-
request && (reject(new
|
|
3622
|
+
request && (reject(new core_AxiosError('Request aborted', core_AxiosError.ECONNABORTED, config, request)), request = null);
|
|
3632
3623
|
}, request.onerror = function(event) {
|
|
3633
|
-
let err = new
|
|
3624
|
+
let err = new core_AxiosError(event && event.message ? event.message : 'Network Error', core_AxiosError.ERR_NETWORK, config, request);
|
|
3634
3625
|
err.event = event || null, reject(err), request = null;
|
|
3635
3626
|
}, request.ontimeout = function() {
|
|
3636
3627
|
let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded', transitional = _config.transitional || defaults_transitional;
|
|
3637
|
-
_config.timeoutErrorMessage && (timeoutErrorMessage = _config.timeoutErrorMessage), reject(new
|
|
3628
|
+
_config.timeoutErrorMessage && (timeoutErrorMessage = _config.timeoutErrorMessage), reject(new core_AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? core_AxiosError.ETIMEDOUT : core_AxiosError.ECONNABORTED, config, request)), request = null;
|
|
3638
3629
|
}, void 0 === requestData && requestHeaders.setContentType(null), 'setRequestHeader' in request && utils.forEach(requestHeaders.toJSON(), function(val, key) {
|
|
3639
3630
|
request.setRequestHeader(key, val);
|
|
3640
3631
|
}), utils.isUndefined(_config.withCredentials) || (request.withCredentials = !!_config.withCredentials), responseType && 'json' !== responseType && (request.responseType = _config.responseType), onDownloadProgress && ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, !0), request.addEventListener('progress', downloadThrottled)), onUploadProgress && request.upload && ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress), request.upload.addEventListener('progress', uploadThrottled), request.upload.addEventListener('loadend', flushUpload)), (_config.cancelToken || _config.signal) && (onCanceled = (cancel)=>{
|
|
3641
|
-
request && (reject(!cancel || cancel.type ? new
|
|
3632
|
+
request && (reject(!cancel || cancel.type ? new cancel_CanceledError(null, config, request) : cancel), request.abort(), request = null);
|
|
3642
3633
|
}, _config.cancelToken && _config.cancelToken.subscribe(onCanceled), _config.signal && (_config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled)));
|
|
3643
3634
|
let protocol = parseProtocol(_config.url);
|
|
3644
|
-
protocol && -1 === platform.protocols.indexOf(protocol) ? reject(new
|
|
3635
|
+
protocol && -1 === platform.protocols.indexOf(protocol) ? reject(new core_AxiosError('Unsupported protocol ' + protocol + ':', core_AxiosError.ERR_BAD_REQUEST, config)) : request.send(requestData || null);
|
|
3645
3636
|
});
|
|
3646
3637
|
}, streamChunk = function*(chunk, chunkSize) {
|
|
3647
3638
|
let end, len = chunk.byteLength;
|
|
@@ -3724,7 +3715,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3724
3715
|
resolvers[type] || (resolvers[type] = (res, config)=>{
|
|
3725
3716
|
let method = res && res[type];
|
|
3726
3717
|
if (method) return method.call(res);
|
|
3727
|
-
throw new
|
|
3718
|
+
throw new core_AxiosError(`Response type '${type}' is not supported`, core_AxiosError.ERR_NOT_SUPPORT, config);
|
|
3728
3719
|
});
|
|
3729
3720
|
});
|
|
3730
3721
|
let getBodyLength = async (body)=>{
|
|
@@ -3752,10 +3743,10 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3752
3743
|
if (!aborted) {
|
|
3753
3744
|
aborted = !0, unsubscribe();
|
|
3754
3745
|
let err = reason instanceof Error ? reason : this.reason;
|
|
3755
|
-
controller.abort(err instanceof
|
|
3746
|
+
controller.abort(err instanceof core_AxiosError ? err : new cancel_CanceledError(err instanceof Error ? err.message : err));
|
|
3756
3747
|
}
|
|
3757
3748
|
}, timer = timeout && setTimeout(()=>{
|
|
3758
|
-
timer = null, onabort(new
|
|
3749
|
+
timer = null, onabort(new core_AxiosError(`timeout of ${timeout}ms exceeded`, core_AxiosError.ETIMEDOUT));
|
|
3759
3750
|
}, timeout), unsubscribe = ()=>{
|
|
3760
3751
|
signals && (timer && clearTimeout(timer), timer = null, signals.forEach((signal)=>{
|
|
3761
3752
|
signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
|
|
@@ -3822,10 +3813,10 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3822
3813
|
});
|
|
3823
3814
|
});
|
|
3824
3815
|
} catch (err) {
|
|
3825
|
-
if (unsubscribe && unsubscribe(), err && 'TypeError' === err.name && /Load failed|fetch/i.test(err.message)) throw Object.assign(new
|
|
3816
|
+
if (unsubscribe && unsubscribe(), err && 'TypeError' === err.name && /Load failed|fetch/i.test(err.message)) throw Object.assign(new core_AxiosError('Network Error', core_AxiosError.ERR_NETWORK, config, request), {
|
|
3826
3817
|
cause: err.cause || err
|
|
3827
3818
|
});
|
|
3828
|
-
throw
|
|
3819
|
+
throw core_AxiosError.from(err, err && err.code, config, request);
|
|
3829
3820
|
}
|
|
3830
3821
|
};
|
|
3831
3822
|
}, seedCache = new Map(), getFetch = (config)=>{
|
|
@@ -3863,18 +3854,18 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3863
3854
|
], rejectedReasons = {};
|
|
3864
3855
|
for(let i = 0; i < length; i++){
|
|
3865
3856
|
let id;
|
|
3866
|
-
if (adapter = nameOrAdapter = adapters[i], !isResolvedHandle(nameOrAdapter) && void 0 === (adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()])) throw new
|
|
3857
|
+
if (adapter = nameOrAdapter = adapters[i], !isResolvedHandle(nameOrAdapter) && void 0 === (adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()])) throw new core_AxiosError(`Unknown adapter '${id}'`);
|
|
3867
3858
|
if (adapter && (utils.isFunction(adapter) || (adapter = adapter.get(config)))) break;
|
|
3868
3859
|
rejectedReasons[id || '#' + i] = adapter;
|
|
3869
3860
|
}
|
|
3870
3861
|
if (!adapter) {
|
|
3871
3862
|
let reasons = Object.entries(rejectedReasons).map(([id, state])=>`adapter ${id} ` + (!1 === state ? 'is not supported by the environment' : 'is not available in the build'));
|
|
3872
|
-
throw new
|
|
3863
|
+
throw new core_AxiosError("There is no suitable adapter to dispatch the request " + (length ? reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0]) : 'as no adapter specified'), 'ERR_NOT_SUPPORT');
|
|
3873
3864
|
}
|
|
3874
3865
|
return adapter;
|
|
3875
3866
|
};
|
|
3876
3867
|
function throwIfCancellationRequested(config) {
|
|
3877
|
-
if (config.cancelToken && config.cancelToken.throwIfRequested(), config.signal && config.signal.aborted) throw new
|
|
3868
|
+
if (config.cancelToken && config.cancelToken.throwIfRequested(), config.signal && config.signal.aborted) throw new cancel_CanceledError(null, config);
|
|
3878
3869
|
}
|
|
3879
3870
|
function dispatchRequest(config) {
|
|
3880
3871
|
return throwIfCancellationRequested(config), config.headers = AxiosHeaders.from(config.headers), config.data = transformData.call(config, config.transformRequest), -1 !== [
|
|
@@ -3903,26 +3894,26 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3903
3894
|
let deprecatedWarnings = {};
|
|
3904
3895
|
validators.transitional = function(validator, version, message) {
|
|
3905
3896
|
function formatMessage(opt, desc) {
|
|
3906
|
-
return "[Axios v1.13.
|
|
3897
|
+
return "[Axios v1.13.4] Transitional option '" + opt + '\'' + desc + (message ? '. ' + message : '');
|
|
3907
3898
|
}
|
|
3908
3899
|
return (value, opt, opts)=>{
|
|
3909
|
-
if (!1 === validator) throw new
|
|
3900
|
+
if (!1 === validator) throw new core_AxiosError(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), core_AxiosError.ERR_DEPRECATED);
|
|
3910
3901
|
return version && !deprecatedWarnings[opt] && (deprecatedWarnings[opt] = !0, console.warn(formatMessage(opt, ' has been deprecated since v' + version + ' and will be removed in the near future'))), !validator || validator(value, opt, opts);
|
|
3911
3902
|
};
|
|
3912
3903
|
}, validators.spelling = function(correctSpelling) {
|
|
3913
3904
|
return (value, opt)=>(console.warn(`${opt} is likely a misspelling of ${correctSpelling}`), !0);
|
|
3914
3905
|
};
|
|
3915
3906
|
let helpers_validator_assertOptions = function(options, schema, allowUnknown) {
|
|
3916
|
-
if ('object' != typeof options) throw new
|
|
3907
|
+
if ('object' != typeof options) throw new core_AxiosError('options must be an object', core_AxiosError.ERR_BAD_OPTION_VALUE);
|
|
3917
3908
|
let keys = Object.keys(options), i = keys.length;
|
|
3918
3909
|
for(; i-- > 0;){
|
|
3919
3910
|
let opt = keys[i], validator = schema[opt];
|
|
3920
3911
|
if (validator) {
|
|
3921
3912
|
let value = options[opt], result = void 0 === value || validator(value, opt, options);
|
|
3922
|
-
if (!0 !== result) throw new
|
|
3913
|
+
if (!0 !== result) throw new core_AxiosError('option ' + opt + ' must be ' + result, core_AxiosError.ERR_BAD_OPTION_VALUE);
|
|
3923
3914
|
continue;
|
|
3924
3915
|
}
|
|
3925
|
-
if (!0 !== allowUnknown) throw new
|
|
3916
|
+
if (!0 !== allowUnknown) throw new core_AxiosError('Unknown option ' + opt, core_AxiosError.ERR_BAD_OPTION);
|
|
3926
3917
|
}
|
|
3927
3918
|
}, helpers_validator_validators = validators, Axios_validators = helpers_validator_validators;
|
|
3928
3919
|
class Axios {
|
|
@@ -4069,7 +4060,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
4069
4060
|
token.unsubscribe(_resolve);
|
|
4070
4061
|
}, promise;
|
|
4071
4062
|
}, executor(function(message, config, request) {
|
|
4072
|
-
token.reason || (token.reason = new
|
|
4063
|
+
token.reason || (token.reason = new cancel_CanceledError(message, config, request), resolvePromise(token.reason));
|
|
4073
4064
|
});
|
|
4074
4065
|
}
|
|
4075
4066
|
throwIfRequested() {
|
|
@@ -4185,7 +4176,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
4185
4176
|
return createInstance(mergeConfig(defaultConfig, instanceConfig));
|
|
4186
4177
|
}, instance;
|
|
4187
4178
|
}(defaults_defaults);
|
|
4188
|
-
axios.Axios = Axios, axios.CanceledError =
|
|
4179
|
+
axios.Axios = Axios, axios.CanceledError = cancel_CanceledError, axios.CancelToken = CancelToken, axios.isCancel = isCancel, axios.VERSION = "1.13.4", axios.toFormData = helpers_toFormData, axios.AxiosError = core_AxiosError, axios.Cancel = axios.CanceledError, axios.all = function(promises) {
|
|
4189
4180
|
return Promise.all(promises);
|
|
4190
4181
|
}, axios.spread = function(callback) {
|
|
4191
4182
|
return function(arr) {
|
|
@@ -4423,7 +4414,7 @@ example: ${bin} bundle-diff --baseline="x.json" --current="x.json"
|
|
|
4423
4414
|
options(commandCli), commandCli.action(async (args)=>{
|
|
4424
4415
|
try {
|
|
4425
4416
|
var command1 = command, args1 = args;
|
|
4426
|
-
"analyze" === command1 && (args1.profile || (logger_namespaceObject.logger.error((0, picocolors.red)(
|
|
4417
|
+
"analyze" === command1 && (args1.profile || (logger_namespaceObject.logger.error((0, picocolors.red)("❌ Missing required argument: --profile")), logger_namespaceObject.logger.info(`💡 Usage: ${constants_bin} ${command1} --profile <path>`), logger_namespaceObject.logger.info("\uD83D\uDCA1 Use --help to see all available options"), process.exit(1))), "bundle-diff" === command1 && (args1.current && args1.baseline || (logger_namespaceObject.logger.error((0, picocolors.red)("❌ Missing required arguments: --current and --baseline")), logger_namespaceObject.logger.info(`💡 Usage: ${constants_bin} ${command1} --current <path> --baseline <path>`), logger_namespaceObject.logger.info("\uD83D\uDCA1 Use --help to see all available options"), process.exit(1))), "stats-analyze" === command1 && (args1.profile || (logger_namespaceObject.logger.error((0, picocolors.red)("❌ Missing required argument: --profile")), logger_namespaceObject.logger.info(`💡 Usage: ${constants_bin} ${command1} --profile <path>`), logger_namespaceObject.logger.info("\uD83D\uDCA1 Use --help to see all available options"), process.exit(1))), await action(args);
|
|
4427
4418
|
} catch (error) {
|
|
4428
4419
|
let { message, stack } = error;
|
|
4429
4420
|
logger_namespaceObject.logger.error((0, picocolors.red)(stack || message)), process.exit(1);
|
|
@@ -4435,7 +4426,7 @@ example: ${bin} bundle-diff --baseline="x.json" --current="x.json"
|
|
|
4435
4426
|
} catch (error) {
|
|
4436
4427
|
!function(error) {
|
|
4437
4428
|
let { message } = error;
|
|
4438
|
-
message.includes('value is missing') ? (logger_namespaceObject.logger.error((0, picocolors.red)(
|
|
4429
|
+
message.includes('value is missing') ? (logger_namespaceObject.logger.error((0, picocolors.red)("❌ Missing required argument. Please provide a value for the option.")), logger_namespaceObject.logger.info("\uD83D\uDCA1 Use --help to see available options")) : message.includes('Unknown option') ? (logger_namespaceObject.logger.error((0, picocolors.red)("❌ Unknown option. Please check your command.")), logger_namespaceObject.logger.info("\uD83D\uDCA1 Use --help to see available options")) : logger_namespaceObject.logger.error((0, picocolors.red)(`❌ ${message}`)), process.exit(1);
|
|
4439
4430
|
}(error);
|
|
4440
4431
|
}
|
|
4441
4432
|
}
|