@fre4x/fred 1.1.2 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/dist/index.js +658 -613
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -13,7 +13,11 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
13
13
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
14
14
|
});
|
|
15
15
|
var __commonJS = (cb, mod) => function __require2() {
|
|
16
|
-
|
|
16
|
+
try {
|
|
17
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
18
|
+
} catch (e) {
|
|
19
|
+
throw mod = 0, e;
|
|
20
|
+
}
|
|
17
21
|
};
|
|
18
22
|
var __export = (target, all3) => {
|
|
19
23
|
for (var name in all3)
|
|
@@ -3112,6 +3116,9 @@ var require_utils = __commonJS({
|
|
|
3112
3116
|
"use strict";
|
|
3113
3117
|
var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
|
|
3114
3118
|
var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
|
|
3119
|
+
var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
|
|
3120
|
+
var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
|
|
3121
|
+
var isPathCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);
|
|
3115
3122
|
function stringArrayToHexStripped(input) {
|
|
3116
3123
|
let acc = "";
|
|
3117
3124
|
let code = 0;
|
|
@@ -3304,27 +3311,77 @@ var require_utils = __commonJS({
|
|
|
3304
3311
|
}
|
|
3305
3312
|
return output.join("");
|
|
3306
3313
|
}
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3314
|
+
var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
|
|
3315
|
+
var HOST_DELIM_RE = /[@/?#:]/g;
|
|
3316
|
+
var HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
|
|
3317
|
+
function reescapeHostDelimiters(host, isIP) {
|
|
3318
|
+
const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE;
|
|
3319
|
+
re.lastIndex = 0;
|
|
3320
|
+
return host.replace(re, (ch) => HOST_DELIMS[ch]);
|
|
3321
|
+
}
|
|
3322
|
+
function normalizePercentEncoding(input, decodeUnreserved = false) {
|
|
3323
|
+
if (input.indexOf("%") === -1) {
|
|
3324
|
+
return input;
|
|
3317
3325
|
}
|
|
3318
|
-
|
|
3319
|
-
|
|
3326
|
+
let output = "";
|
|
3327
|
+
for (let i = 0; i < input.length; i++) {
|
|
3328
|
+
if (input[i] === "%" && i + 2 < input.length) {
|
|
3329
|
+
const hex3 = input.slice(i + 1, i + 3);
|
|
3330
|
+
if (isHexPair(hex3)) {
|
|
3331
|
+
const normalizedHex = hex3.toUpperCase();
|
|
3332
|
+
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
3333
|
+
if (decodeUnreserved && isUnreserved(decoded)) {
|
|
3334
|
+
output += decoded;
|
|
3335
|
+
} else {
|
|
3336
|
+
output += "%" + normalizedHex;
|
|
3337
|
+
}
|
|
3338
|
+
i += 2;
|
|
3339
|
+
continue;
|
|
3340
|
+
}
|
|
3341
|
+
}
|
|
3342
|
+
output += input[i];
|
|
3320
3343
|
}
|
|
3321
|
-
|
|
3322
|
-
|
|
3344
|
+
return output;
|
|
3345
|
+
}
|
|
3346
|
+
function normalizePathEncoding(input) {
|
|
3347
|
+
let output = "";
|
|
3348
|
+
for (let i = 0; i < input.length; i++) {
|
|
3349
|
+
if (input[i] === "%" && i + 2 < input.length) {
|
|
3350
|
+
const hex3 = input.slice(i + 1, i + 3);
|
|
3351
|
+
if (isHexPair(hex3)) {
|
|
3352
|
+
const normalizedHex = hex3.toUpperCase();
|
|
3353
|
+
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
3354
|
+
if (decoded !== "." && isUnreserved(decoded)) {
|
|
3355
|
+
output += decoded;
|
|
3356
|
+
} else {
|
|
3357
|
+
output += "%" + normalizedHex;
|
|
3358
|
+
}
|
|
3359
|
+
i += 2;
|
|
3360
|
+
continue;
|
|
3361
|
+
}
|
|
3362
|
+
}
|
|
3363
|
+
if (isPathCharacter(input[i])) {
|
|
3364
|
+
output += input[i];
|
|
3365
|
+
} else {
|
|
3366
|
+
output += escape(input[i]);
|
|
3367
|
+
}
|
|
3323
3368
|
}
|
|
3324
|
-
|
|
3325
|
-
|
|
3369
|
+
return output;
|
|
3370
|
+
}
|
|
3371
|
+
function escapePreservingEscapes(input) {
|
|
3372
|
+
let output = "";
|
|
3373
|
+
for (let i = 0; i < input.length; i++) {
|
|
3374
|
+
if (input[i] === "%" && i + 2 < input.length) {
|
|
3375
|
+
const hex3 = input.slice(i + 1, i + 3);
|
|
3376
|
+
if (isHexPair(hex3)) {
|
|
3377
|
+
output += "%" + hex3.toUpperCase();
|
|
3378
|
+
i += 2;
|
|
3379
|
+
continue;
|
|
3380
|
+
}
|
|
3381
|
+
}
|
|
3382
|
+
output += escape(input[i]);
|
|
3326
3383
|
}
|
|
3327
|
-
return
|
|
3384
|
+
return output;
|
|
3328
3385
|
}
|
|
3329
3386
|
function recomposeAuthority(component) {
|
|
3330
3387
|
const uriTokens = [];
|
|
@@ -3339,7 +3396,7 @@ var require_utils = __commonJS({
|
|
|
3339
3396
|
if (ipV6res.isIPV6 === true) {
|
|
3340
3397
|
host = `[${ipV6res.escapedHost}]`;
|
|
3341
3398
|
} else {
|
|
3342
|
-
host =
|
|
3399
|
+
host = reescapeHostDelimiters(host, false);
|
|
3343
3400
|
}
|
|
3344
3401
|
}
|
|
3345
3402
|
uriTokens.push(host);
|
|
@@ -3353,7 +3410,10 @@ var require_utils = __commonJS({
|
|
|
3353
3410
|
module.exports = {
|
|
3354
3411
|
nonSimpleDomain,
|
|
3355
3412
|
recomposeAuthority,
|
|
3356
|
-
|
|
3413
|
+
reescapeHostDelimiters,
|
|
3414
|
+
normalizePercentEncoding,
|
|
3415
|
+
normalizePathEncoding,
|
|
3416
|
+
escapePreservingEscapes,
|
|
3357
3417
|
removeDotSegments,
|
|
3358
3418
|
isIPv4,
|
|
3359
3419
|
isUUID,
|
|
@@ -3577,12 +3637,12 @@ var require_schemes = __commonJS({
|
|
|
3577
3637
|
var require_fast_uri = __commonJS({
|
|
3578
3638
|
"../node_modules/fast-uri/index.js"(exports, module) {
|
|
3579
3639
|
"use strict";
|
|
3580
|
-
var { normalizeIPv6, removeDotSegments, recomposeAuthority,
|
|
3640
|
+
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
|
|
3581
3641
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
3582
3642
|
function normalize(uri, options) {
|
|
3583
3643
|
if (typeof uri === "string") {
|
|
3584
3644
|
uri = /** @type {T} */
|
|
3585
|
-
|
|
3645
|
+
normalizeString(uri, options);
|
|
3586
3646
|
} else if (typeof uri === "object") {
|
|
3587
3647
|
uri = /** @type {T} */
|
|
3588
3648
|
parse3(serialize(uri, options), options);
|
|
@@ -3649,19 +3709,9 @@ var require_fast_uri = __commonJS({
|
|
|
3649
3709
|
return target;
|
|
3650
3710
|
}
|
|
3651
3711
|
function equal(uriA, uriB, options) {
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
} else if (typeof uriA === "object") {
|
|
3656
|
-
uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true });
|
|
3657
|
-
}
|
|
3658
|
-
if (typeof uriB === "string") {
|
|
3659
|
-
uriB = unescape(uriB);
|
|
3660
|
-
uriB = serialize(normalizeComponentEncoding(parse3(uriB, options), true), { ...options, skipEscape: true });
|
|
3661
|
-
} else if (typeof uriB === "object") {
|
|
3662
|
-
uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true });
|
|
3663
|
-
}
|
|
3664
|
-
return uriA.toLowerCase() === uriB.toLowerCase();
|
|
3712
|
+
const normalizedA = normalizeComparableURI(uriA, options);
|
|
3713
|
+
const normalizedB = normalizeComparableURI(uriB, options);
|
|
3714
|
+
return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA.toLowerCase() === normalizedB.toLowerCase();
|
|
3665
3715
|
}
|
|
3666
3716
|
function serialize(cmpts, opts) {
|
|
3667
3717
|
const component = {
|
|
@@ -3686,12 +3736,12 @@ var require_fast_uri = __commonJS({
|
|
|
3686
3736
|
if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
|
|
3687
3737
|
if (component.path !== void 0) {
|
|
3688
3738
|
if (!options.skipEscape) {
|
|
3689
|
-
component.path =
|
|
3739
|
+
component.path = escapePreservingEscapes(component.path);
|
|
3690
3740
|
if (component.scheme !== void 0) {
|
|
3691
3741
|
component.path = component.path.split("%3A").join(":");
|
|
3692
3742
|
}
|
|
3693
3743
|
} else {
|
|
3694
|
-
component.path =
|
|
3744
|
+
component.path = normalizePercentEncoding(component.path);
|
|
3695
3745
|
}
|
|
3696
3746
|
}
|
|
3697
3747
|
if (options.reference !== "suffix" && component.scheme) {
|
|
@@ -3726,7 +3776,16 @@ var require_fast_uri = __commonJS({
|
|
|
3726
3776
|
return uriTokens.join("");
|
|
3727
3777
|
}
|
|
3728
3778
|
var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
|
|
3729
|
-
function
|
|
3779
|
+
function getParseError(parsed, matches) {
|
|
3780
|
+
if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") {
|
|
3781
|
+
return 'URI path must start with "/" when authority is present.';
|
|
3782
|
+
}
|
|
3783
|
+
if (typeof parsed.port === "number" && (parsed.port < 0 || parsed.port > 65535)) {
|
|
3784
|
+
return "URI port is malformed.";
|
|
3785
|
+
}
|
|
3786
|
+
return void 0;
|
|
3787
|
+
}
|
|
3788
|
+
function parseWithStatus(uri, opts) {
|
|
3730
3789
|
const options = Object.assign({}, opts);
|
|
3731
3790
|
const parsed = {
|
|
3732
3791
|
scheme: void 0,
|
|
@@ -3737,6 +3796,7 @@ var require_fast_uri = __commonJS({
|
|
|
3737
3796
|
query: void 0,
|
|
3738
3797
|
fragment: void 0
|
|
3739
3798
|
};
|
|
3799
|
+
let malformedAuthorityOrPort = false;
|
|
3740
3800
|
let isIP = false;
|
|
3741
3801
|
if (options.reference === "suffix") {
|
|
3742
3802
|
if (options.scheme) {
|
|
@@ -3757,6 +3817,11 @@ var require_fast_uri = __commonJS({
|
|
|
3757
3817
|
if (isNaN(parsed.port)) {
|
|
3758
3818
|
parsed.port = matches[5];
|
|
3759
3819
|
}
|
|
3820
|
+
const parseError = getParseError(parsed, matches);
|
|
3821
|
+
if (parseError !== void 0) {
|
|
3822
|
+
parsed.error = parsed.error || parseError;
|
|
3823
|
+
malformedAuthorityOrPort = true;
|
|
3824
|
+
}
|
|
3760
3825
|
if (parsed.host) {
|
|
3761
3826
|
const ipv4result = isIPv4(parsed.host);
|
|
3762
3827
|
if (ipv4result === false) {
|
|
@@ -3795,14 +3860,18 @@ var require_fast_uri = __commonJS({
|
|
|
3795
3860
|
parsed.scheme = unescape(parsed.scheme);
|
|
3796
3861
|
}
|
|
3797
3862
|
if (parsed.host !== void 0) {
|
|
3798
|
-
parsed.host = unescape(parsed.host);
|
|
3863
|
+
parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP);
|
|
3799
3864
|
}
|
|
3800
3865
|
}
|
|
3801
3866
|
if (parsed.path) {
|
|
3802
|
-
parsed.path =
|
|
3867
|
+
parsed.path = normalizePathEncoding(parsed.path);
|
|
3803
3868
|
}
|
|
3804
3869
|
if (parsed.fragment) {
|
|
3805
|
-
|
|
3870
|
+
try {
|
|
3871
|
+
parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
|
|
3872
|
+
} catch {
|
|
3873
|
+
parsed.error = parsed.error || "URI malformed";
|
|
3874
|
+
}
|
|
3806
3875
|
}
|
|
3807
3876
|
}
|
|
3808
3877
|
if (schemeHandler && schemeHandler.parse) {
|
|
@@ -3811,7 +3880,29 @@ var require_fast_uri = __commonJS({
|
|
|
3811
3880
|
} else {
|
|
3812
3881
|
parsed.error = parsed.error || "URI can not be parsed.";
|
|
3813
3882
|
}
|
|
3814
|
-
return parsed;
|
|
3883
|
+
return { parsed, malformedAuthorityOrPort };
|
|
3884
|
+
}
|
|
3885
|
+
function parse3(uri, opts) {
|
|
3886
|
+
return parseWithStatus(uri, opts).parsed;
|
|
3887
|
+
}
|
|
3888
|
+
function normalizeString(uri, opts) {
|
|
3889
|
+
return normalizeStringWithStatus(uri, opts).normalized;
|
|
3890
|
+
}
|
|
3891
|
+
function normalizeStringWithStatus(uri, opts) {
|
|
3892
|
+
const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts);
|
|
3893
|
+
return {
|
|
3894
|
+
normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),
|
|
3895
|
+
malformedAuthorityOrPort
|
|
3896
|
+
};
|
|
3897
|
+
}
|
|
3898
|
+
function normalizeComparableURI(uri, opts) {
|
|
3899
|
+
if (typeof uri === "string") {
|
|
3900
|
+
const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts);
|
|
3901
|
+
return malformedAuthorityOrPort ? void 0 : normalized;
|
|
3902
|
+
}
|
|
3903
|
+
if (typeof uri === "object") {
|
|
3904
|
+
return serialize(uri, opts);
|
|
3905
|
+
}
|
|
3815
3906
|
}
|
|
3816
3907
|
var fastUri = {
|
|
3817
3908
|
SCHEMES,
|
|
@@ -7065,9 +7156,9 @@ var require_combined_stream = __commonJS({
|
|
|
7065
7156
|
}
|
|
7066
7157
|
});
|
|
7067
7158
|
|
|
7068
|
-
// ../node_modules/form-data/node_modules/mime-db/db.json
|
|
7159
|
+
// ../node_modules/form-data/node_modules/mime-types/node_modules/mime-db/db.json
|
|
7069
7160
|
var require_db = __commonJS({
|
|
7070
|
-
"../node_modules/form-data/node_modules/mime-db/db.json"(exports, module) {
|
|
7161
|
+
"../node_modules/form-data/node_modules/mime-types/node_modules/mime-db/db.json"(exports, module) {
|
|
7071
7162
|
module.exports = {
|
|
7072
7163
|
"application/1d-interleaved-parityfec": {
|
|
7073
7164
|
source: "iana"
|
|
@@ -15590,9 +15681,9 @@ var require_db = __commonJS({
|
|
|
15590
15681
|
}
|
|
15591
15682
|
});
|
|
15592
15683
|
|
|
15593
|
-
// ../node_modules/form-data/node_modules/mime-db/index.js
|
|
15684
|
+
// ../node_modules/form-data/node_modules/mime-types/node_modules/mime-db/index.js
|
|
15594
15685
|
var require_mime_db = __commonJS({
|
|
15595
|
-
"../node_modules/form-data/node_modules/mime-db/index.js"(exports, module) {
|
|
15686
|
+
"../node_modules/form-data/node_modules/mime-types/node_modules/mime-db/index.js"(exports, module) {
|
|
15596
15687
|
module.exports = require_db();
|
|
15597
15688
|
}
|
|
15598
15689
|
});
|
|
@@ -16764,7 +16855,7 @@ var require_form_data = __commonJS({
|
|
|
16764
16855
|
var path = __require("path");
|
|
16765
16856
|
var http3 = __require("http");
|
|
16766
16857
|
var https3 = __require("https");
|
|
16767
|
-
var
|
|
16858
|
+
var parseUrl = __require("url").parse;
|
|
16768
16859
|
var fs = __require("fs");
|
|
16769
16860
|
var Stream = __require("stream").Stream;
|
|
16770
16861
|
var crypto2 = __require("crypto");
|
|
@@ -16773,6 +16864,9 @@ var require_form_data = __commonJS({
|
|
|
16773
16864
|
var setToStringTag = require_es_set_tostringtag();
|
|
16774
16865
|
var hasOwn = require_hasown();
|
|
16775
16866
|
var populate = require_populate();
|
|
16867
|
+
function escapeHeaderParam(str) {
|
|
16868
|
+
return String(str).replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/"/g, "%22");
|
|
16869
|
+
}
|
|
16776
16870
|
function FormData3(options) {
|
|
16777
16871
|
if (!(this instanceof FormData3)) {
|
|
16778
16872
|
return new FormData3(options);
|
|
@@ -16862,7 +16956,7 @@ var require_form_data = __commonJS({
|
|
|
16862
16956
|
var contents = "";
|
|
16863
16957
|
var headers = {
|
|
16864
16958
|
// add custom disposition as third element or keep it two elements if not
|
|
16865
|
-
"Content-Disposition": ["form-data", 'name="' + field + '"'].concat(contentDisposition || []),
|
|
16959
|
+
"Content-Disposition": ["form-data", 'name="' + escapeHeaderParam(field) + '"'].concat(contentDisposition || []),
|
|
16866
16960
|
// if no content type. allow it to be empty array
|
|
16867
16961
|
"Content-Type": [].concat(contentType || [])
|
|
16868
16962
|
};
|
|
@@ -16896,7 +16990,7 @@ var require_form_data = __commonJS({
|
|
|
16896
16990
|
filename = path.basename(value.client._httpMessage.path || "");
|
|
16897
16991
|
}
|
|
16898
16992
|
if (filename) {
|
|
16899
|
-
return 'filename="' + filename + '"';
|
|
16993
|
+
return 'filename="' + escapeHeaderParam(filename) + '"';
|
|
16900
16994
|
}
|
|
16901
16995
|
};
|
|
16902
16996
|
FormData3.prototype._getContentType = function(value, options) {
|
|
@@ -17017,7 +17111,7 @@ var require_form_data = __commonJS({
|
|
|
17017
17111
|
var options;
|
|
17018
17112
|
var defaults2 = { method: "post" };
|
|
17019
17113
|
if (typeof params === "string") {
|
|
17020
|
-
params =
|
|
17114
|
+
params = parseUrl(params);
|
|
17021
17115
|
options = populate({
|
|
17022
17116
|
port: params.port,
|
|
17023
17117
|
path: params.pathname,
|
|
@@ -17074,6 +17168,76 @@ var require_form_data = __commonJS({
|
|
|
17074
17168
|
}
|
|
17075
17169
|
});
|
|
17076
17170
|
|
|
17171
|
+
// ../node_modules/proxy-from-env/index.js
|
|
17172
|
+
var require_proxy_from_env = __commonJS({
|
|
17173
|
+
"../node_modules/proxy-from-env/index.js"(exports) {
|
|
17174
|
+
"use strict";
|
|
17175
|
+
var parseUrl = __require("url").parse;
|
|
17176
|
+
var DEFAULT_PORTS = {
|
|
17177
|
+
ftp: 21,
|
|
17178
|
+
gopher: 70,
|
|
17179
|
+
http: 80,
|
|
17180
|
+
https: 443,
|
|
17181
|
+
ws: 80,
|
|
17182
|
+
wss: 443
|
|
17183
|
+
};
|
|
17184
|
+
var stringEndsWith = String.prototype.endsWith || function(s) {
|
|
17185
|
+
return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1;
|
|
17186
|
+
};
|
|
17187
|
+
function getProxyForUrl(url3) {
|
|
17188
|
+
var parsedUrl = typeof url3 === "string" ? parseUrl(url3) : url3 || {};
|
|
17189
|
+
var proto = parsedUrl.protocol;
|
|
17190
|
+
var hostname3 = parsedUrl.host;
|
|
17191
|
+
var port = parsedUrl.port;
|
|
17192
|
+
if (typeof hostname3 !== "string" || !hostname3 || typeof proto !== "string") {
|
|
17193
|
+
return "";
|
|
17194
|
+
}
|
|
17195
|
+
proto = proto.split(":", 1)[0];
|
|
17196
|
+
hostname3 = hostname3.replace(/:\d*$/, "");
|
|
17197
|
+
port = parseInt(port) || DEFAULT_PORTS[proto] || 0;
|
|
17198
|
+
if (!shouldProxy(hostname3, port)) {
|
|
17199
|
+
return "";
|
|
17200
|
+
}
|
|
17201
|
+
var proxy = getEnv("npm_config_" + proto + "_proxy") || getEnv(proto + "_proxy") || getEnv("npm_config_proxy") || getEnv("all_proxy");
|
|
17202
|
+
if (proxy && proxy.indexOf("://") === -1) {
|
|
17203
|
+
proxy = proto + "://" + proxy;
|
|
17204
|
+
}
|
|
17205
|
+
return proxy;
|
|
17206
|
+
}
|
|
17207
|
+
function shouldProxy(hostname3, port) {
|
|
17208
|
+
var NO_PROXY = (getEnv("npm_config_no_proxy") || getEnv("no_proxy")).toLowerCase();
|
|
17209
|
+
if (!NO_PROXY) {
|
|
17210
|
+
return true;
|
|
17211
|
+
}
|
|
17212
|
+
if (NO_PROXY === "*") {
|
|
17213
|
+
return false;
|
|
17214
|
+
}
|
|
17215
|
+
return NO_PROXY.split(/[,\s]/).every(function(proxy) {
|
|
17216
|
+
if (!proxy) {
|
|
17217
|
+
return true;
|
|
17218
|
+
}
|
|
17219
|
+
var parsedProxy = proxy.match(/^(.+):(\d+)$/);
|
|
17220
|
+
var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
|
|
17221
|
+
var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
|
|
17222
|
+
if (parsedProxyPort && parsedProxyPort !== port) {
|
|
17223
|
+
return true;
|
|
17224
|
+
}
|
|
17225
|
+
if (!/^[.*]/.test(parsedProxyHostname)) {
|
|
17226
|
+
return hostname3 !== parsedProxyHostname;
|
|
17227
|
+
}
|
|
17228
|
+
if (parsedProxyHostname.charAt(0) === "*") {
|
|
17229
|
+
parsedProxyHostname = parsedProxyHostname.slice(1);
|
|
17230
|
+
}
|
|
17231
|
+
return !stringEndsWith.call(hostname3, parsedProxyHostname);
|
|
17232
|
+
});
|
|
17233
|
+
}
|
|
17234
|
+
function getEnv(key) {
|
|
17235
|
+
return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
|
|
17236
|
+
}
|
|
17237
|
+
exports.getProxyForUrl = getProxyForUrl;
|
|
17238
|
+
}
|
|
17239
|
+
});
|
|
17240
|
+
|
|
17077
17241
|
// ../node_modules/ms/index.js
|
|
17078
17242
|
var require_ms = __commonJS({
|
|
17079
17243
|
"../node_modules/ms/index.js"(exports, module) {
|
|
@@ -17893,6 +18057,11 @@ var require_follow_redirects = __commonJS({
|
|
|
17893
18057
|
} catch (error48) {
|
|
17894
18058
|
useNativeURL = error48.code === "ERR_INVALID_URL";
|
|
17895
18059
|
}
|
|
18060
|
+
var sensitiveHeaders = [
|
|
18061
|
+
"Authorization",
|
|
18062
|
+
"Proxy-Authorization",
|
|
18063
|
+
"Cookie"
|
|
18064
|
+
];
|
|
17896
18065
|
var preservedUrlFields = [
|
|
17897
18066
|
"auth",
|
|
17898
18067
|
"host",
|
|
@@ -17957,6 +18126,7 @@ var require_follow_redirects = __commonJS({
|
|
|
17957
18126
|
self2.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause }));
|
|
17958
18127
|
}
|
|
17959
18128
|
};
|
|
18129
|
+
this._headerFilter = new RegExp("^(?:" + sensitiveHeaders.concat(options.sensitiveHeaders).map(escapeRegex2).join("|") + ")$", "i");
|
|
17960
18130
|
this._performRequest();
|
|
17961
18131
|
}
|
|
17962
18132
|
RedirectableRequest.prototype = Object.create(Writable.prototype);
|
|
@@ -18094,6 +18264,9 @@ var require_follow_redirects = __commonJS({
|
|
|
18094
18264
|
if (!options.headers) {
|
|
18095
18265
|
options.headers = {};
|
|
18096
18266
|
}
|
|
18267
|
+
if (!isArray2(options.sensitiveHeaders)) {
|
|
18268
|
+
options.sensitiveHeaders = [];
|
|
18269
|
+
}
|
|
18097
18270
|
if (options.host) {
|
|
18098
18271
|
if (!options.hostname) {
|
|
18099
18272
|
options.hostname = options.host;
|
|
@@ -18191,7 +18364,7 @@ var require_follow_redirects = __commonJS({
|
|
|
18191
18364
|
removeMatchingHeaders(/^content-/i, this._options.headers);
|
|
18192
18365
|
}
|
|
18193
18366
|
var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
|
|
18194
|
-
var currentUrlParts =
|
|
18367
|
+
var currentUrlParts = parseUrl(this._currentUrl);
|
|
18195
18368
|
var currentHost = currentHostHeader || currentUrlParts.host;
|
|
18196
18369
|
var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url3.format(Object.assign(currentUrlParts, { host: currentHost }));
|
|
18197
18370
|
var redirectUrl = resolveUrl(location, currentUrl);
|
|
@@ -18199,7 +18372,7 @@ var require_follow_redirects = __commonJS({
|
|
|
18199
18372
|
this._isRedirect = true;
|
|
18200
18373
|
spreadUrlObject(redirectUrl, this._options);
|
|
18201
18374
|
if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) {
|
|
18202
|
-
removeMatchingHeaders(
|
|
18375
|
+
removeMatchingHeaders(this._headerFilter, this._options.headers);
|
|
18203
18376
|
}
|
|
18204
18377
|
if (isFunction3(beforeRedirect)) {
|
|
18205
18378
|
var responseDetails = {
|
|
@@ -18230,7 +18403,7 @@ var require_follow_redirects = __commonJS({
|
|
|
18230
18403
|
if (isURL(input)) {
|
|
18231
18404
|
input = spreadUrlObject(input);
|
|
18232
18405
|
} else if (isString2(input)) {
|
|
18233
|
-
input = spreadUrlObject(
|
|
18406
|
+
input = spreadUrlObject(parseUrl(input));
|
|
18234
18407
|
} else {
|
|
18235
18408
|
callback = options;
|
|
18236
18409
|
options = validateUrl(input);
|
|
@@ -18266,7 +18439,7 @@ var require_follow_redirects = __commonJS({
|
|
|
18266
18439
|
}
|
|
18267
18440
|
function noop2() {
|
|
18268
18441
|
}
|
|
18269
|
-
function
|
|
18442
|
+
function parseUrl(input) {
|
|
18270
18443
|
var parsed;
|
|
18271
18444
|
if (useNativeURL) {
|
|
18272
18445
|
parsed = new URL2(input);
|
|
@@ -18279,7 +18452,7 @@ var require_follow_redirects = __commonJS({
|
|
|
18279
18452
|
return parsed;
|
|
18280
18453
|
}
|
|
18281
18454
|
function resolveUrl(relative, base) {
|
|
18282
|
-
return useNativeURL ? new URL2(relative, base) :
|
|
18455
|
+
return useNativeURL ? new URL2(relative, base) : parseUrl(url3.resolve(base, relative));
|
|
18283
18456
|
}
|
|
18284
18457
|
function validateUrl(input) {
|
|
18285
18458
|
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
|
|
@@ -18348,6 +18521,9 @@ var require_follow_redirects = __commonJS({
|
|
|
18348
18521
|
var dot = subdomain.length - domain2.length - 1;
|
|
18349
18522
|
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain2);
|
|
18350
18523
|
}
|
|
18524
|
+
function isArray2(value) {
|
|
18525
|
+
return value instanceof Array;
|
|
18526
|
+
}
|
|
18351
18527
|
function isString2(value) {
|
|
18352
18528
|
return typeof value === "string" || value instanceof String;
|
|
18353
18529
|
}
|
|
@@ -18360,6 +18536,9 @@ var require_follow_redirects = __commonJS({
|
|
|
18360
18536
|
function isURL(value) {
|
|
18361
18537
|
return URL2 && value instanceof URL2;
|
|
18362
18538
|
}
|
|
18539
|
+
function escapeRegex2(regex) {
|
|
18540
|
+
return regex.replace(/[\]\\/()*+?.$]/g, "\\$&");
|
|
18541
|
+
}
|
|
18363
18542
|
module.exports = wrap({ http: http3, https: https3 });
|
|
18364
18543
|
module.exports.wrap = wrap;
|
|
18365
18544
|
}
|
|
@@ -18368,22 +18547,26 @@ var require_follow_redirects = __commonJS({
|
|
|
18368
18547
|
// ../packages/shared/dist/errors.js
|
|
18369
18548
|
function createApiError(message, statusCode) {
|
|
18370
18549
|
let hint = "Check your network connection and retry.";
|
|
18550
|
+
let type = "Service Error";
|
|
18371
18551
|
if (statusCode === 429) {
|
|
18372
|
-
|
|
18552
|
+
type = "Rate Limit";
|
|
18553
|
+
hint = "Request volume is too high. Suggestion: Wait briefly before retrying or reduce concurrent calls.";
|
|
18373
18554
|
} else if (statusCode === 401 || statusCode === 403) {
|
|
18374
|
-
|
|
18555
|
+
type = "Authentication Error";
|
|
18556
|
+
hint = "The request could not be authorized. Suggestion: Verify your API key or token in the environment configuration.";
|
|
18375
18557
|
} else if (statusCode && statusCode >= 500) {
|
|
18376
|
-
|
|
18558
|
+
type = "Upstream Error";
|
|
18559
|
+
hint = "The remote service is experiencing temporary issues. Suggestion: Try again in a few minutes.";
|
|
18377
18560
|
} else if (statusCode === 404) {
|
|
18378
|
-
|
|
18561
|
+
type = "Not Found";
|
|
18562
|
+
hint = "The requested information could not be found. Suggestion: Check if the ID, Ticker, or query parameters are correct.";
|
|
18379
18563
|
}
|
|
18380
|
-
const detail = statusCode ? ` (HTTP ${statusCode})` : "";
|
|
18381
18564
|
return {
|
|
18382
18565
|
isError: true,
|
|
18383
18566
|
content: [
|
|
18384
18567
|
{
|
|
18385
18568
|
type: "text",
|
|
18386
|
-
text:
|
|
18569
|
+
text: `${type}: ${message}
|
|
18387
18570
|
|
|
18388
18571
|
**Next Action**: ${hint}`
|
|
18389
18572
|
}
|
|
@@ -32447,7 +32630,8 @@ config(en_default());
|
|
|
32447
32630
|
var zod_default = external_exports;
|
|
32448
32631
|
|
|
32449
32632
|
// ../packages/shared/dist/pagination.js
|
|
32450
|
-
var
|
|
32633
|
+
var zodCompat = zod_exports;
|
|
32634
|
+
var z2 = zodCompat.z ?? zodCompat.default?.z ?? zodCompat.default ?? zodCompat;
|
|
32451
32635
|
var paginationSchema = z2.object({
|
|
32452
32636
|
limit: z2.number().int().min(1).max(100).default(20).describe("Maximum results to return (1\u2013100, default 20)"),
|
|
32453
32637
|
offset: z2.number().int().min(0).default(0).describe("Number of results to skip for pagination (default 0)")
|
|
@@ -32465,6 +32649,14 @@ function applyPagination(items, params) {
|
|
|
32465
32649
|
};
|
|
32466
32650
|
}
|
|
32467
32651
|
|
|
32652
|
+
// ../packages/shared/dist/package.js
|
|
32653
|
+
import { createRequire as createJsonRequire } from "node:module";
|
|
32654
|
+
function getPackageVersion(moduleUrl) {
|
|
32655
|
+
const require2 = createJsonRequire(moduleUrl);
|
|
32656
|
+
const packageJson = require2("../package.json");
|
|
32657
|
+
return packageJson.version ?? "0.0.0";
|
|
32658
|
+
}
|
|
32659
|
+
|
|
32468
32660
|
// ../node_modules/zod/v3/helpers/util.js
|
|
32469
32661
|
var util;
|
|
32470
32662
|
(function(util4) {
|
|
@@ -42049,25 +42241,12 @@ var isEmptyObject = (val) => {
|
|
|
42049
42241
|
};
|
|
42050
42242
|
var isDate = kindOfTest("Date");
|
|
42051
42243
|
var isFile = kindOfTest("File");
|
|
42052
|
-
var isReactNativeBlob = (value) => {
|
|
42053
|
-
return !!(value && typeof value.uri !== "undefined");
|
|
42054
|
-
};
|
|
42055
|
-
var isReactNative = (formData) => formData && typeof formData.getParts !== "undefined";
|
|
42056
42244
|
var isBlob = kindOfTest("Blob");
|
|
42057
42245
|
var isFileList = kindOfTest("FileList");
|
|
42058
42246
|
var isStream = (val) => isObject2(val) && isFunction(val.pipe);
|
|
42059
|
-
function getGlobal() {
|
|
42060
|
-
if (typeof globalThis !== "undefined") return globalThis;
|
|
42061
|
-
if (typeof self !== "undefined") return self;
|
|
42062
|
-
if (typeof window !== "undefined") return window;
|
|
42063
|
-
if (typeof global !== "undefined") return global;
|
|
42064
|
-
return {};
|
|
42065
|
-
}
|
|
42066
|
-
var G = getGlobal();
|
|
42067
|
-
var FormDataCtor = typeof G.FormData !== "undefined" ? G.FormData : void 0;
|
|
42068
42247
|
var isFormData = (thing) => {
|
|
42069
42248
|
let kind;
|
|
42070
|
-
return thing && (
|
|
42249
|
+
return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
|
|
42071
42250
|
kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
|
|
42072
42251
|
};
|
|
42073
42252
|
var isURLSearchParams = kindOfTest("URLSearchParams");
|
|
@@ -42077,9 +42256,7 @@ var [isReadableStream, isRequest, isResponse, isHeaders] = [
|
|
|
42077
42256
|
"Response",
|
|
42078
42257
|
"Headers"
|
|
42079
42258
|
].map(kindOfTest);
|
|
42080
|
-
var trim = (str) =>
|
|
42081
|
-
return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
42082
|
-
};
|
|
42259
|
+
var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
42083
42260
|
function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
42084
42261
|
if (obj === null || typeof obj === "undefined") {
|
|
42085
42262
|
return;
|
|
@@ -42181,7 +42358,10 @@ var stripBOM = (content) => {
|
|
|
42181
42358
|
return content;
|
|
42182
42359
|
};
|
|
42183
42360
|
var inherits = (constructor, superConstructor, props, descriptors) => {
|
|
42184
|
-
constructor.prototype = Object.create(
|
|
42361
|
+
constructor.prototype = Object.create(
|
|
42362
|
+
superConstructor.prototype,
|
|
42363
|
+
descriptors
|
|
42364
|
+
);
|
|
42185
42365
|
Object.defineProperty(constructor.prototype, "constructor", {
|
|
42186
42366
|
value: constructor,
|
|
42187
42367
|
writable: true,
|
|
@@ -42380,8 +42560,6 @@ var utils_default = {
|
|
|
42380
42560
|
isUndefined,
|
|
42381
42561
|
isDate,
|
|
42382
42562
|
isFile,
|
|
42383
|
-
isReactNativeBlob,
|
|
42384
|
-
isReactNative,
|
|
42385
42563
|
isBlob,
|
|
42386
42564
|
isRegExp,
|
|
42387
42565
|
isFunction,
|
|
@@ -42430,9 +42608,6 @@ var AxiosError = class _AxiosError extends Error {
|
|
|
42430
42608
|
const axiosError = new _AxiosError(error48.message, code || error48.code, config2, request, response);
|
|
42431
42609
|
axiosError.cause = error48;
|
|
42432
42610
|
axiosError.name = error48.name;
|
|
42433
|
-
if (error48.status != null && axiosError.status == null) {
|
|
42434
|
-
axiosError.status = error48.status;
|
|
42435
|
-
}
|
|
42436
42611
|
customProps && Object.assign(axiosError, customProps);
|
|
42437
42612
|
return axiosError;
|
|
42438
42613
|
}
|
|
@@ -42449,12 +42624,6 @@ var AxiosError = class _AxiosError extends Error {
|
|
|
42449
42624
|
*/
|
|
42450
42625
|
constructor(message, code, config2, request, response) {
|
|
42451
42626
|
super(message);
|
|
42452
|
-
Object.defineProperty(this, "message", {
|
|
42453
|
-
value: message,
|
|
42454
|
-
enumerable: true,
|
|
42455
|
-
writable: true,
|
|
42456
|
-
configurable: true
|
|
42457
|
-
});
|
|
42458
42627
|
this.name = "AxiosError";
|
|
42459
42628
|
this.isAxiosError = true;
|
|
42460
42629
|
code && (this.code = code);
|
|
@@ -42528,18 +42697,13 @@ function toFormData(obj, formData, options) {
|
|
|
42528
42697
|
throw new TypeError("target must be an object");
|
|
42529
42698
|
}
|
|
42530
42699
|
formData = formData || new (FormData_default || FormData)();
|
|
42531
|
-
options = utils_default.toFlatObject(
|
|
42532
|
-
|
|
42533
|
-
|
|
42534
|
-
|
|
42535
|
-
|
|
42536
|
-
|
|
42537
|
-
|
|
42538
|
-
false,
|
|
42539
|
-
function defined(option, source) {
|
|
42540
|
-
return !utils_default.isUndefined(source[option]);
|
|
42541
|
-
}
|
|
42542
|
-
);
|
|
42700
|
+
options = utils_default.toFlatObject(options, {
|
|
42701
|
+
metaTokens: true,
|
|
42702
|
+
dots: false,
|
|
42703
|
+
indexes: false
|
|
42704
|
+
}, false, function defined(option, source) {
|
|
42705
|
+
return !utils_default.isUndefined(source[option]);
|
|
42706
|
+
});
|
|
42543
42707
|
const metaTokens = options.metaTokens;
|
|
42544
42708
|
const visitor = options.visitor || defaultVisitor;
|
|
42545
42709
|
const dots = options.dots;
|
|
@@ -42567,10 +42731,6 @@ function toFormData(obj, formData, options) {
|
|
|
42567
42731
|
}
|
|
42568
42732
|
function defaultVisitor(value, key, path) {
|
|
42569
42733
|
let arr = value;
|
|
42570
|
-
if (utils_default.isReactNative(formData) && utils_default.isReactNativeBlob(value)) {
|
|
42571
|
-
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
42572
|
-
return false;
|
|
42573
|
-
}
|
|
42574
42734
|
if (value && !path && typeof value === "object") {
|
|
42575
42735
|
if (utils_default.endsWith(key, "{}")) {
|
|
42576
42736
|
key = metaTokens ? key : key.slice(0, -2);
|
|
@@ -42606,7 +42766,13 @@ function toFormData(obj, formData, options) {
|
|
|
42606
42766
|
}
|
|
42607
42767
|
stack.push(value);
|
|
42608
42768
|
utils_default.forEach(value, function each(el, key) {
|
|
42609
|
-
const result = !(utils_default.isUndefined(el) || el === null) && visitor.call(
|
|
42769
|
+
const result = !(utils_default.isUndefined(el) || el === null) && visitor.call(
|
|
42770
|
+
formData,
|
|
42771
|
+
el,
|
|
42772
|
+
utils_default.isString(key) ? key.trim() : key,
|
|
42773
|
+
path,
|
|
42774
|
+
exposedHelpers
|
|
42775
|
+
);
|
|
42610
42776
|
if (result === true) {
|
|
42611
42777
|
build(el, path ? path.concat(key) : [key]);
|
|
42612
42778
|
}
|
|
@@ -42901,74 +43067,70 @@ function stringifySafely(rawValue, parser, encoder) {
|
|
|
42901
43067
|
var defaults = {
|
|
42902
43068
|
transitional: transitional_default,
|
|
42903
43069
|
adapter: ["xhr", "http", "fetch"],
|
|
42904
|
-
transformRequest: [
|
|
42905
|
-
|
|
42906
|
-
|
|
42907
|
-
|
|
42908
|
-
|
|
42909
|
-
|
|
42910
|
-
|
|
42911
|
-
|
|
42912
|
-
|
|
42913
|
-
|
|
42914
|
-
|
|
42915
|
-
|
|
42916
|
-
|
|
42917
|
-
|
|
42918
|
-
|
|
42919
|
-
|
|
42920
|
-
|
|
42921
|
-
|
|
42922
|
-
|
|
42923
|
-
|
|
42924
|
-
|
|
42925
|
-
|
|
42926
|
-
|
|
42927
|
-
if (
|
|
42928
|
-
|
|
42929
|
-
return toURLEncodedForm(data, this.formSerializer).toString();
|
|
42930
|
-
}
|
|
42931
|
-
if ((isFileList2 = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
|
|
42932
|
-
const _FormData = this.env && this.env.FormData;
|
|
42933
|
-
return toFormData_default(
|
|
42934
|
-
isFileList2 ? { "files[]": data } : data,
|
|
42935
|
-
_FormData && new _FormData(),
|
|
42936
|
-
this.formSerializer
|
|
42937
|
-
);
|
|
42938
|
-
}
|
|
43070
|
+
transformRequest: [function transformRequest(data, headers) {
|
|
43071
|
+
const contentType = headers.getContentType() || "";
|
|
43072
|
+
const hasJSONContentType = contentType.indexOf("application/json") > -1;
|
|
43073
|
+
const isObjectPayload = utils_default.isObject(data);
|
|
43074
|
+
if (isObjectPayload && utils_default.isHTMLForm(data)) {
|
|
43075
|
+
data = new FormData(data);
|
|
43076
|
+
}
|
|
43077
|
+
const isFormData2 = utils_default.isFormData(data);
|
|
43078
|
+
if (isFormData2) {
|
|
43079
|
+
return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data;
|
|
43080
|
+
}
|
|
43081
|
+
if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) {
|
|
43082
|
+
return data;
|
|
43083
|
+
}
|
|
43084
|
+
if (utils_default.isArrayBufferView(data)) {
|
|
43085
|
+
return data.buffer;
|
|
43086
|
+
}
|
|
43087
|
+
if (utils_default.isURLSearchParams(data)) {
|
|
43088
|
+
headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
|
|
43089
|
+
return data.toString();
|
|
43090
|
+
}
|
|
43091
|
+
let isFileList2;
|
|
43092
|
+
if (isObjectPayload) {
|
|
43093
|
+
if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
|
|
43094
|
+
return toURLEncodedForm(data, this.formSerializer).toString();
|
|
42939
43095
|
}
|
|
42940
|
-
if (
|
|
42941
|
-
|
|
42942
|
-
return
|
|
43096
|
+
if ((isFileList2 = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
|
|
43097
|
+
const _FormData = this.env && this.env.FormData;
|
|
43098
|
+
return toFormData_default(
|
|
43099
|
+
isFileList2 ? { "files[]": data } : data,
|
|
43100
|
+
_FormData && new _FormData(),
|
|
43101
|
+
this.formSerializer
|
|
43102
|
+
);
|
|
42943
43103
|
}
|
|
43104
|
+
}
|
|
43105
|
+
if (isObjectPayload || hasJSONContentType) {
|
|
43106
|
+
headers.setContentType("application/json", false);
|
|
43107
|
+
return stringifySafely(data);
|
|
43108
|
+
}
|
|
43109
|
+
return data;
|
|
43110
|
+
}],
|
|
43111
|
+
transformResponse: [function transformResponse(data) {
|
|
43112
|
+
const transitional2 = this.transitional || defaults.transitional;
|
|
43113
|
+
const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
|
|
43114
|
+
const JSONRequested = this.responseType === "json";
|
|
43115
|
+
if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) {
|
|
42944
43116
|
return data;
|
|
42945
43117
|
}
|
|
42946
|
-
|
|
42947
|
-
|
|
42948
|
-
|
|
42949
|
-
|
|
42950
|
-
|
|
42951
|
-
|
|
42952
|
-
|
|
42953
|
-
|
|
42954
|
-
|
|
42955
|
-
if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
|
|
42956
|
-
const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
|
|
42957
|
-
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
42958
|
-
try {
|
|
42959
|
-
return JSON.parse(data, this.parseReviver);
|
|
42960
|
-
} catch (e) {
|
|
42961
|
-
if (strictJSONParsing) {
|
|
42962
|
-
if (e.name === "SyntaxError") {
|
|
42963
|
-
throw AxiosError_default.from(e, AxiosError_default.ERR_BAD_RESPONSE, this, null, this.response);
|
|
42964
|
-
}
|
|
42965
|
-
throw e;
|
|
43118
|
+
if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
|
|
43119
|
+
const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
|
|
43120
|
+
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
43121
|
+
try {
|
|
43122
|
+
return JSON.parse(data, this.parseReviver);
|
|
43123
|
+
} catch (e) {
|
|
43124
|
+
if (strictJSONParsing) {
|
|
43125
|
+
if (e.name === "SyntaxError") {
|
|
43126
|
+
throw AxiosError_default.from(e, AxiosError_default.ERR_BAD_RESPONSE, this, null, this.response);
|
|
42966
43127
|
}
|
|
43128
|
+
throw e;
|
|
42967
43129
|
}
|
|
42968
43130
|
}
|
|
42969
|
-
return data;
|
|
42970
43131
|
}
|
|
42971
|
-
|
|
43132
|
+
return data;
|
|
43133
|
+
}],
|
|
42972
43134
|
/**
|
|
42973
43135
|
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
42974
43136
|
* timeout is not created.
|
|
@@ -42987,7 +43149,7 @@ var defaults = {
|
|
|
42987
43149
|
},
|
|
42988
43150
|
headers: {
|
|
42989
43151
|
common: {
|
|
42990
|
-
Accept: "application/json, text/plain, */*",
|
|
43152
|
+
"Accept": "application/json, text/plain, */*",
|
|
42991
43153
|
"Content-Type": void 0
|
|
42992
43154
|
}
|
|
42993
43155
|
}
|
|
@@ -43051,7 +43213,7 @@ function normalizeValue(value) {
|
|
|
43051
43213
|
if (value === false || value == null) {
|
|
43052
43214
|
return value;
|
|
43053
43215
|
}
|
|
43054
|
-
return utils_default.isArray(value) ? value.map(normalizeValue) : String(value)
|
|
43216
|
+
return utils_default.isArray(value) ? value.map(normalizeValue) : String(value);
|
|
43055
43217
|
}
|
|
43056
43218
|
function parseTokens(str) {
|
|
43057
43219
|
const tokens = /* @__PURE__ */ Object.create(null);
|
|
@@ -43258,14 +43420,7 @@ var AxiosHeaders = class {
|
|
|
43258
43420
|
return this;
|
|
43259
43421
|
}
|
|
43260
43422
|
};
|
|
43261
|
-
AxiosHeaders.accessor([
|
|
43262
|
-
"Content-Type",
|
|
43263
|
-
"Content-Length",
|
|
43264
|
-
"Accept",
|
|
43265
|
-
"Accept-Encoding",
|
|
43266
|
-
"User-Agent",
|
|
43267
|
-
"Authorization"
|
|
43268
|
-
]);
|
|
43423
|
+
AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
43269
43424
|
utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
|
|
43270
43425
|
let mapped = key[0].toUpperCase() + key.slice(1);
|
|
43271
43426
|
return {
|
|
@@ -43321,15 +43476,13 @@ function settle(resolve, reject, response) {
|
|
|
43321
43476
|
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
|
|
43322
43477
|
resolve(response);
|
|
43323
43478
|
} else {
|
|
43324
|
-
reject(
|
|
43325
|
-
|
|
43326
|
-
|
|
43327
|
-
|
|
43328
|
-
|
|
43329
|
-
|
|
43330
|
-
|
|
43331
|
-
)
|
|
43332
|
-
);
|
|
43479
|
+
reject(new AxiosError_default(
|
|
43480
|
+
"Request failed with status code " + response.status,
|
|
43481
|
+
[AxiosError_default.ERR_BAD_REQUEST, AxiosError_default.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
|
|
43482
|
+
response.config,
|
|
43483
|
+
response.request,
|
|
43484
|
+
response
|
|
43485
|
+
));
|
|
43333
43486
|
}
|
|
43334
43487
|
}
|
|
43335
43488
|
|
|
@@ -43355,74 +43508,8 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
|
43355
43508
|
return requestedURL;
|
|
43356
43509
|
}
|
|
43357
43510
|
|
|
43358
|
-
// ../node_modules/proxy-from-env/index.js
|
|
43359
|
-
var DEFAULT_PORTS = {
|
|
43360
|
-
ftp: 21,
|
|
43361
|
-
gopher: 70,
|
|
43362
|
-
http: 80,
|
|
43363
|
-
https: 443,
|
|
43364
|
-
ws: 80,
|
|
43365
|
-
wss: 443
|
|
43366
|
-
};
|
|
43367
|
-
function parseUrl(urlString) {
|
|
43368
|
-
try {
|
|
43369
|
-
return new URL(urlString);
|
|
43370
|
-
} catch {
|
|
43371
|
-
return null;
|
|
43372
|
-
}
|
|
43373
|
-
}
|
|
43374
|
-
function getProxyForUrl(url3) {
|
|
43375
|
-
var parsedUrl = (typeof url3 === "string" ? parseUrl(url3) : url3) || {};
|
|
43376
|
-
var proto = parsedUrl.protocol;
|
|
43377
|
-
var hostname3 = parsedUrl.host;
|
|
43378
|
-
var port = parsedUrl.port;
|
|
43379
|
-
if (typeof hostname3 !== "string" || !hostname3 || typeof proto !== "string") {
|
|
43380
|
-
return "";
|
|
43381
|
-
}
|
|
43382
|
-
proto = proto.split(":", 1)[0];
|
|
43383
|
-
hostname3 = hostname3.replace(/:\d*$/, "");
|
|
43384
|
-
port = parseInt(port) || DEFAULT_PORTS[proto] || 0;
|
|
43385
|
-
if (!shouldProxy(hostname3, port)) {
|
|
43386
|
-
return "";
|
|
43387
|
-
}
|
|
43388
|
-
var proxy = getEnv(proto + "_proxy") || getEnv("all_proxy");
|
|
43389
|
-
if (proxy && proxy.indexOf("://") === -1) {
|
|
43390
|
-
proxy = proto + "://" + proxy;
|
|
43391
|
-
}
|
|
43392
|
-
return proxy;
|
|
43393
|
-
}
|
|
43394
|
-
function shouldProxy(hostname3, port) {
|
|
43395
|
-
var NO_PROXY = getEnv("no_proxy").toLowerCase();
|
|
43396
|
-
if (!NO_PROXY) {
|
|
43397
|
-
return true;
|
|
43398
|
-
}
|
|
43399
|
-
if (NO_PROXY === "*") {
|
|
43400
|
-
return false;
|
|
43401
|
-
}
|
|
43402
|
-
return NO_PROXY.split(/[,\s]/).every(function(proxy) {
|
|
43403
|
-
if (!proxy) {
|
|
43404
|
-
return true;
|
|
43405
|
-
}
|
|
43406
|
-
var parsedProxy = proxy.match(/^(.+):(\d+)$/);
|
|
43407
|
-
var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
|
|
43408
|
-
var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
|
|
43409
|
-
if (parsedProxyPort && parsedProxyPort !== port) {
|
|
43410
|
-
return true;
|
|
43411
|
-
}
|
|
43412
|
-
if (!/^[.*]/.test(parsedProxyHostname)) {
|
|
43413
|
-
return hostname3 !== parsedProxyHostname;
|
|
43414
|
-
}
|
|
43415
|
-
if (parsedProxyHostname.charAt(0) === "*") {
|
|
43416
|
-
parsedProxyHostname = parsedProxyHostname.slice(1);
|
|
43417
|
-
}
|
|
43418
|
-
return !hostname3.endsWith(parsedProxyHostname);
|
|
43419
|
-
});
|
|
43420
|
-
}
|
|
43421
|
-
function getEnv(key) {
|
|
43422
|
-
return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
|
|
43423
|
-
}
|
|
43424
|
-
|
|
43425
43511
|
// ../node_modules/axios/lib/adapters/http.js
|
|
43512
|
+
var import_proxy_from_env = __toESM(require_proxy_from_env(), 1);
|
|
43426
43513
|
var import_follow_redirects = __toESM(require_follow_redirects(), 1);
|
|
43427
43514
|
import http from "http";
|
|
43428
43515
|
import https from "https";
|
|
@@ -43431,7 +43518,7 @@ import util3 from "util";
|
|
|
43431
43518
|
import zlib from "zlib";
|
|
43432
43519
|
|
|
43433
43520
|
// ../node_modules/axios/lib/env/data.js
|
|
43434
|
-
var VERSION = "1.
|
|
43521
|
+
var VERSION = "1.13.5";
|
|
43435
43522
|
|
|
43436
43523
|
// ../node_modules/axios/lib/helpers/parseProtocol.js
|
|
43437
43524
|
function parseProtocol(url3) {
|
|
@@ -43476,21 +43563,16 @@ import stream from "stream";
|
|
|
43476
43563
|
var kInternals = /* @__PURE__ */ Symbol("internals");
|
|
43477
43564
|
var AxiosTransformStream = class extends stream.Transform {
|
|
43478
43565
|
constructor(options) {
|
|
43479
|
-
options = utils_default.toFlatObject(
|
|
43480
|
-
|
|
43481
|
-
|
|
43482
|
-
|
|
43483
|
-
|
|
43484
|
-
|
|
43485
|
-
|
|
43486
|
-
|
|
43487
|
-
|
|
43488
|
-
|
|
43489
|
-
null,
|
|
43490
|
-
(prop, source) => {
|
|
43491
|
-
return !utils_default.isUndefined(source[prop]);
|
|
43492
|
-
}
|
|
43493
|
-
);
|
|
43566
|
+
options = utils_default.toFlatObject(options, {
|
|
43567
|
+
maxRate: 0,
|
|
43568
|
+
chunkSize: 64 * 1024,
|
|
43569
|
+
minChunkSize: 100,
|
|
43570
|
+
timeWindow: 500,
|
|
43571
|
+
ticksRate: 2,
|
|
43572
|
+
samplesCount: 15
|
|
43573
|
+
}, null, (prop, source) => {
|
|
43574
|
+
return !utils_default.isUndefined(source[prop]);
|
|
43575
|
+
});
|
|
43494
43576
|
super({
|
|
43495
43577
|
readableHighWaterMark: options.chunkSize
|
|
43496
43578
|
});
|
|
@@ -43573,12 +43655,9 @@ var AxiosTransformStream = class extends stream.Transform {
|
|
|
43573
43655
|
chunkRemainder = _chunk.subarray(maxChunkSize);
|
|
43574
43656
|
_chunk = _chunk.subarray(0, maxChunkSize);
|
|
43575
43657
|
}
|
|
43576
|
-
pushChunk(
|
|
43577
|
-
|
|
43578
|
-
|
|
43579
|
-
process.nextTick(_callback, null, chunkRemainder);
|
|
43580
|
-
} : _callback
|
|
43581
|
-
);
|
|
43658
|
+
pushChunk(_chunk, chunkRemainder ? () => {
|
|
43659
|
+
process.nextTick(_callback, null, chunkRemainder);
|
|
43660
|
+
} : _callback);
|
|
43582
43661
|
};
|
|
43583
43662
|
transformChunk(chunk, function transformNextChunk(err, _chunk) {
|
|
43584
43663
|
if (err) {
|
|
@@ -43649,14 +43728,11 @@ var FormDataPart = class {
|
|
|
43649
43728
|
yield CRLF_BYTES;
|
|
43650
43729
|
}
|
|
43651
43730
|
static escapeName(name) {
|
|
43652
|
-
return String(name).replace(
|
|
43653
|
-
|
|
43654
|
-
|
|
43655
|
-
|
|
43656
|
-
|
|
43657
|
-
'"': "%22"
|
|
43658
|
-
})[match]
|
|
43659
|
-
);
|
|
43731
|
+
return String(name).replace(/[\r\n"]/g, (match) => ({
|
|
43732
|
+
"\r": "%0D",
|
|
43733
|
+
"\n": "%0A",
|
|
43734
|
+
'"': "%22"
|
|
43735
|
+
})[match]);
|
|
43660
43736
|
}
|
|
43661
43737
|
};
|
|
43662
43738
|
var formDataToStream = (form, headersHandler, options) => {
|
|
@@ -43688,15 +43764,13 @@ var formDataToStream = (form, headersHandler, options) => {
|
|
|
43688
43764
|
computedHeaders["Content-Length"] = contentLength;
|
|
43689
43765
|
}
|
|
43690
43766
|
headersHandler && headersHandler(computedHeaders);
|
|
43691
|
-
return Readable.from(
|
|
43692
|
-
(
|
|
43693
|
-
|
|
43694
|
-
|
|
43695
|
-
|
|
43696
|
-
|
|
43697
|
-
|
|
43698
|
-
})()
|
|
43699
|
-
);
|
|
43767
|
+
return Readable.from((async function* () {
|
|
43768
|
+
for (const part of parts) {
|
|
43769
|
+
yield boundaryBytes;
|
|
43770
|
+
yield* part.encode();
|
|
43771
|
+
}
|
|
43772
|
+
yield footerBytes;
|
|
43773
|
+
})());
|
|
43700
43774
|
};
|
|
43701
43775
|
var formDataToStream_default = formDataToStream;
|
|
43702
43776
|
|
|
@@ -43835,14 +43909,11 @@ var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
|
43835
43909
|
};
|
|
43836
43910
|
var progressEventDecorator = (total, throttled) => {
|
|
43837
43911
|
const lengthComputable = total != null;
|
|
43838
|
-
return [
|
|
43839
|
-
|
|
43840
|
-
|
|
43841
|
-
|
|
43842
|
-
|
|
43843
|
-
}),
|
|
43844
|
-
throttled[1]
|
|
43845
|
-
];
|
|
43912
|
+
return [(loaded) => throttled[0]({
|
|
43913
|
+
lengthComputable,
|
|
43914
|
+
total,
|
|
43915
|
+
loaded
|
|
43916
|
+
}), throttled[1]];
|
|
43846
43917
|
};
|
|
43847
43918
|
var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args));
|
|
43848
43919
|
|
|
@@ -43921,12 +43992,9 @@ var Http2Sessions = class {
|
|
|
43921
43992
|
this.sessions = /* @__PURE__ */ Object.create(null);
|
|
43922
43993
|
}
|
|
43923
43994
|
getSession(authority, options) {
|
|
43924
|
-
options = Object.assign(
|
|
43925
|
-
|
|
43926
|
-
|
|
43927
|
-
},
|
|
43928
|
-
options
|
|
43929
|
-
);
|
|
43995
|
+
options = Object.assign({
|
|
43996
|
+
sessionTimeout: 1e3
|
|
43997
|
+
}, options);
|
|
43930
43998
|
let authoritySessions = this.sessions[authority];
|
|
43931
43999
|
if (authoritySessions) {
|
|
43932
44000
|
let len = authoritySessions.length;
|
|
@@ -43952,9 +44020,6 @@ var Http2Sessions = class {
|
|
|
43952
44020
|
} else {
|
|
43953
44021
|
entries.splice(i, 1);
|
|
43954
44022
|
}
|
|
43955
|
-
if (!session.closed) {
|
|
43956
|
-
session.close();
|
|
43957
|
-
}
|
|
43958
44023
|
return;
|
|
43959
44024
|
}
|
|
43960
44025
|
}
|
|
@@ -43983,7 +44048,10 @@ var Http2Sessions = class {
|
|
|
43983
44048
|
};
|
|
43984
44049
|
}
|
|
43985
44050
|
session.once("close", removeSession);
|
|
43986
|
-
let entry = [
|
|
44051
|
+
let entry = [
|
|
44052
|
+
session,
|
|
44053
|
+
options
|
|
44054
|
+
];
|
|
43987
44055
|
authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
|
|
43988
44056
|
return session;
|
|
43989
44057
|
}
|
|
@@ -44000,7 +44068,7 @@ function dispatchBeforeRedirect(options, responseDetails) {
|
|
|
44000
44068
|
function setProxy(options, configProxy, location) {
|
|
44001
44069
|
let proxy = configProxy;
|
|
44002
44070
|
if (!proxy && proxy !== false) {
|
|
44003
|
-
const proxyUrl = getProxyForUrl(location);
|
|
44071
|
+
const proxyUrl = import_proxy_from_env.default.getProxyForUrl(location);
|
|
44004
44072
|
if (proxyUrl) {
|
|
44005
44073
|
proxy = new URL(proxyUrl);
|
|
44006
44074
|
}
|
|
@@ -44069,7 +44137,12 @@ var http2Transport = {
|
|
|
44069
44137
|
const authority = options.protocol + "//" + options.hostname + ":" + (options.port || (options.protocol === "https:" ? 443 : 80));
|
|
44070
44138
|
const { http2Options, headers } = options;
|
|
44071
44139
|
const session = http2Sessions.getSession(authority, http2Options);
|
|
44072
|
-
const {
|
|
44140
|
+
const {
|
|
44141
|
+
HTTP2_HEADER_SCHEME,
|
|
44142
|
+
HTTP2_HEADER_METHOD,
|
|
44143
|
+
HTTP2_HEADER_PATH,
|
|
44144
|
+
HTTP2_HEADER_STATUS
|
|
44145
|
+
} = http2.constants;
|
|
44073
44146
|
const http2Headers = {
|
|
44074
44147
|
[HTTP2_HEADER_SCHEME]: options.protocol.replace(":", ""),
|
|
44075
44148
|
[HTTP2_HEADER_METHOD]: options.method,
|
|
@@ -44122,10 +44195,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
|
|
|
44122
44195
|
const abortEmitter = new EventEmitter();
|
|
44123
44196
|
function abort(reason) {
|
|
44124
44197
|
try {
|
|
44125
|
-
abortEmitter.emit(
|
|
44126
|
-
"abort",
|
|
44127
|
-
!reason || reason.type ? new CanceledError_default(null, config2, req) : reason
|
|
44128
|
-
);
|
|
44198
|
+
abortEmitter.emit("abort", !reason || reason.type ? new CanceledError_default(null, config2, req) : reason);
|
|
44129
44199
|
} catch (err) {
|
|
44130
44200
|
console.warn("emit error", err);
|
|
44131
44201
|
}
|
|
@@ -44171,13 +44241,11 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
|
|
|
44171
44241
|
const dataUrl = String(config2.url || fullPath || "");
|
|
44172
44242
|
const estimated = estimateDataURLDecodedBytes(dataUrl);
|
|
44173
44243
|
if (estimated > config2.maxContentLength) {
|
|
44174
|
-
return reject(
|
|
44175
|
-
|
|
44176
|
-
|
|
44177
|
-
|
|
44178
|
-
|
|
44179
|
-
)
|
|
44180
|
-
);
|
|
44244
|
+
return reject(new AxiosError_default(
|
|
44245
|
+
"maxContentLength size of " + config2.maxContentLength + " exceeded",
|
|
44246
|
+
AxiosError_default.ERR_BAD_RESPONSE,
|
|
44247
|
+
config2
|
|
44248
|
+
));
|
|
44181
44249
|
}
|
|
44182
44250
|
}
|
|
44183
44251
|
let convertedData;
|
|
@@ -44213,9 +44281,11 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
|
|
|
44213
44281
|
});
|
|
44214
44282
|
}
|
|
44215
44283
|
if (supportedProtocols.indexOf(protocol) === -1) {
|
|
44216
|
-
return reject(
|
|
44217
|
-
|
|
44218
|
-
|
|
44284
|
+
return reject(new AxiosError_default(
|
|
44285
|
+
"Unsupported protocol " + protocol,
|
|
44286
|
+
AxiosError_default.ERR_BAD_REQUEST,
|
|
44287
|
+
config2
|
|
44288
|
+
));
|
|
44219
44289
|
}
|
|
44220
44290
|
const headers = AxiosHeaders_default.from(config2.headers).normalize();
|
|
44221
44291
|
headers.set("User-Agent", "axios/" + VERSION, false);
|
|
@@ -44225,16 +44295,12 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
|
|
|
44225
44295
|
let maxDownloadRate = void 0;
|
|
44226
44296
|
if (utils_default.isSpecCompliantForm(data)) {
|
|
44227
44297
|
const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
|
|
44228
|
-
data = formDataToStream_default(
|
|
44229
|
-
|
|
44230
|
-
|
|
44231
|
-
|
|
44232
|
-
|
|
44233
|
-
|
|
44234
|
-
tag: `axios-${VERSION}-boundary`,
|
|
44235
|
-
boundary: userBoundary && userBoundary[1] || void 0
|
|
44236
|
-
}
|
|
44237
|
-
);
|
|
44298
|
+
data = formDataToStream_default(data, (formHeaders) => {
|
|
44299
|
+
headers.set(formHeaders);
|
|
44300
|
+
}, {
|
|
44301
|
+
tag: `axios-${VERSION}-boundary`,
|
|
44302
|
+
boundary: userBoundary && userBoundary[1] || void 0
|
|
44303
|
+
});
|
|
44238
44304
|
} else if (utils_default.isFormData(data) && utils_default.isFunction(data.getHeaders)) {
|
|
44239
44305
|
headers.set(data.getHeaders());
|
|
44240
44306
|
if (!headers.hasContentLength()) {
|
|
@@ -44255,23 +44321,19 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
|
|
|
44255
44321
|
} else if (utils_default.isString(data)) {
|
|
44256
44322
|
data = Buffer.from(data, "utf-8");
|
|
44257
44323
|
} else {
|
|
44258
|
-
return reject(
|
|
44259
|
-
|
|
44260
|
-
|
|
44261
|
-
|
|
44262
|
-
|
|
44263
|
-
)
|
|
44264
|
-
);
|
|
44324
|
+
return reject(new AxiosError_default(
|
|
44325
|
+
"Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",
|
|
44326
|
+
AxiosError_default.ERR_BAD_REQUEST,
|
|
44327
|
+
config2
|
|
44328
|
+
));
|
|
44265
44329
|
}
|
|
44266
44330
|
headers.setContentLength(data.length, false);
|
|
44267
44331
|
if (config2.maxBodyLength > -1 && data.length > config2.maxBodyLength) {
|
|
44268
|
-
return reject(
|
|
44269
|
-
|
|
44270
|
-
|
|
44271
|
-
|
|
44272
|
-
|
|
44273
|
-
)
|
|
44274
|
-
);
|
|
44332
|
+
return reject(new AxiosError_default(
|
|
44333
|
+
"Request body larger than maxBodyLength limit",
|
|
44334
|
+
AxiosError_default.ERR_BAD_REQUEST,
|
|
44335
|
+
config2
|
|
44336
|
+
));
|
|
44275
44337
|
}
|
|
44276
44338
|
}
|
|
44277
44339
|
const contentLength = utils_default.toFiniteNumber(headers.getContentLength());
|
|
@@ -44285,25 +44347,16 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
|
|
|
44285
44347
|
if (!utils_default.isStream(data)) {
|
|
44286
44348
|
data = stream3.Readable.from(data, { objectMode: false });
|
|
44287
44349
|
}
|
|
44288
|
-
data = stream3.pipeline(
|
|
44289
|
-
|
|
44290
|
-
|
|
44291
|
-
|
|
44292
|
-
|
|
44293
|
-
|
|
44294
|
-
|
|
44295
|
-
|
|
44296
|
-
);
|
|
44297
|
-
onUploadProgress && data.on(
|
|
44298
|
-
"progress",
|
|
44299
|
-
flushOnFinish(
|
|
44300
|
-
data,
|
|
44301
|
-
progressEventDecorator(
|
|
44302
|
-
contentLength,
|
|
44303
|
-
progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
|
|
44304
|
-
)
|
|
44350
|
+
data = stream3.pipeline([data, new AxiosTransformStream_default({
|
|
44351
|
+
maxRate: utils_default.toFiniteNumber(maxUploadRate)
|
|
44352
|
+
})], utils_default.noop);
|
|
44353
|
+
onUploadProgress && data.on("progress", flushOnFinish(
|
|
44354
|
+
data,
|
|
44355
|
+
progressEventDecorator(
|
|
44356
|
+
contentLength,
|
|
44357
|
+
progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
|
|
44305
44358
|
)
|
|
44306
|
-
);
|
|
44359
|
+
));
|
|
44307
44360
|
}
|
|
44308
44361
|
let auth = void 0;
|
|
44309
44362
|
if (config2.auth) {
|
|
@@ -44354,11 +44407,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
|
|
|
44354
44407
|
} else {
|
|
44355
44408
|
options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
|
|
44356
44409
|
options.port = parsed.port;
|
|
44357
|
-
setProxy(
|
|
44358
|
-
options,
|
|
44359
|
-
config2.proxy,
|
|
44360
|
-
protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path
|
|
44361
|
-
);
|
|
44410
|
+
setProxy(options, config2.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path);
|
|
44362
44411
|
}
|
|
44363
44412
|
let transport;
|
|
44364
44413
|
const isHttpsRequest = isHttps.test(options.protocol);
|
|
@@ -44396,16 +44445,13 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
|
|
|
44396
44445
|
const transformStream = new AxiosTransformStream_default({
|
|
44397
44446
|
maxRate: utils_default.toFiniteNumber(maxDownloadRate)
|
|
44398
44447
|
});
|
|
44399
|
-
onDownloadProgress && transformStream.on(
|
|
44400
|
-
|
|
44401
|
-
|
|
44402
|
-
|
|
44403
|
-
|
|
44404
|
-
responseLength,
|
|
44405
|
-
progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
|
|
44406
|
-
)
|
|
44448
|
+
onDownloadProgress && transformStream.on("progress", flushOnFinish(
|
|
44449
|
+
transformStream,
|
|
44450
|
+
progressEventDecorator(
|
|
44451
|
+
responseLength,
|
|
44452
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
|
|
44407
44453
|
)
|
|
44408
|
-
);
|
|
44454
|
+
));
|
|
44409
44455
|
streams.push(transformStream);
|
|
44410
44456
|
}
|
|
44411
44457
|
let responseStream = res;
|
|
@@ -44455,14 +44501,12 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
|
|
|
44455
44501
|
if (config2.maxContentLength > -1 && totalResponseBytes > config2.maxContentLength) {
|
|
44456
44502
|
rejected = true;
|
|
44457
44503
|
responseStream.destroy();
|
|
44458
|
-
abort(
|
|
44459
|
-
|
|
44460
|
-
|
|
44461
|
-
|
|
44462
|
-
|
|
44463
|
-
|
|
44464
|
-
)
|
|
44465
|
-
);
|
|
44504
|
+
abort(new AxiosError_default(
|
|
44505
|
+
"maxContentLength size of " + config2.maxContentLength + " exceeded",
|
|
44506
|
+
AxiosError_default.ERR_BAD_RESPONSE,
|
|
44507
|
+
config2,
|
|
44508
|
+
lastRequest
|
|
44509
|
+
));
|
|
44466
44510
|
}
|
|
44467
44511
|
});
|
|
44468
44512
|
responseStream.on("aborted", function handlerStreamAborted() {
|
|
@@ -44521,14 +44565,12 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
|
|
|
44521
44565
|
if (config2.timeout) {
|
|
44522
44566
|
const timeout = parseInt(config2.timeout, 10);
|
|
44523
44567
|
if (Number.isNaN(timeout)) {
|
|
44524
|
-
abort(
|
|
44525
|
-
|
|
44526
|
-
|
|
44527
|
-
|
|
44528
|
-
|
|
44529
|
-
|
|
44530
|
-
)
|
|
44531
|
-
);
|
|
44568
|
+
abort(new AxiosError_default(
|
|
44569
|
+
"error trying to parse `config.timeout` to int",
|
|
44570
|
+
AxiosError_default.ERR_BAD_OPTION_VALUE,
|
|
44571
|
+
config2,
|
|
44572
|
+
req
|
|
44573
|
+
));
|
|
44532
44574
|
return;
|
|
44533
44575
|
}
|
|
44534
44576
|
req.setTimeout(timeout, function handleRequestTimeout() {
|
|
@@ -44538,14 +44580,12 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
|
|
|
44538
44580
|
if (config2.timeoutErrorMessage) {
|
|
44539
44581
|
timeoutErrorMessage = config2.timeoutErrorMessage;
|
|
44540
44582
|
}
|
|
44541
|
-
abort(
|
|
44542
|
-
|
|
44543
|
-
|
|
44544
|
-
|
|
44545
|
-
|
|
44546
|
-
|
|
44547
|
-
)
|
|
44548
|
-
);
|
|
44583
|
+
abort(new AxiosError_default(
|
|
44584
|
+
timeoutErrorMessage,
|
|
44585
|
+
transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
|
|
44586
|
+
config2,
|
|
44587
|
+
req
|
|
44588
|
+
));
|
|
44549
44589
|
});
|
|
44550
44590
|
} else {
|
|
44551
44591
|
req.setTimeout(0);
|
|
@@ -44700,12 +44740,16 @@ function mergeConfig(config1, config2) {
|
|
|
44700
44740
|
validateStatus: mergeDirectKeys,
|
|
44701
44741
|
headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
|
|
44702
44742
|
};
|
|
44703
|
-
utils_default.forEach(
|
|
44704
|
-
|
|
44705
|
-
|
|
44706
|
-
|
|
44707
|
-
|
|
44708
|
-
|
|
44743
|
+
utils_default.forEach(
|
|
44744
|
+
Object.keys({ ...config1, ...config2 }),
|
|
44745
|
+
function computeConfigValue(prop) {
|
|
44746
|
+
if (prop === "__proto__" || prop === "constructor" || prop === "prototype")
|
|
44747
|
+
return;
|
|
44748
|
+
const merge3 = utils_default.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
|
|
44749
|
+
const configValue = merge3(config1[prop], config2[prop], prop);
|
|
44750
|
+
utils_default.isUndefined(configValue) && merge3 !== mergeDirectKeys || (config3[prop] = configValue);
|
|
44751
|
+
}
|
|
44752
|
+
);
|
|
44709
44753
|
return config3;
|
|
44710
44754
|
}
|
|
44711
44755
|
|
|
@@ -44714,17 +44758,11 @@ var resolveConfig_default = (config2) => {
|
|
|
44714
44758
|
const newConfig = mergeConfig({}, config2);
|
|
44715
44759
|
let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
|
|
44716
44760
|
newConfig.headers = headers = AxiosHeaders_default.from(headers);
|
|
44717
|
-
newConfig.url = buildURL(
|
|
44718
|
-
buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls),
|
|
44719
|
-
config2.params,
|
|
44720
|
-
config2.paramsSerializer
|
|
44721
|
-
);
|
|
44761
|
+
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config2.params, config2.paramsSerializer);
|
|
44722
44762
|
if (auth) {
|
|
44723
44763
|
headers.set(
|
|
44724
44764
|
"Authorization",
|
|
44725
|
-
"Basic " + btoa(
|
|
44726
|
-
(auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")
|
|
44727
|
-
)
|
|
44765
|
+
"Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
|
|
44728
44766
|
);
|
|
44729
44767
|
}
|
|
44730
44768
|
if (utils_default.isFormData(data)) {
|
|
@@ -44788,17 +44826,13 @@ var xhr_default = isXHRAdapterSupported && function(config2) {
|
|
|
44788
44826
|
config: config2,
|
|
44789
44827
|
request
|
|
44790
44828
|
};
|
|
44791
|
-
settle(
|
|
44792
|
-
|
|
44793
|
-
|
|
44794
|
-
|
|
44795
|
-
|
|
44796
|
-
|
|
44797
|
-
|
|
44798
|
-
done();
|
|
44799
|
-
},
|
|
44800
|
-
response
|
|
44801
|
-
);
|
|
44829
|
+
settle(function _resolve(value) {
|
|
44830
|
+
resolve(value);
|
|
44831
|
+
done();
|
|
44832
|
+
}, function _reject(err) {
|
|
44833
|
+
reject(err);
|
|
44834
|
+
done();
|
|
44835
|
+
}, response);
|
|
44802
44836
|
request = null;
|
|
44803
44837
|
}
|
|
44804
44838
|
if ("onloadend" in request) {
|
|
@@ -44834,14 +44868,12 @@ var xhr_default = isXHRAdapterSupported && function(config2) {
|
|
|
44834
44868
|
if (_config.timeoutErrorMessage) {
|
|
44835
44869
|
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
44836
44870
|
}
|
|
44837
|
-
reject(
|
|
44838
|
-
|
|
44839
|
-
|
|
44840
|
-
|
|
44841
|
-
|
|
44842
|
-
|
|
44843
|
-
)
|
|
44844
|
-
);
|
|
44871
|
+
reject(new AxiosError_default(
|
|
44872
|
+
timeoutErrorMessage,
|
|
44873
|
+
transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
|
|
44874
|
+
config2,
|
|
44875
|
+
request
|
|
44876
|
+
));
|
|
44845
44877
|
request = null;
|
|
44846
44878
|
};
|
|
44847
44879
|
requestData === void 0 && requestHeaders.setContentType(null);
|
|
@@ -44881,13 +44913,7 @@ var xhr_default = isXHRAdapterSupported && function(config2) {
|
|
|
44881
44913
|
}
|
|
44882
44914
|
const protocol = parseProtocol(_config.url);
|
|
44883
44915
|
if (protocol && platform_default.protocols.indexOf(protocol) === -1) {
|
|
44884
|
-
reject(
|
|
44885
|
-
new AxiosError_default(
|
|
44886
|
-
"Unsupported protocol " + protocol + ":",
|
|
44887
|
-
AxiosError_default.ERR_BAD_REQUEST,
|
|
44888
|
-
config2
|
|
44889
|
-
)
|
|
44890
|
-
);
|
|
44916
|
+
reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config2));
|
|
44891
44917
|
return;
|
|
44892
44918
|
}
|
|
44893
44919
|
request.send(requestData || null);
|
|
@@ -44905,9 +44931,7 @@ var composeSignals = (signals, timeout) => {
|
|
|
44905
44931
|
aborted2 = true;
|
|
44906
44932
|
unsubscribe();
|
|
44907
44933
|
const err = reason instanceof Error ? reason : this.reason;
|
|
44908
|
-
controller.abort(
|
|
44909
|
-
err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err)
|
|
44910
|
-
);
|
|
44934
|
+
controller.abort(err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err));
|
|
44911
44935
|
}
|
|
44912
44936
|
};
|
|
44913
44937
|
let timer = timeout && setTimeout(() => {
|
|
@@ -44980,36 +45004,33 @@ var trackStream = (stream4, chunkSize, onProgress, onFinish) => {
|
|
|
44980
45004
|
onFinish && onFinish(e);
|
|
44981
45005
|
}
|
|
44982
45006
|
};
|
|
44983
|
-
return new ReadableStream(
|
|
44984
|
-
{
|
|
44985
|
-
|
|
44986
|
-
|
|
44987
|
-
|
|
44988
|
-
|
|
44989
|
-
|
|
44990
|
-
|
|
44991
|
-
return;
|
|
44992
|
-
}
|
|
44993
|
-
let len = value.byteLength;
|
|
44994
|
-
if (onProgress) {
|
|
44995
|
-
let loadedBytes = bytes += len;
|
|
44996
|
-
onProgress(loadedBytes);
|
|
44997
|
-
}
|
|
44998
|
-
controller.enqueue(new Uint8Array(value));
|
|
44999
|
-
} catch (err) {
|
|
45000
|
-
_onFinish(err);
|
|
45001
|
-
throw err;
|
|
45007
|
+
return new ReadableStream({
|
|
45008
|
+
async pull(controller) {
|
|
45009
|
+
try {
|
|
45010
|
+
const { done: done2, value } = await iterator2.next();
|
|
45011
|
+
if (done2) {
|
|
45012
|
+
_onFinish();
|
|
45013
|
+
controller.close();
|
|
45014
|
+
return;
|
|
45002
45015
|
}
|
|
45003
|
-
|
|
45004
|
-
|
|
45005
|
-
|
|
45006
|
-
|
|
45016
|
+
let len = value.byteLength;
|
|
45017
|
+
if (onProgress) {
|
|
45018
|
+
let loadedBytes = bytes += len;
|
|
45019
|
+
onProgress(loadedBytes);
|
|
45020
|
+
}
|
|
45021
|
+
controller.enqueue(new Uint8Array(value));
|
|
45022
|
+
} catch (err) {
|
|
45023
|
+
_onFinish(err);
|
|
45024
|
+
throw err;
|
|
45007
45025
|
}
|
|
45008
45026
|
},
|
|
45009
|
-
{
|
|
45010
|
-
|
|
45027
|
+
cancel(reason) {
|
|
45028
|
+
_onFinish(reason);
|
|
45029
|
+
return iterator2.return();
|
|
45011
45030
|
}
|
|
45012
|
-
|
|
45031
|
+
}, {
|
|
45032
|
+
highWaterMark: 2
|
|
45033
|
+
});
|
|
45013
45034
|
};
|
|
45014
45035
|
|
|
45015
45036
|
// ../node_modules/axios/lib/adapters/fetch.js
|
|
@@ -45019,7 +45040,10 @@ var globalFetchAPI = (({ Request, Response }) => ({
|
|
|
45019
45040
|
Request,
|
|
45020
45041
|
Response
|
|
45021
45042
|
}))(utils_default.global);
|
|
45022
|
-
var {
|
|
45043
|
+
var {
|
|
45044
|
+
ReadableStream: ReadableStream2,
|
|
45045
|
+
TextEncoder: TextEncoder2
|
|
45046
|
+
} = utils_default.global;
|
|
45023
45047
|
var test = (fn, ...args) => {
|
|
45024
45048
|
try {
|
|
45025
45049
|
return !!fn(...args);
|
|
@@ -45028,13 +45052,9 @@ var test = (fn, ...args) => {
|
|
|
45028
45052
|
}
|
|
45029
45053
|
};
|
|
45030
45054
|
var factory = (env) => {
|
|
45031
|
-
env = utils_default.merge.call(
|
|
45032
|
-
|
|
45033
|
-
|
|
45034
|
-
},
|
|
45035
|
-
globalFetchAPI,
|
|
45036
|
-
env
|
|
45037
|
-
);
|
|
45055
|
+
env = utils_default.merge.call({
|
|
45056
|
+
skipUndefined: true
|
|
45057
|
+
}, globalFetchAPI, env);
|
|
45038
45058
|
const { fetch: envFetch, Request, Response } = env;
|
|
45039
45059
|
const isFetchSupported = envFetch ? isFunction2(envFetch) : typeof fetch === "function";
|
|
45040
45060
|
const isRequestSupported = isFunction2(Request);
|
|
@@ -45046,16 +45066,14 @@ var factory = (env) => {
|
|
|
45046
45066
|
const encodeText = isFetchSupported && (typeof TextEncoder2 === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder2()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
|
|
45047
45067
|
const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
|
|
45048
45068
|
let duplexAccessed = false;
|
|
45049
|
-
const body = new ReadableStream2();
|
|
45050
45069
|
const hasContentType = new Request(platform_default.origin, {
|
|
45051
|
-
body,
|
|
45070
|
+
body: new ReadableStream2(),
|
|
45052
45071
|
method: "POST",
|
|
45053
45072
|
get duplex() {
|
|
45054
45073
|
duplexAccessed = true;
|
|
45055
45074
|
return "half";
|
|
45056
45075
|
}
|
|
45057
45076
|
}).headers.has("Content-Type");
|
|
45058
|
-
body.cancel();
|
|
45059
45077
|
return duplexAccessed && !hasContentType;
|
|
45060
45078
|
});
|
|
45061
45079
|
const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
|
|
@@ -45069,11 +45087,7 @@ var factory = (env) => {
|
|
|
45069
45087
|
if (method) {
|
|
45070
45088
|
return method.call(res);
|
|
45071
45089
|
}
|
|
45072
|
-
throw new AxiosError_default(
|
|
45073
|
-
`Response type '${type}' is not supported`,
|
|
45074
|
-
AxiosError_default.ERR_NOT_SUPPORT,
|
|
45075
|
-
config2
|
|
45076
|
-
);
|
|
45090
|
+
throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config2);
|
|
45077
45091
|
});
|
|
45078
45092
|
});
|
|
45079
45093
|
})();
|
|
@@ -45122,10 +45136,7 @@ var factory = (env) => {
|
|
|
45122
45136
|
} = resolveConfig_default(config2);
|
|
45123
45137
|
let _fetch = envFetch || fetch;
|
|
45124
45138
|
responseType = responseType ? (responseType + "").toLowerCase() : "text";
|
|
45125
|
-
let composedSignal = composeSignals_default(
|
|
45126
|
-
[signal, cancelToken && cancelToken.toAbortSignal()],
|
|
45127
|
-
timeout
|
|
45128
|
-
);
|
|
45139
|
+
let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
45129
45140
|
let request = null;
|
|
45130
45141
|
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
45131
45142
|
composedSignal.unsubscribe();
|
|
@@ -45185,10 +45196,7 @@ var factory = (env) => {
|
|
|
45185
45196
|
);
|
|
45186
45197
|
}
|
|
45187
45198
|
responseType = responseType || "text";
|
|
45188
|
-
let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](
|
|
45189
|
-
response,
|
|
45190
|
-
config2
|
|
45191
|
-
);
|
|
45199
|
+
let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config2);
|
|
45192
45200
|
!isStreamResponse && unsubscribe && unsubscribe();
|
|
45193
45201
|
return await new Promise((resolve, reject) => {
|
|
45194
45202
|
settle(resolve, reject, {
|
|
@@ -45204,13 +45212,7 @@ var factory = (env) => {
|
|
|
45204
45212
|
unsubscribe && unsubscribe();
|
|
45205
45213
|
if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
|
|
45206
45214
|
throw Object.assign(
|
|
45207
|
-
new AxiosError_default(
|
|
45208
|
-
"Network Error",
|
|
45209
|
-
AxiosError_default.ERR_NETWORK,
|
|
45210
|
-
config2,
|
|
45211
|
-
request,
|
|
45212
|
-
err && err.response
|
|
45213
|
-
),
|
|
45215
|
+
new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config2, request, err && err.response),
|
|
45214
45216
|
{
|
|
45215
45217
|
cause: err.cause || err
|
|
45216
45218
|
}
|
|
@@ -45224,7 +45226,11 @@ var seedCache = /* @__PURE__ */ new Map();
|
|
|
45224
45226
|
var getFetch = (config2) => {
|
|
45225
45227
|
let env = config2 && config2.env || {};
|
|
45226
45228
|
const { fetch: fetch2, Request, Response } = env;
|
|
45227
|
-
const seeds = [
|
|
45229
|
+
const seeds = [
|
|
45230
|
+
Request,
|
|
45231
|
+
Response,
|
|
45232
|
+
fetch2
|
|
45233
|
+
];
|
|
45228
45234
|
let len = seeds.length, i = len, seed, target, map2 = seedCache;
|
|
45229
45235
|
while (i--) {
|
|
45230
45236
|
seed = seeds[i];
|
|
@@ -45313,33 +45319,37 @@ function throwIfCancellationRequested(config2) {
|
|
|
45313
45319
|
function dispatchRequest(config2) {
|
|
45314
45320
|
throwIfCancellationRequested(config2);
|
|
45315
45321
|
config2.headers = AxiosHeaders_default.from(config2.headers);
|
|
45316
|
-
config2.data = transformData.call(
|
|
45322
|
+
config2.data = transformData.call(
|
|
45323
|
+
config2,
|
|
45324
|
+
config2.transformRequest
|
|
45325
|
+
);
|
|
45317
45326
|
if (["post", "put", "patch"].indexOf(config2.method) !== -1) {
|
|
45318
45327
|
config2.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
45319
45328
|
}
|
|
45320
45329
|
const adapter2 = adapters_default.getAdapter(config2.adapter || defaults_default.adapter, config2);
|
|
45321
|
-
return adapter2(config2).then(
|
|
45322
|
-
|
|
45330
|
+
return adapter2(config2).then(function onAdapterResolution(response) {
|
|
45331
|
+
throwIfCancellationRequested(config2);
|
|
45332
|
+
response.data = transformData.call(
|
|
45333
|
+
config2,
|
|
45334
|
+
config2.transformResponse,
|
|
45335
|
+
response
|
|
45336
|
+
);
|
|
45337
|
+
response.headers = AxiosHeaders_default.from(response.headers);
|
|
45338
|
+
return response;
|
|
45339
|
+
}, function onAdapterRejection(reason) {
|
|
45340
|
+
if (!isCancel(reason)) {
|
|
45323
45341
|
throwIfCancellationRequested(config2);
|
|
45324
|
-
|
|
45325
|
-
|
|
45326
|
-
|
|
45327
|
-
|
|
45328
|
-
|
|
45329
|
-
|
|
45330
|
-
|
|
45331
|
-
if (reason && reason.response) {
|
|
45332
|
-
reason.response.data = transformData.call(
|
|
45333
|
-
config2,
|
|
45334
|
-
config2.transformResponse,
|
|
45335
|
-
reason.response
|
|
45336
|
-
);
|
|
45337
|
-
reason.response.headers = AxiosHeaders_default.from(reason.response.headers);
|
|
45338
|
-
}
|
|
45342
|
+
if (reason && reason.response) {
|
|
45343
|
+
reason.response.data = transformData.call(
|
|
45344
|
+
config2,
|
|
45345
|
+
config2.transformResponse,
|
|
45346
|
+
reason.response
|
|
45347
|
+
);
|
|
45348
|
+
reason.response.headers = AxiosHeaders_default.from(reason.response.headers);
|
|
45339
45349
|
}
|
|
45340
|
-
return Promise.reject(reason);
|
|
45341
45350
|
}
|
|
45342
|
-
|
|
45351
|
+
return Promise.reject(reason);
|
|
45352
|
+
});
|
|
45343
45353
|
}
|
|
45344
45354
|
|
|
45345
45355
|
// ../node_modules/axios/lib/helpers/validator.js
|
|
@@ -45392,10 +45402,7 @@ function assertOptions(options, schema, allowUnknown) {
|
|
|
45392
45402
|
const value = options[opt];
|
|
45393
45403
|
const result = value === void 0 || validator(value, opt, options);
|
|
45394
45404
|
if (result !== true) {
|
|
45395
|
-
throw new AxiosError_default(
|
|
45396
|
-
"option " + opt + " must be " + result,
|
|
45397
|
-
AxiosError_default.ERR_BAD_OPTION_VALUE
|
|
45398
|
-
);
|
|
45405
|
+
throw new AxiosError_default("option " + opt + " must be " + result, AxiosError_default.ERR_BAD_OPTION_VALUE);
|
|
45399
45406
|
}
|
|
45400
45407
|
continue;
|
|
45401
45408
|
}
|
|
@@ -45457,16 +45464,12 @@ var Axios = class {
|
|
|
45457
45464
|
config2 = mergeConfig(this.defaults, config2);
|
|
45458
45465
|
const { transitional: transitional2, paramsSerializer, headers } = config2;
|
|
45459
45466
|
if (transitional2 !== void 0) {
|
|
45460
|
-
validator_default.assertOptions(
|
|
45461
|
-
|
|
45462
|
-
|
|
45463
|
-
|
|
45464
|
-
|
|
45465
|
-
|
|
45466
|
-
legacyInterceptorReqResOrdering: validators2.transitional(validators2.boolean)
|
|
45467
|
-
},
|
|
45468
|
-
false
|
|
45469
|
-
);
|
|
45467
|
+
validator_default.assertOptions(transitional2, {
|
|
45468
|
+
silentJSONParsing: validators2.transitional(validators2.boolean),
|
|
45469
|
+
forcedJSONParsing: validators2.transitional(validators2.boolean),
|
|
45470
|
+
clarifyTimeoutError: validators2.transitional(validators2.boolean),
|
|
45471
|
+
legacyInterceptorReqResOrdering: validators2.transitional(validators2.boolean)
|
|
45472
|
+
}, false);
|
|
45470
45473
|
}
|
|
45471
45474
|
if (paramsSerializer != null) {
|
|
45472
45475
|
if (utils_default.isFunction(paramsSerializer)) {
|
|
@@ -45474,14 +45477,10 @@ var Axios = class {
|
|
|
45474
45477
|
serialize: paramsSerializer
|
|
45475
45478
|
};
|
|
45476
45479
|
} else {
|
|
45477
|
-
validator_default.assertOptions(
|
|
45478
|
-
|
|
45479
|
-
|
|
45480
|
-
|
|
45481
|
-
serialize: validators2.function
|
|
45482
|
-
},
|
|
45483
|
-
true
|
|
45484
|
-
);
|
|
45480
|
+
validator_default.assertOptions(paramsSerializer, {
|
|
45481
|
+
encode: validators2.function,
|
|
45482
|
+
serialize: validators2.function
|
|
45483
|
+
}, true);
|
|
45485
45484
|
}
|
|
45486
45485
|
}
|
|
45487
45486
|
if (config2.allowAbsoluteUrls !== void 0) {
|
|
@@ -45490,19 +45489,21 @@ var Axios = class {
|
|
|
45490
45489
|
} else {
|
|
45491
45490
|
config2.allowAbsoluteUrls = true;
|
|
45492
45491
|
}
|
|
45493
|
-
validator_default.assertOptions(
|
|
45494
|
-
|
|
45495
|
-
|
|
45496
|
-
|
|
45497
|
-
withXsrfToken: validators2.spelling("withXSRFToken")
|
|
45498
|
-
},
|
|
45499
|
-
true
|
|
45500
|
-
);
|
|
45492
|
+
validator_default.assertOptions(config2, {
|
|
45493
|
+
baseUrl: validators2.spelling("baseURL"),
|
|
45494
|
+
withXsrfToken: validators2.spelling("withXSRFToken")
|
|
45495
|
+
}, true);
|
|
45501
45496
|
config2.method = (config2.method || this.defaults.method || "get").toLowerCase();
|
|
45502
|
-
let contextHeaders = headers && utils_default.merge(
|
|
45503
|
-
|
|
45504
|
-
|
|
45505
|
-
|
|
45497
|
+
let contextHeaders = headers && utils_default.merge(
|
|
45498
|
+
headers.common,
|
|
45499
|
+
headers[config2.method]
|
|
45500
|
+
);
|
|
45501
|
+
headers && utils_default.forEach(
|
|
45502
|
+
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
45503
|
+
(method) => {
|
|
45504
|
+
delete headers[method];
|
|
45505
|
+
}
|
|
45506
|
+
);
|
|
45506
45507
|
config2.headers = AxiosHeaders_default.concat(contextHeaders, headers);
|
|
45507
45508
|
const requestInterceptorChain = [];
|
|
45508
45509
|
let synchronousRequestInterceptors = true;
|
|
@@ -45569,28 +45570,24 @@ var Axios = class {
|
|
|
45569
45570
|
};
|
|
45570
45571
|
utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
|
|
45571
45572
|
Axios.prototype[method] = function(url3, config2) {
|
|
45572
|
-
return this.request(
|
|
45573
|
-
|
|
45574
|
-
|
|
45575
|
-
|
|
45576
|
-
|
|
45577
|
-
})
|
|
45578
|
-
);
|
|
45573
|
+
return this.request(mergeConfig(config2 || {}, {
|
|
45574
|
+
method,
|
|
45575
|
+
url: url3,
|
|
45576
|
+
data: (config2 || {}).data
|
|
45577
|
+
}));
|
|
45579
45578
|
};
|
|
45580
45579
|
});
|
|
45581
45580
|
utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
|
|
45582
45581
|
function generateHTTPMethod(isForm) {
|
|
45583
45582
|
return function httpMethod(url3, data, config2) {
|
|
45584
|
-
return this.request(
|
|
45585
|
-
|
|
45586
|
-
|
|
45587
|
-
|
|
45588
|
-
|
|
45589
|
-
|
|
45590
|
-
|
|
45591
|
-
|
|
45592
|
-
})
|
|
45593
|
-
);
|
|
45583
|
+
return this.request(mergeConfig(config2 || {}, {
|
|
45584
|
+
method,
|
|
45585
|
+
headers: isForm ? {
|
|
45586
|
+
"Content-Type": "multipart/form-data"
|
|
45587
|
+
} : {},
|
|
45588
|
+
url: url3,
|
|
45589
|
+
data
|
|
45590
|
+
}));
|
|
45594
45591
|
};
|
|
45595
45592
|
}
|
|
45596
45593
|
Axios.prototype[method] = generateHTTPMethod();
|
|
@@ -45841,20 +45838,30 @@ var {
|
|
|
45841
45838
|
// src/api.ts
|
|
45842
45839
|
var FRED_BASE_URL = "https://api.stlouisfed.org/fred";
|
|
45843
45840
|
var httpsAgent = new https2.Agent({ keepAlive: true });
|
|
45841
|
+
function getApiKey() {
|
|
45842
|
+
const key = process.env.FRED_API_KEY;
|
|
45843
|
+
if (!key) {
|
|
45844
|
+
throw new Error(
|
|
45845
|
+
"FRED_API_KEY environment variable not set. Please set it to use this server."
|
|
45846
|
+
);
|
|
45847
|
+
}
|
|
45848
|
+
return key;
|
|
45849
|
+
}
|
|
45850
|
+
function buildRequestParams(params) {
|
|
45851
|
+
const filteredEntries = Object.entries(params).filter(
|
|
45852
|
+
([, value]) => value !== void 0
|
|
45853
|
+
);
|
|
45854
|
+
return Object.fromEntries([
|
|
45855
|
+
...filteredEntries,
|
|
45856
|
+
["api_key", getApiKey()],
|
|
45857
|
+
["file_type", "json"]
|
|
45858
|
+
]);
|
|
45859
|
+
}
|
|
45844
45860
|
var FredApiClient = class {
|
|
45845
45861
|
client;
|
|
45846
|
-
apiKey;
|
|
45847
45862
|
constructor() {
|
|
45848
|
-
const key = process.env.FRED_API_KEY;
|
|
45849
|
-
if (!key) {
|
|
45850
|
-
throw new Error(
|
|
45851
|
-
"FRED_API_KEY environment variable not set. Please set it to use this server."
|
|
45852
|
-
);
|
|
45853
|
-
}
|
|
45854
|
-
this.apiKey = key;
|
|
45855
45863
|
this.client = axios_default.create({
|
|
45856
45864
|
baseURL: FRED_BASE_URL,
|
|
45857
|
-
params: { api_key: this.apiKey, file_type: "json" },
|
|
45858
45865
|
httpsAgent
|
|
45859
45866
|
});
|
|
45860
45867
|
}
|
|
@@ -45862,13 +45869,13 @@ var FredApiClient = class {
|
|
|
45862
45869
|
const { data } = await this.client.get(
|
|
45863
45870
|
"/series/search",
|
|
45864
45871
|
{
|
|
45865
|
-
params: {
|
|
45872
|
+
params: buildRequestParams({
|
|
45866
45873
|
search_text: query,
|
|
45867
45874
|
limit,
|
|
45868
45875
|
offset,
|
|
45869
45876
|
order_by: "popularity",
|
|
45870
45877
|
sort_order: "desc"
|
|
45871
|
-
}
|
|
45878
|
+
})
|
|
45872
45879
|
}
|
|
45873
45880
|
);
|
|
45874
45881
|
return data;
|
|
@@ -45877,7 +45884,7 @@ var FredApiClient = class {
|
|
|
45877
45884
|
const { data } = await this.client.get(
|
|
45878
45885
|
"/series",
|
|
45879
45886
|
{
|
|
45880
|
-
params: { series_id: seriesId }
|
|
45887
|
+
params: buildRequestParams({ series_id: seriesId })
|
|
45881
45888
|
}
|
|
45882
45889
|
);
|
|
45883
45890
|
return data;
|
|
@@ -45886,12 +45893,12 @@ var FredApiClient = class {
|
|
|
45886
45893
|
const { data } = await this.client.get(
|
|
45887
45894
|
"/series/observations",
|
|
45888
45895
|
{
|
|
45889
|
-
params: {
|
|
45896
|
+
params: buildRequestParams({
|
|
45890
45897
|
series_id: seriesId,
|
|
45891
45898
|
limit,
|
|
45892
45899
|
offset,
|
|
45893
45900
|
sort_order: "desc"
|
|
45894
|
-
}
|
|
45901
|
+
})
|
|
45895
45902
|
}
|
|
45896
45903
|
);
|
|
45897
45904
|
return data;
|
|
@@ -45900,13 +45907,13 @@ var FredApiClient = class {
|
|
|
45900
45907
|
const { data } = await this.client.get(
|
|
45901
45908
|
"/category/series",
|
|
45902
45909
|
{
|
|
45903
|
-
params: {
|
|
45910
|
+
params: buildRequestParams({
|
|
45904
45911
|
category_id: categoryId,
|
|
45905
45912
|
limit,
|
|
45906
45913
|
offset,
|
|
45907
45914
|
order_by: "popularity",
|
|
45908
45915
|
sort_order: "desc"
|
|
45909
|
-
}
|
|
45916
|
+
})
|
|
45910
45917
|
}
|
|
45911
45918
|
);
|
|
45912
45919
|
return data;
|
|
@@ -45915,7 +45922,12 @@ var FredApiClient = class {
|
|
|
45915
45922
|
const { data } = await this.client.get(
|
|
45916
45923
|
"/releases",
|
|
45917
45924
|
{
|
|
45918
|
-
params: {
|
|
45925
|
+
params: buildRequestParams({
|
|
45926
|
+
limit,
|
|
45927
|
+
offset,
|
|
45928
|
+
order_by: "release_id",
|
|
45929
|
+
sort_order: "desc"
|
|
45930
|
+
})
|
|
45919
45931
|
}
|
|
45920
45932
|
);
|
|
45921
45933
|
return data;
|
|
@@ -45924,20 +45936,31 @@ var FredApiClient = class {
|
|
|
45924
45936
|
const { data } = await this.client.get(
|
|
45925
45937
|
"/release/series",
|
|
45926
45938
|
{
|
|
45927
|
-
params: {
|
|
45939
|
+
params: buildRequestParams({
|
|
45940
|
+
release_id: releaseId,
|
|
45941
|
+
limit,
|
|
45942
|
+
offset,
|
|
45943
|
+
order_by: "popularity",
|
|
45944
|
+
sort_order: "desc"
|
|
45945
|
+
})
|
|
45928
45946
|
}
|
|
45929
45947
|
);
|
|
45930
45948
|
return data;
|
|
45931
45949
|
}
|
|
45932
45950
|
async getSources() {
|
|
45933
|
-
const { data } = await this.client.get(
|
|
45951
|
+
const { data } = await this.client.get(
|
|
45952
|
+
"/sources",
|
|
45953
|
+
{
|
|
45954
|
+
params: buildRequestParams({})
|
|
45955
|
+
}
|
|
45956
|
+
);
|
|
45934
45957
|
return data;
|
|
45935
45958
|
}
|
|
45936
45959
|
async getSource(sourceId) {
|
|
45937
45960
|
const { data } = await this.client.get(
|
|
45938
45961
|
"/source",
|
|
45939
45962
|
{
|
|
45940
|
-
params: { source_id: sourceId }
|
|
45963
|
+
params: buildRequestParams({ source_id: sourceId })
|
|
45941
45964
|
}
|
|
45942
45965
|
);
|
|
45943
45966
|
return data;
|
|
@@ -46138,9 +46161,10 @@ var MOCK_FIXTURES = {
|
|
|
46138
46161
|
};
|
|
46139
46162
|
|
|
46140
46163
|
// src/index.ts
|
|
46164
|
+
var PACKAGE_VERSION = getPackageVersion(import.meta.url);
|
|
46141
46165
|
var server = new McpServer({
|
|
46142
46166
|
name: "fred-mcp-server",
|
|
46143
|
-
version:
|
|
46167
|
+
version: PACKAGE_VERSION
|
|
46144
46168
|
});
|
|
46145
46169
|
var clientInstance = null;
|
|
46146
46170
|
function getClient() {
|
|
@@ -46150,25 +46174,36 @@ function getClient() {
|
|
|
46150
46174
|
return clientInstance;
|
|
46151
46175
|
}
|
|
46152
46176
|
function extractErrorMessage(err) {
|
|
46177
|
+
const sanitize = (value) => {
|
|
46178
|
+
const apiKey = process.env.FRED_API_KEY;
|
|
46179
|
+
let sanitized = value.replace(
|
|
46180
|
+
/([?&]api_key=)[^&\s]+/gi,
|
|
46181
|
+
"$1[REDACTED]"
|
|
46182
|
+
);
|
|
46183
|
+
if (apiKey) {
|
|
46184
|
+
sanitized = sanitized.split(apiKey).join("[REDACTED]");
|
|
46185
|
+
}
|
|
46186
|
+
return sanitized;
|
|
46187
|
+
};
|
|
46153
46188
|
if (typeof err !== "object" || err === null) {
|
|
46154
|
-
return String(err);
|
|
46189
|
+
return sanitize(String(err));
|
|
46155
46190
|
}
|
|
46156
46191
|
const error48 = err;
|
|
46157
46192
|
const responseData = error48.response?.data;
|
|
46158
46193
|
if (typeof responseData === "string" && responseData.trim()) {
|
|
46159
|
-
return responseData.trim();
|
|
46194
|
+
return sanitize(responseData.trim());
|
|
46160
46195
|
}
|
|
46161
46196
|
if (responseData && typeof responseData === "object") {
|
|
46162
46197
|
const data = responseData;
|
|
46163
46198
|
const nestedMessage = data.error_message ?? data.message ?? data.error ?? data.detail;
|
|
46164
46199
|
if (nestedMessage !== void 0 && nestedMessage !== null) {
|
|
46165
|
-
return String(nestedMessage);
|
|
46200
|
+
return sanitize(String(nestedMessage));
|
|
46166
46201
|
}
|
|
46167
46202
|
}
|
|
46168
46203
|
if (error48.message !== void 0 && error48.message !== null) {
|
|
46169
|
-
return String(error48.message);
|
|
46204
|
+
return sanitize(String(error48.message));
|
|
46170
46205
|
}
|
|
46171
|
-
return "Request failed.";
|
|
46206
|
+
return sanitize("Request failed.");
|
|
46172
46207
|
}
|
|
46173
46208
|
function handleFredError(err) {
|
|
46174
46209
|
if (typeof err === "object" && err !== null) {
|
|
@@ -46245,7 +46280,7 @@ function formatSources(sources, total, offset, limit) {
|
|
|
46245
46280
|
` + rows.join("\n") + formatPaginationFooter(offset, limit, total);
|
|
46246
46281
|
}
|
|
46247
46282
|
server.registerTool(
|
|
46248
|
-
"
|
|
46283
|
+
"search_series",
|
|
46249
46284
|
{
|
|
46250
46285
|
title: "Search FRED Series",
|
|
46251
46286
|
description: "Search FRED economic data series by text query.",
|
|
@@ -46278,7 +46313,7 @@ server.registerTool(
|
|
|
46278
46313
|
}
|
|
46279
46314
|
);
|
|
46280
46315
|
server.registerTool(
|
|
46281
|
-
"
|
|
46316
|
+
"get_series_info",
|
|
46282
46317
|
{
|
|
46283
46318
|
title: "Get FRED Series Info",
|
|
46284
46319
|
description: "Get metadata for a specific FRED series.",
|
|
@@ -46316,7 +46351,7 @@ server.registerTool(
|
|
|
46316
46351
|
}
|
|
46317
46352
|
);
|
|
46318
46353
|
server.registerTool(
|
|
46319
|
-
"
|
|
46354
|
+
"get_series_data",
|
|
46320
46355
|
{
|
|
46321
46356
|
title: "Get FRED Series Data",
|
|
46322
46357
|
description: "Get observation data points for a specific FRED series.",
|
|
@@ -46371,7 +46406,7 @@ server.registerTool(
|
|
|
46371
46406
|
}
|
|
46372
46407
|
);
|
|
46373
46408
|
server.registerTool(
|
|
46374
|
-
"
|
|
46409
|
+
"get_category_series",
|
|
46375
46410
|
{
|
|
46376
46411
|
title: "Get FRED Category Series",
|
|
46377
46412
|
description: "Get series belonging to a specific FRED category.",
|
|
@@ -46405,6 +46440,11 @@ server.registerTool(
|
|
|
46405
46440
|
limit,
|
|
46406
46441
|
offset
|
|
46407
46442
|
);
|
|
46443
|
+
if (!res.seriess || res.seriess.length === 0) {
|
|
46444
|
+
return createNotFoundError(
|
|
46445
|
+
`Category '${category_id}' not found.`
|
|
46446
|
+
);
|
|
46447
|
+
}
|
|
46408
46448
|
const text = formatSeriesList(res.seriess, res.count, offset);
|
|
46409
46449
|
return { content: [{ type: "text", text: truncateToLimit(text) }] };
|
|
46410
46450
|
} catch (err) {
|
|
@@ -46413,7 +46453,7 @@ server.registerTool(
|
|
|
46413
46453
|
}
|
|
46414
46454
|
);
|
|
46415
46455
|
server.registerTool(
|
|
46416
|
-
"
|
|
46456
|
+
"get_releases",
|
|
46417
46457
|
{
|
|
46418
46458
|
title: "Get FRED Releases",
|
|
46419
46459
|
description: "Get all economic data releases from FRED.",
|
|
@@ -46443,7 +46483,7 @@ server.registerTool(
|
|
|
46443
46483
|
}
|
|
46444
46484
|
);
|
|
46445
46485
|
server.registerTool(
|
|
46446
|
-
"
|
|
46486
|
+
"get_release_series",
|
|
46447
46487
|
{
|
|
46448
46488
|
title: "Get FRED Release Series",
|
|
46449
46489
|
description: "Get series belonging to a specific FRED release.",
|
|
@@ -46477,6 +46517,11 @@ server.registerTool(
|
|
|
46477
46517
|
limit,
|
|
46478
46518
|
offset
|
|
46479
46519
|
);
|
|
46520
|
+
if (!res.seriess || res.seriess.length === 0) {
|
|
46521
|
+
return createNotFoundError(
|
|
46522
|
+
`Release '${release_id}' not found.`
|
|
46523
|
+
);
|
|
46524
|
+
}
|
|
46480
46525
|
const text = formatSeriesList(res.seriess, res.count, offset);
|
|
46481
46526
|
return { content: [{ type: "text", text: truncateToLimit(text) }] };
|
|
46482
46527
|
} catch (err) {
|
|
@@ -46485,7 +46530,7 @@ server.registerTool(
|
|
|
46485
46530
|
}
|
|
46486
46531
|
);
|
|
46487
46532
|
server.registerTool(
|
|
46488
|
-
"
|
|
46533
|
+
"get_sources",
|
|
46489
46534
|
{
|
|
46490
46535
|
title: "Get FRED Sources",
|
|
46491
46536
|
description: "Get all data sources available in FRED.",
|
|
@@ -46532,7 +46577,7 @@ server.registerTool(
|
|
|
46532
46577
|
}
|
|
46533
46578
|
);
|
|
46534
46579
|
server.registerTool(
|
|
46535
|
-
"
|
|
46580
|
+
"get_source",
|
|
46536
46581
|
{
|
|
46537
46582
|
title: "Get FRED Source",
|
|
46538
46583
|
description: "Get details for a specific FRED data source.",
|