maka-agent 0.2.0-dev.64.20260929 → 0.2.0-dev.67.20261002
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/LICENSE +1 -1
- package/THIRD_PARTY_NOTICES.txt +3 -3
- package/dist/pi-tui-runner.js +26 -29
- package/dist/tui-copy-catalog.js +9 -9
- package/native/runtime-host-peer/prebuilds/darwin-arm64/maka_runtime_host_peer.node +0 -0
- package/native/runtime-host-peer/prebuilds/linux-arm64/maka_runtime_host_peer.node +0 -0
- package/native/runtime-host-peer/prebuilds/linux-x64/maka_runtime_host_peer.node +0 -0
- package/native/runtime-host-peer/prebuilds/win32-x64/maka_runtime_host_peer.node +0 -0
- package/native/runtime-host-windows-task-launcher/prebuilds/win32-x64/maka-runtime-host-task-launcher.exe +0 -0
- package/node_modules/@maka/core/dist/settings.js +2 -2
- package/node_modules/@maka/core/dist/tool-ledger-scanner.js +53 -150
- package/node_modules/@maka/runtime/dist/ai-sdk-compaction.js +8 -1
- package/node_modules/@maka/runtime/dist/conversation-copy.js +6 -0
- package/node_modules/@maka/runtime/dist/runtime-event-read-model.js +17 -0
- package/node_modules/@maka/runtime/dist/session-manager.js +25 -40
- package/node_modules/@maka/runtime/dist/stream-graph-coordinator.js +79 -13
- package/node_modules/@maka/runtime/dist/stream-graph-projection.js +64 -0
- package/node_modules/@maka/runtime/dist/stream-graph-read-model.js +138 -20
- package/node_modules/@maka/runtime/dist/tool-availability.js +10 -3
- package/node_modules/@maka/runtime-host/dist/candidate-entry.js +15 -0
- package/node_modules/@maka/runtime-host/dist/candidate-startup-failure.js +5 -0
- package/node_modules/@maka/runtime-host/dist/client/session-catalog-summary.js +1 -0
- package/node_modules/@maka/runtime-host/dist/client/startup-error.js +5 -0
- package/node_modules/@maka/runtime-host/dist/protocol/agent-graph.js +46 -1
- package/node_modules/@maka/runtime-host/dist/protocol/index.js +14 -1
- package/node_modules/@maka/runtime-host/dist/protocol/operations.js +5 -1
- package/node_modules/@maka/runtime-host/dist/protocol/session-catalog.js +12 -0
- package/node_modules/@maka/runtime-host/dist/protocol/session-retirement.js +46 -10
- package/node_modules/@maka/runtime-host/dist/protocol/storage-usage.js +155 -0
- package/node_modules/@maka/runtime-host/dist/server/agent-graph-coordinator.js +23 -0
- package/node_modules/@maka/runtime-host/dist/server/canonical-turn-snapshot.js +5 -0
- package/node_modules/@maka/runtime-host/dist/server/execution-composition.js +27 -6
- package/node_modules/@maka/runtime-host/dist/server/hosted-execution-tool-profile.js +2 -0
- package/node_modules/@maka/runtime-host/dist/server/session-catalog-coordinator.js +6 -0
- package/node_modules/@maka/runtime-host/dist/server/session-retirement-coordinator.js +112 -36
- package/node_modules/@maka/runtime-host/dist/server/session-revision-coordinator.js +27 -1
- package/node_modules/@maka/runtime-host/dist/server/storage-usage-coordinator.js +67 -0
- package/node_modules/@maka/runtime-host/dist/server/workhub-inspection-tool.js +208 -0
- package/node_modules/@maka/storage/dist/git-worktree-child-executor.js +3 -1
- package/node_modules/@maka/storage/dist/operational-state-store.js +0 -13
- package/node_modules/@maka/storage/dist/session-store.js +9 -6
- package/node_modules/@maka/storage/dist/sqlite-file-set.js +22 -0
- package/node_modules/@maka/storage/dist/sqlite-long-term-memory-store.js +1 -3
- package/node_modules/@maka/storage/dist/sqlite-runtime-store.js +10 -260
- package/node_modules/@maka/storage/dist/sqlite-session-catalog-query.js +1 -0
- package/node_modules/@maka/storage/dist/sqlite-session-metadata-schema.js +18 -6
- package/node_modules/@maka/storage/dist/sqlite-session-metadata-store.js +28 -6
- package/node_modules/@maka/storage/dist/storage-footprint.js +239 -0
- package/node_modules/@maka/storage/dist/storage-writer-composition.js +10 -1
- package/node_modules/axios/CHANGELOG.md +62 -0
- package/node_modules/axios/README.md +297 -5
- package/node_modules/axios/dist/axios.js +728 -170
- package/node_modules/axios/dist/axios.min.js +3 -3
- package/node_modules/axios/dist/browser/axios.cjs +871 -188
- package/node_modules/axios/dist/esm/axios.js +871 -188
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/node/axios.cjs +1037 -225
- package/node_modules/axios/lib/adapters/fetch.js +64 -11
- package/node_modules/axios/lib/adapters/http.js +140 -67
- package/node_modules/axios/lib/adapters/xhr.js +52 -3
- package/node_modules/axios/lib/core/Axios.js +43 -20
- package/node_modules/axios/lib/core/AxiosError.js +33 -2
- package/node_modules/axios/lib/core/AxiosHeaders.js +124 -1
- package/node_modules/axios/lib/core/InterceptorManager.js +107 -8
- package/node_modules/axios/lib/core/buildFullPath.js +41 -15
- package/node_modules/axios/lib/core/dispatchRequest.js +8 -2
- package/node_modules/axios/lib/core/mergeConfig.js +19 -4
- package/node_modules/axios/lib/core/methodList.js +17 -0
- package/node_modules/axios/lib/core/setFormDataHeaders.js +27 -0
- package/node_modules/axios/lib/defaults/index.js +2 -1
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/Http2Sessions.js +2 -0
- package/node_modules/axios/lib/helpers/HttpStatusCode.js +12 -1
- package/node_modules/axios/lib/helpers/combineURLs.js +11 -3
- package/node_modules/axios/lib/helpers/composeSignals.js +12 -1
- package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +115 -54
- package/node_modules/axios/lib/helpers/formDataToJSON.js +11 -5
- package/node_modules/axios/lib/helpers/fromDataURI.js +5 -4
- package/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
- package/node_modules/axios/lib/helpers/parseHeaders.js +5 -3
- package/node_modules/axios/lib/helpers/progressEventReducer.js +4 -4
- package/node_modules/axios/lib/helpers/resolveConfig.js +5 -17
- package/node_modules/axios/lib/helpers/shouldBypassProxy.js +300 -5
- package/node_modules/axios/lib/helpers/throttle.js +3 -2
- package/node_modules/axios/lib/helpers/toFormData.js +17 -23
- package/node_modules/axios/lib/platform/node/classes/Buffer.js +11 -0
- package/node_modules/axios/lib/utils.js +151 -18
- package/node_modules/axios/package.json +21 -19
- package/node_modules/brace-expansion/dist/commonjs/index.js +69 -25
- package/node_modules/brace-expansion/dist/esm/index.js +68 -24
- package/node_modules/brace-expansion/package.json +2 -1
- package/node_modules/fast-uri/index.js +10 -6
- package/node_modules/fast-uri/package.json +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Axios v1.
|
|
1
|
+
/*! Axios v1.20.0 Copyright (c) 2026 Matt Zabriskie and contributors */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
@@ -561,13 +561,61 @@
|
|
|
561
561
|
return hasOwnProperty.call(obj, prop);
|
|
562
562
|
};
|
|
563
563
|
}(Object.prototype);
|
|
564
|
+
var isUnsafeObjectKey = function isUnsafeObjectKey(prop) {
|
|
565
|
+
return typeof prop === 'string' && (prop === '__proto__' || prop === 'constructor' || prop === 'prototype');
|
|
566
|
+
};
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* Determine whether an inherited object must be treated as a shared-prototype
|
|
570
|
+
* boundary. Cross-realm Object.prototype objects cannot be distinguished
|
|
571
|
+
* reliably from application-created null-prototype objects because their
|
|
572
|
+
* properties are mutable, so all inherited terminal prototypes are excluded
|
|
573
|
+
* as a fail-closed boundary. A null-prototype source still keeps its own
|
|
574
|
+
* properties, as produced by mergeConfig and other safe materialization paths.
|
|
575
|
+
*
|
|
576
|
+
* @param {*} obj The object to inspect
|
|
577
|
+
* @param {*} prototype The object's prototype
|
|
578
|
+
* @param {boolean} source Whether obj is the original traversal source
|
|
579
|
+
*
|
|
580
|
+
* @returns {boolean} True when obj is a safe prototype traversal boundary
|
|
581
|
+
*/
|
|
582
|
+
var isPrototypeBoundary = function isPrototypeBoundary(obj, prototype, source) {
|
|
583
|
+
return obj === Object.prototype || !source && prototype === null;
|
|
584
|
+
};
|
|
564
585
|
|
|
565
586
|
/**
|
|
566
|
-
*
|
|
567
|
-
*
|
|
568
|
-
*
|
|
569
|
-
*
|
|
570
|
-
*
|
|
587
|
+
* Determine whether an object can retain its identity through code paths that
|
|
588
|
+
* add, replace, and remove config properties without bypassing unsafe-key
|
|
589
|
+
* filtering. Immutable objects, unsafe-key-bearing objects, and objects with
|
|
590
|
+
* accessor or restricted data properties must be materialized instead.
|
|
591
|
+
*
|
|
592
|
+
* @param {*} obj The object to inspect
|
|
593
|
+
*
|
|
594
|
+
* @returns {boolean} True when every own property is safe and fully mutable
|
|
595
|
+
*/
|
|
596
|
+
var isSafeAndFullyMutable = function isSafeAndFullyMutable(obj) {
|
|
597
|
+
if (!Object.isExtensible(obj)) {
|
|
598
|
+
return false;
|
|
599
|
+
}
|
|
600
|
+
var props = Object.getOwnPropertyNames(obj);
|
|
601
|
+
if (Object.getOwnPropertySymbols) {
|
|
602
|
+
props.push.apply(props, _toConsumableArray(Object.getOwnPropertySymbols(obj)));
|
|
603
|
+
}
|
|
604
|
+
return props.every(function (prop) {
|
|
605
|
+
if (isUnsafeObjectKey(prop)) {
|
|
606
|
+
return false;
|
|
607
|
+
}
|
|
608
|
+
var descriptor = Object.getOwnPropertyDescriptor(obj, prop);
|
|
609
|
+
return !!descriptor && descriptor.configurable && descriptor.writable === true;
|
|
610
|
+
});
|
|
611
|
+
};
|
|
612
|
+
|
|
613
|
+
/**
|
|
614
|
+
* Walk the prototype chain (excluding the source realm's Object.prototype)
|
|
615
|
+
* looking for an own `prop`. This distinguishes genuine own/inherited members
|
|
616
|
+
* — including class accessors and template prototypes — from members injected
|
|
617
|
+
* via Object.prototype pollution (e.g. `Object.prototype.username = '...'`),
|
|
618
|
+
* which live on Object.prototype itself and are therefore never matched.
|
|
571
619
|
*
|
|
572
620
|
* @param {*} thing The value whose chain to inspect
|
|
573
621
|
* @param {string|symbol} prop The property key to look for
|
|
@@ -577,15 +625,19 @@
|
|
|
577
625
|
var hasOwnInPrototypeChain = function hasOwnInPrototypeChain(thing, prop) {
|
|
578
626
|
var obj = thing;
|
|
579
627
|
var seen = [];
|
|
580
|
-
while (obj != null
|
|
628
|
+
while (obj != null) {
|
|
581
629
|
if (seen.indexOf(obj) !== -1) {
|
|
582
630
|
return false;
|
|
583
631
|
}
|
|
584
632
|
seen.push(obj);
|
|
633
|
+
var prototype = getPrototypeOf(obj);
|
|
634
|
+
if (isPrototypeBoundary(obj, prototype, obj === thing)) {
|
|
635
|
+
return false;
|
|
636
|
+
}
|
|
585
637
|
if (hasOwnProperty(obj, prop)) {
|
|
586
638
|
return true;
|
|
587
639
|
}
|
|
588
|
-
obj =
|
|
640
|
+
obj = prototype;
|
|
589
641
|
}
|
|
590
642
|
return false;
|
|
591
643
|
};
|
|
@@ -604,6 +656,65 @@
|
|
|
604
656
|
var getSafeProp = function getSafeProp(obj, prop) {
|
|
605
657
|
return obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : undefined;
|
|
606
658
|
};
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* Flatten an object and its application-defined prototype chain into a
|
|
662
|
+
* null-prototype object. Members inherited only from the source realm's
|
|
663
|
+
* Object.prototype are deliberately excluded, while class/template members
|
|
664
|
+
* below that boundary are preserved.
|
|
665
|
+
*
|
|
666
|
+
* @param {*} thing The value to flatten
|
|
667
|
+
*
|
|
668
|
+
* @returns {*} A null-prototype copy, or the original value when it is already
|
|
669
|
+
* structurally safe or is not an object
|
|
670
|
+
*/
|
|
671
|
+
var toSafeFlatObject = function toSafeFlatObject(thing) {
|
|
672
|
+
if (thing == null || _typeof(thing) !== 'object' && typeof thing !== 'function') {
|
|
673
|
+
return thing;
|
|
674
|
+
}
|
|
675
|
+
var sourcePrototype = getPrototypeOf(thing);
|
|
676
|
+
if (sourcePrototype === null && isSafeAndFullyMutable(thing)) {
|
|
677
|
+
return thing;
|
|
678
|
+
}
|
|
679
|
+
var result = Object.create(null);
|
|
680
|
+
var merged = Object.create(null);
|
|
681
|
+
var seen = [];
|
|
682
|
+
var current = thing;
|
|
683
|
+
while (current != null) {
|
|
684
|
+
if (seen.indexOf(current) !== -1) {
|
|
685
|
+
break;
|
|
686
|
+
}
|
|
687
|
+
seen.push(current);
|
|
688
|
+
var prototype = current === thing ? sourcePrototype : getPrototypeOf(current);
|
|
689
|
+
if (isPrototypeBoundary(current, prototype, current === thing)) {
|
|
690
|
+
break;
|
|
691
|
+
}
|
|
692
|
+
var props = Object.getOwnPropertyNames(current);
|
|
693
|
+
if (Object.getOwnPropertySymbols) {
|
|
694
|
+
props.push.apply(props, _toConsumableArray(Object.getOwnPropertySymbols(current)));
|
|
695
|
+
}
|
|
696
|
+
var _iterator2 = _createForOfIteratorHelper(props),
|
|
697
|
+
_step;
|
|
698
|
+
try {
|
|
699
|
+
for (_iterator2.s(); !(_step = _iterator2.n()).done;) {
|
|
700
|
+
var prop = _step.value;
|
|
701
|
+
if (isUnsafeObjectKey(prop)) {
|
|
702
|
+
continue;
|
|
703
|
+
}
|
|
704
|
+
if (!hasOwnProperty(merged, prop)) {
|
|
705
|
+
result[prop] = thing[prop];
|
|
706
|
+
merged[prop] = true;
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
} catch (err) {
|
|
710
|
+
_iterator2.e(err);
|
|
711
|
+
} finally {
|
|
712
|
+
_iterator2.f();
|
|
713
|
+
}
|
|
714
|
+
current = prototype;
|
|
715
|
+
}
|
|
716
|
+
return result;
|
|
717
|
+
};
|
|
607
718
|
var kindOf = function (cache) {
|
|
608
719
|
return function (thing) {
|
|
609
720
|
var str = toString.call(thing);
|
|
@@ -737,9 +848,9 @@
|
|
|
737
848
|
}
|
|
738
849
|
var prototype = getPrototypeOf(val);
|
|
739
850
|
return (prototype === null || prototype === Object.prototype || getPrototypeOf(prototype) === null) &&
|
|
740
|
-
// Treat
|
|
741
|
-
//
|
|
742
|
-
//
|
|
851
|
+
// Treat safe own/inherited Symbol.toStringTag or Symbol.iterator members as
|
|
852
|
+
// evidence the value is tagged/iterable, while ignoring members reachable
|
|
853
|
+
// only through shared or terminal prototype boundaries.
|
|
743
854
|
!hasOwnInPrototypeChain(val, toStringTag) && !hasOwnInPrototypeChain(val, iterator);
|
|
744
855
|
};
|
|
745
856
|
|
|
@@ -825,6 +936,7 @@
|
|
|
825
936
|
* @returns {boolean} True if value is a FileList, otherwise false
|
|
826
937
|
*/
|
|
827
938
|
var isFileList = kindOfTest('FileList');
|
|
939
|
+
var isSet = kindOfTest('Set');
|
|
828
940
|
|
|
829
941
|
/**
|
|
830
942
|
* Determine if a value is a Stream
|
|
@@ -1354,11 +1466,29 @@
|
|
|
1354
1466
|
if (!('toJSON' in source)) {
|
|
1355
1467
|
// add-on descent / delete-on-ascent: preserves path semantics, so DAG nodes serialise at every occurrence (see #7230).
|
|
1356
1468
|
visited.add(source);
|
|
1357
|
-
var target
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1469
|
+
var target;
|
|
1470
|
+
if (isSet(source)) {
|
|
1471
|
+
target = [];
|
|
1472
|
+
var _iterator3 = _createForOfIteratorHelper(source),
|
|
1473
|
+
_step2;
|
|
1474
|
+
try {
|
|
1475
|
+
for (_iterator3.s(); !(_step2 = _iterator3.n()).done;) {
|
|
1476
|
+
var value = _step2.value;
|
|
1477
|
+
var reducedValue = _visit(value);
|
|
1478
|
+
!isUndefined(reducedValue) && target.push(reducedValue);
|
|
1479
|
+
}
|
|
1480
|
+
} catch (err) {
|
|
1481
|
+
_iterator3.e(err);
|
|
1482
|
+
} finally {
|
|
1483
|
+
_iterator3.f();
|
|
1484
|
+
}
|
|
1485
|
+
} else {
|
|
1486
|
+
target = isArray(source) ? [] : {};
|
|
1487
|
+
forEach(source, function (value, key) {
|
|
1488
|
+
var reducedValue = _visit(value);
|
|
1489
|
+
!isUndefined(reducedValue) && (target[key] = reducedValue);
|
|
1490
|
+
});
|
|
1491
|
+
}
|
|
1362
1492
|
visited["delete"](source);
|
|
1363
1493
|
return target;
|
|
1364
1494
|
}
|
|
@@ -1493,6 +1623,7 @@
|
|
|
1493
1623
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
1494
1624
|
hasOwnInPrototypeChain: hasOwnInPrototypeChain,
|
|
1495
1625
|
getSafeProp: getSafeProp,
|
|
1626
|
+
toSafeFlatObject: toSafeFlatObject,
|
|
1496
1627
|
reduceDescriptors: reduceDescriptors,
|
|
1497
1628
|
freezeMethods: freezeMethods,
|
|
1498
1629
|
toObjectSet: toObjectSet,
|
|
@@ -1539,17 +1670,18 @@
|
|
|
1539
1670
|
i = line.indexOf(':');
|
|
1540
1671
|
key = line.substring(0, i).trim().toLowerCase();
|
|
1541
1672
|
val = line.substring(i + 1).trim();
|
|
1542
|
-
|
|
1673
|
+
var hasKey = utils$1.hasOwnProp(parsed, key);
|
|
1674
|
+
if (!key || hasKey && utils$1.hasOwnProp(ignoreDuplicateOf, key)) {
|
|
1543
1675
|
return;
|
|
1544
1676
|
}
|
|
1545
1677
|
if (key === 'set-cookie') {
|
|
1546
|
-
if (
|
|
1678
|
+
if (hasKey) {
|
|
1547
1679
|
parsed[key].push(val);
|
|
1548
1680
|
} else {
|
|
1549
1681
|
parsed[key] = [val];
|
|
1550
1682
|
}
|
|
1551
1683
|
} else {
|
|
1552
|
-
parsed[key] =
|
|
1684
|
+
parsed[key] = hasKey ? parsed[key] + ', ' + val : val;
|
|
1553
1685
|
}
|
|
1554
1686
|
});
|
|
1555
1687
|
return parsed;
|
|
@@ -1602,7 +1734,7 @@
|
|
|
1602
1734
|
return byteStringHeaders;
|
|
1603
1735
|
}
|
|
1604
1736
|
|
|
1605
|
-
var $internals = Symbol('internals');
|
|
1737
|
+
var $internals$1 = Symbol('internals');
|
|
1606
1738
|
function normalizeHeader(header) {
|
|
1607
1739
|
return header && String(header).trim().toLowerCase();
|
|
1608
1740
|
}
|
|
@@ -1621,6 +1753,90 @@
|
|
|
1621
1753
|
}
|
|
1622
1754
|
return tokens;
|
|
1623
1755
|
}
|
|
1756
|
+
var parameterNameRE = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
1757
|
+
function trimOWS(value) {
|
|
1758
|
+
var start = 0;
|
|
1759
|
+
var end = value.length;
|
|
1760
|
+
while (start < end) {
|
|
1761
|
+
var code = value.charCodeAt(start);
|
|
1762
|
+
if (code !== 0x09 && code !== 0x20) {
|
|
1763
|
+
break;
|
|
1764
|
+
}
|
|
1765
|
+
start += 1;
|
|
1766
|
+
}
|
|
1767
|
+
while (end > start) {
|
|
1768
|
+
var _code = value.charCodeAt(end - 1);
|
|
1769
|
+
if (_code !== 0x09 && _code !== 0x20) {
|
|
1770
|
+
break;
|
|
1771
|
+
}
|
|
1772
|
+
end -= 1;
|
|
1773
|
+
}
|
|
1774
|
+
return start === 0 && end === value.length ? value : value.slice(start, end);
|
|
1775
|
+
}
|
|
1776
|
+
function decodeQuotedString(value) {
|
|
1777
|
+
var last = value.length - 1;
|
|
1778
|
+
if (last < 1 || value.charCodeAt(0) !== 0x22 || value.charCodeAt(last) !== 0x22) {
|
|
1779
|
+
return value;
|
|
1780
|
+
}
|
|
1781
|
+
var decoded = '';
|
|
1782
|
+
for (var i = 1; i < last; i++) {
|
|
1783
|
+
var code = value.charCodeAt(i);
|
|
1784
|
+
if (code === 0x22) {
|
|
1785
|
+
return value;
|
|
1786
|
+
}
|
|
1787
|
+
if (code === 0x5c) {
|
|
1788
|
+
i += 1;
|
|
1789
|
+
if (i >= last) {
|
|
1790
|
+
return value;
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1793
|
+
decoded += value[i];
|
|
1794
|
+
}
|
|
1795
|
+
return decoded;
|
|
1796
|
+
}
|
|
1797
|
+
function _parseParameters(value) {
|
|
1798
|
+
var parameters = Object.create(null);
|
|
1799
|
+
var str = String(value);
|
|
1800
|
+
var start = 0;
|
|
1801
|
+
var quoted = false;
|
|
1802
|
+
var escaped = false;
|
|
1803
|
+
function parseParameter(end) {
|
|
1804
|
+
var part = trimOWS(str.slice(start, end));
|
|
1805
|
+
var equals = part.indexOf('=');
|
|
1806
|
+
if (equals < 1) {
|
|
1807
|
+
return;
|
|
1808
|
+
}
|
|
1809
|
+
var name = trimOWS(part.slice(0, equals));
|
|
1810
|
+
if (!parameterNameRE.test(name)) {
|
|
1811
|
+
return;
|
|
1812
|
+
}
|
|
1813
|
+
var normalizedName = name.toLowerCase();
|
|
1814
|
+
if (normalizedName === '__proto__' || normalizedName === 'constructor' || normalizedName === 'prototype') {
|
|
1815
|
+
return;
|
|
1816
|
+
}
|
|
1817
|
+
var parameterValue = trimOWS(part.slice(equals + 1));
|
|
1818
|
+
parameters[normalizedName] = decodeQuotedString(parameterValue);
|
|
1819
|
+
}
|
|
1820
|
+
for (var i = 0; i < str.length; i++) {
|
|
1821
|
+
var code = str.charCodeAt(i);
|
|
1822
|
+
if (quoted) {
|
|
1823
|
+
if (escaped) {
|
|
1824
|
+
escaped = false;
|
|
1825
|
+
} else if (code === 0x5c) {
|
|
1826
|
+
escaped = true;
|
|
1827
|
+
} else if (code === 0x22) {
|
|
1828
|
+
quoted = false;
|
|
1829
|
+
}
|
|
1830
|
+
} else if (code === 0x22) {
|
|
1831
|
+
quoted = true;
|
|
1832
|
+
} else if (code === 0x2c || code === 0x3b) {
|
|
1833
|
+
parseParameter(i);
|
|
1834
|
+
start = i + 1;
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
parseParameter(str.length);
|
|
1838
|
+
return parameters;
|
|
1839
|
+
}
|
|
1624
1840
|
var isValidHeaderName = function isValidHeaderName(str) {
|
|
1625
1841
|
return /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
|
1626
1842
|
};
|
|
@@ -1845,7 +2061,8 @@
|
|
|
1845
2061
|
}, {
|
|
1846
2062
|
key: "getSetCookie",
|
|
1847
2063
|
value: function getSetCookie() {
|
|
1848
|
-
|
|
2064
|
+
var value = this.get('set-cookie');
|
|
2065
|
+
return utils$1.isArray(value) ? value : value == null || value === false ? [] : [value];
|
|
1849
2066
|
}
|
|
1850
2067
|
}, {
|
|
1851
2068
|
key: Symbol.toStringTag,
|
|
@@ -1857,6 +2074,11 @@
|
|
|
1857
2074
|
value: function from(thing) {
|
|
1858
2075
|
return thing instanceof this ? thing : new this(thing);
|
|
1859
2076
|
}
|
|
2077
|
+
}, {
|
|
2078
|
+
key: "parseParameters",
|
|
2079
|
+
value: function parseParameters(value) {
|
|
2080
|
+
return _parseParameters(value);
|
|
2081
|
+
}
|
|
1860
2082
|
}, {
|
|
1861
2083
|
key: "concat",
|
|
1862
2084
|
value: function concat(first) {
|
|
@@ -1872,7 +2094,7 @@
|
|
|
1872
2094
|
}, {
|
|
1873
2095
|
key: "accessor",
|
|
1874
2096
|
value: function accessor(header) {
|
|
1875
|
-
var internals = this[$internals] = this[$internals] = {
|
|
2097
|
+
var internals = this[$internals$1] = this[$internals$1] = {
|
|
1876
2098
|
accessors: {}
|
|
1877
2099
|
};
|
|
1878
2100
|
var accessors = internals.accessors;
|
|
@@ -1967,6 +2189,23 @@
|
|
|
1967
2189
|
};
|
|
1968
2190
|
return _visit(config);
|
|
1969
2191
|
}
|
|
2192
|
+
function stringifySafely$1(value) {
|
|
2193
|
+
try {
|
|
2194
|
+
return String(value);
|
|
2195
|
+
} catch (err) {
|
|
2196
|
+
return '';
|
|
2197
|
+
}
|
|
2198
|
+
}
|
|
2199
|
+
function aggregateErrorMessage(error) {
|
|
2200
|
+
var message = error.errors.map(function (entry) {
|
|
2201
|
+
try {
|
|
2202
|
+
return entry && entry.message ? stringifySafely$1(entry.message) : stringifySafely$1(entry);
|
|
2203
|
+
} catch (err) {
|
|
2204
|
+
return '';
|
|
2205
|
+
}
|
|
2206
|
+
}).filter(Boolean).join('; ');
|
|
2207
|
+
return message || error.name || 'AggregateError';
|
|
2208
|
+
}
|
|
1970
2209
|
var AxiosError = /*#__PURE__*/function (_Error) {
|
|
1971
2210
|
/**
|
|
1972
2211
|
* Create an Error with the specified message, config, error code, request and response.
|
|
@@ -2039,7 +2278,14 @@
|
|
|
2039
2278
|
}], [{
|
|
2040
2279
|
key: "from",
|
|
2041
2280
|
value: function from(error, code, config, request, response, customProps) {
|
|
2042
|
-
|
|
2281
|
+
// `AggregateError` (thrown by Node on dual-stack/Happy-Eyeballs connection
|
|
2282
|
+
// failures) has an empty `message`; its detail lives in `errors[]`. Without
|
|
2283
|
+
// this, the wrapped error surfaces with a blank message (see #6721).
|
|
2284
|
+
var message = error.message;
|
|
2285
|
+
if (!message && utils$1.isArray(error.errors) && error.errors.length) {
|
|
2286
|
+
message = aggregateErrorMessage(error);
|
|
2287
|
+
}
|
|
2288
|
+
var axiosError = new AxiosError(message, code || error.code, config, request, response);
|
|
2043
2289
|
// Match native `Error` `cause` semantics: non-enumerable. The wrapped
|
|
2044
2290
|
// error often carries circular internals (sockets, requests, agents), so
|
|
2045
2291
|
// an enumerable `cause` makes structured loggers (pino/winston) and any
|
|
@@ -2170,23 +2416,17 @@
|
|
|
2170
2416
|
|
|
2171
2417
|
// eslint-disable-next-line no-param-reassign
|
|
2172
2418
|
formData = formData || new (FormData)();
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
indexes: false
|
|
2179
|
-
}, false, function defined(option, source) {
|
|
2180
|
-
// eslint-disable-next-line no-eq-null,eqeqeq
|
|
2181
|
-
return !utils$1.isUndefined(source[option]);
|
|
2182
|
-
});
|
|
2183
|
-
var metaTokens = options.metaTokens;
|
|
2419
|
+
var option = function option(name, fallback) {
|
|
2420
|
+
var value = utils$1.getSafeProp(options, name);
|
|
2421
|
+
return utils$1.isUndefined(value) ? fallback : value;
|
|
2422
|
+
};
|
|
2423
|
+
var metaTokens = option('metaTokens', true);
|
|
2184
2424
|
// eslint-disable-next-line no-use-before-define
|
|
2185
|
-
var visitor =
|
|
2186
|
-
var dots =
|
|
2187
|
-
var indexes =
|
|
2188
|
-
var _Blob =
|
|
2189
|
-
var maxDepth =
|
|
2425
|
+
var visitor = option('visitor') || defaultVisitor;
|
|
2426
|
+
var dots = option('dots', false);
|
|
2427
|
+
var indexes = option('indexes', false);
|
|
2428
|
+
var _Blob = option('Blob') || typeof Blob !== 'undefined' && Blob;
|
|
2429
|
+
var maxDepth = option('maxDepth', DEFAULT_FORM_DATA_MAX_DEPTH);
|
|
2190
2430
|
var useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
2191
2431
|
var stack = [];
|
|
2192
2432
|
if (!utils$1.isFunction(visitor)) {
|
|
@@ -2207,9 +2447,6 @@
|
|
|
2207
2447
|
if (useBlob && typeof _Blob === 'function') {
|
|
2208
2448
|
return new _Blob([value]);
|
|
2209
2449
|
}
|
|
2210
|
-
if (typeof Buffer !== 'undefined') {
|
|
2211
|
-
return Buffer.from(value);
|
|
2212
|
-
}
|
|
2213
2450
|
throw new AxiosError('Blob is not supported. Use a Buffer instead.', AxiosError.ERR_NOT_SUPPORT);
|
|
2214
2451
|
}
|
|
2215
2452
|
return value;
|
|
@@ -2403,10 +2640,52 @@
|
|
|
2403
2640
|
return url;
|
|
2404
2641
|
}
|
|
2405
2642
|
|
|
2643
|
+
var $internals = Symbol('internals');
|
|
2644
|
+
|
|
2645
|
+
// `handlers` is public and may be replaced with a nullish value by user code;
|
|
2646
|
+
// `clear()` has always tolerated that. Treat it as an empty stack rather than
|
|
2647
|
+
// dereferencing it.
|
|
2648
|
+
function countHandlers(handlers) {
|
|
2649
|
+
return handlers ? handlers.length : 0;
|
|
2650
|
+
}
|
|
2651
|
+
function trimHandlers(handlers) {
|
|
2652
|
+
if (!handlers) {
|
|
2653
|
+
return;
|
|
2654
|
+
}
|
|
2655
|
+
while (handlers.length && handlers[handlers.length - 1] === null) {
|
|
2656
|
+
handlers.pop();
|
|
2657
|
+
}
|
|
2658
|
+
}
|
|
2659
|
+
function syncHandlerEntries(manager, internals) {
|
|
2660
|
+
var handlers = manager.handlers;
|
|
2661
|
+
var length = countHandlers(handlers);
|
|
2662
|
+
if (handlers !== internals.handlersRef) {
|
|
2663
|
+
internals.handlersRef = handlers;
|
|
2664
|
+
internals.handlerEntries.clear();
|
|
2665
|
+
} else if (length !== internals.handlersLength) {
|
|
2666
|
+
if (!length) {
|
|
2667
|
+
internals.handlerEntries.clear();
|
|
2668
|
+
} else {
|
|
2669
|
+
internals.handlerEntries.forEach(function removeStaleEntry(entry, id) {
|
|
2670
|
+
if (handlers[entry.index] !== entry.handler) {
|
|
2671
|
+
internals.handlerEntries["delete"](id);
|
|
2672
|
+
}
|
|
2673
|
+
});
|
|
2674
|
+
}
|
|
2675
|
+
}
|
|
2676
|
+
internals.handlersLength = length;
|
|
2677
|
+
}
|
|
2406
2678
|
var InterceptorManager = /*#__PURE__*/function () {
|
|
2407
2679
|
function InterceptorManager() {
|
|
2408
2680
|
_classCallCheck(this, InterceptorManager);
|
|
2409
2681
|
this.handlers = [];
|
|
2682
|
+
this[$internals] = {
|
|
2683
|
+
handlersRef: this.handlers,
|
|
2684
|
+
handlersLength: this.handlers.length,
|
|
2685
|
+
handlerEntries: new Map(),
|
|
2686
|
+
iterationDepth: 0,
|
|
2687
|
+
nextId: 0
|
|
2688
|
+
};
|
|
2410
2689
|
}
|
|
2411
2690
|
|
|
2412
2691
|
/**
|
|
@@ -2421,13 +2700,25 @@
|
|
|
2421
2700
|
return _createClass(InterceptorManager, [{
|
|
2422
2701
|
key: "use",
|
|
2423
2702
|
value: function use(fulfilled, rejected, options) {
|
|
2424
|
-
|
|
2703
|
+
var handler = {
|
|
2425
2704
|
fulfilled: fulfilled,
|
|
2426
2705
|
rejected: rejected,
|
|
2427
2706
|
synchronous: options ? options.synchronous : false,
|
|
2428
2707
|
runWhen: options ? options.runWhen : null
|
|
2708
|
+
};
|
|
2709
|
+
var internals = this[$internals];
|
|
2710
|
+
if (this.handlers == null) {
|
|
2711
|
+
this.handlers = [];
|
|
2712
|
+
}
|
|
2713
|
+
syncHandlerEntries(this, internals);
|
|
2714
|
+
var id = internals.nextId++;
|
|
2715
|
+
this.handlers.push(handler);
|
|
2716
|
+
internals.handlerEntries.set(id, {
|
|
2717
|
+
handler: handler,
|
|
2718
|
+
index: this.handlers.length - 1
|
|
2429
2719
|
});
|
|
2430
|
-
|
|
2720
|
+
internals.handlersLength = this.handlers.length;
|
|
2721
|
+
return id;
|
|
2431
2722
|
}
|
|
2432
2723
|
|
|
2433
2724
|
/**
|
|
@@ -2440,8 +2731,23 @@
|
|
|
2440
2731
|
}, {
|
|
2441
2732
|
key: "eject",
|
|
2442
2733
|
value: function eject(id) {
|
|
2443
|
-
|
|
2444
|
-
|
|
2734
|
+
var internals = this[$internals];
|
|
2735
|
+
syncHandlerEntries(this, internals);
|
|
2736
|
+
var entry = internals.handlerEntries.get(id);
|
|
2737
|
+
if (entry) {
|
|
2738
|
+
internals.handlerEntries["delete"](id);
|
|
2739
|
+
|
|
2740
|
+
// Ignore IDs invalidated by clear or direct replacement of handlers.
|
|
2741
|
+
if (this.handlers[entry.index] !== entry.handler) {
|
|
2742
|
+
return;
|
|
2743
|
+
}
|
|
2744
|
+
this.handlers[entry.index] = null;
|
|
2745
|
+
|
|
2746
|
+
// Do not reuse an index while forEach is walking its length snapshot.
|
|
2747
|
+
if (!internals.iterationDepth) {
|
|
2748
|
+
trimHandlers(this.handlers);
|
|
2749
|
+
internals.handlersLength = this.handlers.length;
|
|
2750
|
+
}
|
|
2445
2751
|
}
|
|
2446
2752
|
}
|
|
2447
2753
|
|
|
@@ -2455,6 +2761,7 @@
|
|
|
2455
2761
|
value: function clear() {
|
|
2456
2762
|
if (this.handlers) {
|
|
2457
2763
|
this.handlers = [];
|
|
2764
|
+
syncHandlerEntries(this, this[$internals]);
|
|
2458
2765
|
}
|
|
2459
2766
|
}
|
|
2460
2767
|
|
|
@@ -2471,11 +2778,22 @@
|
|
|
2471
2778
|
}, {
|
|
2472
2779
|
key: "forEach",
|
|
2473
2780
|
value: function forEach(fn) {
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2781
|
+
var internals = this[$internals];
|
|
2782
|
+
syncHandlerEntries(this, internals);
|
|
2783
|
+
internals.iterationDepth++;
|
|
2784
|
+
try {
|
|
2785
|
+
utils$1.forEach(this.handlers, function forEachHandler(h) {
|
|
2786
|
+
if (h !== null) {
|
|
2787
|
+
fn(h);
|
|
2788
|
+
}
|
|
2789
|
+
});
|
|
2790
|
+
} finally {
|
|
2791
|
+
if (! --internals.iterationDepth) {
|
|
2792
|
+
syncHandlerEntries(this, internals);
|
|
2793
|
+
trimHandlers(this.handlers);
|
|
2794
|
+
internals.handlersLength = countHandlers(this.handlers);
|
|
2477
2795
|
}
|
|
2478
|
-
}
|
|
2796
|
+
}
|
|
2479
2797
|
}
|
|
2480
2798
|
}]);
|
|
2481
2799
|
}();
|
|
@@ -2581,12 +2899,18 @@
|
|
|
2581
2899
|
* @returns An array of strings.
|
|
2582
2900
|
*/
|
|
2583
2901
|
function parsePropPath(name) {
|
|
2584
|
-
// foo[x][y][z]
|
|
2585
|
-
// foo.x.y.z
|
|
2586
|
-
//
|
|
2587
|
-
//
|
|
2902
|
+
// foo[x][y][z] -> ['foo', 'x', 'y', 'z']
|
|
2903
|
+
// foo.x.y.z -> ['foo', 'x', 'y', 'z']
|
|
2904
|
+
// A path is split on `.` and on `[...]` groups. A segment — whether written
|
|
2905
|
+
// in dot notation or captured inside brackets — may contain any character
|
|
2906
|
+
// except `.`, `[` and `]`, so a key like `user-name` or `user name` is kept
|
|
2907
|
+
// literal instead of being split (#5402). `.`, `[` and `]` keep their existing
|
|
2908
|
+
// meaning, e.g. `foo[bar.baz]` -> ['foo', 'bar', 'baz'] and `[]` is an array push.
|
|
2909
|
+
// Excluding `[` from the bracket group also makes the match fail fast at the
|
|
2910
|
+
// next `[`, so a malformed name cannot rescan to the end of the string from
|
|
2911
|
+
// every unmatched `[` — parsing stays linear in the length of the name.
|
|
2588
2912
|
var path = [];
|
|
2589
|
-
var pattern =
|
|
2913
|
+
var pattern = /[^.[\]]+|\[([^.[\]]*)]/g;
|
|
2590
2914
|
var match;
|
|
2591
2915
|
while ((match = pattern.exec(name)) !== null) {
|
|
2592
2916
|
throwIfDepthExceeded(path.length);
|
|
@@ -2657,6 +2981,8 @@
|
|
|
2657
2981
|
return null;
|
|
2658
2982
|
}
|
|
2659
2983
|
|
|
2984
|
+
var methodList = Object.freeze(['get', 'delete', 'head', 'options', 'post', 'put', 'patch', 'purge', 'link', 'unlink', 'query']);
|
|
2985
|
+
|
|
2660
2986
|
var own = function own(obj, key) {
|
|
2661
2987
|
return obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined;
|
|
2662
2988
|
};
|
|
@@ -2775,7 +3101,7 @@
|
|
|
2775
3101
|
}
|
|
2776
3102
|
}
|
|
2777
3103
|
};
|
|
2778
|
-
utils$1.forEach(
|
|
3104
|
+
utils$1.forEach(methodList, function (method) {
|
|
2779
3105
|
defaults.headers[method] = {};
|
|
2780
3106
|
});
|
|
2781
3107
|
|
|
@@ -2843,6 +3169,26 @@
|
|
|
2843
3169
|
}
|
|
2844
3170
|
}
|
|
2845
3171
|
|
|
3172
|
+
var urlParserControlCharacters = /[\t\n\r]/g;
|
|
3173
|
+
|
|
3174
|
+
/**
|
|
3175
|
+
* Match WHATWG URL preprocessing before checking a URL's protocol.
|
|
3176
|
+
*
|
|
3177
|
+
* @param {string} url
|
|
3178
|
+
*
|
|
3179
|
+
* @returns {string}
|
|
3180
|
+
*/
|
|
3181
|
+
function normalizeURLForProtocolCheck(url) {
|
|
3182
|
+
if (typeof url !== 'string') {
|
|
3183
|
+
return url;
|
|
3184
|
+
}
|
|
3185
|
+
var start = 0;
|
|
3186
|
+
while (start < url.length && url.charCodeAt(start) <= 0x20) {
|
|
3187
|
+
start++;
|
|
3188
|
+
}
|
|
3189
|
+
return url.slice(start).replace(urlParserControlCharacters, '');
|
|
3190
|
+
}
|
|
3191
|
+
|
|
2846
3192
|
function parseProtocol(url) {
|
|
2847
3193
|
var match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url);
|
|
2848
3194
|
return match && match[1] || '';
|
|
@@ -2892,7 +3238,7 @@
|
|
|
2892
3238
|
* Throttle decorator
|
|
2893
3239
|
* @param {Function} fn
|
|
2894
3240
|
* @param {Number} freq
|
|
2895
|
-
* @return {Function}
|
|
3241
|
+
* @return {Array<Function>}
|
|
2896
3242
|
*/
|
|
2897
3243
|
function throttle(fn, freq) {
|
|
2898
3244
|
var timestamp = 0;
|
|
@@ -2930,7 +3276,13 @@
|
|
|
2930
3276
|
var flush = function flush() {
|
|
2931
3277
|
return lastArgs && invoke(lastArgs);
|
|
2932
3278
|
};
|
|
2933
|
-
|
|
3279
|
+
var flushWith = function flushWith() {
|
|
3280
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
3281
|
+
args[_key2] = arguments[_key2];
|
|
3282
|
+
}
|
|
3283
|
+
return invoke(args);
|
|
3284
|
+
};
|
|
3285
|
+
return [throttled, flush, flushWith];
|
|
2934
3286
|
}
|
|
2935
3287
|
|
|
2936
3288
|
var progressEventReducer = function progressEventReducer(listener, isDownloadStream) {
|
|
@@ -2938,12 +3290,12 @@
|
|
|
2938
3290
|
var bytesNotified = 0;
|
|
2939
3291
|
var _speedometer = speedometer(50, 250);
|
|
2940
3292
|
return throttle(function (e) {
|
|
2941
|
-
if (!e ||
|
|
3293
|
+
if (!e || !utils$1.isNumber(e.loaded)) {
|
|
2942
3294
|
return;
|
|
2943
3295
|
}
|
|
2944
3296
|
var rawLoaded = e.loaded;
|
|
2945
3297
|
var total = e.lengthComputable ? e.total : undefined;
|
|
2946
|
-
var loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
|
|
3298
|
+
var loaded = Math.max(0, total != null ? Math.min(rawLoaded, total) : rawLoaded);
|
|
2947
3299
|
var progressBytes = Math.max(0, loaded - bytesNotified);
|
|
2948
3300
|
var rate = _speedometer(progressBytes);
|
|
2949
3301
|
bytesNotified = Math.max(bytesNotified, loaded);
|
|
@@ -2971,11 +3323,12 @@
|
|
|
2971
3323
|
}, throttled[1]];
|
|
2972
3324
|
};
|
|
2973
3325
|
var asyncDecorator = function asyncDecorator(fn) {
|
|
3326
|
+
var scheduler = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : utils$1.asap;
|
|
2974
3327
|
return function () {
|
|
2975
3328
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2976
3329
|
args[_key] = arguments[_key];
|
|
2977
3330
|
}
|
|
2978
|
-
return
|
|
3331
|
+
return scheduler(function () {
|
|
2979
3332
|
return fn.apply(void 0, args);
|
|
2980
3333
|
});
|
|
2981
3334
|
};
|
|
@@ -3073,24 +3426,51 @@
|
|
|
3073
3426
|
* @returns {string} The combined URL
|
|
3074
3427
|
*/
|
|
3075
3428
|
function combineURLs(baseURL, relativeURL) {
|
|
3076
|
-
|
|
3429
|
+
if (!relativeURL) {
|
|
3430
|
+
return baseURL;
|
|
3431
|
+
}
|
|
3432
|
+
var end = baseURL.length;
|
|
3433
|
+
while (end > 0 && baseURL.charCodeAt(end - 1) === 47) {
|
|
3434
|
+
end--;
|
|
3435
|
+
}
|
|
3436
|
+
return baseURL.slice(0, end) + '/' + relativeURL.replace(/^\/+/, '');
|
|
3077
3437
|
}
|
|
3078
3438
|
|
|
3079
3439
|
var malformedHttpProtocol = /^https?:(?!\/\/)/i;
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3440
|
+
|
|
3441
|
+
// Redact the parts of a URL that can carry secrets before it is embedded in an
|
|
3442
|
+
// error message. AxiosError.toJSON() serializes `message` verbatim and errors
|
|
3443
|
+
// are commonly logged, while the opt-in `config.redact` model only cleans
|
|
3444
|
+
// config keys — it cannot reach the message. Redact only the genuinely
|
|
3445
|
+
// sensitive substrings — userinfo (credentials), query parameter values and
|
|
3446
|
+
// fragment contents — with the same REDACTED marker the config redaction uses,
|
|
3447
|
+
// while keeping the scheme, host, path and parameter names so the offending
|
|
3448
|
+
// request stays accurately identifiable.
|
|
3449
|
+
function redactFragment(fragment) {
|
|
3450
|
+
if (!fragment) {
|
|
3451
|
+
return fragment;
|
|
3085
3452
|
}
|
|
3086
|
-
return
|
|
3453
|
+
return fragment.replace(/(^|&)([^=&]*=)?[^&]+/g, function (match, separator) {
|
|
3454
|
+
var parameterName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
3455
|
+
return "".concat(separator).concat(parameterName).concat(REDACTED);
|
|
3456
|
+
});
|
|
3087
3457
|
}
|
|
3088
|
-
function
|
|
3089
|
-
|
|
3458
|
+
function redactSensitiveURLParts(url) {
|
|
3459
|
+
var redactedURL = url.replace(/^(https?:\/{0,2})[^/?#]*@/i, "$1".concat(REDACTED, "@"));
|
|
3460
|
+
var fragmentIndex = redactedURL.indexOf('#');
|
|
3461
|
+
var urlWithoutFragment = fragmentIndex === -1 ? redactedURL : redactedURL.slice(0, fragmentIndex);
|
|
3462
|
+
var redactedURLWithoutFragment = urlWithoutFragment.replace(/([?&][^=&#]*=)[^&#]*/g, "$1".concat(REDACTED));
|
|
3463
|
+
if (fragmentIndex === -1) {
|
|
3464
|
+
return redactedURLWithoutFragment;
|
|
3465
|
+
}
|
|
3466
|
+
return "".concat(redactedURLWithoutFragment, "#").concat(redactFragment(redactedURL.slice(fragmentIndex + 1)));
|
|
3090
3467
|
}
|
|
3091
3468
|
function assertValidHttpProtocolURL(url, config) {
|
|
3092
|
-
if (typeof url === 'string'
|
|
3093
|
-
|
|
3469
|
+
if (typeof url === 'string') {
|
|
3470
|
+
var normalizedURL = normalizeURLForProtocolCheck(url);
|
|
3471
|
+
if (malformedHttpProtocol.test(normalizedURL)) {
|
|
3472
|
+
throw new AxiosError("Invalid URL ".concat(JSON.stringify(redactSensitiveURLParts(normalizedURL)), ": missing \"//\" after protocol"), AxiosError.ERR_INVALID_URL, config);
|
|
3473
|
+
}
|
|
3094
3474
|
}
|
|
3095
3475
|
}
|
|
3096
3476
|
|
|
@@ -3117,6 +3497,14 @@
|
|
|
3117
3497
|
var headersToObject = function headersToObject(thing) {
|
|
3118
3498
|
return thing instanceof AxiosHeaders ? _objectSpread2({}, thing) : thing;
|
|
3119
3499
|
};
|
|
3500
|
+
var ownEnumerableKeys = function ownEnumerableKeys(thing) {
|
|
3501
|
+
if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) {
|
|
3502
|
+
return Object.keys(thing).concat(Object.getOwnPropertySymbols(thing).filter(function (symbol) {
|
|
3503
|
+
return Object.getOwnPropertyDescriptor(thing, symbol).enumerable;
|
|
3504
|
+
}));
|
|
3505
|
+
}
|
|
3506
|
+
return Object.keys(thing);
|
|
3507
|
+
};
|
|
3120
3508
|
|
|
3121
3509
|
/**
|
|
3122
3510
|
* Config-specific merge-function which creates a new config-object
|
|
@@ -3216,7 +3604,7 @@
|
|
|
3216
3604
|
transformResponse: defaultToConfig2,
|
|
3217
3605
|
paramsSerializer: defaultToConfig2,
|
|
3218
3606
|
timeout: defaultToConfig2,
|
|
3219
|
-
|
|
3607
|
+
timeoutErrorMessage: defaultToConfig2,
|
|
3220
3608
|
withCredentials: defaultToConfig2,
|
|
3221
3609
|
withXSRFToken: defaultToConfig2,
|
|
3222
3610
|
adapter: defaultToConfig2,
|
|
@@ -3241,7 +3629,7 @@
|
|
|
3241
3629
|
return mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true);
|
|
3242
3630
|
}
|
|
3243
3631
|
};
|
|
3244
|
-
utils$1.forEach(
|
|
3632
|
+
utils$1.forEach(ownEnumerableKeys(_objectSpread2(_objectSpread2({}, config1), config2)), function computeConfigValue(prop) {
|
|
3245
3633
|
if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;
|
|
3246
3634
|
var merge = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
|
|
3247
3635
|
var a = utils$1.hasOwnProp(config1, prop) ? config1[prop] : undefined;
|
|
@@ -3260,6 +3648,18 @@
|
|
|
3260
3648
|
}
|
|
3261
3649
|
|
|
3262
3650
|
var FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];
|
|
3651
|
+
|
|
3652
|
+
/**
|
|
3653
|
+
* Apply the headers generated by a FormData implementation to the request headers,
|
|
3654
|
+
* honoring the `formDataHeaderPolicy` option: with 'content-only', copy only the
|
|
3655
|
+
* content-* headers; otherwise merge all of them.
|
|
3656
|
+
*
|
|
3657
|
+
* @param {AxiosHeaders} headers - the request headers to mutate
|
|
3658
|
+
* @param {Object | null | undefined} formHeaders - headers produced by the FormData implementation
|
|
3659
|
+
* @param {String} [policy] - the resolved `formDataHeaderPolicy` config value
|
|
3660
|
+
*
|
|
3661
|
+
* @returns {void}
|
|
3662
|
+
*/
|
|
3263
3663
|
function setFormDataHeaders(headers, formHeaders, policy) {
|
|
3264
3664
|
if (policy !== 'content-only') {
|
|
3265
3665
|
headers.set(formHeaders);
|
|
@@ -3319,11 +3719,12 @@
|
|
|
3319
3719
|
}
|
|
3320
3720
|
}
|
|
3321
3721
|
if (utils$1.isFormData(data)) {
|
|
3722
|
+
var getHeaders = utils$1.getSafeProp(data, 'getHeaders');
|
|
3322
3723
|
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv || utils$1.isReactNative(data)) {
|
|
3323
3724
|
headers.setContentType(undefined); // browser/web worker/RN handles it
|
|
3324
|
-
} else if (utils$1.isFunction(
|
|
3725
|
+
} else if (utils$1.isFunction(getHeaders)) {
|
|
3325
3726
|
// Node.js FormData (like form-data package)
|
|
3326
|
-
setFormDataHeaders(headers,
|
|
3727
|
+
setFormDataHeaders(headers, getHeaders.call(data), own('formDataHeaderPolicy'));
|
|
3327
3728
|
}
|
|
3328
3729
|
}
|
|
3329
3730
|
|
|
@@ -3361,7 +3762,7 @@
|
|
|
3361
3762
|
onDownloadProgress = _config.onDownloadProgress;
|
|
3362
3763
|
var onCanceled;
|
|
3363
3764
|
var uploadThrottled, downloadThrottled;
|
|
3364
|
-
var flushUpload, flushDownload;
|
|
3765
|
+
var flushUpload, flushDownload, flushDownloadWithEvent;
|
|
3365
3766
|
function done() {
|
|
3366
3767
|
flushUpload && flushUpload(); // flush events
|
|
3367
3768
|
flushDownload && flushDownload(); // flush events
|
|
@@ -3374,10 +3775,50 @@
|
|
|
3374
3775
|
|
|
3375
3776
|
// Set the request timeout in MS
|
|
3376
3777
|
request.timeout = _config.timeout;
|
|
3377
|
-
function onloadend() {
|
|
3778
|
+
function onloadend(event) {
|
|
3779
|
+
if (!request) {
|
|
3780
|
+
return;
|
|
3781
|
+
}
|
|
3782
|
+
|
|
3783
|
+
// Status 0 means no response was received, which onerror and onabort normally
|
|
3784
|
+
// reject before this runs. Firefox 152 fires only readystatechange and loadend for
|
|
3785
|
+
// navigation-canceled requests (https://bugzilla.mozilla.org/show_bug.cgi?id=1505389),
|
|
3786
|
+
// leaving settle() to resolve them as an empty success. ECONNABORTED is the error
|
|
3787
|
+
// onabort raised on Firefox 151. Reads over file:, which some environments report as
|
|
3788
|
+
// status 0 on success, are excluded by the request URL's scheme after browser-style
|
|
3789
|
+
// preprocessing, by the page origin's scheme for relative URLs (which inherit it), or
|
|
3790
|
+
// by responseURL where implemented.
|
|
3791
|
+
if (request.status === 0 && (parseProtocol(normalizeURLForProtocolCheck(_config.url)) || parseProtocol(platform.origin)) !== 'file' && !(request.responseURL && request.responseURL.startsWith('file:'))) {
|
|
3792
|
+
reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
|
|
3793
|
+
done();
|
|
3794
|
+
|
|
3795
|
+
// Clean up request
|
|
3796
|
+
request = null;
|
|
3797
|
+
return;
|
|
3798
|
+
}
|
|
3799
|
+
|
|
3800
|
+
// When loadend is still dispatching, flushing with it gives progress
|
|
3801
|
+
// listeners a final delivery whose event has a live target. The legacy
|
|
3802
|
+
// ready-state fallback has no event, so replay its pending progress.
|
|
3803
|
+
// A throwing listener must not block settlement; rethrow asynchronously,
|
|
3804
|
+
// matching how listener errors surface on the throttle timer path.
|
|
3805
|
+
try {
|
|
3806
|
+
if (event) {
|
|
3807
|
+
flushDownloadWithEvent && flushDownloadWithEvent(event);
|
|
3808
|
+
} else {
|
|
3809
|
+
flushDownload && flushDownload();
|
|
3810
|
+
}
|
|
3811
|
+
} catch (err) {
|
|
3812
|
+
setTimeout(function () {
|
|
3813
|
+
throw err;
|
|
3814
|
+
});
|
|
3815
|
+
}
|
|
3816
|
+
|
|
3817
|
+
// A final progress callback can cancel the request synchronously.
|
|
3378
3818
|
if (!request) {
|
|
3379
3819
|
return;
|
|
3380
3820
|
}
|
|
3821
|
+
|
|
3381
3822
|
// Prepare the response
|
|
3382
3823
|
var responseHeaders = AxiosHeaders.from('getAllResponseHeaders' in request && request.getAllResponseHeaders());
|
|
3383
3824
|
var responseData = !responseType || responseType === 'text' || responseType === 'json' ? request.responseText : request.response;
|
|
@@ -3486,9 +3927,10 @@
|
|
|
3486
3927
|
// Handle progress if needed
|
|
3487
3928
|
if (onDownloadProgress) {
|
|
3488
3929
|
var _progressEventReducer = progressEventReducer(onDownloadProgress, true);
|
|
3489
|
-
var _progressEventReducer2 = _slicedToArray(_progressEventReducer,
|
|
3930
|
+
var _progressEventReducer2 = _slicedToArray(_progressEventReducer, 3);
|
|
3490
3931
|
downloadThrottled = _progressEventReducer2[0];
|
|
3491
3932
|
flushDownload = _progressEventReducer2[1];
|
|
3933
|
+
flushDownloadWithEvent = _progressEventReducer2[2];
|
|
3492
3934
|
request.addEventListener('progress', downloadThrottled);
|
|
3493
3935
|
}
|
|
3494
3936
|
|
|
@@ -3561,7 +4003,14 @@
|
|
|
3561
4003
|
signals = null;
|
|
3562
4004
|
};
|
|
3563
4005
|
signals.forEach(function (signal) {
|
|
3564
|
-
|
|
4006
|
+
if (aborted) {
|
|
4007
|
+
return;
|
|
4008
|
+
}
|
|
4009
|
+
if (signal.aborted) {
|
|
4010
|
+
onabort.call(signal);
|
|
4011
|
+
return;
|
|
4012
|
+
}
|
|
4013
|
+
signal.addEventListener('abort', onabort, {
|
|
3565
4014
|
once: true
|
|
3566
4015
|
});
|
|
3567
4016
|
});
|
|
@@ -3776,13 +4225,11 @@
|
|
|
3776
4225
|
};
|
|
3777
4226
|
|
|
3778
4227
|
/**
|
|
3779
|
-
* Estimate
|
|
3780
|
-
* -
|
|
3781
|
-
*
|
|
3782
|
-
*
|
|
3783
|
-
*
|
|
3784
|
-
* @param {string} url
|
|
3785
|
-
* @returns {number}
|
|
4228
|
+
* Estimate data: URL byte lengths *without* allocating large buffers.
|
|
4229
|
+
* - Fetch percent-decodes a base64 body before decoding it.
|
|
4230
|
+
* - Node's Buffer.from(body, 'base64') sizes its backing allocation from the
|
|
4231
|
+
* raw body, including ignored characters and content after padding.
|
|
4232
|
+
* - Non-base64 data is percent-decoded and then encoded as UTF-8.
|
|
3786
4233
|
*/
|
|
3787
4234
|
var isHexDigit = function isHexDigit(charCode) {
|
|
3788
4235
|
return charCode >= 48 && charCode <= 57 || charCode >= 65 && charCode <= 70 || charCode >= 97 && charCode <= 102;
|
|
@@ -3790,7 +4237,80 @@
|
|
|
3790
4237
|
var isPercentEncodedByte = function isPercentEncodedByte(str, i, len) {
|
|
3791
4238
|
return i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2));
|
|
3792
4239
|
};
|
|
3793
|
-
function
|
|
4240
|
+
var hexValue = function hexValue(charCode) {
|
|
4241
|
+
return charCode <= 57 ? charCode - 48 : (charCode & 0xdf) - 55;
|
|
4242
|
+
};
|
|
4243
|
+
var isBase64Char = function isBase64Char(charCode) {
|
|
4244
|
+
return charCode >= 65 && charCode <= 90 ||
|
|
4245
|
+
// A-Z
|
|
4246
|
+
charCode >= 97 && charCode <= 122 ||
|
|
4247
|
+
// a-z
|
|
4248
|
+
charCode >= 48 && charCode <= 57 ||
|
|
4249
|
+
// 0-9
|
|
4250
|
+
charCode === 43 ||
|
|
4251
|
+
// +
|
|
4252
|
+
charCode === 47 ||
|
|
4253
|
+
// /
|
|
4254
|
+
charCode === 45 ||
|
|
4255
|
+
// - (base64url)
|
|
4256
|
+
charCode === 95;
|
|
4257
|
+
}; // _ (base64url)
|
|
4258
|
+
|
|
4259
|
+
var isBase64Whitespace = function isBase64Whitespace(charCode) {
|
|
4260
|
+
return charCode === 9 || charCode === 10 || charCode === 12 || charCode === 13 || charCode === 32;
|
|
4261
|
+
};
|
|
4262
|
+
var base64Bytes = function base64Bytes(significant) {
|
|
4263
|
+
var groups = Math.floor(significant / 4);
|
|
4264
|
+
var remainder = significant % 4;
|
|
4265
|
+
return groups * 3 + (remainder === 2 ? 1 : remainder === 3 ? 2 : 0);
|
|
4266
|
+
};
|
|
4267
|
+
|
|
4268
|
+
// Buffer.byteLength(body, 'base64') uses the raw string length as an allocation
|
|
4269
|
+
// upper bound even when Buffer.from later ignores characters or stops at '='.
|
|
4270
|
+
var estimateBase64BufferAllocation = function estimateBase64BufferAllocation(body) {
|
|
4271
|
+
var len = body.length;
|
|
4272
|
+
var padding = 0;
|
|
4273
|
+
if (len > 0 && body.charCodeAt(len - 1) === 61 /* '=' */) {
|
|
4274
|
+
padding++;
|
|
4275
|
+
if (len > 1 && body.charCodeAt(len - 2) === 61 /* '=' */) {
|
|
4276
|
+
padding++;
|
|
4277
|
+
}
|
|
4278
|
+
}
|
|
4279
|
+
return Math.floor((len - padding) * 3 / 4);
|
|
4280
|
+
};
|
|
4281
|
+
var estimatePercentDecodedBase64Bytes = function estimatePercentDecodedBase64Bytes(body) {
|
|
4282
|
+
var len = body.length;
|
|
4283
|
+
var significant = 0;
|
|
4284
|
+
var padding = 0;
|
|
4285
|
+
var invalid = false;
|
|
4286
|
+
for (var i = 0; i < len; i++) {
|
|
4287
|
+
var code = body.charCodeAt(i);
|
|
4288
|
+
if (code === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) {
|
|
4289
|
+
code = hexValue(body.charCodeAt(i + 1)) * 16 + hexValue(body.charCodeAt(i + 2));
|
|
4290
|
+
i += 2;
|
|
4291
|
+
}
|
|
4292
|
+
if (isBase64Whitespace(code)) {
|
|
4293
|
+
continue;
|
|
4294
|
+
}
|
|
4295
|
+
if (code === 61 /* '=' */) {
|
|
4296
|
+
padding++;
|
|
4297
|
+
continue;
|
|
4298
|
+
}
|
|
4299
|
+
if (!isBase64Char(code) || padding > 0) {
|
|
4300
|
+
invalid = true;
|
|
4301
|
+
continue;
|
|
4302
|
+
}
|
|
4303
|
+
significant++;
|
|
4304
|
+
}
|
|
4305
|
+
|
|
4306
|
+
// Fetch rejects malformed forgiving-base64 input. Returning the raw-size
|
|
4307
|
+
// allocation bound keeps that invalid input from becoming a pre-check bypass.
|
|
4308
|
+
if (invalid || padding > 2 || padding > 0 && (significant + padding) % 4 !== 0 || significant % 4 === 1) {
|
|
4309
|
+
return estimateBase64BufferAllocation(body);
|
|
4310
|
+
}
|
|
4311
|
+
return base64Bytes(significant);
|
|
4312
|
+
};
|
|
4313
|
+
var estimateDataURLBytes = function estimateDataURLBytes(url, estimateBase64) {
|
|
3794
4314
|
if (!url || typeof url !== 'string') return 0;
|
|
3795
4315
|
if (!url.startsWith('data:')) return 0;
|
|
3796
4316
|
var comma = url.indexOf(',');
|
|
@@ -3799,49 +4319,7 @@
|
|
|
3799
4319
|
var body = url.slice(comma + 1);
|
|
3800
4320
|
var isBase64 = /;base64/i.test(meta);
|
|
3801
4321
|
if (isBase64) {
|
|
3802
|
-
|
|
3803
|
-
var len = body.length; // cache length
|
|
3804
|
-
|
|
3805
|
-
for (var i = 0; i < len; i++) {
|
|
3806
|
-
if (body.charCodeAt(i) === 37 /* '%' */ && i + 2 < len) {
|
|
3807
|
-
var a = body.charCodeAt(i + 1);
|
|
3808
|
-
var b = body.charCodeAt(i + 2);
|
|
3809
|
-
var isHex = isHexDigit(a) && isHexDigit(b);
|
|
3810
|
-
if (isHex) {
|
|
3811
|
-
effectiveLen -= 2;
|
|
3812
|
-
i += 2;
|
|
3813
|
-
}
|
|
3814
|
-
}
|
|
3815
|
-
}
|
|
3816
|
-
var pad = 0;
|
|
3817
|
-
var idx = len - 1;
|
|
3818
|
-
var tailIsPct3D = function tailIsPct3D(j) {
|
|
3819
|
-
return j >= 2 && body.charCodeAt(j - 2) === 37 &&
|
|
3820
|
-
// '%'
|
|
3821
|
-
body.charCodeAt(j - 1) === 51 && (
|
|
3822
|
-
// '3'
|
|
3823
|
-
body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100);
|
|
3824
|
-
}; // 'D' or 'd'
|
|
3825
|
-
|
|
3826
|
-
if (idx >= 0) {
|
|
3827
|
-
if (body.charCodeAt(idx) === 61 /* '=' */) {
|
|
3828
|
-
pad++;
|
|
3829
|
-
idx--;
|
|
3830
|
-
} else if (tailIsPct3D(idx)) {
|
|
3831
|
-
pad++;
|
|
3832
|
-
idx -= 3;
|
|
3833
|
-
}
|
|
3834
|
-
}
|
|
3835
|
-
if (pad === 1 && idx >= 0) {
|
|
3836
|
-
if (body.charCodeAt(idx) === 61 /* '=' */) {
|
|
3837
|
-
pad++;
|
|
3838
|
-
} else if (tailIsPct3D(idx)) {
|
|
3839
|
-
pad++;
|
|
3840
|
-
}
|
|
3841
|
-
}
|
|
3842
|
-
var groups = Math.floor(effectiveLen / 4);
|
|
3843
|
-
var _bytes = groups * 3 - (pad || 0);
|
|
3844
|
-
return _bytes > 0 ? _bytes : 0;
|
|
4322
|
+
return estimateBase64(body);
|
|
3845
4323
|
}
|
|
3846
4324
|
|
|
3847
4325
|
// Compute UTF-8 byte length directly from UTF-16 code units without allocating
|
|
@@ -3849,20 +4327,20 @@
|
|
|
3849
4327
|
// Valid %XX triplets count as one decoded byte; this matches the bytes that
|
|
3850
4328
|
// decodeURIComponent(body) would produce before Buffer re-encodes the string.
|
|
3851
4329
|
var bytes = 0;
|
|
3852
|
-
for (var
|
|
3853
|
-
var c = body.charCodeAt(
|
|
3854
|
-
if (c === 37 /* '%' */ && isPercentEncodedByte(body,
|
|
4330
|
+
for (var i = 0, len = body.length; i < len; i++) {
|
|
4331
|
+
var c = body.charCodeAt(i);
|
|
4332
|
+
if (c === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) {
|
|
3855
4333
|
bytes += 1;
|
|
3856
|
-
|
|
4334
|
+
i += 2;
|
|
3857
4335
|
} else if (c < 0x80) {
|
|
3858
4336
|
bytes += 1;
|
|
3859
4337
|
} else if (c < 0x800) {
|
|
3860
4338
|
bytes += 2;
|
|
3861
|
-
} else if (c >= 0xd800 && c <= 0xdbff &&
|
|
3862
|
-
var next = body.charCodeAt(
|
|
4339
|
+
} else if (c >= 0xd800 && c <= 0xdbff && i + 1 < len) {
|
|
4340
|
+
var next = body.charCodeAt(i + 1);
|
|
3863
4341
|
if (next >= 0xdc00 && next <= 0xdfff) {
|
|
3864
4342
|
bytes += 4;
|
|
3865
|
-
|
|
4343
|
+
i++;
|
|
3866
4344
|
} else {
|
|
3867
4345
|
bytes += 3;
|
|
3868
4346
|
}
|
|
@@ -3871,11 +4349,34 @@
|
|
|
3871
4349
|
}
|
|
3872
4350
|
}
|
|
3873
4351
|
return bytes;
|
|
4352
|
+
};
|
|
4353
|
+
|
|
4354
|
+
/**
|
|
4355
|
+
* Estimate the percent-decoded payload size used by Fetch data: URLs.
|
|
4356
|
+
*
|
|
4357
|
+
* @param {string} url
|
|
4358
|
+
* @returns {number}
|
|
4359
|
+
*/
|
|
4360
|
+
function estimateDataURLDecodedBytes(url) {
|
|
4361
|
+
// Fetch removes URL fragments before processing a data: URL.
|
|
4362
|
+
var fragmentIndex = typeof url === 'string' ? url.indexOf('#') : -1;
|
|
4363
|
+
return estimateDataURLBytes(fragmentIndex === -1 ? url : url.slice(0, fragmentIndex), estimatePercentDecodedBase64Bytes);
|
|
3874
4364
|
}
|
|
3875
4365
|
|
|
3876
|
-
var VERSION = "1.
|
|
4366
|
+
var VERSION = "1.20.0";
|
|
3877
4367
|
|
|
3878
4368
|
var DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
4369
|
+
var DEFAULT_REQUEST_OPTIONS = {
|
|
4370
|
+
cache: 'default',
|
|
4371
|
+
redirect: 'follow',
|
|
4372
|
+
referrer: 'about:client',
|
|
4373
|
+
referrerPolicy: '',
|
|
4374
|
+
mode: 'cors',
|
|
4375
|
+
integrity: '',
|
|
4376
|
+
keepalive: false,
|
|
4377
|
+
priority: 'auto',
|
|
4378
|
+
window: null
|
|
4379
|
+
};
|
|
3879
4380
|
var isFunction = utils$1.isFunction;
|
|
3880
4381
|
|
|
3881
4382
|
/**
|
|
@@ -4077,11 +4578,11 @@
|
|
|
4077
4578
|
}();
|
|
4078
4579
|
return /*#__PURE__*/function () {
|
|
4079
4580
|
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(config) {
|
|
4080
|
-
var _resolveConfig, url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, _resolveConfig$withCr, withCredentials, fetchOptions, maxContentLength, maxBodyLength, hasMaxContentLength, hasMaxBodyLength, own, _fetch, composedSignal, request, unsubscribe, requestContentLength, pendingBodyError, maxBodyLengthError, auth, configAuth, username, password, parsedURL, urlUsername, urlPassword, estimated, outboundLength, mustEnforceStreamBody, trackRequestStream, _request, contentTypeHeader, _ref5, _ref6, onProgress, flush, isCredentialsSupported, contentType, resolvedOptions, response, responseHeaders, declaredLength, isStreamResponse, options, responseContentLength, _ref7, _ref8, _onProgress, _flush, bytesRead, onChunkProgress, responseData, materializedSize, canceledError, networkError, _t3, _t4;
|
|
4581
|
+
var _resolveConfig, url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, _resolveConfig$withCr, withCredentials, fetchOptions, maxContentLength, maxBodyLength, maxRedirects, hasMaxContentLength, hasMaxBodyLength, own, _fetch, composedSignal, request, unsubscribe, requestContentLength, pendingBodyError, maxBodyLengthError, auth, configAuth, username, password, parsedURL, urlUsername, urlPassword, estimated, outboundLength, mustEnforceStreamBody, trackRequestStream, _request, contentTypeHeader, _ref5, _ref6, onProgress, flush, isCredentialsSupported, contentType, safeFetchOptions, resolvedOptions, response, responseHeaders, declaredLength, isStreamResponse, options, responseContentLength, _ref7, _ref8, _onProgress, _flush, bytesRead, onChunkProgress, responseData, materializedSize, canceledError, networkError, _t3, _t4;
|
|
4081
4582
|
return _regenerator().w(function (_context4) {
|
|
4082
4583
|
while (1) switch (_context4.p = _context4.n) {
|
|
4083
4584
|
case 0:
|
|
4084
|
-
_resolveConfig = resolveConfig(config), url = _resolveConfig.url, method = _resolveConfig.method, data = _resolveConfig.data, signal = _resolveConfig.signal, cancelToken = _resolveConfig.cancelToken, timeout = _resolveConfig.timeout, onDownloadProgress = _resolveConfig.onDownloadProgress, onUploadProgress = _resolveConfig.onUploadProgress, responseType = _resolveConfig.responseType, headers = _resolveConfig.headers, _resolveConfig$withCr = _resolveConfig.withCredentials, withCredentials = _resolveConfig$withCr === void 0 ? 'same-origin' : _resolveConfig$withCr, fetchOptions = _resolveConfig.fetchOptions, maxContentLength = _resolveConfig.maxContentLength, maxBodyLength = _resolveConfig.maxBodyLength;
|
|
4585
|
+
_resolveConfig = resolveConfig(config), url = _resolveConfig.url, method = _resolveConfig.method, data = _resolveConfig.data, signal = _resolveConfig.signal, cancelToken = _resolveConfig.cancelToken, timeout = _resolveConfig.timeout, onDownloadProgress = _resolveConfig.onDownloadProgress, onUploadProgress = _resolveConfig.onUploadProgress, responseType = _resolveConfig.responseType, headers = _resolveConfig.headers, _resolveConfig$withCr = _resolveConfig.withCredentials, withCredentials = _resolveConfig$withCr === void 0 ? 'same-origin' : _resolveConfig$withCr, fetchOptions = _resolveConfig.fetchOptions, maxContentLength = _resolveConfig.maxContentLength, maxBodyLength = _resolveConfig.maxBodyLength, maxRedirects = _resolveConfig.maxRedirects;
|
|
4085
4586
|
hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1;
|
|
4086
4587
|
hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1;
|
|
4087
4588
|
own = function own(key) {
|
|
@@ -4247,7 +4748,18 @@
|
|
|
4247
4748
|
|
|
4248
4749
|
// Set User-Agent header if not already set (fetch defaults to 'node' in Node.js)
|
|
4249
4750
|
headers.set('User-Agent', 'axios/' + VERSION, false);
|
|
4250
|
-
|
|
4751
|
+
safeFetchOptions = fetchOptions == null ? fetchOptions : Object.assign(Object.create(null), fetchOptions);
|
|
4752
|
+
if (safeFetchOptions) {
|
|
4753
|
+
// These options are owned by Axios and are already reflected in the
|
|
4754
|
+
// resolved Request passed to fetch.
|
|
4755
|
+
delete safeFetchOptions.body;
|
|
4756
|
+
delete safeFetchOptions.headers;
|
|
4757
|
+
delete safeFetchOptions.method;
|
|
4758
|
+
delete safeFetchOptions.signal;
|
|
4759
|
+
delete safeFetchOptions.duplex;
|
|
4760
|
+
delete safeFetchOptions.credentials;
|
|
4761
|
+
}
|
|
4762
|
+
resolvedOptions = Object.assign(Object.create(null), safeFetchOptions, {
|
|
4251
4763
|
signal: composedSignal,
|
|
4252
4764
|
method: method.toUpperCase(),
|
|
4253
4765
|
headers: toByteStringHeaderObject(headers.normalize()),
|
|
@@ -4255,9 +4767,28 @@
|
|
|
4255
4767
|
duplex: 'half',
|
|
4256
4768
|
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
4257
4769
|
});
|
|
4770
|
+
if (isRequestSupported) {
|
|
4771
|
+
utils$1.forEach(DEFAULT_REQUEST_OPTIONS, function (value, key) {
|
|
4772
|
+
if (resolvedOptions[key] === undefined) {
|
|
4773
|
+
resolvedOptions[key] = value;
|
|
4774
|
+
}
|
|
4775
|
+
});
|
|
4776
|
+
if (resolvedOptions.signal === undefined) {
|
|
4777
|
+
resolvedOptions.signal = null;
|
|
4778
|
+
}
|
|
4779
|
+
if (resolvedOptions.body === undefined) {
|
|
4780
|
+
resolvedOptions.body = null;
|
|
4781
|
+
}
|
|
4782
|
+
}
|
|
4783
|
+
if (maxRedirects === 0) {
|
|
4784
|
+
resolvedOptions.redirect = 'manual';
|
|
4785
|
+
if (safeFetchOptions) {
|
|
4786
|
+
safeFetchOptions.redirect = 'manual';
|
|
4787
|
+
}
|
|
4788
|
+
}
|
|
4258
4789
|
request = isRequestSupported && new Request(url, resolvedOptions);
|
|
4259
4790
|
_context4.n = 11;
|
|
4260
|
-
return isRequestSupported ? _fetch(request,
|
|
4791
|
+
return isRequestSupported ? _fetch(request, safeFetchOptions) : _fetch(url, resolvedOptions);
|
|
4261
4792
|
case 11:
|
|
4262
4793
|
response = _context4.v;
|
|
4263
4794
|
responseHeaders = AxiosHeaders.from(response.headers); // Cheap pre-check: if the server honestly declares a content-length that
|
|
@@ -4565,9 +5096,13 @@
|
|
|
4565
5096
|
*
|
|
4566
5097
|
* @returns {Promise} The Promise to be fulfilled
|
|
4567
5098
|
*/
|
|
4568
|
-
function dispatchRequest(
|
|
5099
|
+
function dispatchRequest(_config) {
|
|
5100
|
+
// Interceptors may replace the merged config with an ordinary object. Flatten
|
|
5101
|
+
// it at the dispatch boundary so shared prototype members cannot become
|
|
5102
|
+
// request behavior, while preserving intentional template/class members.
|
|
5103
|
+
var config = utils$1.toSafeFlatObject(_config);
|
|
4569
5104
|
throwIfCancellationRequested(config);
|
|
4570
|
-
config.headers = AxiosHeaders.from(config
|
|
5105
|
+
config.headers = AxiosHeaders.from(utils$1.getSafeProp(config, 'headers'));
|
|
4571
5106
|
|
|
4572
5107
|
// Transform request data
|
|
4573
5108
|
config.data = transformData.call(config, config.transformRequest);
|
|
@@ -4723,7 +5258,7 @@
|
|
|
4723
5258
|
key: "request",
|
|
4724
5259
|
value: (function () {
|
|
4725
5260
|
var _request2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(configOrUrl, config) {
|
|
4726
|
-
var dummy, stack, firstNewlineIndex, secondNewlineIndex, stackWithoutTwoTopLines, _t;
|
|
5261
|
+
var dummy, dummyStack, stack, firstNewlineIndex, _firstNewlineIndex, secondNewlineIndex, stackWithoutTwoTopLines, _t;
|
|
4727
5262
|
return _regenerator().w(function (_context) {
|
|
4728
5263
|
while (1) switch (_context.p = _context.n) {
|
|
4729
5264
|
case 0:
|
|
@@ -4736,31 +5271,28 @@
|
|
|
4736
5271
|
_context.p = 2;
|
|
4737
5272
|
_t = _context.v;
|
|
4738
5273
|
if (_t instanceof Error) {
|
|
4739
|
-
dummy = {};
|
|
4740
|
-
Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
|
|
4741
|
-
|
|
4742
|
-
// slice off the Error: ... line
|
|
4743
|
-
stack = function () {
|
|
4744
|
-
if (!dummy.stack) {
|
|
4745
|
-
return '';
|
|
4746
|
-
}
|
|
4747
|
-
var firstNewlineIndex = dummy.stack.indexOf('\n');
|
|
4748
|
-
return firstNewlineIndex === -1 ? '' : dummy.stack.slice(firstNewlineIndex + 1);
|
|
4749
|
-
}();
|
|
4750
5274
|
try {
|
|
5275
|
+
dummy = {};
|
|
5276
|
+
Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
|
|
5277
|
+
dummyStack = dummy.stack;
|
|
5278
|
+
stack = ''; // slice off the Error: ... line
|
|
5279
|
+
if (typeof dummyStack === 'string') {
|
|
5280
|
+
firstNewlineIndex = dummyStack.indexOf('\n');
|
|
5281
|
+
stack = firstNewlineIndex === -1 ? '' : dummyStack.slice(firstNewlineIndex + 1);
|
|
5282
|
+
}
|
|
4751
5283
|
if (!_t.stack) {
|
|
4752
5284
|
_t.stack = stack;
|
|
4753
5285
|
// match without the 2 top stack lines
|
|
4754
5286
|
} else if (stack) {
|
|
4755
|
-
|
|
4756
|
-
secondNewlineIndex =
|
|
5287
|
+
_firstNewlineIndex = stack.indexOf('\n');
|
|
5288
|
+
secondNewlineIndex = _firstNewlineIndex === -1 ? -1 : stack.indexOf('\n', _firstNewlineIndex + 1);
|
|
4757
5289
|
stackWithoutTwoTopLines = secondNewlineIndex === -1 ? '' : stack.slice(secondNewlineIndex + 1);
|
|
4758
5290
|
if (!String(_t.stack).endsWith(stackWithoutTwoTopLines)) {
|
|
4759
5291
|
_t.stack += '\n' + stack;
|
|
4760
5292
|
}
|
|
4761
5293
|
}
|
|
4762
5294
|
} catch (e) {
|
|
4763
|
-
//
|
|
5295
|
+
// Ignore failures from custom stack hooks or un-writable stack properties.
|
|
4764
5296
|
}
|
|
4765
5297
|
}
|
|
4766
5298
|
throw _t;
|
|
@@ -4777,6 +5309,7 @@
|
|
|
4777
5309
|
}, {
|
|
4778
5310
|
key: "_request",
|
|
4779
5311
|
value: function _request(configOrUrl, config) {
|
|
5312
|
+
var _this = this;
|
|
4780
5313
|
/*eslint no-param-reassign:0*/
|
|
4781
5314
|
// Allow for axios('example/url'[, config]) a la fetch API
|
|
4782
5315
|
if (typeof configOrUrl === 'string') {
|
|
@@ -4825,11 +5358,11 @@
|
|
|
4825
5358
|
}, true);
|
|
4826
5359
|
|
|
4827
5360
|
// Set config.method
|
|
4828
|
-
config.method = (config
|
|
5361
|
+
config.method = (utils$1.getSafeProp(config, 'method') || utils$1.getSafeProp(this.defaults, 'method') || 'get').toLowerCase();
|
|
4829
5362
|
|
|
4830
5363
|
// Flatten headers
|
|
4831
5364
|
var contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
|
|
4832
|
-
headers && utils$1.forEach(
|
|
5365
|
+
headers && utils$1.forEach(methodList.concat('common'), function (method) {
|
|
4833
5366
|
delete headers[method];
|
|
4834
5367
|
});
|
|
4835
5368
|
config.headers = AxiosHeaders.concat(contextHeaders, headers);
|
|
@@ -4874,16 +5407,31 @@
|
|
|
4874
5407
|
var onFulfilled = requestInterceptorChain[i++];
|
|
4875
5408
|
var onRejected = requestInterceptorChain[i++];
|
|
4876
5409
|
try {
|
|
4877
|
-
newConfig = onFulfilled(newConfig);
|
|
5410
|
+
newConfig = onFulfilled ? onFulfilled(newConfig) : newConfig;
|
|
4878
5411
|
} catch (error) {
|
|
4879
|
-
onRejected
|
|
5412
|
+
if (!onRejected) {
|
|
5413
|
+
promise = Promise.reject(error);
|
|
5414
|
+
break;
|
|
5415
|
+
}
|
|
5416
|
+
try {
|
|
5417
|
+
var rejectedResult = onRejected.call(this, error);
|
|
5418
|
+
if (utils$1.isThenable(rejectedResult)) {
|
|
5419
|
+
promise = Promise.resolve(rejectedResult).then(function () {
|
|
5420
|
+
return dispatchRequest.call(_this, newConfig);
|
|
5421
|
+
});
|
|
5422
|
+
}
|
|
5423
|
+
} catch (rejectedError) {
|
|
5424
|
+
promise = Promise.reject(rejectedError);
|
|
5425
|
+
}
|
|
4880
5426
|
break;
|
|
4881
5427
|
}
|
|
4882
5428
|
}
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
5429
|
+
if (!promise) {
|
|
5430
|
+
try {
|
|
5431
|
+
promise = dispatchRequest.call(this, newConfig);
|
|
5432
|
+
} catch (error) {
|
|
5433
|
+
promise = Promise.reject(error);
|
|
5434
|
+
}
|
|
4887
5435
|
}
|
|
4888
5436
|
i = 0;
|
|
4889
5437
|
len = responseInterceptorChain.length;
|
|
@@ -5136,14 +5684,22 @@
|
|
|
5136
5684
|
Gone: 410,
|
|
5137
5685
|
LengthRequired: 411,
|
|
5138
5686
|
PreconditionFailed: 412,
|
|
5687
|
+
/**
|
|
5688
|
+
* @deprecated Use `ContentTooLarge` instead.
|
|
5689
|
+
*/
|
|
5139
5690
|
PayloadTooLarge: 413,
|
|
5691
|
+
ContentTooLarge: 413,
|
|
5140
5692
|
UriTooLong: 414,
|
|
5141
5693
|
UnsupportedMediaType: 415,
|
|
5142
5694
|
RangeNotSatisfiable: 416,
|
|
5143
5695
|
ExpectationFailed: 417,
|
|
5144
5696
|
ImATeapot: 418,
|
|
5145
5697
|
MisdirectedRequest: 421,
|
|
5698
|
+
/**
|
|
5699
|
+
* @deprecated Use `UnprocessableContent` instead.
|
|
5700
|
+
*/
|
|
5146
5701
|
UnprocessableEntity: 422,
|
|
5702
|
+
UnprocessableContent: 422,
|
|
5147
5703
|
Locked: 423,
|
|
5148
5704
|
FailedDependency: 424,
|
|
5149
5705
|
TooEarly: 425,
|
|
@@ -5163,6 +5719,7 @@
|
|
|
5163
5719
|
LoopDetected: 508,
|
|
5164
5720
|
NotExtended: 510,
|
|
5165
5721
|
NetworkAuthenticationRequired: 511,
|
|
5722
|
+
WebServerReturnsAnUnknownError: 520,
|
|
5166
5723
|
WebServerIsDown: 521,
|
|
5167
5724
|
ConnectionTimedOut: 522,
|
|
5168
5725
|
OriginIsUnreachable: 523,
|
|
@@ -5174,7 +5731,9 @@
|
|
|
5174
5731
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
5175
5732
|
key = _ref2[0],
|
|
5176
5733
|
value = _ref2[1];
|
|
5177
|
-
HttpStatusCode[value]
|
|
5734
|
+
if (HttpStatusCode[value] === undefined) {
|
|
5735
|
+
HttpStatusCode[value] = key;
|
|
5736
|
+
}
|
|
5178
5737
|
});
|
|
5179
5738
|
|
|
5180
5739
|
/**
|
|
@@ -5246,4 +5805,3 @@
|
|
|
5246
5805
|
return axios;
|
|
5247
5806
|
|
|
5248
5807
|
}));
|
|
5249
|
-
//# sourceMappingURL=axios.js.map
|