@verdocs/web-sdk 2.2.47 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{TemplateStore-d9936a68.js → TemplateStore-6110ad1f.js} +1 -1
- package/dist/cjs/{Types-ee5afdf8.js → Types-fb95ed6b.js} +2 -1
- package/dist/cjs/{VerdocsEndpoint-2d85658d.js → VerdocsEndpoint-6441c5c0.js} +286 -425
- package/dist/cjs/{_commonjsHelpers-0c557e26.js → _commonjsHelpers-1fbbf0eb.js} +0 -5
- package/dist/cjs/interact.min-7c05ff8a.js +12 -0
- package/dist/cjs/ipc-test.cjs.entry.js +2 -2
- package/dist/cjs/{utils-2ddfdf9e.js → utils-a3f0b70a.js} +2 -2
- package/dist/cjs/verdocs-activity-box.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-auth.cjs.entry.js +5 -8
- package/dist/cjs/verdocs-build.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-button-panel_2.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-field-attachment.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-field-date.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-field-initial.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-field-payment.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-field-signature.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-field-textarea.cjs.entry.js +7 -7
- package/dist/cjs/verdocs-field-textbox.cjs.entry.js +7 -7
- package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-pagination_2.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-preview_8.cjs.entry.js +5 -5
- package/dist/cjs/verdocs-quick-functions_3.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-settings-api-keys_4.cjs.entry.js +44 -33
- package/dist/cjs/verdocs-settings.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +11 -11
- package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-templates-list.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-view.cjs.entry.js +4 -4
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +4 -7
- package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.css +1 -0
- package/dist/collection/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.css +1 -0
- package/dist/collection/utils/Types.js +2 -1
- package/dist/components/Types2.js +2 -1
- package/dist/components/VerdocsEndpoint.js +286 -425
- package/dist/components/_commonjsHelpers.js +1 -5
- package/dist/components/index3.js +40 -29
- package/dist/components/interact.min.js +5 -6
- package/dist/components/verdocs-auth.js +4 -7
- package/dist/components/verdocs-field-date.js +1 -1
- package/dist/components/verdocs-field-textarea.js +3 -3
- package/dist/components/verdocs-field-textbox.js +3 -3
- package/dist/components/verdocs-field-timestamp.js +1 -1
- package/dist/components/verdocs-template-fields2.js +3 -3
- package/dist/components/verdocs-template-roles2.js +4 -4
- package/dist/docs.json +1 -1
- package/dist/esm/{TemplateStore-018fc1db.js → TemplateStore-03608883.js} +1 -1
- package/dist/esm/Types-1628dc71.js +5 -0
- package/dist/esm/{VerdocsEndpoint-b011af25.js → VerdocsEndpoint-6f42e6a8.js} +286 -425
- package/dist/esm/{_commonjsHelpers-5ec8f9b7.js → _commonjsHelpers-8a9f3b18.js} +1 -5
- package/dist/esm/interact.min-ef5402f3.js +10 -0
- package/dist/esm/ipc-test.entry.js +2 -2
- package/dist/esm/{utils-d269cea3.js → utils-e0ce2c22.js} +2 -2
- package/dist/esm/verdocs-activity-box.entry.js +1 -1
- package/dist/esm/verdocs-auth.entry.js +5 -8
- package/dist/esm/verdocs-build.entry.js +2 -2
- package/dist/esm/verdocs-button-panel_2.entry.js +3 -3
- package/dist/esm/verdocs-contact-picker_2.entry.js +4 -4
- package/dist/esm/verdocs-envelope-document-page.entry.js +4 -4
- package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +1 -1
- package/dist/esm/verdocs-envelope-sidebar.entry.js +2 -2
- package/dist/esm/verdocs-envelopes-list.entry.js +4 -4
- package/dist/esm/verdocs-field-attachment.entry.js +3 -3
- package/dist/esm/verdocs-field-checkbox.entry.js +3 -3
- package/dist/esm/verdocs-field-date.entry.js +4 -4
- package/dist/esm/verdocs-field-dropdown.entry.js +3 -3
- package/dist/esm/verdocs-field-initial.entry.js +3 -3
- package/dist/esm/verdocs-field-payment.entry.js +3 -3
- package/dist/esm/verdocs-field-radio-button.entry.js +3 -3
- package/dist/esm/verdocs-field-signature.entry.js +3 -3
- package/dist/esm/verdocs-field-textarea.entry.js +7 -7
- package/dist/esm/verdocs-field-textbox.entry.js +7 -7
- package/dist/esm/verdocs-field-timestamp.entry.js +4 -4
- package/dist/esm/verdocs-file-chooser_2.entry.js +1 -1
- package/dist/esm/verdocs-pagination_2.entry.js +3 -3
- package/dist/esm/verdocs-preview_8.entry.js +5 -5
- package/dist/esm/verdocs-quick-functions_3.entry.js +1 -1
- package/dist/esm/verdocs-search.entry.js +1 -1
- package/dist/esm/verdocs-settings-api-keys_4.entry.js +44 -33
- package/dist/esm/verdocs-settings.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +4 -4
- package/dist/esm/verdocs-template-document-page_2.entry.js +4 -4
- package/dist/esm/verdocs-template-fields_4.entry.js +11 -11
- package/dist/esm/verdocs-template-star.entry.js +1 -1
- package/dist/esm/verdocs-templates-list.entry.js +1 -1
- package/dist/esm/verdocs-view.entry.js +4 -4
- package/dist/esm-es5/{TemplateStore-018fc1db.js → TemplateStore-03608883.js} +1 -1
- package/dist/esm-es5/Types-1628dc71.js +1 -0
- package/dist/esm-es5/VerdocsEndpoint-6f42e6a8.js +1 -0
- package/dist/esm-es5/_commonjsHelpers-8a9f3b18.js +1 -0
- package/dist/esm-es5/interact.min-ef5402f3.js +1 -0
- package/dist/esm-es5/ipc-test.entry.js +1 -1
- package/dist/esm-es5/{utils-d269cea3.js → utils-e0ce2c22.js} +1 -1
- package/dist/esm-es5/verdocs-activity-box.entry.js +1 -1
- package/dist/esm-es5/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-button-panel_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-signature.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
- package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_8.entry.js +1 -1
- package/dist/esm-es5/verdocs-quick-functions_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-search.entry.js +1 -1
- package/dist/esm-es5/verdocs-settings-api-keys_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-settings.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
- package/dist/esm-es5/verdocs-templates-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-view.entry.js +1 -1
- package/dist/types/utils/Types.d.ts +1 -1
- package/dist/types/utils/utils.d.ts +1 -1
- package/dist/verdocs-web-sdk/{p-35769d0c.system.entry.js → p-026eb575.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-89aa696c.system.entry.js → p-0494ee4f.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-eb595245.system.js → p-0ffb2c57.system.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7805f0e0.entry.js → p-112cd2f5.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-af3e9624.entry.js → p-120f75b1.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-aa51514f.system.entry.js → p-16849f44.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-76907130.entry.js → p-1831cb38.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-343672f5.system.entry.js → p-1983855b.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-126ba5d2.system.entry.js → p-19f8d4eb.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-1ba9f457.system.js +1 -0
- package/dist/verdocs-web-sdk/{p-77abc3ce.entry.js → p-1eb38c2e.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-208fd2e2.js +1 -0
- package/dist/verdocs-web-sdk/{p-10af7aec.system.entry.js → p-262d513f.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-409e992a.entry.js → p-2979d6eb.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-0df58c57.entry.js → p-2ec8a9be.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-32b26f8f.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-b73415c3.system.entry.js → p-393a9a2a.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-3a7fa389.js +1 -0
- package/dist/verdocs-web-sdk/{p-23be436b.entry.js → p-3b96b2c9.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-5c50a778.system.entry.js → p-3eb191fd.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-0e5449d1.system.entry.js → p-43d14a05.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-4f08ceaf.system.js +1 -0
- package/dist/verdocs-web-sdk/{p-3abfff14.entry.js → p-5b70ff97.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-79dc4f76.entry.js → p-5c38d5cc.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-6307e6ae.entry.js → p-5dfefab6.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e3a9d167.system.entry.js → p-5f736f85.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-04d7d759.system.entry.js → p-6653aa42.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-0f94d635.entry.js → p-686139a0.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a310f65b.entry.js → p-75541556.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-3a702f79.entry.js → p-7b3fed68.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a0b02d83.system.entry.js → p-7c3a05f6.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-7cbd2c3a.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-7d5dbd9a.js +1 -0
- package/dist/verdocs-web-sdk/{p-2f04fb38.system.entry.js → p-7d6f7f4b.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-80540240.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-17d0e5f4.entry.js → p-82b74dc0.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ace35be6.entry.js → p-83225bcb.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-839f6f0d.js +1 -0
- package/dist/verdocs-web-sdk/p-8439bf7b.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-df6a373e.system.entry.js → p-87008226.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-f1257cd0.system.entry.js → p-8a80d243.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-609c7fab.system.entry.js → p-8b1b3ffd.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-14aefeb2.system.entry.js → p-8e0d6152.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-1406ffd2.entry.js → p-8f8504e2.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-01166179.system.entry.js → p-947d60dc.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ee195e5e.entry.js → p-965ec85a.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-999fbe79.js +1 -0
- package/dist/verdocs-web-sdk/{p-bd0bc3dd.system.entry.js → p-99c10bba.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-cf765153.entry.js → p-9aff3ff0.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a171983b.system.entry.js → p-9b66a84a.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-4f439363.entry.js → p-a2531ddc.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-a5ce0030.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-3f9fbf94.entry.js → p-a7134b10.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-261d376e.system.entry.js → p-a75490f4.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-aaf87ce4.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-62f090c7.system.entry.js → p-ad0805b6.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-c694cf93.system.js → p-b0bf091c.system.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7b40bf68.system.entry.js → p-b4238a4c.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-5df0fa7a.system.entry.js → p-b8732502.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-4a94ee00.system.entry.js → p-b88f9ff5.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-39cbfe15.entry.js → p-c37f1a93.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a52a832b.system.entry.js → p-c58916d2.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-6bda7dce.entry.js → p-c89bf71d.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a5425a9b.entry.js → p-cdf1efe7.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-0ad1fd33.entry.js → p-d01e5b64.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-37187046.system.entry.js → p-d5e28045.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-eef694e8.entry.js → p-d841fd4b.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-d8cd6b59.system.js +1 -0
- package/dist/verdocs-web-sdk/{p-fde6b724.entry.js → p-dab1e29a.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ecf04564.system.entry.js → p-dceba864.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-b17a20b8.entry.js → p-de82e80e.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-50ac71f3.system.entry.js → p-e1dc1460.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-137cedc8.entry.js → p-ed639a7c.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a35314fe.js → p-ee159b14.js} +1 -1
- package/dist/verdocs-web-sdk/{p-9b07a2a7.entry.js → p-eea1dd87.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-f04bf956.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-bb2c866b.system.entry.js → p-f6c3da25.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-961708ac.entry.js → p-f80b83e7.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-dd8845d4.system.entry.js → p-f83a0c6e.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-8da1555a.entry.js → p-fa0d27b1.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-fcd0a40a.system.js +1 -0
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +7 -6
- package/dist/cjs/interact.min-ba5cc513.js +0 -13
- package/dist/esm/Types-de18e225.js +0 -4
- package/dist/esm/interact.min-cf83fa88.js +0 -11
- package/dist/esm-es5/Types-de18e225.js +0 -1
- package/dist/esm-es5/VerdocsEndpoint-b011af25.js +0 -1
- package/dist/esm-es5/_commonjsHelpers-5ec8f9b7.js +0 -1
- package/dist/esm-es5/interact.min-cf83fa88.js +0 -1
- package/dist/verdocs-web-sdk/p-0d28cf05.js +0 -1
- package/dist/verdocs-web-sdk/p-15cb963a.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-30b4bd45.js +0 -1
- package/dist/verdocs-web-sdk/p-3305a941.system.js +0 -1
- package/dist/verdocs-web-sdk/p-66d66e2b.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-70a3a6c1.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-7b63017c.js +0 -1
- package/dist/verdocs-web-sdk/p-7fd7152d.system.js +0 -1
- package/dist/verdocs-web-sdk/p-9934f3ec.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-b2d698f7.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-bbee73c8.system.js +0 -1
- package/dist/verdocs-web-sdk/p-bfcf8ad2.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-cbbf849f.system.js +0 -1
- package/dist/verdocs-web-sdk/p-de60d3a8.js +0 -1
- package/dist/verdocs-web-sdk/p-eab67c09.js +0 -1
@@ -418,277 +418,137 @@ const denyList = new Set([
|
|
418
418
|
// TODO: Use `error?.code` when targeting Node.js 14
|
419
419
|
var isRetryAllowed = error => !denyList.has(error && error.code);
|
420
420
|
|
421
|
-
|
422
|
-
|
423
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
424
|
-
|
425
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
426
|
-
|
427
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
428
|
-
|
429
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
430
|
-
var namespace = 'axios-retry';
|
431
|
-
/**
|
432
|
-
* @param {Error} error
|
433
|
-
* @return {boolean}
|
434
|
-
*/
|
435
|
-
|
421
|
+
const namespace = 'axios-retry';
|
436
422
|
function isNetworkError(error) {
|
437
|
-
|
438
|
-
|
439
|
-
|
423
|
+
const CODE_EXCLUDE_LIST = ['ERR_CANCELED', 'ECONNABORTED'];
|
424
|
+
if (error.response) {
|
425
|
+
return false;
|
426
|
+
}
|
427
|
+
if (!error.code) {
|
428
|
+
return false;
|
429
|
+
}
|
430
|
+
// Prevents retrying timed out & cancelled requests
|
431
|
+
if (CODE_EXCLUDE_LIST.includes(error.code)) {
|
432
|
+
return false;
|
433
|
+
}
|
434
|
+
// Prevents retrying unsafe errors
|
435
|
+
return isRetryAllowed(error);
|
440
436
|
}
|
441
|
-
|
442
|
-
|
443
|
-
/**
|
444
|
-
* @param {Error} error
|
445
|
-
* @return {boolean}
|
446
|
-
*/
|
447
|
-
|
437
|
+
const SAFE_HTTP_METHODS = ['get', 'head', 'options'];
|
438
|
+
const IDEMPOTENT_HTTP_METHODS = SAFE_HTTP_METHODS.concat(['put', 'delete']);
|
448
439
|
function isRetryableError(error) {
|
449
|
-
|
440
|
+
return (error.code !== 'ECONNABORTED' &&
|
441
|
+
(!error.response || (error.response.status >= 500 && error.response.status <= 599)));
|
450
442
|
}
|
451
|
-
/**
|
452
|
-
* @param {Error} error
|
453
|
-
* @return {boolean}
|
454
|
-
*/
|
455
|
-
|
456
443
|
function isSafeRequestError(error) {
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
return isRetryableError(error) && SAFE_HTTP_METHODS.indexOf(error.config.method) !== -1;
|
444
|
+
if (!error.config?.method) {
|
445
|
+
// Cannot determine if the request can be retried
|
446
|
+
return false;
|
447
|
+
}
|
448
|
+
return isRetryableError(error) && SAFE_HTTP_METHODS.indexOf(error.config.method) !== -1;
|
463
449
|
}
|
464
|
-
/**
|
465
|
-
* @param {Error} error
|
466
|
-
* @return {boolean}
|
467
|
-
*/
|
468
|
-
|
469
450
|
function isIdempotentRequestError(error) {
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
return isRetryableError(error) && IDEMPOTENT_HTTP_METHODS.indexOf(error.config.method) !== -1;
|
451
|
+
if (!error.config?.method) {
|
452
|
+
// Cannot determine if the request can be retried
|
453
|
+
return false;
|
454
|
+
}
|
455
|
+
return isRetryableError(error) && IDEMPOTENT_HTTP_METHODS.indexOf(error.config.method) !== -1;
|
476
456
|
}
|
477
|
-
/**
|
478
|
-
* @param {Error} error
|
479
|
-
* @return {boolean}
|
480
|
-
*/
|
481
|
-
|
482
457
|
function isNetworkOrIdempotentRequestError(error) {
|
483
|
-
|
458
|
+
return isNetworkError(error) || isIdempotentRequestError(error);
|
484
459
|
}
|
485
|
-
/**
|
486
|
-
* @return {number} - delay in milliseconds, always 0
|
487
|
-
*/
|
488
|
-
|
489
460
|
function noDelay() {
|
490
|
-
|
461
|
+
return 0;
|
491
462
|
}
|
492
|
-
|
493
|
-
|
494
|
-
*
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
function exponentialDelay() {
|
499
|
-
var retryNumber = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
500
|
-
var delay = Math.pow(2, retryNumber) * 100;
|
501
|
-
var randomSum = delay * 0.2 * Math.random(); // 0-20% of the delay
|
502
|
-
|
503
|
-
return delay + randomSum;
|
463
|
+
function exponentialDelay(retryNumber = 0, _error = undefined, delayFactor = 100) {
|
464
|
+
const delay = 2 ** retryNumber * delayFactor;
|
465
|
+
const randomSum = delay * 0.2 * Math.random(); // 0-20% of the delay
|
466
|
+
return delay + randomSum;
|
504
467
|
}
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
var currentState = config[namespace] || {};
|
513
|
-
currentState.retryCount = currentState.retryCount || 0;
|
514
|
-
config[namespace] = currentState;
|
515
|
-
return currentState;
|
516
|
-
}
|
517
|
-
/**
|
518
|
-
* Returns the axios-retry options for the current request
|
519
|
-
* @param {AxiosRequestConfig} config
|
520
|
-
* @param {AxiosRetryConfig} defaultOptions
|
521
|
-
* @return {AxiosRetryConfig}
|
522
|
-
*/
|
523
|
-
|
524
|
-
|
468
|
+
const DEFAULT_OPTIONS = {
|
469
|
+
retries: 3,
|
470
|
+
retryCondition: isNetworkOrIdempotentRequestError,
|
471
|
+
retryDelay: noDelay,
|
472
|
+
shouldResetTimeout: false,
|
473
|
+
onRetry: () => { }
|
474
|
+
};
|
525
475
|
function getRequestOptions(config, defaultOptions) {
|
526
|
-
|
476
|
+
return { ...DEFAULT_OPTIONS, ...defaultOptions, ...config[namespace] };
|
527
477
|
}
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
function fixConfig(axios, config) {
|
535
|
-
if (axios.defaults.agent === config.agent) {
|
536
|
-
delete config.agent;
|
537
|
-
}
|
538
|
-
|
539
|
-
if (axios.defaults.httpAgent === config.httpAgent) {
|
540
|
-
delete config.httpAgent;
|
541
|
-
}
|
542
|
-
|
543
|
-
if (axios.defaults.httpsAgent === config.httpsAgent) {
|
544
|
-
delete config.httpsAgent;
|
545
|
-
}
|
478
|
+
function setCurrentState(config, defaultOptions) {
|
479
|
+
const currentState = getRequestOptions(config, defaultOptions || {});
|
480
|
+
currentState.retryCount = currentState.retryCount || 0;
|
481
|
+
currentState.lastRequestTime = currentState.lastRequestTime || Date.now();
|
482
|
+
config[namespace] = currentState;
|
483
|
+
return currentState;
|
546
484
|
}
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
485
|
+
function fixConfig(axiosInstance, config) {
|
486
|
+
// @ts-ignore
|
487
|
+
if (axiosInstance.defaults.agent === config.agent) {
|
488
|
+
// @ts-ignore
|
489
|
+
delete config.agent;
|
490
|
+
}
|
491
|
+
if (axiosInstance.defaults.httpAgent === config.httpAgent) {
|
492
|
+
delete config.httpAgent;
|
493
|
+
}
|
494
|
+
if (axiosInstance.defaults.httpsAgent === config.httpsAgent) {
|
495
|
+
delete config.httpsAgent;
|
496
|
+
}
|
559
497
|
}
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
*
|
565
|
-
* import axios from 'axios';
|
566
|
-
*
|
567
|
-
* axiosRetry(axios, { retries: 3 });
|
568
|
-
*
|
569
|
-
* axios.get('http://example.com/test') // The first request fails and the second returns 'ok'
|
570
|
-
* .then(result => {
|
571
|
-
* result.data; // 'ok'
|
572
|
-
* });
|
573
|
-
*
|
574
|
-
* // Exponential back-off retry delay between requests
|
575
|
-
* axiosRetry(axios, { retryDelay : axiosRetry.exponentialDelay});
|
576
|
-
*
|
577
|
-
* // Custom retry delay
|
578
|
-
* axiosRetry(axios, { retryDelay : (retryCount) => {
|
579
|
-
* return retryCount * 1000;
|
580
|
-
* }});
|
581
|
-
*
|
582
|
-
* // Also works with custom axios instances
|
583
|
-
* const client = axios.create({ baseURL: 'http://example.com' });
|
584
|
-
* axiosRetry(client, { retries: 3 });
|
585
|
-
*
|
586
|
-
* client.get('/test') // The first request fails and the second returns 'ok'
|
587
|
-
* .then(result => {
|
588
|
-
* result.data; // 'ok'
|
589
|
-
* });
|
590
|
-
*
|
591
|
-
* // Allows request-specific configuration
|
592
|
-
* client
|
593
|
-
* .get('/test', {
|
594
|
-
* 'axios-retry': {
|
595
|
-
* retries: 0
|
596
|
-
* }
|
597
|
-
* })
|
598
|
-
* .catch(error => { // The first request fails
|
599
|
-
* error !== undefined
|
600
|
-
* });
|
601
|
-
*
|
602
|
-
* @param {Axios} axios An axios instance (the axios object or one created from axios.create)
|
603
|
-
* @param {Object} [defaultOptions]
|
604
|
-
* @param {number} [defaultOptions.retries=3] Number of retries
|
605
|
-
* @param {boolean} [defaultOptions.shouldResetTimeout=false]
|
606
|
-
* Defines if the timeout should be reset between retries
|
607
|
-
* @param {Function} [defaultOptions.retryCondition=isNetworkOrIdempotentRequestError]
|
608
|
-
* A function to determine if the error can be retried
|
609
|
-
* @param {Function} [defaultOptions.retryDelay=noDelay]
|
610
|
-
* A function to determine the delay between retry requests
|
611
|
-
* @param {Function} [defaultOptions.onRetry=()=>{}]
|
612
|
-
* A function to get notified when a retry occurs
|
613
|
-
*/
|
614
|
-
|
615
|
-
|
616
|
-
function _shouldRetry() {
|
617
|
-
_shouldRetry = _asyncToGenerator(function* (retries, retryCondition, currentState, error) {
|
618
|
-
var shouldRetryOrPromise = currentState.retryCount < retries && retryCondition(error); // This could be a promise
|
619
|
-
|
498
|
+
async function shouldRetry(currentState, error) {
|
499
|
+
const { retries, retryCondition } = currentState;
|
500
|
+
const shouldRetryOrPromise = (currentState.retryCount || 0) < retries && retryCondition(error);
|
501
|
+
// This could be a promise
|
620
502
|
if (typeof shouldRetryOrPromise === 'object') {
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
503
|
+
try {
|
504
|
+
const shouldRetryPromiseResult = await shouldRetryOrPromise;
|
505
|
+
// keep return true unless shouldRetryPromiseResult return false for compatibility
|
506
|
+
return shouldRetryPromiseResult !== false;
|
507
|
+
}
|
508
|
+
catch (_err) {
|
509
|
+
return false;
|
510
|
+
}
|
628
511
|
}
|
629
|
-
|
630
512
|
return shouldRetryOrPromise;
|
631
|
-
});
|
632
|
-
return _shouldRetry.apply(this, arguments);
|
633
513
|
}
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
var {
|
644
|
-
config
|
645
|
-
} = error; // If we have no information to retry the request
|
646
|
-
|
647
|
-
if (!config) {
|
648
|
-
return Promise.reject(error);
|
649
|
-
}
|
650
|
-
|
651
|
-
var {
|
652
|
-
retries = 3,
|
653
|
-
retryCondition = isNetworkOrIdempotentRequestError,
|
654
|
-
retryDelay = noDelay,
|
655
|
-
shouldResetTimeout = false,
|
656
|
-
onRetry = () => {}
|
657
|
-
} = getRequestOptions(config, defaultOptions);
|
658
|
-
var currentState = getCurrentState(config);
|
659
|
-
|
660
|
-
if (yield shouldRetry(retries, retryCondition, currentState, error)) {
|
661
|
-
currentState.retryCount += 1;
|
662
|
-
var delay = retryDelay(currentState.retryCount, error); // Axios fails merging this configuration to the default configuration because it has an issue
|
663
|
-
// with circular structures: https://github.com/mzabriskie/axios/issues/370
|
664
|
-
|
665
|
-
fixConfig(axios, config);
|
666
|
-
|
667
|
-
if (!shouldResetTimeout && config.timeout && currentState.lastRequestTime) {
|
668
|
-
var lastRequestDuration = Date.now() - currentState.lastRequestTime;
|
669
|
-
var timeout = config.timeout - lastRequestDuration - delay;
|
670
|
-
|
671
|
-
if (timeout <= 0) {
|
514
|
+
const axiosRetry = (axiosInstance, defaultOptions) => {
|
515
|
+
const requestInterceptorId = axiosInstance.interceptors.request.use((config) => {
|
516
|
+
setCurrentState(config, defaultOptions);
|
517
|
+
return config;
|
518
|
+
});
|
519
|
+
const responseInterceptorId = axiosInstance.interceptors.response.use(null, async (error) => {
|
520
|
+
const { config } = error;
|
521
|
+
// If we have no information to retry the request
|
522
|
+
if (!config) {
|
672
523
|
return Promise.reject(error);
|
673
|
-
}
|
674
|
-
|
675
|
-
config.timeout = timeout;
|
676
524
|
}
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
525
|
+
const currentState = setCurrentState(config, defaultOptions);
|
526
|
+
if (await shouldRetry(currentState, error)) {
|
527
|
+
currentState.retryCount += 1;
|
528
|
+
const { retryDelay, shouldResetTimeout, onRetry } = currentState;
|
529
|
+
const delay = retryDelay(currentState.retryCount, error);
|
530
|
+
// Axios fails merging this configuration to the default configuration because it has an issue
|
531
|
+
// with circular structures: https://github.com/mzabriskie/axios/issues/370
|
532
|
+
fixConfig(axiosInstance, config);
|
533
|
+
if (!shouldResetTimeout && config.timeout && currentState.lastRequestTime) {
|
534
|
+
const lastRequestDuration = Date.now() - currentState.lastRequestTime;
|
535
|
+
const timeout = config.timeout - lastRequestDuration - delay;
|
536
|
+
if (timeout <= 0) {
|
537
|
+
return Promise.reject(error);
|
538
|
+
}
|
539
|
+
config.timeout = timeout;
|
540
|
+
}
|
541
|
+
config.transformRequest = [(data) => data];
|
542
|
+
await onRetry(currentState.retryCount, error, config);
|
543
|
+
return new Promise((resolve) => {
|
544
|
+
setTimeout(() => resolve(axiosInstance(config)), delay);
|
545
|
+
});
|
546
|
+
}
|
547
|
+
return Promise.reject(error);
|
684
548
|
});
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
};
|
689
|
-
}());
|
690
|
-
} // Compatibility with CommonJS
|
691
|
-
|
549
|
+
return { requestInterceptorId, responseInterceptorId };
|
550
|
+
};
|
551
|
+
// Compatibility with CommonJS
|
692
552
|
axiosRetry.isNetworkError = isNetworkError;
|
693
553
|
axiosRetry.isSafeRequestError = isSafeRequestError;
|
694
554
|
axiosRetry.isIdempotentRequestError = isIdempotentRequestError;
|
@@ -1368,7 +1228,7 @@ const isAsyncFn = kindOfTest('AsyncFunction');
|
|
1368
1228
|
const isThenable = (thing) =>
|
1369
1229
|
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
1370
1230
|
|
1371
|
-
const utils = {
|
1231
|
+
const utils$1 = {
|
1372
1232
|
isArray,
|
1373
1233
|
isArrayBuffer,
|
1374
1234
|
isBuffer,
|
@@ -1450,7 +1310,7 @@ function AxiosError(message, code, config, request, response) {
|
|
1450
1310
|
response && (this.response = response);
|
1451
1311
|
}
|
1452
1312
|
|
1453
|
-
utils.inherits(AxiosError, Error, {
|
1313
|
+
utils$1.inherits(AxiosError, Error, {
|
1454
1314
|
toJSON: function toJSON() {
|
1455
1315
|
return {
|
1456
1316
|
// Standard
|
@@ -1465,7 +1325,7 @@ utils.inherits(AxiosError, Error, {
|
|
1465
1325
|
columnNumber: this.columnNumber,
|
1466
1326
|
stack: this.stack,
|
1467
1327
|
// Axios
|
1468
|
-
config: utils.toJSONObject(this.config),
|
1328
|
+
config: utils$1.toJSONObject(this.config),
|
1469
1329
|
code: this.code,
|
1470
1330
|
status: this.response && this.response.status ? this.response.status : null
|
1471
1331
|
};
|
@@ -1500,7 +1360,7 @@ Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
|
|
1500
1360
|
AxiosError.from = (error, code, config, request, response, customProps) => {
|
1501
1361
|
const axiosError = Object.create(prototype$1);
|
1502
1362
|
|
1503
|
-
utils.toFlatObject(error, axiosError, function filter(obj) {
|
1363
|
+
utils$1.toFlatObject(error, axiosError, function filter(obj) {
|
1504
1364
|
return obj !== Error.prototype;
|
1505
1365
|
}, prop => {
|
1506
1366
|
return prop !== 'isAxiosError';
|
@@ -1528,7 +1388,7 @@ const httpAdapter = null;
|
|
1528
1388
|
* @returns {boolean}
|
1529
1389
|
*/
|
1530
1390
|
function isVisitable(thing) {
|
1531
|
-
return utils.isPlainObject(thing) || utils.isArray(thing);
|
1391
|
+
return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
|
1532
1392
|
}
|
1533
1393
|
|
1534
1394
|
/**
|
@@ -1539,7 +1399,7 @@ function isVisitable(thing) {
|
|
1539
1399
|
* @returns {string} the key without the brackets.
|
1540
1400
|
*/
|
1541
1401
|
function removeBrackets(key) {
|
1542
|
-
return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;
|
1402
|
+
return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
|
1543
1403
|
}
|
1544
1404
|
|
1545
1405
|
/**
|
@@ -1568,10 +1428,10 @@ function renderKey(path, key, dots) {
|
|
1568
1428
|
* @returns {boolean}
|
1569
1429
|
*/
|
1570
1430
|
function isFlatArray(arr) {
|
1571
|
-
return utils.isArray(arr) && !arr.some(isVisitable);
|
1431
|
+
return utils$1.isArray(arr) && !arr.some(isVisitable);
|
1572
1432
|
}
|
1573
1433
|
|
1574
|
-
const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
|
1434
|
+
const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
|
1575
1435
|
return /^is[A-Z]/.test(prop);
|
1576
1436
|
});
|
1577
1437
|
|
@@ -1599,7 +1459,7 @@ const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
|
|
1599
1459
|
* @returns
|
1600
1460
|
*/
|
1601
1461
|
function toFormData(obj, formData, options) {
|
1602
|
-
if (!utils.isObject(obj)) {
|
1462
|
+
if (!utils$1.isObject(obj)) {
|
1603
1463
|
throw new TypeError('target must be an object');
|
1604
1464
|
}
|
1605
1465
|
|
@@ -1607,13 +1467,13 @@ function toFormData(obj, formData, options) {
|
|
1607
1467
|
formData = formData || new (FormData)();
|
1608
1468
|
|
1609
1469
|
// eslint-disable-next-line no-param-reassign
|
1610
|
-
options = utils.toFlatObject(options, {
|
1470
|
+
options = utils$1.toFlatObject(options, {
|
1611
1471
|
metaTokens: true,
|
1612
1472
|
dots: false,
|
1613
1473
|
indexes: false
|
1614
1474
|
}, false, function defined(option, source) {
|
1615
1475
|
// eslint-disable-next-line no-eq-null,eqeqeq
|
1616
|
-
return !utils.isUndefined(source[option]);
|
1476
|
+
return !utils$1.isUndefined(source[option]);
|
1617
1477
|
});
|
1618
1478
|
|
1619
1479
|
const metaTokens = options.metaTokens;
|
@@ -1622,24 +1482,24 @@ function toFormData(obj, formData, options) {
|
|
1622
1482
|
const dots = options.dots;
|
1623
1483
|
const indexes = options.indexes;
|
1624
1484
|
const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
|
1625
|
-
const useBlob = _Blob && utils.isSpecCompliantForm(formData);
|
1485
|
+
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
1626
1486
|
|
1627
|
-
if (!utils.isFunction(visitor)) {
|
1487
|
+
if (!utils$1.isFunction(visitor)) {
|
1628
1488
|
throw new TypeError('visitor must be a function');
|
1629
1489
|
}
|
1630
1490
|
|
1631
1491
|
function convertValue(value) {
|
1632
1492
|
if (value === null) return '';
|
1633
1493
|
|
1634
|
-
if (utils.isDate(value)) {
|
1494
|
+
if (utils$1.isDate(value)) {
|
1635
1495
|
return value.toISOString();
|
1636
1496
|
}
|
1637
1497
|
|
1638
|
-
if (!useBlob && utils.isBlob(value)) {
|
1498
|
+
if (!useBlob && utils$1.isBlob(value)) {
|
1639
1499
|
throw new AxiosError('Blob is not supported. Use a Buffer instead.');
|
1640
1500
|
}
|
1641
1501
|
|
1642
|
-
if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
|
1502
|
+
if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
|
1643
1503
|
return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
|
1644
1504
|
}
|
1645
1505
|
|
@@ -1660,20 +1520,20 @@ function toFormData(obj, formData, options) {
|
|
1660
1520
|
let arr = value;
|
1661
1521
|
|
1662
1522
|
if (value && !path && typeof value === 'object') {
|
1663
|
-
if (utils.endsWith(key, '{}')) {
|
1523
|
+
if (utils$1.endsWith(key, '{}')) {
|
1664
1524
|
// eslint-disable-next-line no-param-reassign
|
1665
1525
|
key = metaTokens ? key : key.slice(0, -2);
|
1666
1526
|
// eslint-disable-next-line no-param-reassign
|
1667
1527
|
value = JSON.stringify(value);
|
1668
1528
|
} else if (
|
1669
|
-
(utils.isArray(value) && isFlatArray(value)) ||
|
1670
|
-
((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))
|
1529
|
+
(utils$1.isArray(value) && isFlatArray(value)) ||
|
1530
|
+
((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
|
1671
1531
|
)) {
|
1672
1532
|
// eslint-disable-next-line no-param-reassign
|
1673
1533
|
key = removeBrackets(key);
|
1674
1534
|
|
1675
1535
|
arr.forEach(function each(el, index) {
|
1676
|
-
!(utils.isUndefined(el) || el === null) && formData.append(
|
1536
|
+
!(utils$1.isUndefined(el) || el === null) && formData.append(
|
1677
1537
|
// eslint-disable-next-line no-nested-ternary
|
1678
1538
|
indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
|
1679
1539
|
convertValue(el)
|
@@ -1701,7 +1561,7 @@ function toFormData(obj, formData, options) {
|
|
1701
1561
|
});
|
1702
1562
|
|
1703
1563
|
function build(value, path) {
|
1704
|
-
if (utils.isUndefined(value)) return;
|
1564
|
+
if (utils$1.isUndefined(value)) return;
|
1705
1565
|
|
1706
1566
|
if (stack.indexOf(value) !== -1) {
|
1707
1567
|
throw Error('Circular reference detected in ' + path.join('.'));
|
@@ -1709,9 +1569,9 @@ function toFormData(obj, formData, options) {
|
|
1709
1569
|
|
1710
1570
|
stack.push(value);
|
1711
1571
|
|
1712
|
-
utils.forEach(value, function each(el, key) {
|
1713
|
-
const result = !(utils.isUndefined(el) || el === null) && visitor.call(
|
1714
|
-
formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers
|
1572
|
+
utils$1.forEach(value, function each(el, key) {
|
1573
|
+
const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
|
1574
|
+
formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
|
1715
1575
|
);
|
1716
1576
|
|
1717
1577
|
if (result === true) {
|
@@ -1722,7 +1582,7 @@ function toFormData(obj, formData, options) {
|
|
1722
1582
|
stack.pop();
|
1723
1583
|
}
|
1724
1584
|
|
1725
|
-
if (!utils.isObject(obj)) {
|
1585
|
+
if (!utils$1.isObject(obj)) {
|
1726
1586
|
throw new TypeError('data must be an object');
|
1727
1587
|
}
|
1728
1588
|
|
@@ -1826,7 +1686,7 @@ function buildURL(url, params, options) {
|
|
1826
1686
|
if (serializeFn) {
|
1827
1687
|
serializedParams = serializeFn(params, options);
|
1828
1688
|
} else {
|
1829
|
-
serializedParams = utils.isURLSearchParams(params) ?
|
1689
|
+
serializedParams = utils$1.isURLSearchParams(params) ?
|
1830
1690
|
params.toString() :
|
1831
1691
|
new AxiosURLSearchParams(params, options).toString(_encode);
|
1832
1692
|
}
|
@@ -1901,7 +1761,7 @@ class InterceptorManager {
|
|
1901
1761
|
* @returns {void}
|
1902
1762
|
*/
|
1903
1763
|
forEach(fn) {
|
1904
|
-
utils.forEach(this.handlers, function forEachHandler(h) {
|
1764
|
+
utils$1.forEach(this.handlers, function forEachHandler(h) {
|
1905
1765
|
if (h !== null) {
|
1906
1766
|
fn(h);
|
1907
1767
|
}
|
@@ -1921,6 +1781,18 @@ const FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
|
|
1921
1781
|
|
1922
1782
|
const Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
|
1923
1783
|
|
1784
|
+
const platform$1 = {
|
1785
|
+
isBrowser: true,
|
1786
|
+
classes: {
|
1787
|
+
URLSearchParams: URLSearchParams$1,
|
1788
|
+
FormData: FormData$1,
|
1789
|
+
Blob: Blob$1
|
1790
|
+
},
|
1791
|
+
protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
|
1792
|
+
};
|
1793
|
+
|
1794
|
+
const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
|
1795
|
+
|
1924
1796
|
/**
|
1925
1797
|
* Determine if we're running in a standard browser environment
|
1926
1798
|
*
|
@@ -1938,18 +1810,10 @@ const Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
|
|
1938
1810
|
*
|
1939
1811
|
* @returns {boolean}
|
1940
1812
|
*/
|
1941
|
-
const
|
1942
|
-
|
1943
|
-
|
1944
|
-
|
1945
|
-
product === 'NativeScript' ||
|
1946
|
-
product === 'NS')
|
1947
|
-
) {
|
1948
|
-
return false;
|
1949
|
-
}
|
1950
|
-
|
1951
|
-
return typeof window !== 'undefined' && typeof document !== 'undefined';
|
1952
|
-
})();
|
1813
|
+
const hasStandardBrowserEnv = (
|
1814
|
+
(product) => {
|
1815
|
+
return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
|
1816
|
+
})(typeof navigator !== 'undefined' && navigator.product);
|
1953
1817
|
|
1954
1818
|
/**
|
1955
1819
|
* Determine if we're running in a standard browser webWorker environment
|
@@ -1960,7 +1824,7 @@ const isStandardBrowserEnv = (() => {
|
|
1960
1824
|
* `typeof window !== 'undefined' && typeof document !== 'undefined'`.
|
1961
1825
|
* This leads to a problem when axios post `FormData` in webWorker
|
1962
1826
|
*/
|
1963
|
-
|
1827
|
+
const hasStandardBrowserWebWorkerEnv = (() => {
|
1964
1828
|
return (
|
1965
1829
|
typeof WorkerGlobalScope !== 'undefined' &&
|
1966
1830
|
// eslint-disable-next-line no-undef
|
@@ -1969,22 +1833,25 @@ const isStandardBrowserEnv = (() => {
|
|
1969
1833
|
);
|
1970
1834
|
})();
|
1971
1835
|
|
1836
|
+
const utils = /*#__PURE__*/Object.freeze({
|
1837
|
+
__proto__: null,
|
1838
|
+
hasBrowserEnv: hasBrowserEnv,
|
1839
|
+
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
1840
|
+
hasStandardBrowserEnv: hasStandardBrowserEnv
|
1841
|
+
});
|
1972
1842
|
|
1973
1843
|
const platform = {
|
1974
|
-
|
1975
|
-
|
1976
|
-
URLSearchParams: URLSearchParams$1,
|
1977
|
-
FormData: FormData$1,
|
1978
|
-
Blob: Blob$1
|
1979
|
-
},
|
1980
|
-
isStandardBrowserEnv,
|
1981
|
-
isStandardBrowserWebWorkerEnv,
|
1982
|
-
protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
|
1844
|
+
...utils,
|
1845
|
+
...platform$1
|
1983
1846
|
};
|
1984
1847
|
|
1985
1848
|
function toURLEncodedForm(data, options) {
|
1986
1849
|
return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
|
1987
1850
|
visitor: function(value, key, path, helpers) {
|
1851
|
+
if (platform.isNode && utils$1.isBuffer(value)) {
|
1852
|
+
this.append(key, value.toString('base64'));
|
1853
|
+
return false;
|
1854
|
+
}
|
1988
1855
|
|
1989
1856
|
return helpers.defaultVisitor.apply(this, arguments);
|
1990
1857
|
}
|
@@ -2003,7 +1870,7 @@ function parsePropPath(name) {
|
|
2003
1870
|
// foo.x.y.z
|
2004
1871
|
// foo-x-y-z
|
2005
1872
|
// foo x y z
|
2006
|
-
return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
|
1873
|
+
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
|
2007
1874
|
return match[0] === '[]' ? '' : match[1] || match[0];
|
2008
1875
|
});
|
2009
1876
|
}
|
@@ -2040,10 +1907,10 @@ function formDataToJSON(formData) {
|
|
2040
1907
|
let name = path[index++];
|
2041
1908
|
const isNumericKey = Number.isFinite(+name);
|
2042
1909
|
const isLast = index >= path.length;
|
2043
|
-
name = !name && utils.isArray(target) ? target.length : name;
|
1910
|
+
name = !name && utils$1.isArray(target) ? target.length : name;
|
2044
1911
|
|
2045
1912
|
if (isLast) {
|
2046
|
-
if (utils.hasOwnProp(target, name)) {
|
1913
|
+
if (utils$1.hasOwnProp(target, name)) {
|
2047
1914
|
target[name] = [target[name], value];
|
2048
1915
|
} else {
|
2049
1916
|
target[name] = value;
|
@@ -2052,23 +1919,23 @@ function formDataToJSON(formData) {
|
|
2052
1919
|
return !isNumericKey;
|
2053
1920
|
}
|
2054
1921
|
|
2055
|
-
if (!target[name] || !utils.isObject(target[name])) {
|
1922
|
+
if (!target[name] || !utils$1.isObject(target[name])) {
|
2056
1923
|
target[name] = [];
|
2057
1924
|
}
|
2058
1925
|
|
2059
1926
|
const result = buildPath(path, value, target[name], index);
|
2060
1927
|
|
2061
|
-
if (result && utils.isArray(target[name])) {
|
1928
|
+
if (result && utils$1.isArray(target[name])) {
|
2062
1929
|
target[name] = arrayToObject(target[name]);
|
2063
1930
|
}
|
2064
1931
|
|
2065
1932
|
return !isNumericKey;
|
2066
1933
|
}
|
2067
1934
|
|
2068
|
-
if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {
|
1935
|
+
if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
|
2069
1936
|
const obj = {};
|
2070
1937
|
|
2071
|
-
utils.forEachEntry(formData, (name, value) => {
|
1938
|
+
utils$1.forEachEntry(formData, (name, value) => {
|
2072
1939
|
buildPath(parsePropPath(name), value, obj, 0);
|
2073
1940
|
});
|
2074
1941
|
|
@@ -2089,10 +1956,10 @@ function formDataToJSON(formData) {
|
|
2089
1956
|
* @returns {string} A stringified version of the rawValue.
|
2090
1957
|
*/
|
2091
1958
|
function stringifySafely(rawValue, parser, encoder) {
|
2092
|
-
if (utils.isString(rawValue)) {
|
1959
|
+
if (utils$1.isString(rawValue)) {
|
2093
1960
|
try {
|
2094
1961
|
(parser || JSON.parse)(rawValue);
|
2095
|
-
return utils.trim(rawValue);
|
1962
|
+
return utils$1.trim(rawValue);
|
2096
1963
|
} catch (e) {
|
2097
1964
|
if (e.name !== 'SyntaxError') {
|
2098
1965
|
throw e;
|
@@ -2112,13 +1979,13 @@ const defaults = {
|
|
2112
1979
|
transformRequest: [function transformRequest(data, headers) {
|
2113
1980
|
const contentType = headers.getContentType() || '';
|
2114
1981
|
const hasJSONContentType = contentType.indexOf('application/json') > -1;
|
2115
|
-
const isObjectPayload = utils.isObject(data);
|
1982
|
+
const isObjectPayload = utils$1.isObject(data);
|
2116
1983
|
|
2117
|
-
if (isObjectPayload && utils.isHTMLForm(data)) {
|
1984
|
+
if (isObjectPayload && utils$1.isHTMLForm(data)) {
|
2118
1985
|
data = new FormData(data);
|
2119
1986
|
}
|
2120
1987
|
|
2121
|
-
const isFormData = utils.isFormData(data);
|
1988
|
+
const isFormData = utils$1.isFormData(data);
|
2122
1989
|
|
2123
1990
|
if (isFormData) {
|
2124
1991
|
if (!hasJSONContentType) {
|
@@ -2127,18 +1994,18 @@ const defaults = {
|
|
2127
1994
|
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
2128
1995
|
}
|
2129
1996
|
|
2130
|
-
if (utils.isArrayBuffer(data) ||
|
2131
|
-
utils.isBuffer(data) ||
|
2132
|
-
utils.isStream(data) ||
|
2133
|
-
utils.isFile(data) ||
|
2134
|
-
utils.isBlob(data)
|
1997
|
+
if (utils$1.isArrayBuffer(data) ||
|
1998
|
+
utils$1.isBuffer(data) ||
|
1999
|
+
utils$1.isStream(data) ||
|
2000
|
+
utils$1.isFile(data) ||
|
2001
|
+
utils$1.isBlob(data)
|
2135
2002
|
) {
|
2136
2003
|
return data;
|
2137
2004
|
}
|
2138
|
-
if (utils.isArrayBufferView(data)) {
|
2005
|
+
if (utils$1.isArrayBufferView(data)) {
|
2139
2006
|
return data.buffer;
|
2140
2007
|
}
|
2141
|
-
if (utils.isURLSearchParams(data)) {
|
2008
|
+
if (utils$1.isURLSearchParams(data)) {
|
2142
2009
|
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
|
2143
2010
|
return data.toString();
|
2144
2011
|
}
|
@@ -2150,7 +2017,7 @@ const defaults = {
|
|
2150
2017
|
return toURLEncodedForm(data, this.formSerializer).toString();
|
2151
2018
|
}
|
2152
2019
|
|
2153
|
-
if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
|
2020
|
+
if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
|
2154
2021
|
const _FormData = this.env && this.env.FormData;
|
2155
2022
|
|
2156
2023
|
return toFormData(
|
@@ -2174,7 +2041,7 @@ const defaults = {
|
|
2174
2041
|
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
2175
2042
|
const JSONRequested = this.responseType === 'json';
|
2176
2043
|
|
2177
|
-
if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
|
2044
|
+
if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
|
2178
2045
|
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
2179
2046
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
2180
2047
|
|
@@ -2222,13 +2089,13 @@ const defaults = {
|
|
2222
2089
|
}
|
2223
2090
|
};
|
2224
2091
|
|
2225
|
-
utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
2092
|
+
utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
2226
2093
|
defaults.headers[method] = {};
|
2227
2094
|
});
|
2228
2095
|
|
2229
2096
|
// RawAxiosHeaders whose duplicates are ignored by node
|
2230
2097
|
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
2231
|
-
const ignoreDuplicateOf = utils.toObjectSet([
|
2098
|
+
const ignoreDuplicateOf = utils$1.toObjectSet([
|
2232
2099
|
'age', 'authorization', 'content-length', 'content-type', 'etag',
|
2233
2100
|
'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
|
2234
2101
|
'last-modified', 'location', 'max-forwards', 'proxy-authorization',
|
@@ -2289,7 +2156,7 @@ function normalizeValue(value) {
|
|
2289
2156
|
return value;
|
2290
2157
|
}
|
2291
2158
|
|
2292
|
-
return utils.isArray(value) ? value.map(normalizeValue) : String(value);
|
2159
|
+
return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
|
2293
2160
|
}
|
2294
2161
|
|
2295
2162
|
function parseTokens(str) {
|
@@ -2307,7 +2174,7 @@ function parseTokens(str) {
|
|
2307
2174
|
const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
2308
2175
|
|
2309
2176
|
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
2310
|
-
if (utils.isFunction(filter)) {
|
2177
|
+
if (utils$1.isFunction(filter)) {
|
2311
2178
|
return filter.call(this, value, header);
|
2312
2179
|
}
|
2313
2180
|
|
@@ -2315,13 +2182,13 @@ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
2315
2182
|
value = header;
|
2316
2183
|
}
|
2317
2184
|
|
2318
|
-
if (!utils.isString(value)) return;
|
2185
|
+
if (!utils$1.isString(value)) return;
|
2319
2186
|
|
2320
|
-
if (utils.isString(filter)) {
|
2187
|
+
if (utils$1.isString(filter)) {
|
2321
2188
|
return value.indexOf(filter) !== -1;
|
2322
2189
|
}
|
2323
2190
|
|
2324
|
-
if (utils.isRegExp(filter)) {
|
2191
|
+
if (utils$1.isRegExp(filter)) {
|
2325
2192
|
return filter.test(value);
|
2326
2193
|
}
|
2327
2194
|
}
|
@@ -2334,7 +2201,7 @@ function formatHeader(header) {
|
|
2334
2201
|
}
|
2335
2202
|
|
2336
2203
|
function buildAccessors(obj, header) {
|
2337
|
-
const accessorName = utils.toCamelCase(' ' + header);
|
2204
|
+
const accessorName = utils$1.toCamelCase(' ' + header);
|
2338
2205
|
|
2339
2206
|
['get', 'set', 'has'].forEach(methodName => {
|
2340
2207
|
Object.defineProperty(obj, methodName + accessorName, {
|
@@ -2361,7 +2228,7 @@ class AxiosHeaders {
|
|
2361
2228
|
throw new Error('header name must be a non-empty string');
|
2362
2229
|
}
|
2363
2230
|
|
2364
|
-
const key = utils.findKey(self, lHeader);
|
2231
|
+
const key = utils$1.findKey(self, lHeader);
|
2365
2232
|
|
2366
2233
|
if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
|
2367
2234
|
self[key || _header] = normalizeValue(_value);
|
@@ -2369,11 +2236,11 @@ class AxiosHeaders {
|
|
2369
2236
|
}
|
2370
2237
|
|
2371
2238
|
const setHeaders = (headers, _rewrite) =>
|
2372
|
-
utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
2239
|
+
utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
2373
2240
|
|
2374
|
-
if (utils.isPlainObject(header) || header instanceof this.constructor) {
|
2241
|
+
if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
|
2375
2242
|
setHeaders(header, valueOrRewrite);
|
2376
|
-
} else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
2243
|
+
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
2377
2244
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
2378
2245
|
} else {
|
2379
2246
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
@@ -2386,7 +2253,7 @@ class AxiosHeaders {
|
|
2386
2253
|
header = normalizeHeader(header);
|
2387
2254
|
|
2388
2255
|
if (header) {
|
2389
|
-
const key = utils.findKey(this, header);
|
2256
|
+
const key = utils$1.findKey(this, header);
|
2390
2257
|
|
2391
2258
|
if (key) {
|
2392
2259
|
const value = this[key];
|
@@ -2399,11 +2266,11 @@ class AxiosHeaders {
|
|
2399
2266
|
return parseTokens(value);
|
2400
2267
|
}
|
2401
2268
|
|
2402
|
-
if (utils.isFunction(parser)) {
|
2269
|
+
if (utils$1.isFunction(parser)) {
|
2403
2270
|
return parser.call(this, value, key);
|
2404
2271
|
}
|
2405
2272
|
|
2406
|
-
if (utils.isRegExp(parser)) {
|
2273
|
+
if (utils$1.isRegExp(parser)) {
|
2407
2274
|
return parser.exec(value);
|
2408
2275
|
}
|
2409
2276
|
|
@@ -2416,7 +2283,7 @@ class AxiosHeaders {
|
|
2416
2283
|
header = normalizeHeader(header);
|
2417
2284
|
|
2418
2285
|
if (header) {
|
2419
|
-
const key = utils.findKey(this, header);
|
2286
|
+
const key = utils$1.findKey(this, header);
|
2420
2287
|
|
2421
2288
|
return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
2422
2289
|
}
|
@@ -2432,7 +2299,7 @@ class AxiosHeaders {
|
|
2432
2299
|
_header = normalizeHeader(_header);
|
2433
2300
|
|
2434
2301
|
if (_header) {
|
2435
|
-
const key = utils.findKey(self, _header);
|
2302
|
+
const key = utils$1.findKey(self, _header);
|
2436
2303
|
|
2437
2304
|
if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
|
2438
2305
|
delete self[key];
|
@@ -2442,7 +2309,7 @@ class AxiosHeaders {
|
|
2442
2309
|
}
|
2443
2310
|
}
|
2444
2311
|
|
2445
|
-
if (utils.isArray(header)) {
|
2312
|
+
if (utils$1.isArray(header)) {
|
2446
2313
|
header.forEach(deleteHeader);
|
2447
2314
|
} else {
|
2448
2315
|
deleteHeader(header);
|
@@ -2471,8 +2338,8 @@ class AxiosHeaders {
|
|
2471
2338
|
const self = this;
|
2472
2339
|
const headers = {};
|
2473
2340
|
|
2474
|
-
utils.forEach(this, (value, header) => {
|
2475
|
-
const key = utils.findKey(headers, header);
|
2341
|
+
utils$1.forEach(this, (value, header) => {
|
2342
|
+
const key = utils$1.findKey(headers, header);
|
2476
2343
|
|
2477
2344
|
if (key) {
|
2478
2345
|
self[key] = normalizeValue(value);
|
@@ -2501,8 +2368,8 @@ class AxiosHeaders {
|
|
2501
2368
|
toJSON(asStrings) {
|
2502
2369
|
const obj = Object.create(null);
|
2503
2370
|
|
2504
|
-
utils.forEach(this, (value, header) => {
|
2505
|
-
value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
|
2371
|
+
utils$1.forEach(this, (value, header) => {
|
2372
|
+
value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
|
2506
2373
|
});
|
2507
2374
|
|
2508
2375
|
return obj;
|
@@ -2549,7 +2416,7 @@ class AxiosHeaders {
|
|
2549
2416
|
}
|
2550
2417
|
}
|
2551
2418
|
|
2552
|
-
utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
2419
|
+
utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
2553
2420
|
|
2554
2421
|
return this;
|
2555
2422
|
}
|
@@ -2558,7 +2425,7 @@ class AxiosHeaders {
|
|
2558
2425
|
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
|
2559
2426
|
|
2560
2427
|
// reserved names hotfix
|
2561
|
-
utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
|
2428
|
+
utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
|
2562
2429
|
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
2563
2430
|
return {
|
2564
2431
|
get: () => value,
|
@@ -2568,7 +2435,7 @@ utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
|
|
2568
2435
|
}
|
2569
2436
|
});
|
2570
2437
|
|
2571
|
-
utils.freezeMethods(AxiosHeaders);
|
2438
|
+
utils$1.freezeMethods(AxiosHeaders);
|
2572
2439
|
|
2573
2440
|
/**
|
2574
2441
|
* Transform the data for a request or a response
|
@@ -2584,7 +2451,7 @@ function transformData(fns, response) {
|
|
2584
2451
|
const headers = AxiosHeaders.from(context.headers);
|
2585
2452
|
let data = context.data;
|
2586
2453
|
|
2587
|
-
utils.forEach(fns, function transform(fn) {
|
2454
|
+
utils$1.forEach(fns, function transform(fn) {
|
2588
2455
|
data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
|
2589
2456
|
});
|
2590
2457
|
|
@@ -2612,7 +2479,7 @@ function CanceledError(message, config, request) {
|
|
2612
2479
|
this.name = 'CanceledError';
|
2613
2480
|
}
|
2614
2481
|
|
2615
|
-
utils.inherits(CanceledError, AxiosError, {
|
2482
|
+
utils$1.inherits(CanceledError, AxiosError, {
|
2616
2483
|
__CANCEL__: true
|
2617
2484
|
});
|
2618
2485
|
|
@@ -2640,53 +2507,44 @@ function settle(resolve, reject, response) {
|
|
2640
2507
|
}
|
2641
2508
|
}
|
2642
2509
|
|
2643
|
-
const cookies = platform.
|
2510
|
+
const cookies = platform.hasStandardBrowserEnv ?
|
2644
2511
|
|
2645
|
-
// Standard browser envs support document.cookie
|
2646
|
-
|
2647
|
-
|
2648
|
-
|
2649
|
-
const cookie = [];
|
2650
|
-
cookie.push(name + '=' + encodeURIComponent(value));
|
2512
|
+
// Standard browser envs support document.cookie
|
2513
|
+
{
|
2514
|
+
write(name, value, expires, path, domain, secure) {
|
2515
|
+
const cookie = [name + '=' + encodeURIComponent(value)];
|
2651
2516
|
|
2652
|
-
|
2653
|
-
cookie.push('expires=' + new Date(expires).toGMTString());
|
2654
|
-
}
|
2517
|
+
utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
|
2655
2518
|
|
2656
|
-
|
2657
|
-
cookie.push('path=' + path);
|
2658
|
-
}
|
2519
|
+
utils$1.isString(path) && cookie.push('path=' + path);
|
2659
2520
|
|
2660
|
-
|
2661
|
-
cookie.push('domain=' + domain);
|
2662
|
-
}
|
2521
|
+
utils$1.isString(domain) && cookie.push('domain=' + domain);
|
2663
2522
|
|
2664
|
-
|
2665
|
-
cookie.push('secure');
|
2666
|
-
}
|
2523
|
+
secure === true && cookie.push('secure');
|
2667
2524
|
|
2668
|
-
|
2669
|
-
|
2525
|
+
document.cookie = cookie.join('; ');
|
2526
|
+
},
|
2670
2527
|
|
2671
|
-
|
2672
|
-
|
2673
|
-
|
2674
|
-
|
2528
|
+
read(name) {
|
2529
|
+
const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
2530
|
+
return (match ? decodeURIComponent(match[3]) : null);
|
2531
|
+
},
|
2675
2532
|
|
2676
|
-
|
2677
|
-
|
2678
|
-
|
2679
|
-
|
2680
|
-
})() :
|
2533
|
+
remove(name) {
|
2534
|
+
this.write(name, '', Date.now() - 86400000);
|
2535
|
+
}
|
2536
|
+
}
|
2681
2537
|
|
2682
|
-
|
2683
|
-
|
2684
|
-
|
2685
|
-
|
2686
|
-
|
2687
|
-
|
2688
|
-
|
2689
|
-
|
2538
|
+
:
|
2539
|
+
|
2540
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
2541
|
+
{
|
2542
|
+
write() {},
|
2543
|
+
read() {
|
2544
|
+
return null;
|
2545
|
+
},
|
2546
|
+
remove() {}
|
2547
|
+
};
|
2690
2548
|
|
2691
2549
|
/**
|
2692
2550
|
* Determines whether the specified URL is absolute
|
@@ -2733,7 +2591,7 @@ function buildFullPath(baseURL, requestedURL) {
|
|
2733
2591
|
return requestedURL;
|
2734
2592
|
}
|
2735
2593
|
|
2736
|
-
const isURLSameOrigin = platform.
|
2594
|
+
const isURLSameOrigin = platform.hasStandardBrowserEnv ?
|
2737
2595
|
|
2738
2596
|
// Standard browser envs have full support of the APIs needed to test
|
2739
2597
|
// whether the request URL is of the same origin as current location.
|
@@ -2743,7 +2601,7 @@ const isURLSameOrigin = platform.isStandardBrowserEnv ?
|
|
2743
2601
|
let originURL;
|
2744
2602
|
|
2745
2603
|
/**
|
2746
|
-
* Parse a URL to discover
|
2604
|
+
* Parse a URL to discover its components
|
2747
2605
|
*
|
2748
2606
|
* @param {String} url The URL to be parsed
|
2749
2607
|
* @returns {Object}
|
@@ -2783,7 +2641,7 @@ const isURLSameOrigin = platform.isStandardBrowserEnv ?
|
|
2783
2641
|
* @returns {boolean} True if URL shares the same origin, otherwise false
|
2784
2642
|
*/
|
2785
2643
|
return function isURLSameOrigin(requestURL) {
|
2786
|
-
const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
2644
|
+
const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
2787
2645
|
return (parsed.protocol === originURL.protocol &&
|
2788
2646
|
parsed.host === originURL.host);
|
2789
2647
|
};
|
@@ -2888,7 +2746,7 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
2888
2746
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
2889
2747
|
let requestData = config.data;
|
2890
2748
|
const requestHeaders = AxiosHeaders.from(config.headers).normalize();
|
2891
|
-
|
2749
|
+
let {responseType, withXSRFToken} = config;
|
2892
2750
|
let onCanceled;
|
2893
2751
|
function done() {
|
2894
2752
|
if (config.cancelToken) {
|
@@ -2902,14 +2760,13 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
2902
2760
|
|
2903
2761
|
let contentType;
|
2904
2762
|
|
2905
|
-
if (utils.isFormData(requestData)) {
|
2906
|
-
if (platform.
|
2763
|
+
if (utils$1.isFormData(requestData)) {
|
2764
|
+
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
2907
2765
|
requestHeaders.setContentType(false); // Let the browser set it
|
2908
|
-
} else if(
|
2909
|
-
requestHeaders.setContentType('multipart/form-data'); // mobile/desktop app frameworks
|
2910
|
-
} else if(utils.isString(contentType = requestHeaders.getContentType())){
|
2766
|
+
} else if ((contentType = requestHeaders.getContentType()) !== false) {
|
2911
2767
|
// fix semicolon duplication issue for ReactNative FormData implementation
|
2912
|
-
|
2768
|
+
const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
|
2769
|
+
requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
|
2913
2770
|
}
|
2914
2771
|
}
|
2915
2772
|
|
@@ -3025,13 +2882,16 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
3025
2882
|
// Add xsrf header
|
3026
2883
|
// This is only done if running in a standard browser environment.
|
3027
2884
|
// Specifically not if we're in a web worker, or react-native.
|
3028
|
-
if
|
3029
|
-
|
3030
|
-
const xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath))
|
3031
|
-
&& config.xsrfCookieName && cookies.read(config.xsrfCookieName);
|
2885
|
+
if(platform.hasStandardBrowserEnv) {
|
2886
|
+
withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
|
3032
2887
|
|
3033
|
-
if (
|
3034
|
-
|
2888
|
+
if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {
|
2889
|
+
// Add xsrf header
|
2890
|
+
const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
|
2891
|
+
|
2892
|
+
if (xsrfValue) {
|
2893
|
+
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
|
2894
|
+
}
|
3035
2895
|
}
|
3036
2896
|
}
|
3037
2897
|
|
@@ -3040,13 +2900,13 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
3040
2900
|
|
3041
2901
|
// Add headers to the request
|
3042
2902
|
if ('setRequestHeader' in request) {
|
3043
|
-
utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
2903
|
+
utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
3044
2904
|
request.setRequestHeader(key, val);
|
3045
2905
|
});
|
3046
2906
|
}
|
3047
2907
|
|
3048
2908
|
// Add withCredentials to request if needed
|
3049
|
-
if (!utils.isUndefined(config.withCredentials)) {
|
2909
|
+
if (!utils$1.isUndefined(config.withCredentials)) {
|
3050
2910
|
request.withCredentials = !!config.withCredentials;
|
3051
2911
|
}
|
3052
2912
|
|
@@ -3101,7 +2961,7 @@ const knownAdapters = {
|
|
3101
2961
|
xhr: xhrAdapter
|
3102
2962
|
};
|
3103
2963
|
|
3104
|
-
utils.forEach(knownAdapters, (fn, value) => {
|
2964
|
+
utils$1.forEach(knownAdapters, (fn, value) => {
|
3105
2965
|
if (fn) {
|
3106
2966
|
try {
|
3107
2967
|
Object.defineProperty(fn, 'name', {value});
|
@@ -3114,11 +2974,11 @@ utils.forEach(knownAdapters, (fn, value) => {
|
|
3114
2974
|
|
3115
2975
|
const renderReason = (reason) => `- ${reason}`;
|
3116
2976
|
|
3117
|
-
const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;
|
2977
|
+
const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
3118
2978
|
|
3119
2979
|
const adapters = {
|
3120
2980
|
getAdapter: (adapters) => {
|
3121
|
-
adapters = utils.isArray(adapters) ? adapters : [adapters];
|
2981
|
+
adapters = utils$1.isArray(adapters) ? adapters : [adapters];
|
3122
2982
|
|
3123
2983
|
const {length} = adapters;
|
3124
2984
|
let nameOrAdapter;
|
@@ -3259,11 +3119,11 @@ function mergeConfig(config1, config2) {
|
|
3259
3119
|
const config = {};
|
3260
3120
|
|
3261
3121
|
function getMergedValue(target, source, caseless) {
|
3262
|
-
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
3263
|
-
return utils.merge.call({caseless}, target, source);
|
3264
|
-
} else if (utils.isPlainObject(source)) {
|
3265
|
-
return utils.merge({}, source);
|
3266
|
-
} else if (utils.isArray(source)) {
|
3122
|
+
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
3123
|
+
return utils$1.merge.call({caseless}, target, source);
|
3124
|
+
} else if (utils$1.isPlainObject(source)) {
|
3125
|
+
return utils$1.merge({}, source);
|
3126
|
+
} else if (utils$1.isArray(source)) {
|
3267
3127
|
return source.slice();
|
3268
3128
|
}
|
3269
3129
|
return source;
|
@@ -3271,25 +3131,25 @@ function mergeConfig(config1, config2) {
|
|
3271
3131
|
|
3272
3132
|
// eslint-disable-next-line consistent-return
|
3273
3133
|
function mergeDeepProperties(a, b, caseless) {
|
3274
|
-
if (!utils.isUndefined(b)) {
|
3134
|
+
if (!utils$1.isUndefined(b)) {
|
3275
3135
|
return getMergedValue(a, b, caseless);
|
3276
|
-
} else if (!utils.isUndefined(a)) {
|
3136
|
+
} else if (!utils$1.isUndefined(a)) {
|
3277
3137
|
return getMergedValue(undefined, a, caseless);
|
3278
3138
|
}
|
3279
3139
|
}
|
3280
3140
|
|
3281
3141
|
// eslint-disable-next-line consistent-return
|
3282
3142
|
function valueFromConfig2(a, b) {
|
3283
|
-
if (!utils.isUndefined(b)) {
|
3143
|
+
if (!utils$1.isUndefined(b)) {
|
3284
3144
|
return getMergedValue(undefined, b);
|
3285
3145
|
}
|
3286
3146
|
}
|
3287
3147
|
|
3288
3148
|
// eslint-disable-next-line consistent-return
|
3289
3149
|
function defaultToConfig2(a, b) {
|
3290
|
-
if (!utils.isUndefined(b)) {
|
3150
|
+
if (!utils$1.isUndefined(b)) {
|
3291
3151
|
return getMergedValue(undefined, b);
|
3292
|
-
} else if (!utils.isUndefined(a)) {
|
3152
|
+
} else if (!utils$1.isUndefined(a)) {
|
3293
3153
|
return getMergedValue(undefined, a);
|
3294
3154
|
}
|
3295
3155
|
}
|
@@ -3314,6 +3174,7 @@ function mergeConfig(config1, config2) {
|
|
3314
3174
|
timeout: defaultToConfig2,
|
3315
3175
|
timeoutMessage: defaultToConfig2,
|
3316
3176
|
withCredentials: defaultToConfig2,
|
3177
|
+
withXSRFToken: defaultToConfig2,
|
3317
3178
|
adapter: defaultToConfig2,
|
3318
3179
|
responseType: defaultToConfig2,
|
3319
3180
|
xsrfCookieName: defaultToConfig2,
|
@@ -3334,16 +3195,16 @@ function mergeConfig(config1, config2) {
|
|
3334
3195
|
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
3335
3196
|
};
|
3336
3197
|
|
3337
|
-
utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
3198
|
+
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
3338
3199
|
const merge = mergeMap[prop] || mergeDeepProperties;
|
3339
3200
|
const configValue = merge(config1[prop], config2[prop], prop);
|
3340
|
-
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
3201
|
+
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
3341
3202
|
});
|
3342
3203
|
|
3343
3204
|
return config;
|
3344
3205
|
}
|
3345
3206
|
|
3346
|
-
const VERSION = "1.
|
3207
|
+
const VERSION = "1.6.2";
|
3347
3208
|
|
3348
3209
|
const validators$1 = {};
|
3349
3210
|
|
@@ -3481,7 +3342,7 @@ class Axios {
|
|
3481
3342
|
}
|
3482
3343
|
|
3483
3344
|
if (paramsSerializer != null) {
|
3484
|
-
if (utils.isFunction(paramsSerializer)) {
|
3345
|
+
if (utils$1.isFunction(paramsSerializer)) {
|
3485
3346
|
config.paramsSerializer = {
|
3486
3347
|
serialize: paramsSerializer
|
3487
3348
|
};
|
@@ -3497,12 +3358,12 @@ class Axios {
|
|
3497
3358
|
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
3498
3359
|
|
3499
3360
|
// Flatten headers
|
3500
|
-
let contextHeaders = headers && utils.merge(
|
3361
|
+
let contextHeaders = headers && utils$1.merge(
|
3501
3362
|
headers.common,
|
3502
3363
|
headers[config.method]
|
3503
3364
|
);
|
3504
3365
|
|
3505
|
-
headers && utils.forEach(
|
3366
|
+
headers && utils$1.forEach(
|
3506
3367
|
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
3507
3368
|
(method) => {
|
3508
3369
|
delete headers[method];
|
@@ -3589,7 +3450,7 @@ class Axios {
|
|
3589
3450
|
}
|
3590
3451
|
|
3591
3452
|
// Provide aliases for supported request methods
|
3592
|
-
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
3453
|
+
utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
3593
3454
|
/*eslint func-names:0*/
|
3594
3455
|
Axios.prototype[method] = function(url, config) {
|
3595
3456
|
return this.request(mergeConfig(config || {}, {
|
@@ -3600,7 +3461,7 @@ utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData
|
|
3600
3461
|
};
|
3601
3462
|
});
|
3602
3463
|
|
3603
|
-
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
3464
|
+
utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
3604
3465
|
/*eslint func-names:0*/
|
3605
3466
|
|
3606
3467
|
function generateHTTPMethod(isForm) {
|
@@ -3772,7 +3633,7 @@ function spread(callback) {
|
|
3772
3633
|
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
3773
3634
|
*/
|
3774
3635
|
function isAxiosError(payload) {
|
3775
|
-
return utils.isObject(payload) && (payload.isAxiosError === true);
|
3636
|
+
return utils$1.isObject(payload) && (payload.isAxiosError === true);
|
3776
3637
|
}
|
3777
3638
|
|
3778
3639
|
const HttpStatusCode = {
|
@@ -3857,10 +3718,10 @@ function createInstance(defaultConfig) {
|
|
3857
3718
|
const instance = bind(Axios.prototype.request, context);
|
3858
3719
|
|
3859
3720
|
// Copy axios.prototype to instance
|
3860
|
-
utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});
|
3721
|
+
utils$1.extend(instance, Axios.prototype, context, {allOwnKeys: true});
|
3861
3722
|
|
3862
3723
|
// Copy context to instance
|
3863
|
-
utils.extend(instance, context, null, {allOwnKeys: true});
|
3724
|
+
utils$1.extend(instance, context, null, {allOwnKeys: true});
|
3864
3725
|
|
3865
3726
|
// Factory for creating new instances
|
3866
3727
|
instance.create = function create(instanceConfig) {
|
@@ -3904,7 +3765,7 @@ axios.mergeConfig = mergeConfig;
|
|
3904
3765
|
|
3905
3766
|
axios.AxiosHeaders = AxiosHeaders;
|
3906
3767
|
|
3907
|
-
axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
|
3768
|
+
axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
3908
3769
|
|
3909
3770
|
axios.getAdapter = adapters.getAdapter;
|
3910
3771
|
|