@jjrawlins/cdk-iam-policy-builder-helper 0.0.4 → 0.0.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/.jsii +211 -62
- package/.mergify.yml +60 -0
- package/cdk-iam-policy-builder-helper/go.mod +13 -0
- package/{jjrawlinscdkiampolicybuilderhelper → cdk-iam-policy-builder-helper}/jsii/jsii.go +2 -2
- package/cdk-iam-policy-builder-helper/version +1 -0
- package/lib/bin/download-actions-json.js +3 -7
- package/lib/constructs/Actions.d.ts +800 -61
- package/lib/constructs/Actions.js +801 -62
- package/lib/constructs/ManagedPolicies.d.ts +248 -40
- package/lib/constructs/ManagedPolicies.js +249 -41
- package/methods_list.txt +19274 -0
- package/node_modules/axios/CHANGELOG.md +257 -0
- package/node_modules/axios/README.md +71 -87
- package/node_modules/axios/dist/axios.js +303 -235
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +2 -1
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +230 -177
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +230 -177
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/node_modules/axios/dist/esm/axios.min.js +2 -1
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +268 -187
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +22 -6
- package/node_modules/axios/index.d.ts +14 -4
- package/node_modules/axios/lib/adapters/fetch.js +22 -22
- package/node_modules/axios/lib/adapters/http.js +7 -7
- package/node_modules/axios/lib/cancel/CancelToken.js +14 -0
- package/node_modules/axios/lib/core/Axios.js +20 -6
- package/node_modules/axios/lib/core/AxiosError.js +5 -2
- package/node_modules/axios/lib/core/AxiosHeaders.js +15 -3
- package/node_modules/axios/lib/core/buildFullPath.js +3 -2
- package/node_modules/axios/lib/core/mergeConfig.js +6 -6
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/buildURL.js +7 -1
- package/node_modules/axios/lib/helpers/composeSignals.js +31 -29
- package/node_modules/axios/lib/helpers/formDataToStream.js +6 -5
- package/node_modules/axios/lib/helpers/isURLSameOrigin.js +12 -65
- package/node_modules/axios/lib/helpers/resolveConfig.js +1 -1
- package/node_modules/axios/lib/helpers/throttle.js +1 -1
- package/node_modules/axios/lib/helpers/toFormData.js +4 -0
- package/node_modules/axios/lib/helpers/toURLEncodedForm.js +4 -3
- package/node_modules/axios/lib/helpers/trackStream.js +25 -5
- package/node_modules/axios/lib/helpers/validator.js +8 -0
- package/node_modules/axios/lib/platform/common/utils.js +5 -4
- package/node_modules/axios/lib/platform/node/index.js +26 -0
- package/node_modules/axios/lib/utils.js +48 -28
- package/node_modules/axios/package.json +14 -5
- package/node_modules/form-data/CHANGELOG.md +601 -0
- package/node_modules/form-data/{Readme.md → README.md} +34 -37
- package/node_modules/form-data/lib/browser.js +3 -1
- package/node_modules/form-data/lib/form_data.js +126 -135
- package/node_modules/form-data/lib/populate.js +5 -5
- package/node_modules/form-data/package.json +24 -16
- package/package.json +16 -10
- package/jjrawlinscdkiampolicybuilderhelper/go.mod +0 -13
- package/jjrawlinscdkiampolicybuilderhelper/version +0 -1
- package/node_modules/axios/SECURITY.md +0 -6
- /package/{jjrawlinscdkiampolicybuilderhelper → cdk-iam-policy-builder-helper}/LICENSE +0 -0
- /package/{jjrawlinscdkiampolicybuilderhelper → cdk-iam-policy-builder-helper}/README.md +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Axios v1.11.0 Copyright (c) 2025 Matt Zabriskie and contributors */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
function bind(fn, thisArg) {
|
|
@@ -11,6 +11,7 @@ function bind(fn, thisArg) {
|
|
|
11
11
|
|
|
12
12
|
const {toString} = Object.prototype;
|
|
13
13
|
const {getPrototypeOf} = Object;
|
|
14
|
+
const {iterator, toStringTag} = Symbol;
|
|
14
15
|
|
|
15
16
|
const kindOf = (cache => thing => {
|
|
16
17
|
const str = toString.call(thing);
|
|
@@ -137,7 +138,28 @@ const isPlainObject = (val) => {
|
|
|
137
138
|
}
|
|
138
139
|
|
|
139
140
|
const prototype = getPrototypeOf(val);
|
|
140
|
-
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(
|
|
141
|
+
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Determine if a value is an empty object (safely handles Buffers)
|
|
146
|
+
*
|
|
147
|
+
* @param {*} val The value to test
|
|
148
|
+
*
|
|
149
|
+
* @returns {boolean} True if value is an empty object, otherwise false
|
|
150
|
+
*/
|
|
151
|
+
const isEmptyObject = (val) => {
|
|
152
|
+
// Early return for non-objects or Buffers to prevent RangeError
|
|
153
|
+
if (!isObject(val) || isBuffer(val)) {
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
try {
|
|
158
|
+
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
|
|
159
|
+
} catch (e) {
|
|
160
|
+
// Fallback for any other objects that might cause RangeError with Object.keys()
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
141
163
|
};
|
|
142
164
|
|
|
143
165
|
/**
|
|
@@ -262,6 +284,11 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
|
262
284
|
fn.call(null, obj[i], i, obj);
|
|
263
285
|
}
|
|
264
286
|
} else {
|
|
287
|
+
// Buffer check
|
|
288
|
+
if (isBuffer(obj)) {
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
|
|
265
292
|
// Iterate over object keys
|
|
266
293
|
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
|
267
294
|
const len = keys.length;
|
|
@@ -275,6 +302,10 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
|
275
302
|
}
|
|
276
303
|
|
|
277
304
|
function findKey(obj, key) {
|
|
305
|
+
if (isBuffer(obj)){
|
|
306
|
+
return null;
|
|
307
|
+
}
|
|
308
|
+
|
|
278
309
|
key = key.toLowerCase();
|
|
279
310
|
const keys = Object.keys(obj);
|
|
280
311
|
let i = keys.length;
|
|
@@ -488,13 +519,13 @@ const isTypedArray = (TypedArray => {
|
|
|
488
519
|
* @returns {void}
|
|
489
520
|
*/
|
|
490
521
|
const forEachEntry = (obj, fn) => {
|
|
491
|
-
const generator = obj && obj[
|
|
522
|
+
const generator = obj && obj[iterator];
|
|
492
523
|
|
|
493
|
-
const
|
|
524
|
+
const _iterator = generator.call(obj);
|
|
494
525
|
|
|
495
526
|
let result;
|
|
496
527
|
|
|
497
|
-
while ((result =
|
|
528
|
+
while ((result = _iterator.next()) && !result.done) {
|
|
498
529
|
const pair = result.value;
|
|
499
530
|
fn.call(obj, pair[0], pair[1]);
|
|
500
531
|
}
|
|
@@ -607,26 +638,6 @@ const toFiniteNumber = (value, defaultValue) => {
|
|
|
607
638
|
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
608
639
|
};
|
|
609
640
|
|
|
610
|
-
const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
|
|
611
|
-
|
|
612
|
-
const DIGIT = '0123456789';
|
|
613
|
-
|
|
614
|
-
const ALPHABET = {
|
|
615
|
-
DIGIT,
|
|
616
|
-
ALPHA,
|
|
617
|
-
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
|
|
618
|
-
};
|
|
619
|
-
|
|
620
|
-
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
|
621
|
-
let str = '';
|
|
622
|
-
const {length} = alphabet;
|
|
623
|
-
while (size--) {
|
|
624
|
-
str += alphabet[Math.random() * length|0];
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
return str;
|
|
628
|
-
};
|
|
629
|
-
|
|
630
641
|
/**
|
|
631
642
|
* If the thing is a FormData object, return true, otherwise return false.
|
|
632
643
|
*
|
|
@@ -635,7 +646,7 @@ const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
|
|
635
646
|
* @returns {boolean}
|
|
636
647
|
*/
|
|
637
648
|
function isSpecCompliantForm(thing) {
|
|
638
|
-
return !!(thing && isFunction(thing.append) && thing[
|
|
649
|
+
return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
|
|
639
650
|
}
|
|
640
651
|
|
|
641
652
|
const toJSONObject = (obj) => {
|
|
@@ -648,6 +659,11 @@ const toJSONObject = (obj) => {
|
|
|
648
659
|
return;
|
|
649
660
|
}
|
|
650
661
|
|
|
662
|
+
//Buffer check
|
|
663
|
+
if (isBuffer(source)) {
|
|
664
|
+
return source;
|
|
665
|
+
}
|
|
666
|
+
|
|
651
667
|
if(!('toJSON' in source)) {
|
|
652
668
|
stack[i] = source;
|
|
653
669
|
const target = isArray(source) ? [] : {};
|
|
@@ -704,6 +720,10 @@ const asap = typeof queueMicrotask !== 'undefined' ?
|
|
|
704
720
|
|
|
705
721
|
// *********************
|
|
706
722
|
|
|
723
|
+
|
|
724
|
+
const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
|
|
725
|
+
|
|
726
|
+
|
|
707
727
|
var utils$1 = {
|
|
708
728
|
isArray,
|
|
709
729
|
isArrayBuffer,
|
|
@@ -715,6 +735,7 @@ var utils$1 = {
|
|
|
715
735
|
isBoolean,
|
|
716
736
|
isObject,
|
|
717
737
|
isPlainObject,
|
|
738
|
+
isEmptyObject,
|
|
718
739
|
isReadableStream,
|
|
719
740
|
isRequest,
|
|
720
741
|
isResponse,
|
|
@@ -754,14 +775,13 @@ var utils$1 = {
|
|
|
754
775
|
findKey,
|
|
755
776
|
global: _global,
|
|
756
777
|
isContextDefined,
|
|
757
|
-
ALPHABET,
|
|
758
|
-
generateString,
|
|
759
778
|
isSpecCompliantForm,
|
|
760
779
|
toJSONObject,
|
|
761
780
|
isAsyncFn,
|
|
762
781
|
isThenable,
|
|
763
782
|
setImmediate: _setImmediate,
|
|
764
|
-
asap
|
|
783
|
+
asap,
|
|
784
|
+
isIterable
|
|
765
785
|
};
|
|
766
786
|
|
|
767
787
|
/**
|
|
@@ -789,7 +809,10 @@ function AxiosError(message, code, config, request, response) {
|
|
|
789
809
|
code && (this.code = code);
|
|
790
810
|
config && (this.config = config);
|
|
791
811
|
request && (this.request = request);
|
|
792
|
-
|
|
812
|
+
if (response) {
|
|
813
|
+
this.response = response;
|
|
814
|
+
this.status = response.status ? response.status : null;
|
|
815
|
+
}
|
|
793
816
|
}
|
|
794
817
|
|
|
795
818
|
utils$1.inherits(AxiosError, Error, {
|
|
@@ -809,7 +832,7 @@ utils$1.inherits(AxiosError, Error, {
|
|
|
809
832
|
// Axios
|
|
810
833
|
config: utils$1.toJSONObject(this.config),
|
|
811
834
|
code: this.code,
|
|
812
|
-
status: this.
|
|
835
|
+
status: this.status
|
|
813
836
|
};
|
|
814
837
|
}
|
|
815
838
|
});
|
|
@@ -977,6 +1000,10 @@ function toFormData(obj, formData, options) {
|
|
|
977
1000
|
return value.toISOString();
|
|
978
1001
|
}
|
|
979
1002
|
|
|
1003
|
+
if (utils$1.isBoolean(value)) {
|
|
1004
|
+
return value.toString();
|
|
1005
|
+
}
|
|
1006
|
+
|
|
980
1007
|
if (!useBlob && utils$1.isBlob(value)) {
|
|
981
1008
|
throw new AxiosError('Blob is not supported. Use a Buffer instead.');
|
|
982
1009
|
}
|
|
@@ -1149,7 +1176,7 @@ function encode(val) {
|
|
|
1149
1176
|
*
|
|
1150
1177
|
* @param {string} url The base of the url (e.g., http://www.google.com)
|
|
1151
1178
|
* @param {object} [params] The params to be appended
|
|
1152
|
-
* @param {?object} options
|
|
1179
|
+
* @param {?(object|Function)} options
|
|
1153
1180
|
*
|
|
1154
1181
|
* @returns {string} The formatted url
|
|
1155
1182
|
*/
|
|
@@ -1161,6 +1188,12 @@ function buildURL(url, params, options) {
|
|
|
1161
1188
|
|
|
1162
1189
|
const _encode = options && options.encode || encode;
|
|
1163
1190
|
|
|
1191
|
+
if (utils$1.isFunction(options)) {
|
|
1192
|
+
options = {
|
|
1193
|
+
serialize: options
|
|
1194
|
+
};
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1164
1197
|
const serializeFn = options && options.serialize;
|
|
1165
1198
|
|
|
1166
1199
|
let serializedParams;
|
|
@@ -1277,6 +1310,8 @@ var platform$1 = {
|
|
|
1277
1310
|
|
|
1278
1311
|
const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
1279
1312
|
|
|
1313
|
+
const _navigator = typeof navigator === 'object' && navigator || undefined;
|
|
1314
|
+
|
|
1280
1315
|
/**
|
|
1281
1316
|
* Determine if we're running in a standard browser environment
|
|
1282
1317
|
*
|
|
@@ -1294,10 +1329,8 @@ const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'unde
|
|
|
1294
1329
|
*
|
|
1295
1330
|
* @returns {boolean}
|
|
1296
1331
|
*/
|
|
1297
|
-
const hasStandardBrowserEnv =
|
|
1298
|
-
(product)
|
|
1299
|
-
return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
|
|
1300
|
-
})(typeof navigator !== 'undefined' && navigator.product);
|
|
1332
|
+
const hasStandardBrowserEnv = hasBrowserEnv &&
|
|
1333
|
+
(!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
|
|
1301
1334
|
|
|
1302
1335
|
/**
|
|
1303
1336
|
* Determine if we're running in a standard browser webWorker environment
|
|
@@ -1324,6 +1357,7 @@ var utils = /*#__PURE__*/Object.freeze({
|
|
|
1324
1357
|
hasBrowserEnv: hasBrowserEnv,
|
|
1325
1358
|
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
|
1326
1359
|
hasStandardBrowserEnv: hasStandardBrowserEnv,
|
|
1360
|
+
navigator: _navigator,
|
|
1327
1361
|
origin: origin
|
|
1328
1362
|
});
|
|
1329
1363
|
|
|
@@ -1333,7 +1367,7 @@ var platform = {
|
|
|
1333
1367
|
};
|
|
1334
1368
|
|
|
1335
1369
|
function toURLEncodedForm(data, options) {
|
|
1336
|
-
return toFormData(data, new platform.classes.URLSearchParams(),
|
|
1370
|
+
return toFormData(data, new platform.classes.URLSearchParams(), {
|
|
1337
1371
|
visitor: function(value, key, path, helpers) {
|
|
1338
1372
|
if (platform.isNode && utils$1.isBuffer(value)) {
|
|
1339
1373
|
this.append(key, value.toString('base64'));
|
|
@@ -1341,8 +1375,9 @@ function toURLEncodedForm(data, options) {
|
|
|
1341
1375
|
}
|
|
1342
1376
|
|
|
1343
1377
|
return helpers.defaultVisitor.apply(this, arguments);
|
|
1344
|
-
}
|
|
1345
|
-
|
|
1378
|
+
},
|
|
1379
|
+
...options
|
|
1380
|
+
});
|
|
1346
1381
|
}
|
|
1347
1382
|
|
|
1348
1383
|
/**
|
|
@@ -1736,10 +1771,18 @@ class AxiosHeaders {
|
|
|
1736
1771
|
setHeaders(header, valueOrRewrite);
|
|
1737
1772
|
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
1738
1773
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
1739
|
-
} else if (utils$1.
|
|
1740
|
-
|
|
1741
|
-
|
|
1774
|
+
} else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
|
|
1775
|
+
let obj = {}, dest, key;
|
|
1776
|
+
for (const entry of header) {
|
|
1777
|
+
if (!utils$1.isArray(entry)) {
|
|
1778
|
+
throw TypeError('Object iterator must return a key-value pair');
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
obj[key = entry[0]] = (dest = obj[key]) ?
|
|
1782
|
+
(utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
|
|
1742
1783
|
}
|
|
1784
|
+
|
|
1785
|
+
setHeaders(obj, valueOrRewrite);
|
|
1743
1786
|
} else {
|
|
1744
1787
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
1745
1788
|
}
|
|
@@ -1881,6 +1924,10 @@ class AxiosHeaders {
|
|
|
1881
1924
|
return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
|
|
1882
1925
|
}
|
|
1883
1926
|
|
|
1927
|
+
getSetCookie() {
|
|
1928
|
+
return this.get("set-cookie") || [];
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1884
1931
|
get [Symbol.toStringTag]() {
|
|
1885
1932
|
return 'AxiosHeaders';
|
|
1886
1933
|
}
|
|
@@ -2083,7 +2130,7 @@ function throttle(fn, freq) {
|
|
|
2083
2130
|
clearTimeout(timer);
|
|
2084
2131
|
timer = null;
|
|
2085
2132
|
}
|
|
2086
|
-
fn
|
|
2133
|
+
fn(...args);
|
|
2087
2134
|
};
|
|
2088
2135
|
|
|
2089
2136
|
const throttled = (...args) => {
|
|
@@ -2148,68 +2195,18 @@ const progressEventDecorator = (total, throttled) => {
|
|
|
2148
2195
|
|
|
2149
2196
|
const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
|
|
2150
2197
|
|
|
2151
|
-
var isURLSameOrigin = platform.hasStandardBrowserEnv ?
|
|
2152
|
-
|
|
2153
|
-
// Standard browser envs have full support of the APIs needed to test
|
|
2154
|
-
// whether the request URL is of the same origin as current location.
|
|
2155
|
-
(function standardBrowserEnv() {
|
|
2156
|
-
const msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
2157
|
-
const urlParsingNode = document.createElement('a');
|
|
2158
|
-
let originURL;
|
|
2159
|
-
|
|
2160
|
-
/**
|
|
2161
|
-
* Parse a URL to discover its components
|
|
2162
|
-
*
|
|
2163
|
-
* @param {String} url The URL to be parsed
|
|
2164
|
-
* @returns {Object}
|
|
2165
|
-
*/
|
|
2166
|
-
function resolveURL(url) {
|
|
2167
|
-
let href = url;
|
|
2168
|
-
|
|
2169
|
-
if (msie) {
|
|
2170
|
-
// IE needs attribute set twice to normalize properties
|
|
2171
|
-
urlParsingNode.setAttribute('href', href);
|
|
2172
|
-
href = urlParsingNode.href;
|
|
2173
|
-
}
|
|
2174
|
-
|
|
2175
|
-
urlParsingNode.setAttribute('href', href);
|
|
2176
|
-
|
|
2177
|
-
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
|
|
2178
|
-
return {
|
|
2179
|
-
href: urlParsingNode.href,
|
|
2180
|
-
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
|
|
2181
|
-
host: urlParsingNode.host,
|
|
2182
|
-
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
|
|
2183
|
-
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
|
|
2184
|
-
hostname: urlParsingNode.hostname,
|
|
2185
|
-
port: urlParsingNode.port,
|
|
2186
|
-
pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
|
|
2187
|
-
urlParsingNode.pathname :
|
|
2188
|
-
'/' + urlParsingNode.pathname
|
|
2189
|
-
};
|
|
2190
|
-
}
|
|
2198
|
+
var isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
|
|
2199
|
+
url = new URL(url, platform.origin);
|
|
2191
2200
|
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
|
2202
|
-
return (parsed.protocol === originURL.protocol &&
|
|
2203
|
-
parsed.host === originURL.host);
|
|
2204
|
-
};
|
|
2205
|
-
})() :
|
|
2206
|
-
|
|
2207
|
-
// Non standard browser envs (web workers, react-native) lack needed support.
|
|
2208
|
-
(function nonStandardBrowserEnv() {
|
|
2209
|
-
return function isURLSameOrigin() {
|
|
2210
|
-
return true;
|
|
2211
|
-
};
|
|
2212
|
-
})();
|
|
2201
|
+
return (
|
|
2202
|
+
origin.protocol === url.protocol &&
|
|
2203
|
+
origin.host === url.host &&
|
|
2204
|
+
(isMSIE || origin.port === url.port)
|
|
2205
|
+
);
|
|
2206
|
+
})(
|
|
2207
|
+
new URL(platform.origin),
|
|
2208
|
+
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
|
2209
|
+
) : () => true;
|
|
2213
2210
|
|
|
2214
2211
|
var cookies = platform.hasStandardBrowserEnv ?
|
|
2215
2212
|
|
|
@@ -2288,8 +2285,9 @@ function combineURLs(baseURL, relativeURL) {
|
|
|
2288
2285
|
*
|
|
2289
2286
|
* @returns {string} The combined full path
|
|
2290
2287
|
*/
|
|
2291
|
-
function buildFullPath(baseURL, requestedURL) {
|
|
2292
|
-
|
|
2288
|
+
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
2289
|
+
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
|
2290
|
+
if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
|
|
2293
2291
|
return combineURLs(baseURL, requestedURL);
|
|
2294
2292
|
}
|
|
2295
2293
|
return requestedURL;
|
|
@@ -2311,7 +2309,7 @@ function mergeConfig(config1, config2) {
|
|
|
2311
2309
|
config2 = config2 || {};
|
|
2312
2310
|
const config = {};
|
|
2313
2311
|
|
|
2314
|
-
function getMergedValue(target, source, caseless) {
|
|
2312
|
+
function getMergedValue(target, source, prop, caseless) {
|
|
2315
2313
|
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
2316
2314
|
return utils$1.merge.call({caseless}, target, source);
|
|
2317
2315
|
} else if (utils$1.isPlainObject(source)) {
|
|
@@ -2323,11 +2321,11 @@ function mergeConfig(config1, config2) {
|
|
|
2323
2321
|
}
|
|
2324
2322
|
|
|
2325
2323
|
// eslint-disable-next-line consistent-return
|
|
2326
|
-
function mergeDeepProperties(a, b, caseless) {
|
|
2324
|
+
function mergeDeepProperties(a, b, prop , caseless) {
|
|
2327
2325
|
if (!utils$1.isUndefined(b)) {
|
|
2328
|
-
return getMergedValue(a, b, caseless);
|
|
2326
|
+
return getMergedValue(a, b, prop , caseless);
|
|
2329
2327
|
} else if (!utils$1.isUndefined(a)) {
|
|
2330
|
-
return getMergedValue(undefined, a, caseless);
|
|
2328
|
+
return getMergedValue(undefined, a, prop , caseless);
|
|
2331
2329
|
}
|
|
2332
2330
|
}
|
|
2333
2331
|
|
|
@@ -2385,10 +2383,10 @@ function mergeConfig(config1, config2) {
|
|
|
2385
2383
|
socketPath: defaultToConfig2,
|
|
2386
2384
|
responseEncoding: defaultToConfig2,
|
|
2387
2385
|
validateStatus: mergeDirectKeys,
|
|
2388
|
-
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
|
2386
|
+
headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
|
|
2389
2387
|
};
|
|
2390
2388
|
|
|
2391
|
-
utils$1.forEach(Object.keys(
|
|
2389
|
+
utils$1.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
|
|
2392
2390
|
const merge = mergeMap[prop] || mergeDeepProperties;
|
|
2393
2391
|
const configValue = merge(config1[prop], config2[prop], prop);
|
|
2394
2392
|
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
@@ -2404,7 +2402,7 @@ var resolveConfig = (config) => {
|
|
|
2404
2402
|
|
|
2405
2403
|
newConfig.headers = headers = AxiosHeaders$1.from(headers);
|
|
2406
2404
|
|
|
2407
|
-
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
|
|
2405
|
+
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
|
|
2408
2406
|
|
|
2409
2407
|
// HTTP basic authentication
|
|
2410
2408
|
if (auth) {
|
|
@@ -2633,45 +2631,46 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
2633
2631
|
};
|
|
2634
2632
|
|
|
2635
2633
|
const composeSignals = (signals, timeout) => {
|
|
2636
|
-
|
|
2634
|
+
const {length} = (signals = signals ? signals.filter(Boolean) : []);
|
|
2637
2635
|
|
|
2638
|
-
|
|
2636
|
+
if (timeout || length) {
|
|
2637
|
+
let controller = new AbortController();
|
|
2639
2638
|
|
|
2640
|
-
|
|
2641
|
-
if (!aborted) {
|
|
2642
|
-
aborted = true;
|
|
2643
|
-
unsubscribe();
|
|
2644
|
-
const err = cancel instanceof Error ? cancel : this.reason;
|
|
2645
|
-
controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
|
|
2646
|
-
}
|
|
2647
|
-
};
|
|
2639
|
+
let aborted;
|
|
2648
2640
|
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2641
|
+
const onabort = function (reason) {
|
|
2642
|
+
if (!aborted) {
|
|
2643
|
+
aborted = true;
|
|
2644
|
+
unsubscribe();
|
|
2645
|
+
const err = reason instanceof Error ? reason : this.reason;
|
|
2646
|
+
controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
|
|
2647
|
+
}
|
|
2648
|
+
};
|
|
2652
2649
|
|
|
2653
|
-
|
|
2654
|
-
if (signals) {
|
|
2655
|
-
timer && clearTimeout(timer);
|
|
2650
|
+
let timer = timeout && setTimeout(() => {
|
|
2656
2651
|
timer = null;
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
signals
|
|
2662
|
-
|
|
2663
|
-
|
|
2652
|
+
onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
|
|
2653
|
+
}, timeout);
|
|
2654
|
+
|
|
2655
|
+
const unsubscribe = () => {
|
|
2656
|
+
if (signals) {
|
|
2657
|
+
timer && clearTimeout(timer);
|
|
2658
|
+
timer = null;
|
|
2659
|
+
signals.forEach(signal => {
|
|
2660
|
+
signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
|
|
2661
|
+
});
|
|
2662
|
+
signals = null;
|
|
2663
|
+
}
|
|
2664
|
+
};
|
|
2664
2665
|
|
|
2665
|
-
|
|
2666
|
+
signals.forEach((signal) => signal.addEventListener('abort', onabort));
|
|
2666
2667
|
|
|
2667
|
-
|
|
2668
|
+
const {signal} = controller;
|
|
2668
2669
|
|
|
2669
|
-
|
|
2670
|
+
signal.unsubscribe = () => utils$1.asap(unsubscribe);
|
|
2670
2671
|
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
timer = null;
|
|
2674
|
-
}];
|
|
2672
|
+
return signal;
|
|
2673
|
+
}
|
|
2675
2674
|
};
|
|
2676
2675
|
|
|
2677
2676
|
var composeSignals$1 = composeSignals;
|
|
@@ -2694,14 +2693,34 @@ const streamChunk = function* (chunk, chunkSize) {
|
|
|
2694
2693
|
}
|
|
2695
2694
|
};
|
|
2696
2695
|
|
|
2697
|
-
const readBytes = async function* (iterable, chunkSize
|
|
2698
|
-
for await (const chunk of iterable) {
|
|
2699
|
-
yield* streamChunk(
|
|
2696
|
+
const readBytes = async function* (iterable, chunkSize) {
|
|
2697
|
+
for await (const chunk of readStream(iterable)) {
|
|
2698
|
+
yield* streamChunk(chunk, chunkSize);
|
|
2700
2699
|
}
|
|
2701
2700
|
};
|
|
2702
2701
|
|
|
2703
|
-
const
|
|
2704
|
-
|
|
2702
|
+
const readStream = async function* (stream) {
|
|
2703
|
+
if (stream[Symbol.asyncIterator]) {
|
|
2704
|
+
yield* stream;
|
|
2705
|
+
return;
|
|
2706
|
+
}
|
|
2707
|
+
|
|
2708
|
+
const reader = stream.getReader();
|
|
2709
|
+
try {
|
|
2710
|
+
for (;;) {
|
|
2711
|
+
const {done, value} = await reader.read();
|
|
2712
|
+
if (done) {
|
|
2713
|
+
break;
|
|
2714
|
+
}
|
|
2715
|
+
yield value;
|
|
2716
|
+
}
|
|
2717
|
+
} finally {
|
|
2718
|
+
await reader.cancel();
|
|
2719
|
+
}
|
|
2720
|
+
};
|
|
2721
|
+
|
|
2722
|
+
const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
2723
|
+
const iterator = readBytes(stream, chunkSize);
|
|
2705
2724
|
|
|
2706
2725
|
let bytes = 0;
|
|
2707
2726
|
let done;
|
|
@@ -2804,7 +2823,11 @@ const getBodyLength = async (body) => {
|
|
|
2804
2823
|
}
|
|
2805
2824
|
|
|
2806
2825
|
if(utils$1.isSpecCompliantForm(body)) {
|
|
2807
|
-
|
|
2826
|
+
const _request = new Request(platform.origin, {
|
|
2827
|
+
method: 'POST',
|
|
2828
|
+
body,
|
|
2829
|
+
});
|
|
2830
|
+
return (await _request.arrayBuffer()).byteLength;
|
|
2808
2831
|
}
|
|
2809
2832
|
|
|
2810
2833
|
if(utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
|
|
@@ -2844,18 +2867,13 @@ var fetchAdapter = isFetchSupported && (async (config) => {
|
|
|
2844
2867
|
|
|
2845
2868
|
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
|
2846
2869
|
|
|
2847
|
-
let
|
|
2848
|
-
composeSignals$1([signal, cancelToken], timeout) : [];
|
|
2849
|
-
|
|
2850
|
-
let finished, request;
|
|
2870
|
+
let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
2851
2871
|
|
|
2852
|
-
|
|
2853
|
-
!finished && setTimeout(() => {
|
|
2854
|
-
composedSignal && composedSignal.unsubscribe();
|
|
2855
|
-
});
|
|
2872
|
+
let request;
|
|
2856
2873
|
|
|
2857
|
-
|
|
2858
|
-
|
|
2874
|
+
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
2875
|
+
composedSignal.unsubscribe();
|
|
2876
|
+
});
|
|
2859
2877
|
|
|
2860
2878
|
let requestContentLength;
|
|
2861
2879
|
|
|
@@ -2882,7 +2900,7 @@ var fetchAdapter = isFetchSupported && (async (config) => {
|
|
|
2882
2900
|
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
2883
2901
|
);
|
|
2884
2902
|
|
|
2885
|
-
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush
|
|
2903
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
2886
2904
|
}
|
|
2887
2905
|
}
|
|
2888
2906
|
|
|
@@ -2890,6 +2908,9 @@ var fetchAdapter = isFetchSupported && (async (config) => {
|
|
|
2890
2908
|
withCredentials = withCredentials ? 'include' : 'omit';
|
|
2891
2909
|
}
|
|
2892
2910
|
|
|
2911
|
+
// Cloudflare Workers throws when credentials are defined
|
|
2912
|
+
// see https://github.com/cloudflare/workerd/issues/902
|
|
2913
|
+
const isCredentialsSupported = "credentials" in Request.prototype;
|
|
2893
2914
|
request = new Request(url, {
|
|
2894
2915
|
...fetchOptions,
|
|
2895
2916
|
signal: composedSignal,
|
|
@@ -2897,14 +2918,14 @@ var fetchAdapter = isFetchSupported && (async (config) => {
|
|
|
2897
2918
|
headers: headers.normalize().toJSON(),
|
|
2898
2919
|
body: data,
|
|
2899
2920
|
duplex: "half",
|
|
2900
|
-
credentials: withCredentials
|
|
2921
|
+
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
2901
2922
|
});
|
|
2902
2923
|
|
|
2903
|
-
let response = await fetch(request);
|
|
2924
|
+
let response = await fetch(request, fetchOptions);
|
|
2904
2925
|
|
|
2905
2926
|
const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
|
2906
2927
|
|
|
2907
|
-
if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {
|
|
2928
|
+
if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
|
|
2908
2929
|
const options = {};
|
|
2909
2930
|
|
|
2910
2931
|
['status', 'statusText', 'headers'].forEach(prop => {
|
|
@@ -2921,8 +2942,8 @@ var fetchAdapter = isFetchSupported && (async (config) => {
|
|
|
2921
2942
|
response = new Response(
|
|
2922
2943
|
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
2923
2944
|
flush && flush();
|
|
2924
|
-
|
|
2925
|
-
}
|
|
2945
|
+
unsubscribe && unsubscribe();
|
|
2946
|
+
}),
|
|
2926
2947
|
options
|
|
2927
2948
|
);
|
|
2928
2949
|
}
|
|
@@ -2931,9 +2952,7 @@ var fetchAdapter = isFetchSupported && (async (config) => {
|
|
|
2931
2952
|
|
|
2932
2953
|
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
|
|
2933
2954
|
|
|
2934
|
-
!isStreamResponse &&
|
|
2935
|
-
|
|
2936
|
-
stopTimeout && stopTimeout();
|
|
2955
|
+
!isStreamResponse && unsubscribe && unsubscribe();
|
|
2937
2956
|
|
|
2938
2957
|
return await new Promise((resolve, reject) => {
|
|
2939
2958
|
settle(resolve, reject, {
|
|
@@ -2946,9 +2965,9 @@ var fetchAdapter = isFetchSupported && (async (config) => {
|
|
|
2946
2965
|
});
|
|
2947
2966
|
})
|
|
2948
2967
|
} catch (err) {
|
|
2949
|
-
|
|
2968
|
+
unsubscribe && unsubscribe();
|
|
2950
2969
|
|
|
2951
|
-
if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
|
|
2970
|
+
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
|
2952
2971
|
throw Object.assign(
|
|
2953
2972
|
new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
|
|
2954
2973
|
{
|
|
@@ -3108,7 +3127,7 @@ function dispatchRequest(config) {
|
|
|
3108
3127
|
});
|
|
3109
3128
|
}
|
|
3110
3129
|
|
|
3111
|
-
const VERSION = "1.
|
|
3130
|
+
const VERSION = "1.11.0";
|
|
3112
3131
|
|
|
3113
3132
|
const validators$1 = {};
|
|
3114
3133
|
|
|
@@ -3159,6 +3178,14 @@ validators$1.transitional = function transitional(validator, version, message) {
|
|
|
3159
3178
|
};
|
|
3160
3179
|
};
|
|
3161
3180
|
|
|
3181
|
+
validators$1.spelling = function spelling(correctSpelling) {
|
|
3182
|
+
return (value, opt) => {
|
|
3183
|
+
// eslint-disable-next-line no-console
|
|
3184
|
+
console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
|
|
3185
|
+
return true;
|
|
3186
|
+
}
|
|
3187
|
+
};
|
|
3188
|
+
|
|
3162
3189
|
/**
|
|
3163
3190
|
* Assert object's properties type
|
|
3164
3191
|
*
|
|
@@ -3208,7 +3235,7 @@ const validators = validator.validators;
|
|
|
3208
3235
|
*/
|
|
3209
3236
|
class Axios {
|
|
3210
3237
|
constructor(instanceConfig) {
|
|
3211
|
-
this.defaults = instanceConfig;
|
|
3238
|
+
this.defaults = instanceConfig || {};
|
|
3212
3239
|
this.interceptors = {
|
|
3213
3240
|
request: new InterceptorManager$1(),
|
|
3214
3241
|
response: new InterceptorManager$1()
|
|
@@ -3228,9 +3255,9 @@ class Axios {
|
|
|
3228
3255
|
return await this._request(configOrUrl, config);
|
|
3229
3256
|
} catch (err) {
|
|
3230
3257
|
if (err instanceof Error) {
|
|
3231
|
-
let dummy;
|
|
3258
|
+
let dummy = {};
|
|
3232
3259
|
|
|
3233
|
-
Error.captureStackTrace ? Error.captureStackTrace(dummy
|
|
3260
|
+
Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
|
|
3234
3261
|
|
|
3235
3262
|
// slice off the Error: ... line
|
|
3236
3263
|
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
|
|
@@ -3285,6 +3312,18 @@ class Axios {
|
|
|
3285
3312
|
}
|
|
3286
3313
|
}
|
|
3287
3314
|
|
|
3315
|
+
// Set config.allowAbsoluteUrls
|
|
3316
|
+
if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {
|
|
3317
|
+
config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
|
|
3318
|
+
} else {
|
|
3319
|
+
config.allowAbsoluteUrls = true;
|
|
3320
|
+
}
|
|
3321
|
+
|
|
3322
|
+
validator.assertOptions(config, {
|
|
3323
|
+
baseUrl: validators.spelling('baseURL'),
|
|
3324
|
+
withXsrfToken: validators.spelling('withXSRFToken')
|
|
3325
|
+
}, true);
|
|
3326
|
+
|
|
3288
3327
|
// Set config.method
|
|
3289
3328
|
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
|
3290
3329
|
|
|
@@ -3327,8 +3366,8 @@ class Axios {
|
|
|
3327
3366
|
|
|
3328
3367
|
if (!synchronousRequestInterceptors) {
|
|
3329
3368
|
const chain = [dispatchRequest.bind(this), undefined];
|
|
3330
|
-
chain.unshift
|
|
3331
|
-
chain.push
|
|
3369
|
+
chain.unshift(...requestInterceptorChain);
|
|
3370
|
+
chain.push(...responseInterceptorChain);
|
|
3332
3371
|
len = chain.length;
|
|
3333
3372
|
|
|
3334
3373
|
promise = Promise.resolve(config);
|
|
@@ -3375,7 +3414,7 @@ class Axios {
|
|
|
3375
3414
|
|
|
3376
3415
|
getUri(config) {
|
|
3377
3416
|
config = mergeConfig(this.defaults, config);
|
|
3378
|
-
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
3417
|
+
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
|
3379
3418
|
return buildURL(fullPath, config.params, config.paramsSerializer);
|
|
3380
3419
|
}
|
|
3381
3420
|
}
|
|
@@ -3515,6 +3554,20 @@ class CancelToken {
|
|
|
3515
3554
|
}
|
|
3516
3555
|
}
|
|
3517
3556
|
|
|
3557
|
+
toAbortSignal() {
|
|
3558
|
+
const controller = new AbortController();
|
|
3559
|
+
|
|
3560
|
+
const abort = (err) => {
|
|
3561
|
+
controller.abort(err);
|
|
3562
|
+
};
|
|
3563
|
+
|
|
3564
|
+
this.subscribe(abort);
|
|
3565
|
+
|
|
3566
|
+
controller.signal.unsubscribe = () => this.unsubscribe(abort);
|
|
3567
|
+
|
|
3568
|
+
return controller.signal;
|
|
3569
|
+
}
|
|
3570
|
+
|
|
3518
3571
|
/**
|
|
3519
3572
|
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
3520
3573
|
* cancels the `CancelToken`.
|