@verdocs/web-sdk 2.2.47 → 2.3.1
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-d5dd1621.js} +1 -1
- package/dist/cjs/{Types-ee5afdf8.js → Types-fb95ed6b.js} +2 -1
- package/dist/cjs/{VerdocsEndpoint-2d85658d.js → VerdocsEndpoint-8495a05a.js} +294 -436
- 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 +6 -6
- 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/components/templates/verdocs-template-create/verdocs-template-create.js +2 -2
- package/dist/collection/utils/Types.js +2 -1
- package/dist/components/Types2.js +2 -1
- package/dist/components/VerdocsEndpoint.js +294 -436
- 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-create2.js +2 -2
- 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-18b6dbe3.js} +1 -1
- package/dist/esm/Types-1628dc71.js +5 -0
- package/dist/esm/{VerdocsEndpoint-b011af25.js → VerdocsEndpoint-140b14d7.js} +294 -436
- 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 +6 -6
- 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-18b6dbe3.js} +1 -1
- package/dist/esm-es5/Types-1628dc71.js +1 -0
- package/dist/esm-es5/VerdocsEndpoint-140b14d7.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-5c50a778.system.entry.js → p-0002c8d5.system.entry.js} +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-bd0bc3dd.system.entry.js → p-07432832.system.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-16724702.js +1 -0
- package/dist/verdocs-web-sdk/{p-aa51514f.system.entry.js → p-16849f44.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-1ba9f457.system.js +1 -0
- package/dist/verdocs-web-sdk/{p-23be436b.entry.js → p-1bb86e1a.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-76907130.entry.js → p-1cd6f713.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-609c7fab.system.entry.js → p-1df623d7.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-77abc3ce.entry.js → p-1eb38c2e.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-50ac71f3.system.entry.js → p-23ff8991.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-17d0e5f4.entry.js → p-2ec00680.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-32f1c0a6.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-961708ac.entry.js → p-36f7c8c6.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-79dc4f76.entry.js → p-38272a03.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-b73415c3.system.entry.js → p-393a9a2a.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a310f65b.entry.js → p-3a8c1133.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-f1257cd0.system.entry.js → p-4aeea02f.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-6bda7dce.entry.js → p-4ddbb290.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7b63017c.js → p-571f4e12.js} +1 -1
- package/dist/verdocs-web-sdk/{p-4a94ee00.system.entry.js → p-576a4517.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-59baf5ed.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-ee195e5e.entry.js → p-5c2b1e35.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-df6a373e.system.entry.js → p-5cce8ddb.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-5ed0a61e.system.js +1 -0
- 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-65b96820.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-70a3a6c1.entry.js → p-66b2899b.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-8da1555a.entry.js → p-764045ab.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-7d5dbd9a.js +1 -0
- package/dist/verdocs-web-sdk/{p-126ba5d2.system.entry.js → p-7db74d5e.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-839f6f0d.js +1 -0
- package/dist/verdocs-web-sdk/{p-ace35be6.entry.js → p-853a8c73.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-01166179.system.entry.js → p-878edeb5.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-89aa696c.system.entry.js → p-8ad78ada.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-6307e6ae.entry.js → p-8b28f85b.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-3abfff14.entry.js → p-8ceccd53.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-999fbe79.js +1 -0
- 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-3f9fbf94.entry.js → p-a7134b10.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-b17a20b8.entry.js → p-a8533019.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a0b02d83.system.entry.js → p-aca795cb.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a5425a9b.entry.js → p-acac85fc.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-62f090c7.system.entry.js → p-ad0805b6.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7805f0e0.entry.js → p-ad18bb44.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-9b07a2a7.entry.js → p-b10db51e.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-4f439363.entry.js → p-b2139ec5.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-343672f5.system.entry.js → p-be083d74.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-37187046.system.entry.js → p-c01196f9.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-2f04fb38.system.entry.js → p-c48b67ab.system.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-eef694e8.entry.js → p-c58e4861.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-261d376e.system.entry.js → p-c7f6bb1d.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-d0865aca.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-d8cd6b59.system.js +1 -0
- package/dist/verdocs-web-sdk/{p-7b40bf68.system.entry.js → p-dc37ce85.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-39cbfe15.entry.js → p-e4432f87.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-5df0fa7a.system.entry.js → p-e7481777.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-bb2c866b.system.entry.js → p-ed2d0a49.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-f04bf956.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-10af7aec.system.entry.js → p-f0b826a2.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-f1aa1551.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-fde6b724.entry.js → p-f269c7c4.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-eb595245.system.js → p-f83e5b8f.system.js} +1 -1
- package/dist/verdocs-web-sdk/{p-0e5449d1.system.entry.js → p-fc6629e5.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ecf04564.system.entry.js → p-fc94492b.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-fcd0a40a.system.js +1 -0
- package/dist/verdocs-web-sdk/{p-0ad1fd33.entry.js → p-fff35c6b.entry.js} +1 -1
- 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/custom-elements.json +0 -2059
- 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-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
@@ -217,10 +217,10 @@ var ALLOWED_CREATE_FIELDS = [
|
|
217
217
|
* ```typescript
|
218
218
|
* import {Templates} from '@verdocs/js-sdk/Templates';
|
219
219
|
*
|
220
|
-
* const newTemplate = await Templates.
|
220
|
+
* const newTemplate = await Templates.createTemplatev2((VerdocsEndpoint.getDefault(), {...});
|
221
221
|
* ```
|
222
222
|
*/
|
223
|
-
var
|
223
|
+
var createTemplatev2 = function (endpoint, params, onUploadProgress) {
|
224
224
|
var options = {
|
225
225
|
timeout: 120000,
|
226
226
|
onUploadProgress: function (event) {
|
@@ -230,22 +230,19 @@ var createTemplate = function (endpoint, params, onUploadProgress) {
|
|
230
230
|
},
|
231
231
|
};
|
232
232
|
if (params.documents && params.documents[0] instanceof File) {
|
233
|
-
|
234
|
-
throw new Error('createTemplate() has a maximum of 10 documents that can be attached.');
|
235
|
-
}
|
236
|
-
var formData_1 = new FormData();
|
233
|
+
var formData_2 = new FormData();
|
237
234
|
ALLOWED_CREATE_FIELDS.forEach(function (allowedKey) {
|
238
235
|
if (params[allowedKey] !== undefined) {
|
239
|
-
|
236
|
+
formData_2.append(allowedKey, params[allowedKey]);
|
240
237
|
}
|
241
238
|
});
|
242
239
|
params.documents.forEach(function (file) {
|
243
|
-
|
240
|
+
formData_2.append('documents', file, file.name);
|
244
241
|
});
|
245
|
-
return endpoint.api.post('/templates',
|
242
|
+
return endpoint.api.post('/v2/templates', formData_2, options).then(function (r) { return r.data; });
|
246
243
|
}
|
247
244
|
else {
|
248
|
-
return endpoint.api.post('/templates', params, options).then(function (r) { return r.data; });
|
245
|
+
return endpoint.api.post('/v2/templates', params, options).then(function (r) { return r.data; });
|
249
246
|
}
|
250
247
|
};
|
251
248
|
/**
|
@@ -420,277 +417,137 @@ const denyList = new Set([
|
|
420
417
|
// TODO: Use `error?.code` when targeting Node.js 14
|
421
418
|
var isRetryAllowed = error => !denyList.has(error && error.code);
|
422
419
|
|
423
|
-
|
424
|
-
|
425
|
-
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); }); }; }
|
426
|
-
|
427
|
-
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; }
|
428
|
-
|
429
|
-
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; }
|
430
|
-
|
431
|
-
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; }
|
432
|
-
var namespace = 'axios-retry';
|
433
|
-
/**
|
434
|
-
* @param {Error} error
|
435
|
-
* @return {boolean}
|
436
|
-
*/
|
437
|
-
|
420
|
+
const namespace = 'axios-retry';
|
438
421
|
function isNetworkError(error) {
|
439
|
-
|
440
|
-
|
441
|
-
|
422
|
+
const CODE_EXCLUDE_LIST = ['ERR_CANCELED', 'ECONNABORTED'];
|
423
|
+
if (error.response) {
|
424
|
+
return false;
|
425
|
+
}
|
426
|
+
if (!error.code) {
|
427
|
+
return false;
|
428
|
+
}
|
429
|
+
// Prevents retrying timed out & cancelled requests
|
430
|
+
if (CODE_EXCLUDE_LIST.includes(error.code)) {
|
431
|
+
return false;
|
432
|
+
}
|
433
|
+
// Prevents retrying unsafe errors
|
434
|
+
return isRetryAllowed(error);
|
442
435
|
}
|
443
|
-
|
444
|
-
|
445
|
-
/**
|
446
|
-
* @param {Error} error
|
447
|
-
* @return {boolean}
|
448
|
-
*/
|
449
|
-
|
436
|
+
const SAFE_HTTP_METHODS = ['get', 'head', 'options'];
|
437
|
+
const IDEMPOTENT_HTTP_METHODS = SAFE_HTTP_METHODS.concat(['put', 'delete']);
|
450
438
|
function isRetryableError(error) {
|
451
|
-
|
439
|
+
return (error.code !== 'ECONNABORTED' &&
|
440
|
+
(!error.response || (error.response.status >= 500 && error.response.status <= 599)));
|
452
441
|
}
|
453
|
-
/**
|
454
|
-
* @param {Error} error
|
455
|
-
* @return {boolean}
|
456
|
-
*/
|
457
|
-
|
458
442
|
function isSafeRequestError(error) {
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
return isRetryableError(error) && SAFE_HTTP_METHODS.indexOf(error.config.method) !== -1;
|
443
|
+
if (!error.config?.method) {
|
444
|
+
// Cannot determine if the request can be retried
|
445
|
+
return false;
|
446
|
+
}
|
447
|
+
return isRetryableError(error) && SAFE_HTTP_METHODS.indexOf(error.config.method) !== -1;
|
465
448
|
}
|
466
|
-
/**
|
467
|
-
* @param {Error} error
|
468
|
-
* @return {boolean}
|
469
|
-
*/
|
470
|
-
|
471
449
|
function isIdempotentRequestError(error) {
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
return isRetryableError(error) && IDEMPOTENT_HTTP_METHODS.indexOf(error.config.method) !== -1;
|
450
|
+
if (!error.config?.method) {
|
451
|
+
// Cannot determine if the request can be retried
|
452
|
+
return false;
|
453
|
+
}
|
454
|
+
return isRetryableError(error) && IDEMPOTENT_HTTP_METHODS.indexOf(error.config.method) !== -1;
|
478
455
|
}
|
479
|
-
/**
|
480
|
-
* @param {Error} error
|
481
|
-
* @return {boolean}
|
482
|
-
*/
|
483
|
-
|
484
456
|
function isNetworkOrIdempotentRequestError(error) {
|
485
|
-
|
457
|
+
return isNetworkError(error) || isIdempotentRequestError(error);
|
486
458
|
}
|
487
|
-
/**
|
488
|
-
* @return {number} - delay in milliseconds, always 0
|
489
|
-
*/
|
490
|
-
|
491
459
|
function noDelay() {
|
492
|
-
|
493
|
-
}
|
494
|
-
/**
|
495
|
-
* @param {number} [retryNumber=0]
|
496
|
-
* @return {number} - delay in milliseconds
|
497
|
-
*/
|
498
|
-
|
499
|
-
|
500
|
-
function exponentialDelay() {
|
501
|
-
var retryNumber = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
502
|
-
var delay = Math.pow(2, retryNumber) * 100;
|
503
|
-
var randomSum = delay * 0.2 * Math.random(); // 0-20% of the delay
|
504
|
-
|
505
|
-
return delay + randomSum;
|
460
|
+
return 0;
|
506
461
|
}
|
507
|
-
|
508
|
-
|
509
|
-
*
|
510
|
-
|
511
|
-
*/
|
512
|
-
|
513
|
-
function getCurrentState(config) {
|
514
|
-
var currentState = config[namespace] || {};
|
515
|
-
currentState.retryCount = currentState.retryCount || 0;
|
516
|
-
config[namespace] = currentState;
|
517
|
-
return currentState;
|
462
|
+
function exponentialDelay(retryNumber = 0, _error = undefined, delayFactor = 100) {
|
463
|
+
const delay = 2 ** retryNumber * delayFactor;
|
464
|
+
const randomSum = delay * 0.2 * Math.random(); // 0-20% of the delay
|
465
|
+
return delay + randomSum;
|
518
466
|
}
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
467
|
+
const DEFAULT_OPTIONS = {
|
468
|
+
retries: 3,
|
469
|
+
retryCondition: isNetworkOrIdempotentRequestError,
|
470
|
+
retryDelay: noDelay,
|
471
|
+
shouldResetTimeout: false,
|
472
|
+
onRetry: () => { }
|
473
|
+
};
|
527
474
|
function getRequestOptions(config, defaultOptions) {
|
528
|
-
|
475
|
+
return { ...DEFAULT_OPTIONS, ...defaultOptions, ...config[namespace] };
|
529
476
|
}
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
function fixConfig(axios, config) {
|
537
|
-
if (axios.defaults.agent === config.agent) {
|
538
|
-
delete config.agent;
|
539
|
-
}
|
540
|
-
|
541
|
-
if (axios.defaults.httpAgent === config.httpAgent) {
|
542
|
-
delete config.httpAgent;
|
543
|
-
}
|
544
|
-
|
545
|
-
if (axios.defaults.httpsAgent === config.httpsAgent) {
|
546
|
-
delete config.httpsAgent;
|
547
|
-
}
|
477
|
+
function setCurrentState(config, defaultOptions) {
|
478
|
+
const currentState = getRequestOptions(config, defaultOptions || {});
|
479
|
+
currentState.retryCount = currentState.retryCount || 0;
|
480
|
+
currentState.lastRequestTime = currentState.lastRequestTime || Date.now();
|
481
|
+
config[namespace] = currentState;
|
482
|
+
return currentState;
|
548
483
|
}
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
484
|
+
function fixConfig(axiosInstance, config) {
|
485
|
+
// @ts-ignore
|
486
|
+
if (axiosInstance.defaults.agent === config.agent) {
|
487
|
+
// @ts-ignore
|
488
|
+
delete config.agent;
|
489
|
+
}
|
490
|
+
if (axiosInstance.defaults.httpAgent === config.httpAgent) {
|
491
|
+
delete config.httpAgent;
|
492
|
+
}
|
493
|
+
if (axiosInstance.defaults.httpsAgent === config.httpsAgent) {
|
494
|
+
delete config.httpsAgent;
|
495
|
+
}
|
561
496
|
}
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
*
|
567
|
-
* import axios from 'axios';
|
568
|
-
*
|
569
|
-
* axiosRetry(axios, { retries: 3 });
|
570
|
-
*
|
571
|
-
* axios.get('http://example.com/test') // The first request fails and the second returns 'ok'
|
572
|
-
* .then(result => {
|
573
|
-
* result.data; // 'ok'
|
574
|
-
* });
|
575
|
-
*
|
576
|
-
* // Exponential back-off retry delay between requests
|
577
|
-
* axiosRetry(axios, { retryDelay : axiosRetry.exponentialDelay});
|
578
|
-
*
|
579
|
-
* // Custom retry delay
|
580
|
-
* axiosRetry(axios, { retryDelay : (retryCount) => {
|
581
|
-
* return retryCount * 1000;
|
582
|
-
* }});
|
583
|
-
*
|
584
|
-
* // Also works with custom axios instances
|
585
|
-
* const client = axios.create({ baseURL: 'http://example.com' });
|
586
|
-
* axiosRetry(client, { retries: 3 });
|
587
|
-
*
|
588
|
-
* client.get('/test') // The first request fails and the second returns 'ok'
|
589
|
-
* .then(result => {
|
590
|
-
* result.data; // 'ok'
|
591
|
-
* });
|
592
|
-
*
|
593
|
-
* // Allows request-specific configuration
|
594
|
-
* client
|
595
|
-
* .get('/test', {
|
596
|
-
* 'axios-retry': {
|
597
|
-
* retries: 0
|
598
|
-
* }
|
599
|
-
* })
|
600
|
-
* .catch(error => { // The first request fails
|
601
|
-
* error !== undefined
|
602
|
-
* });
|
603
|
-
*
|
604
|
-
* @param {Axios} axios An axios instance (the axios object or one created from axios.create)
|
605
|
-
* @param {Object} [defaultOptions]
|
606
|
-
* @param {number} [defaultOptions.retries=3] Number of retries
|
607
|
-
* @param {boolean} [defaultOptions.shouldResetTimeout=false]
|
608
|
-
* Defines if the timeout should be reset between retries
|
609
|
-
* @param {Function} [defaultOptions.retryCondition=isNetworkOrIdempotentRequestError]
|
610
|
-
* A function to determine if the error can be retried
|
611
|
-
* @param {Function} [defaultOptions.retryDelay=noDelay]
|
612
|
-
* A function to determine the delay between retry requests
|
613
|
-
* @param {Function} [defaultOptions.onRetry=()=>{}]
|
614
|
-
* A function to get notified when a retry occurs
|
615
|
-
*/
|
616
|
-
|
617
|
-
|
618
|
-
function _shouldRetry() {
|
619
|
-
_shouldRetry = _asyncToGenerator(function* (retries, retryCondition, currentState, error) {
|
620
|
-
var shouldRetryOrPromise = currentState.retryCount < retries && retryCondition(error); // This could be a promise
|
621
|
-
|
497
|
+
async function shouldRetry(currentState, error) {
|
498
|
+
const { retries, retryCondition } = currentState;
|
499
|
+
const shouldRetryOrPromise = (currentState.retryCount || 0) < retries && retryCondition(error);
|
500
|
+
// This could be a promise
|
622
501
|
if (typeof shouldRetryOrPromise === 'object') {
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
502
|
+
try {
|
503
|
+
const shouldRetryPromiseResult = await shouldRetryOrPromise;
|
504
|
+
// keep return true unless shouldRetryPromiseResult return false for compatibility
|
505
|
+
return shouldRetryPromiseResult !== false;
|
506
|
+
}
|
507
|
+
catch (_err) {
|
508
|
+
return false;
|
509
|
+
}
|
630
510
|
}
|
631
|
-
|
632
511
|
return shouldRetryOrPromise;
|
633
|
-
});
|
634
|
-
return _shouldRetry.apply(this, arguments);
|
635
512
|
}
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
var {
|
646
|
-
config
|
647
|
-
} = error; // If we have no information to retry the request
|
648
|
-
|
649
|
-
if (!config) {
|
650
|
-
return Promise.reject(error);
|
651
|
-
}
|
652
|
-
|
653
|
-
var {
|
654
|
-
retries = 3,
|
655
|
-
retryCondition = isNetworkOrIdempotentRequestError,
|
656
|
-
retryDelay = noDelay,
|
657
|
-
shouldResetTimeout = false,
|
658
|
-
onRetry = () => {}
|
659
|
-
} = getRequestOptions(config, defaultOptions);
|
660
|
-
var currentState = getCurrentState(config);
|
661
|
-
|
662
|
-
if (yield shouldRetry(retries, retryCondition, currentState, error)) {
|
663
|
-
currentState.retryCount += 1;
|
664
|
-
var delay = retryDelay(currentState.retryCount, error); // Axios fails merging this configuration to the default configuration because it has an issue
|
665
|
-
// with circular structures: https://github.com/mzabriskie/axios/issues/370
|
666
|
-
|
667
|
-
fixConfig(axios, config);
|
668
|
-
|
669
|
-
if (!shouldResetTimeout && config.timeout && currentState.lastRequestTime) {
|
670
|
-
var lastRequestDuration = Date.now() - currentState.lastRequestTime;
|
671
|
-
var timeout = config.timeout - lastRequestDuration - delay;
|
672
|
-
|
673
|
-
if (timeout <= 0) {
|
513
|
+
const axiosRetry = (axiosInstance, defaultOptions) => {
|
514
|
+
const requestInterceptorId = axiosInstance.interceptors.request.use((config) => {
|
515
|
+
setCurrentState(config, defaultOptions);
|
516
|
+
return config;
|
517
|
+
});
|
518
|
+
const responseInterceptorId = axiosInstance.interceptors.response.use(null, async (error) => {
|
519
|
+
const { config } = error;
|
520
|
+
// If we have no information to retry the request
|
521
|
+
if (!config) {
|
674
522
|
return Promise.reject(error);
|
675
|
-
}
|
676
|
-
|
677
|
-
config.timeout = timeout;
|
678
523
|
}
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
524
|
+
const currentState = setCurrentState(config, defaultOptions);
|
525
|
+
if (await shouldRetry(currentState, error)) {
|
526
|
+
currentState.retryCount += 1;
|
527
|
+
const { retryDelay, shouldResetTimeout, onRetry } = currentState;
|
528
|
+
const delay = retryDelay(currentState.retryCount, error);
|
529
|
+
// Axios fails merging this configuration to the default configuration because it has an issue
|
530
|
+
// with circular structures: https://github.com/mzabriskie/axios/issues/370
|
531
|
+
fixConfig(axiosInstance, config);
|
532
|
+
if (!shouldResetTimeout && config.timeout && currentState.lastRequestTime) {
|
533
|
+
const lastRequestDuration = Date.now() - currentState.lastRequestTime;
|
534
|
+
const timeout = config.timeout - lastRequestDuration - delay;
|
535
|
+
if (timeout <= 0) {
|
536
|
+
return Promise.reject(error);
|
537
|
+
}
|
538
|
+
config.timeout = timeout;
|
539
|
+
}
|
540
|
+
config.transformRequest = [(data) => data];
|
541
|
+
await onRetry(currentState.retryCount, error, config);
|
542
|
+
return new Promise((resolve) => {
|
543
|
+
setTimeout(() => resolve(axiosInstance(config)), delay);
|
544
|
+
});
|
545
|
+
}
|
546
|
+
return Promise.reject(error);
|
686
547
|
});
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
};
|
691
|
-
}());
|
692
|
-
} // Compatibility with CommonJS
|
693
|
-
|
548
|
+
return { requestInterceptorId, responseInterceptorId };
|
549
|
+
};
|
550
|
+
// Compatibility with CommonJS
|
694
551
|
axiosRetry.isNetworkError = isNetworkError;
|
695
552
|
axiosRetry.isSafeRequestError = isSafeRequestError;
|
696
553
|
axiosRetry.isIdempotentRequestError = isIdempotentRequestError;
|
@@ -1370,7 +1227,7 @@ const isAsyncFn = kindOfTest('AsyncFunction');
|
|
1370
1227
|
const isThenable = (thing) =>
|
1371
1228
|
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
1372
1229
|
|
1373
|
-
const utils = {
|
1230
|
+
const utils$1 = {
|
1374
1231
|
isArray,
|
1375
1232
|
isArrayBuffer,
|
1376
1233
|
isBuffer,
|
@@ -1452,7 +1309,7 @@ function AxiosError(message, code, config, request, response) {
|
|
1452
1309
|
response && (this.response = response);
|
1453
1310
|
}
|
1454
1311
|
|
1455
|
-
utils.inherits(AxiosError, Error, {
|
1312
|
+
utils$1.inherits(AxiosError, Error, {
|
1456
1313
|
toJSON: function toJSON() {
|
1457
1314
|
return {
|
1458
1315
|
// Standard
|
@@ -1467,7 +1324,7 @@ utils.inherits(AxiosError, Error, {
|
|
1467
1324
|
columnNumber: this.columnNumber,
|
1468
1325
|
stack: this.stack,
|
1469
1326
|
// Axios
|
1470
|
-
config: utils.toJSONObject(this.config),
|
1327
|
+
config: utils$1.toJSONObject(this.config),
|
1471
1328
|
code: this.code,
|
1472
1329
|
status: this.response && this.response.status ? this.response.status : null
|
1473
1330
|
};
|
@@ -1502,7 +1359,7 @@ Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
|
|
1502
1359
|
AxiosError.from = (error, code, config, request, response, customProps) => {
|
1503
1360
|
const axiosError = Object.create(prototype$1);
|
1504
1361
|
|
1505
|
-
utils.toFlatObject(error, axiosError, function filter(obj) {
|
1362
|
+
utils$1.toFlatObject(error, axiosError, function filter(obj) {
|
1506
1363
|
return obj !== Error.prototype;
|
1507
1364
|
}, prop => {
|
1508
1365
|
return prop !== 'isAxiosError';
|
@@ -1530,7 +1387,7 @@ const httpAdapter = null;
|
|
1530
1387
|
* @returns {boolean}
|
1531
1388
|
*/
|
1532
1389
|
function isVisitable(thing) {
|
1533
|
-
return utils.isPlainObject(thing) || utils.isArray(thing);
|
1390
|
+
return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
|
1534
1391
|
}
|
1535
1392
|
|
1536
1393
|
/**
|
@@ -1541,7 +1398,7 @@ function isVisitable(thing) {
|
|
1541
1398
|
* @returns {string} the key without the brackets.
|
1542
1399
|
*/
|
1543
1400
|
function removeBrackets(key) {
|
1544
|
-
return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;
|
1401
|
+
return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
|
1545
1402
|
}
|
1546
1403
|
|
1547
1404
|
/**
|
@@ -1570,10 +1427,10 @@ function renderKey(path, key, dots) {
|
|
1570
1427
|
* @returns {boolean}
|
1571
1428
|
*/
|
1572
1429
|
function isFlatArray(arr) {
|
1573
|
-
return utils.isArray(arr) && !arr.some(isVisitable);
|
1430
|
+
return utils$1.isArray(arr) && !arr.some(isVisitable);
|
1574
1431
|
}
|
1575
1432
|
|
1576
|
-
const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
|
1433
|
+
const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
|
1577
1434
|
return /^is[A-Z]/.test(prop);
|
1578
1435
|
});
|
1579
1436
|
|
@@ -1601,7 +1458,7 @@ const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
|
|
1601
1458
|
* @returns
|
1602
1459
|
*/
|
1603
1460
|
function toFormData(obj, formData, options) {
|
1604
|
-
if (!utils.isObject(obj)) {
|
1461
|
+
if (!utils$1.isObject(obj)) {
|
1605
1462
|
throw new TypeError('target must be an object');
|
1606
1463
|
}
|
1607
1464
|
|
@@ -1609,13 +1466,13 @@ function toFormData(obj, formData, options) {
|
|
1609
1466
|
formData = formData || new (FormData)();
|
1610
1467
|
|
1611
1468
|
// eslint-disable-next-line no-param-reassign
|
1612
|
-
options = utils.toFlatObject(options, {
|
1469
|
+
options = utils$1.toFlatObject(options, {
|
1613
1470
|
metaTokens: true,
|
1614
1471
|
dots: false,
|
1615
1472
|
indexes: false
|
1616
1473
|
}, false, function defined(option, source) {
|
1617
1474
|
// eslint-disable-next-line no-eq-null,eqeqeq
|
1618
|
-
return !utils.isUndefined(source[option]);
|
1475
|
+
return !utils$1.isUndefined(source[option]);
|
1619
1476
|
});
|
1620
1477
|
|
1621
1478
|
const metaTokens = options.metaTokens;
|
@@ -1624,24 +1481,24 @@ function toFormData(obj, formData, options) {
|
|
1624
1481
|
const dots = options.dots;
|
1625
1482
|
const indexes = options.indexes;
|
1626
1483
|
const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
|
1627
|
-
const useBlob = _Blob && utils.isSpecCompliantForm(formData);
|
1484
|
+
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
1628
1485
|
|
1629
|
-
if (!utils.isFunction(visitor)) {
|
1486
|
+
if (!utils$1.isFunction(visitor)) {
|
1630
1487
|
throw new TypeError('visitor must be a function');
|
1631
1488
|
}
|
1632
1489
|
|
1633
1490
|
function convertValue(value) {
|
1634
1491
|
if (value === null) return '';
|
1635
1492
|
|
1636
|
-
if (utils.isDate(value)) {
|
1493
|
+
if (utils$1.isDate(value)) {
|
1637
1494
|
return value.toISOString();
|
1638
1495
|
}
|
1639
1496
|
|
1640
|
-
if (!useBlob && utils.isBlob(value)) {
|
1497
|
+
if (!useBlob && utils$1.isBlob(value)) {
|
1641
1498
|
throw new AxiosError('Blob is not supported. Use a Buffer instead.');
|
1642
1499
|
}
|
1643
1500
|
|
1644
|
-
if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
|
1501
|
+
if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
|
1645
1502
|
return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
|
1646
1503
|
}
|
1647
1504
|
|
@@ -1662,20 +1519,20 @@ function toFormData(obj, formData, options) {
|
|
1662
1519
|
let arr = value;
|
1663
1520
|
|
1664
1521
|
if (value && !path && typeof value === 'object') {
|
1665
|
-
if (utils.endsWith(key, '{}')) {
|
1522
|
+
if (utils$1.endsWith(key, '{}')) {
|
1666
1523
|
// eslint-disable-next-line no-param-reassign
|
1667
1524
|
key = metaTokens ? key : key.slice(0, -2);
|
1668
1525
|
// eslint-disable-next-line no-param-reassign
|
1669
1526
|
value = JSON.stringify(value);
|
1670
1527
|
} else if (
|
1671
|
-
(utils.isArray(value) && isFlatArray(value)) ||
|
1672
|
-
((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))
|
1528
|
+
(utils$1.isArray(value) && isFlatArray(value)) ||
|
1529
|
+
((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
|
1673
1530
|
)) {
|
1674
1531
|
// eslint-disable-next-line no-param-reassign
|
1675
1532
|
key = removeBrackets(key);
|
1676
1533
|
|
1677
1534
|
arr.forEach(function each(el, index) {
|
1678
|
-
!(utils.isUndefined(el) || el === null) && formData.append(
|
1535
|
+
!(utils$1.isUndefined(el) || el === null) && formData.append(
|
1679
1536
|
// eslint-disable-next-line no-nested-ternary
|
1680
1537
|
indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
|
1681
1538
|
convertValue(el)
|
@@ -1703,7 +1560,7 @@ function toFormData(obj, formData, options) {
|
|
1703
1560
|
});
|
1704
1561
|
|
1705
1562
|
function build(value, path) {
|
1706
|
-
if (utils.isUndefined(value)) return;
|
1563
|
+
if (utils$1.isUndefined(value)) return;
|
1707
1564
|
|
1708
1565
|
if (stack.indexOf(value) !== -1) {
|
1709
1566
|
throw Error('Circular reference detected in ' + path.join('.'));
|
@@ -1711,9 +1568,9 @@ function toFormData(obj, formData, options) {
|
|
1711
1568
|
|
1712
1569
|
stack.push(value);
|
1713
1570
|
|
1714
|
-
utils.forEach(value, function each(el, key) {
|
1715
|
-
const result = !(utils.isUndefined(el) || el === null) && visitor.call(
|
1716
|
-
formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers
|
1571
|
+
utils$1.forEach(value, function each(el, key) {
|
1572
|
+
const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
|
1573
|
+
formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
|
1717
1574
|
);
|
1718
1575
|
|
1719
1576
|
if (result === true) {
|
@@ -1724,7 +1581,7 @@ function toFormData(obj, formData, options) {
|
|
1724
1581
|
stack.pop();
|
1725
1582
|
}
|
1726
1583
|
|
1727
|
-
if (!utils.isObject(obj)) {
|
1584
|
+
if (!utils$1.isObject(obj)) {
|
1728
1585
|
throw new TypeError('data must be an object');
|
1729
1586
|
}
|
1730
1587
|
|
@@ -1828,7 +1685,7 @@ function buildURL(url, params, options) {
|
|
1828
1685
|
if (serializeFn) {
|
1829
1686
|
serializedParams = serializeFn(params, options);
|
1830
1687
|
} else {
|
1831
|
-
serializedParams = utils.isURLSearchParams(params) ?
|
1688
|
+
serializedParams = utils$1.isURLSearchParams(params) ?
|
1832
1689
|
params.toString() :
|
1833
1690
|
new AxiosURLSearchParams(params, options).toString(_encode);
|
1834
1691
|
}
|
@@ -1903,7 +1760,7 @@ class InterceptorManager {
|
|
1903
1760
|
* @returns {void}
|
1904
1761
|
*/
|
1905
1762
|
forEach(fn) {
|
1906
|
-
utils.forEach(this.handlers, function forEachHandler(h) {
|
1763
|
+
utils$1.forEach(this.handlers, function forEachHandler(h) {
|
1907
1764
|
if (h !== null) {
|
1908
1765
|
fn(h);
|
1909
1766
|
}
|
@@ -1923,6 +1780,18 @@ const FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
|
|
1923
1780
|
|
1924
1781
|
const Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
|
1925
1782
|
|
1783
|
+
const platform$1 = {
|
1784
|
+
isBrowser: true,
|
1785
|
+
classes: {
|
1786
|
+
URLSearchParams: URLSearchParams$1,
|
1787
|
+
FormData: FormData$1,
|
1788
|
+
Blob: Blob$1
|
1789
|
+
},
|
1790
|
+
protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
|
1791
|
+
};
|
1792
|
+
|
1793
|
+
const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
|
1794
|
+
|
1926
1795
|
/**
|
1927
1796
|
* Determine if we're running in a standard browser environment
|
1928
1797
|
*
|
@@ -1940,18 +1809,10 @@ const Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
|
|
1940
1809
|
*
|
1941
1810
|
* @returns {boolean}
|
1942
1811
|
*/
|
1943
|
-
const
|
1944
|
-
|
1945
|
-
|
1946
|
-
|
1947
|
-
product === 'NativeScript' ||
|
1948
|
-
product === 'NS')
|
1949
|
-
) {
|
1950
|
-
return false;
|
1951
|
-
}
|
1952
|
-
|
1953
|
-
return typeof window !== 'undefined' && typeof document !== 'undefined';
|
1954
|
-
})();
|
1812
|
+
const hasStandardBrowserEnv = (
|
1813
|
+
(product) => {
|
1814
|
+
return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
|
1815
|
+
})(typeof navigator !== 'undefined' && navigator.product);
|
1955
1816
|
|
1956
1817
|
/**
|
1957
1818
|
* Determine if we're running in a standard browser webWorker environment
|
@@ -1962,7 +1823,7 @@ const isStandardBrowserEnv = (() => {
|
|
1962
1823
|
* `typeof window !== 'undefined' && typeof document !== 'undefined'`.
|
1963
1824
|
* This leads to a problem when axios post `FormData` in webWorker
|
1964
1825
|
*/
|
1965
|
-
|
1826
|
+
const hasStandardBrowserWebWorkerEnv = (() => {
|
1966
1827
|
return (
|
1967
1828
|
typeof WorkerGlobalScope !== 'undefined' &&
|
1968
1829
|
// eslint-disable-next-line no-undef
|
@@ -1971,22 +1832,25 @@ const isStandardBrowserEnv = (() => {
|
|
1971
1832
|
);
|
1972
1833
|
})();
|
1973
1834
|
|
1835
|
+
const utils = /*#__PURE__*/Object.freeze({
|
1836
|
+
__proto__: null,
|
1837
|
+
hasBrowserEnv: hasBrowserEnv,
|
1838
|
+
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
1839
|
+
hasStandardBrowserEnv: hasStandardBrowserEnv
|
1840
|
+
});
|
1974
1841
|
|
1975
1842
|
const platform = {
|
1976
|
-
|
1977
|
-
|
1978
|
-
URLSearchParams: URLSearchParams$1,
|
1979
|
-
FormData: FormData$1,
|
1980
|
-
Blob: Blob$1
|
1981
|
-
},
|
1982
|
-
isStandardBrowserEnv,
|
1983
|
-
isStandardBrowserWebWorkerEnv,
|
1984
|
-
protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
|
1843
|
+
...utils,
|
1844
|
+
...platform$1
|
1985
1845
|
};
|
1986
1846
|
|
1987
1847
|
function toURLEncodedForm(data, options) {
|
1988
1848
|
return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
|
1989
1849
|
visitor: function(value, key, path, helpers) {
|
1850
|
+
if (platform.isNode && utils$1.isBuffer(value)) {
|
1851
|
+
this.append(key, value.toString('base64'));
|
1852
|
+
return false;
|
1853
|
+
}
|
1990
1854
|
|
1991
1855
|
return helpers.defaultVisitor.apply(this, arguments);
|
1992
1856
|
}
|
@@ -2005,7 +1869,7 @@ function parsePropPath(name) {
|
|
2005
1869
|
// foo.x.y.z
|
2006
1870
|
// foo-x-y-z
|
2007
1871
|
// foo x y z
|
2008
|
-
return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
|
1872
|
+
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
|
2009
1873
|
return match[0] === '[]' ? '' : match[1] || match[0];
|
2010
1874
|
});
|
2011
1875
|
}
|
@@ -2042,10 +1906,10 @@ function formDataToJSON(formData) {
|
|
2042
1906
|
let name = path[index++];
|
2043
1907
|
const isNumericKey = Number.isFinite(+name);
|
2044
1908
|
const isLast = index >= path.length;
|
2045
|
-
name = !name && utils.isArray(target) ? target.length : name;
|
1909
|
+
name = !name && utils$1.isArray(target) ? target.length : name;
|
2046
1910
|
|
2047
1911
|
if (isLast) {
|
2048
|
-
if (utils.hasOwnProp(target, name)) {
|
1912
|
+
if (utils$1.hasOwnProp(target, name)) {
|
2049
1913
|
target[name] = [target[name], value];
|
2050
1914
|
} else {
|
2051
1915
|
target[name] = value;
|
@@ -2054,23 +1918,23 @@ function formDataToJSON(formData) {
|
|
2054
1918
|
return !isNumericKey;
|
2055
1919
|
}
|
2056
1920
|
|
2057
|
-
if (!target[name] || !utils.isObject(target[name])) {
|
1921
|
+
if (!target[name] || !utils$1.isObject(target[name])) {
|
2058
1922
|
target[name] = [];
|
2059
1923
|
}
|
2060
1924
|
|
2061
1925
|
const result = buildPath(path, value, target[name], index);
|
2062
1926
|
|
2063
|
-
if (result && utils.isArray(target[name])) {
|
1927
|
+
if (result && utils$1.isArray(target[name])) {
|
2064
1928
|
target[name] = arrayToObject(target[name]);
|
2065
1929
|
}
|
2066
1930
|
|
2067
1931
|
return !isNumericKey;
|
2068
1932
|
}
|
2069
1933
|
|
2070
|
-
if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {
|
1934
|
+
if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
|
2071
1935
|
const obj = {};
|
2072
1936
|
|
2073
|
-
utils.forEachEntry(formData, (name, value) => {
|
1937
|
+
utils$1.forEachEntry(formData, (name, value) => {
|
2074
1938
|
buildPath(parsePropPath(name), value, obj, 0);
|
2075
1939
|
});
|
2076
1940
|
|
@@ -2091,10 +1955,10 @@ function formDataToJSON(formData) {
|
|
2091
1955
|
* @returns {string} A stringified version of the rawValue.
|
2092
1956
|
*/
|
2093
1957
|
function stringifySafely(rawValue, parser, encoder) {
|
2094
|
-
if (utils.isString(rawValue)) {
|
1958
|
+
if (utils$1.isString(rawValue)) {
|
2095
1959
|
try {
|
2096
1960
|
(parser || JSON.parse)(rawValue);
|
2097
|
-
return utils.trim(rawValue);
|
1961
|
+
return utils$1.trim(rawValue);
|
2098
1962
|
} catch (e) {
|
2099
1963
|
if (e.name !== 'SyntaxError') {
|
2100
1964
|
throw e;
|
@@ -2114,13 +1978,13 @@ const defaults = {
|
|
2114
1978
|
transformRequest: [function transformRequest(data, headers) {
|
2115
1979
|
const contentType = headers.getContentType() || '';
|
2116
1980
|
const hasJSONContentType = contentType.indexOf('application/json') > -1;
|
2117
|
-
const isObjectPayload = utils.isObject(data);
|
1981
|
+
const isObjectPayload = utils$1.isObject(data);
|
2118
1982
|
|
2119
|
-
if (isObjectPayload && utils.isHTMLForm(data)) {
|
1983
|
+
if (isObjectPayload && utils$1.isHTMLForm(data)) {
|
2120
1984
|
data = new FormData(data);
|
2121
1985
|
}
|
2122
1986
|
|
2123
|
-
const isFormData = utils.isFormData(data);
|
1987
|
+
const isFormData = utils$1.isFormData(data);
|
2124
1988
|
|
2125
1989
|
if (isFormData) {
|
2126
1990
|
if (!hasJSONContentType) {
|
@@ -2129,18 +1993,18 @@ const defaults = {
|
|
2129
1993
|
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
2130
1994
|
}
|
2131
1995
|
|
2132
|
-
if (utils.isArrayBuffer(data) ||
|
2133
|
-
utils.isBuffer(data) ||
|
2134
|
-
utils.isStream(data) ||
|
2135
|
-
utils.isFile(data) ||
|
2136
|
-
utils.isBlob(data)
|
1996
|
+
if (utils$1.isArrayBuffer(data) ||
|
1997
|
+
utils$1.isBuffer(data) ||
|
1998
|
+
utils$1.isStream(data) ||
|
1999
|
+
utils$1.isFile(data) ||
|
2000
|
+
utils$1.isBlob(data)
|
2137
2001
|
) {
|
2138
2002
|
return data;
|
2139
2003
|
}
|
2140
|
-
if (utils.isArrayBufferView(data)) {
|
2004
|
+
if (utils$1.isArrayBufferView(data)) {
|
2141
2005
|
return data.buffer;
|
2142
2006
|
}
|
2143
|
-
if (utils.isURLSearchParams(data)) {
|
2007
|
+
if (utils$1.isURLSearchParams(data)) {
|
2144
2008
|
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
|
2145
2009
|
return data.toString();
|
2146
2010
|
}
|
@@ -2152,7 +2016,7 @@ const defaults = {
|
|
2152
2016
|
return toURLEncodedForm(data, this.formSerializer).toString();
|
2153
2017
|
}
|
2154
2018
|
|
2155
|
-
if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
|
2019
|
+
if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
|
2156
2020
|
const _FormData = this.env && this.env.FormData;
|
2157
2021
|
|
2158
2022
|
return toFormData(
|
@@ -2176,7 +2040,7 @@ const defaults = {
|
|
2176
2040
|
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
2177
2041
|
const JSONRequested = this.responseType === 'json';
|
2178
2042
|
|
2179
|
-
if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
|
2043
|
+
if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
|
2180
2044
|
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
2181
2045
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
2182
2046
|
|
@@ -2224,13 +2088,13 @@ const defaults = {
|
|
2224
2088
|
}
|
2225
2089
|
};
|
2226
2090
|
|
2227
|
-
utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
2091
|
+
utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
2228
2092
|
defaults.headers[method] = {};
|
2229
2093
|
});
|
2230
2094
|
|
2231
2095
|
// RawAxiosHeaders whose duplicates are ignored by node
|
2232
2096
|
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
2233
|
-
const ignoreDuplicateOf = utils.toObjectSet([
|
2097
|
+
const ignoreDuplicateOf = utils$1.toObjectSet([
|
2234
2098
|
'age', 'authorization', 'content-length', 'content-type', 'etag',
|
2235
2099
|
'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
|
2236
2100
|
'last-modified', 'location', 'max-forwards', 'proxy-authorization',
|
@@ -2291,7 +2155,7 @@ function normalizeValue(value) {
|
|
2291
2155
|
return value;
|
2292
2156
|
}
|
2293
2157
|
|
2294
|
-
return utils.isArray(value) ? value.map(normalizeValue) : String(value);
|
2158
|
+
return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
|
2295
2159
|
}
|
2296
2160
|
|
2297
2161
|
function parseTokens(str) {
|
@@ -2309,7 +2173,7 @@ function parseTokens(str) {
|
|
2309
2173
|
const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
2310
2174
|
|
2311
2175
|
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
2312
|
-
if (utils.isFunction(filter)) {
|
2176
|
+
if (utils$1.isFunction(filter)) {
|
2313
2177
|
return filter.call(this, value, header);
|
2314
2178
|
}
|
2315
2179
|
|
@@ -2317,13 +2181,13 @@ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
2317
2181
|
value = header;
|
2318
2182
|
}
|
2319
2183
|
|
2320
|
-
if (!utils.isString(value)) return;
|
2184
|
+
if (!utils$1.isString(value)) return;
|
2321
2185
|
|
2322
|
-
if (utils.isString(filter)) {
|
2186
|
+
if (utils$1.isString(filter)) {
|
2323
2187
|
return value.indexOf(filter) !== -1;
|
2324
2188
|
}
|
2325
2189
|
|
2326
|
-
if (utils.isRegExp(filter)) {
|
2190
|
+
if (utils$1.isRegExp(filter)) {
|
2327
2191
|
return filter.test(value);
|
2328
2192
|
}
|
2329
2193
|
}
|
@@ -2336,7 +2200,7 @@ function formatHeader(header) {
|
|
2336
2200
|
}
|
2337
2201
|
|
2338
2202
|
function buildAccessors(obj, header) {
|
2339
|
-
const accessorName = utils.toCamelCase(' ' + header);
|
2203
|
+
const accessorName = utils$1.toCamelCase(' ' + header);
|
2340
2204
|
|
2341
2205
|
['get', 'set', 'has'].forEach(methodName => {
|
2342
2206
|
Object.defineProperty(obj, methodName + accessorName, {
|
@@ -2363,7 +2227,7 @@ class AxiosHeaders {
|
|
2363
2227
|
throw new Error('header name must be a non-empty string');
|
2364
2228
|
}
|
2365
2229
|
|
2366
|
-
const key = utils.findKey(self, lHeader);
|
2230
|
+
const key = utils$1.findKey(self, lHeader);
|
2367
2231
|
|
2368
2232
|
if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
|
2369
2233
|
self[key || _header] = normalizeValue(_value);
|
@@ -2371,11 +2235,11 @@ class AxiosHeaders {
|
|
2371
2235
|
}
|
2372
2236
|
|
2373
2237
|
const setHeaders = (headers, _rewrite) =>
|
2374
|
-
utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
2238
|
+
utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
2375
2239
|
|
2376
|
-
if (utils.isPlainObject(header) || header instanceof this.constructor) {
|
2240
|
+
if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
|
2377
2241
|
setHeaders(header, valueOrRewrite);
|
2378
|
-
} else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
2242
|
+
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
2379
2243
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
2380
2244
|
} else {
|
2381
2245
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
@@ -2388,7 +2252,7 @@ class AxiosHeaders {
|
|
2388
2252
|
header = normalizeHeader(header);
|
2389
2253
|
|
2390
2254
|
if (header) {
|
2391
|
-
const key = utils.findKey(this, header);
|
2255
|
+
const key = utils$1.findKey(this, header);
|
2392
2256
|
|
2393
2257
|
if (key) {
|
2394
2258
|
const value = this[key];
|
@@ -2401,11 +2265,11 @@ class AxiosHeaders {
|
|
2401
2265
|
return parseTokens(value);
|
2402
2266
|
}
|
2403
2267
|
|
2404
|
-
if (utils.isFunction(parser)) {
|
2268
|
+
if (utils$1.isFunction(parser)) {
|
2405
2269
|
return parser.call(this, value, key);
|
2406
2270
|
}
|
2407
2271
|
|
2408
|
-
if (utils.isRegExp(parser)) {
|
2272
|
+
if (utils$1.isRegExp(parser)) {
|
2409
2273
|
return parser.exec(value);
|
2410
2274
|
}
|
2411
2275
|
|
@@ -2418,7 +2282,7 @@ class AxiosHeaders {
|
|
2418
2282
|
header = normalizeHeader(header);
|
2419
2283
|
|
2420
2284
|
if (header) {
|
2421
|
-
const key = utils.findKey(this, header);
|
2285
|
+
const key = utils$1.findKey(this, header);
|
2422
2286
|
|
2423
2287
|
return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
2424
2288
|
}
|
@@ -2434,7 +2298,7 @@ class AxiosHeaders {
|
|
2434
2298
|
_header = normalizeHeader(_header);
|
2435
2299
|
|
2436
2300
|
if (_header) {
|
2437
|
-
const key = utils.findKey(self, _header);
|
2301
|
+
const key = utils$1.findKey(self, _header);
|
2438
2302
|
|
2439
2303
|
if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
|
2440
2304
|
delete self[key];
|
@@ -2444,7 +2308,7 @@ class AxiosHeaders {
|
|
2444
2308
|
}
|
2445
2309
|
}
|
2446
2310
|
|
2447
|
-
if (utils.isArray(header)) {
|
2311
|
+
if (utils$1.isArray(header)) {
|
2448
2312
|
header.forEach(deleteHeader);
|
2449
2313
|
} else {
|
2450
2314
|
deleteHeader(header);
|
@@ -2473,8 +2337,8 @@ class AxiosHeaders {
|
|
2473
2337
|
const self = this;
|
2474
2338
|
const headers = {};
|
2475
2339
|
|
2476
|
-
utils.forEach(this, (value, header) => {
|
2477
|
-
const key = utils.findKey(headers, header);
|
2340
|
+
utils$1.forEach(this, (value, header) => {
|
2341
|
+
const key = utils$1.findKey(headers, header);
|
2478
2342
|
|
2479
2343
|
if (key) {
|
2480
2344
|
self[key] = normalizeValue(value);
|
@@ -2503,8 +2367,8 @@ class AxiosHeaders {
|
|
2503
2367
|
toJSON(asStrings) {
|
2504
2368
|
const obj = Object.create(null);
|
2505
2369
|
|
2506
|
-
utils.forEach(this, (value, header) => {
|
2507
|
-
value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
|
2370
|
+
utils$1.forEach(this, (value, header) => {
|
2371
|
+
value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
|
2508
2372
|
});
|
2509
2373
|
|
2510
2374
|
return obj;
|
@@ -2551,7 +2415,7 @@ class AxiosHeaders {
|
|
2551
2415
|
}
|
2552
2416
|
}
|
2553
2417
|
|
2554
|
-
utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
2418
|
+
utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
2555
2419
|
|
2556
2420
|
return this;
|
2557
2421
|
}
|
@@ -2560,7 +2424,7 @@ class AxiosHeaders {
|
|
2560
2424
|
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
|
2561
2425
|
|
2562
2426
|
// reserved names hotfix
|
2563
|
-
utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
|
2427
|
+
utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
|
2564
2428
|
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
2565
2429
|
return {
|
2566
2430
|
get: () => value,
|
@@ -2570,7 +2434,7 @@ utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
|
|
2570
2434
|
}
|
2571
2435
|
});
|
2572
2436
|
|
2573
|
-
utils.freezeMethods(AxiosHeaders);
|
2437
|
+
utils$1.freezeMethods(AxiosHeaders);
|
2574
2438
|
|
2575
2439
|
/**
|
2576
2440
|
* Transform the data for a request or a response
|
@@ -2586,7 +2450,7 @@ function transformData(fns, response) {
|
|
2586
2450
|
const headers = AxiosHeaders.from(context.headers);
|
2587
2451
|
let data = context.data;
|
2588
2452
|
|
2589
|
-
utils.forEach(fns, function transform(fn) {
|
2453
|
+
utils$1.forEach(fns, function transform(fn) {
|
2590
2454
|
data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
|
2591
2455
|
});
|
2592
2456
|
|
@@ -2614,7 +2478,7 @@ function CanceledError(message, config, request) {
|
|
2614
2478
|
this.name = 'CanceledError';
|
2615
2479
|
}
|
2616
2480
|
|
2617
|
-
utils.inherits(CanceledError, AxiosError, {
|
2481
|
+
utils$1.inherits(CanceledError, AxiosError, {
|
2618
2482
|
__CANCEL__: true
|
2619
2483
|
});
|
2620
2484
|
|
@@ -2642,53 +2506,44 @@ function settle(resolve, reject, response) {
|
|
2642
2506
|
}
|
2643
2507
|
}
|
2644
2508
|
|
2645
|
-
const cookies = platform.
|
2509
|
+
const cookies = platform.hasStandardBrowserEnv ?
|
2646
2510
|
|
2647
|
-
// Standard browser envs support document.cookie
|
2648
|
-
|
2649
|
-
|
2650
|
-
|
2651
|
-
const cookie = [];
|
2652
|
-
cookie.push(name + '=' + encodeURIComponent(value));
|
2511
|
+
// Standard browser envs support document.cookie
|
2512
|
+
{
|
2513
|
+
write(name, value, expires, path, domain, secure) {
|
2514
|
+
const cookie = [name + '=' + encodeURIComponent(value)];
|
2653
2515
|
|
2654
|
-
|
2655
|
-
cookie.push('expires=' + new Date(expires).toGMTString());
|
2656
|
-
}
|
2516
|
+
utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
|
2657
2517
|
|
2658
|
-
|
2659
|
-
cookie.push('path=' + path);
|
2660
|
-
}
|
2518
|
+
utils$1.isString(path) && cookie.push('path=' + path);
|
2661
2519
|
|
2662
|
-
|
2663
|
-
cookie.push('domain=' + domain);
|
2664
|
-
}
|
2520
|
+
utils$1.isString(domain) && cookie.push('domain=' + domain);
|
2665
2521
|
|
2666
|
-
|
2667
|
-
cookie.push('secure');
|
2668
|
-
}
|
2522
|
+
secure === true && cookie.push('secure');
|
2669
2523
|
|
2670
|
-
|
2671
|
-
|
2524
|
+
document.cookie = cookie.join('; ');
|
2525
|
+
},
|
2672
2526
|
|
2673
|
-
|
2674
|
-
|
2675
|
-
|
2676
|
-
|
2527
|
+
read(name) {
|
2528
|
+
const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
2529
|
+
return (match ? decodeURIComponent(match[3]) : null);
|
2530
|
+
},
|
2677
2531
|
|
2678
|
-
|
2679
|
-
|
2680
|
-
|
2681
|
-
|
2682
|
-
})() :
|
2532
|
+
remove(name) {
|
2533
|
+
this.write(name, '', Date.now() - 86400000);
|
2534
|
+
}
|
2535
|
+
}
|
2683
2536
|
|
2684
|
-
|
2685
|
-
|
2686
|
-
|
2687
|
-
|
2688
|
-
|
2689
|
-
|
2690
|
-
|
2691
|
-
|
2537
|
+
:
|
2538
|
+
|
2539
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
2540
|
+
{
|
2541
|
+
write() {},
|
2542
|
+
read() {
|
2543
|
+
return null;
|
2544
|
+
},
|
2545
|
+
remove() {}
|
2546
|
+
};
|
2692
2547
|
|
2693
2548
|
/**
|
2694
2549
|
* Determines whether the specified URL is absolute
|
@@ -2735,7 +2590,7 @@ function buildFullPath(baseURL, requestedURL) {
|
|
2735
2590
|
return requestedURL;
|
2736
2591
|
}
|
2737
2592
|
|
2738
|
-
const isURLSameOrigin = platform.
|
2593
|
+
const isURLSameOrigin = platform.hasStandardBrowserEnv ?
|
2739
2594
|
|
2740
2595
|
// Standard browser envs have full support of the APIs needed to test
|
2741
2596
|
// whether the request URL is of the same origin as current location.
|
@@ -2745,7 +2600,7 @@ const isURLSameOrigin = platform.isStandardBrowserEnv ?
|
|
2745
2600
|
let originURL;
|
2746
2601
|
|
2747
2602
|
/**
|
2748
|
-
* Parse a URL to discover
|
2603
|
+
* Parse a URL to discover its components
|
2749
2604
|
*
|
2750
2605
|
* @param {String} url The URL to be parsed
|
2751
2606
|
* @returns {Object}
|
@@ -2785,7 +2640,7 @@ const isURLSameOrigin = platform.isStandardBrowserEnv ?
|
|
2785
2640
|
* @returns {boolean} True if URL shares the same origin, otherwise false
|
2786
2641
|
*/
|
2787
2642
|
return function isURLSameOrigin(requestURL) {
|
2788
|
-
const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
2643
|
+
const parsed = (utils$1.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
2789
2644
|
return (parsed.protocol === originURL.protocol &&
|
2790
2645
|
parsed.host === originURL.host);
|
2791
2646
|
};
|
@@ -2890,7 +2745,7 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
2890
2745
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
2891
2746
|
let requestData = config.data;
|
2892
2747
|
const requestHeaders = AxiosHeaders.from(config.headers).normalize();
|
2893
|
-
|
2748
|
+
let {responseType, withXSRFToken} = config;
|
2894
2749
|
let onCanceled;
|
2895
2750
|
function done() {
|
2896
2751
|
if (config.cancelToken) {
|
@@ -2904,14 +2759,13 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
2904
2759
|
|
2905
2760
|
let contentType;
|
2906
2761
|
|
2907
|
-
if (utils.isFormData(requestData)) {
|
2908
|
-
if (platform.
|
2762
|
+
if (utils$1.isFormData(requestData)) {
|
2763
|
+
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
2909
2764
|
requestHeaders.setContentType(false); // Let the browser set it
|
2910
|
-
} else if(
|
2911
|
-
requestHeaders.setContentType('multipart/form-data'); // mobile/desktop app frameworks
|
2912
|
-
} else if(utils.isString(contentType = requestHeaders.getContentType())){
|
2765
|
+
} else if ((contentType = requestHeaders.getContentType()) !== false) {
|
2913
2766
|
// fix semicolon duplication issue for ReactNative FormData implementation
|
2914
|
-
|
2767
|
+
const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
|
2768
|
+
requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
|
2915
2769
|
}
|
2916
2770
|
}
|
2917
2771
|
|
@@ -3027,13 +2881,16 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
3027
2881
|
// Add xsrf header
|
3028
2882
|
// This is only done if running in a standard browser environment.
|
3029
2883
|
// Specifically not if we're in a web worker, or react-native.
|
3030
|
-
if
|
3031
|
-
|
3032
|
-
const xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath))
|
3033
|
-
&& config.xsrfCookieName && cookies.read(config.xsrfCookieName);
|
2884
|
+
if(platform.hasStandardBrowserEnv) {
|
2885
|
+
withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
|
3034
2886
|
|
3035
|
-
if (
|
3036
|
-
|
2887
|
+
if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {
|
2888
|
+
// Add xsrf header
|
2889
|
+
const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
|
2890
|
+
|
2891
|
+
if (xsrfValue) {
|
2892
|
+
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
|
2893
|
+
}
|
3037
2894
|
}
|
3038
2895
|
}
|
3039
2896
|
|
@@ -3042,13 +2899,13 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
3042
2899
|
|
3043
2900
|
// Add headers to the request
|
3044
2901
|
if ('setRequestHeader' in request) {
|
3045
|
-
utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
2902
|
+
utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
3046
2903
|
request.setRequestHeader(key, val);
|
3047
2904
|
});
|
3048
2905
|
}
|
3049
2906
|
|
3050
2907
|
// Add withCredentials to request if needed
|
3051
|
-
if (!utils.isUndefined(config.withCredentials)) {
|
2908
|
+
if (!utils$1.isUndefined(config.withCredentials)) {
|
3052
2909
|
request.withCredentials = !!config.withCredentials;
|
3053
2910
|
}
|
3054
2911
|
|
@@ -3103,7 +2960,7 @@ const knownAdapters = {
|
|
3103
2960
|
xhr: xhrAdapter
|
3104
2961
|
};
|
3105
2962
|
|
3106
|
-
utils.forEach(knownAdapters, (fn, value) => {
|
2963
|
+
utils$1.forEach(knownAdapters, (fn, value) => {
|
3107
2964
|
if (fn) {
|
3108
2965
|
try {
|
3109
2966
|
Object.defineProperty(fn, 'name', {value});
|
@@ -3116,11 +2973,11 @@ utils.forEach(knownAdapters, (fn, value) => {
|
|
3116
2973
|
|
3117
2974
|
const renderReason = (reason) => `- ${reason}`;
|
3118
2975
|
|
3119
|
-
const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;
|
2976
|
+
const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
3120
2977
|
|
3121
2978
|
const adapters = {
|
3122
2979
|
getAdapter: (adapters) => {
|
3123
|
-
adapters = utils.isArray(adapters) ? adapters : [adapters];
|
2980
|
+
adapters = utils$1.isArray(adapters) ? adapters : [adapters];
|
3124
2981
|
|
3125
2982
|
const {length} = adapters;
|
3126
2983
|
let nameOrAdapter;
|
@@ -3261,11 +3118,11 @@ function mergeConfig(config1, config2) {
|
|
3261
3118
|
const config = {};
|
3262
3119
|
|
3263
3120
|
function getMergedValue(target, source, caseless) {
|
3264
|
-
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
3265
|
-
return utils.merge.call({caseless}, target, source);
|
3266
|
-
} else if (utils.isPlainObject(source)) {
|
3267
|
-
return utils.merge({}, source);
|
3268
|
-
} else if (utils.isArray(source)) {
|
3121
|
+
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
3122
|
+
return utils$1.merge.call({caseless}, target, source);
|
3123
|
+
} else if (utils$1.isPlainObject(source)) {
|
3124
|
+
return utils$1.merge({}, source);
|
3125
|
+
} else if (utils$1.isArray(source)) {
|
3269
3126
|
return source.slice();
|
3270
3127
|
}
|
3271
3128
|
return source;
|
@@ -3273,25 +3130,25 @@ function mergeConfig(config1, config2) {
|
|
3273
3130
|
|
3274
3131
|
// eslint-disable-next-line consistent-return
|
3275
3132
|
function mergeDeepProperties(a, b, caseless) {
|
3276
|
-
if (!utils.isUndefined(b)) {
|
3133
|
+
if (!utils$1.isUndefined(b)) {
|
3277
3134
|
return getMergedValue(a, b, caseless);
|
3278
|
-
} else if (!utils.isUndefined(a)) {
|
3135
|
+
} else if (!utils$1.isUndefined(a)) {
|
3279
3136
|
return getMergedValue(undefined, a, caseless);
|
3280
3137
|
}
|
3281
3138
|
}
|
3282
3139
|
|
3283
3140
|
// eslint-disable-next-line consistent-return
|
3284
3141
|
function valueFromConfig2(a, b) {
|
3285
|
-
if (!utils.isUndefined(b)) {
|
3142
|
+
if (!utils$1.isUndefined(b)) {
|
3286
3143
|
return getMergedValue(undefined, b);
|
3287
3144
|
}
|
3288
3145
|
}
|
3289
3146
|
|
3290
3147
|
// eslint-disable-next-line consistent-return
|
3291
3148
|
function defaultToConfig2(a, b) {
|
3292
|
-
if (!utils.isUndefined(b)) {
|
3149
|
+
if (!utils$1.isUndefined(b)) {
|
3293
3150
|
return getMergedValue(undefined, b);
|
3294
|
-
} else if (!utils.isUndefined(a)) {
|
3151
|
+
} else if (!utils$1.isUndefined(a)) {
|
3295
3152
|
return getMergedValue(undefined, a);
|
3296
3153
|
}
|
3297
3154
|
}
|
@@ -3316,6 +3173,7 @@ function mergeConfig(config1, config2) {
|
|
3316
3173
|
timeout: defaultToConfig2,
|
3317
3174
|
timeoutMessage: defaultToConfig2,
|
3318
3175
|
withCredentials: defaultToConfig2,
|
3176
|
+
withXSRFToken: defaultToConfig2,
|
3319
3177
|
adapter: defaultToConfig2,
|
3320
3178
|
responseType: defaultToConfig2,
|
3321
3179
|
xsrfCookieName: defaultToConfig2,
|
@@ -3336,16 +3194,16 @@ function mergeConfig(config1, config2) {
|
|
3336
3194
|
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
3337
3195
|
};
|
3338
3196
|
|
3339
|
-
utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
3197
|
+
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
3340
3198
|
const merge = mergeMap[prop] || mergeDeepProperties;
|
3341
3199
|
const configValue = merge(config1[prop], config2[prop], prop);
|
3342
|
-
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
3200
|
+
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
3343
3201
|
});
|
3344
3202
|
|
3345
3203
|
return config;
|
3346
3204
|
}
|
3347
3205
|
|
3348
|
-
const VERSION = "1.
|
3206
|
+
const VERSION = "1.6.2";
|
3349
3207
|
|
3350
3208
|
const validators$1 = {};
|
3351
3209
|
|
@@ -3483,7 +3341,7 @@ class Axios {
|
|
3483
3341
|
}
|
3484
3342
|
|
3485
3343
|
if (paramsSerializer != null) {
|
3486
|
-
if (utils.isFunction(paramsSerializer)) {
|
3344
|
+
if (utils$1.isFunction(paramsSerializer)) {
|
3487
3345
|
config.paramsSerializer = {
|
3488
3346
|
serialize: paramsSerializer
|
3489
3347
|
};
|
@@ -3499,12 +3357,12 @@ class Axios {
|
|
3499
3357
|
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
3500
3358
|
|
3501
3359
|
// Flatten headers
|
3502
|
-
let contextHeaders = headers && utils.merge(
|
3360
|
+
let contextHeaders = headers && utils$1.merge(
|
3503
3361
|
headers.common,
|
3504
3362
|
headers[config.method]
|
3505
3363
|
);
|
3506
3364
|
|
3507
|
-
headers && utils.forEach(
|
3365
|
+
headers && utils$1.forEach(
|
3508
3366
|
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
3509
3367
|
(method) => {
|
3510
3368
|
delete headers[method];
|
@@ -3591,7 +3449,7 @@ class Axios {
|
|
3591
3449
|
}
|
3592
3450
|
|
3593
3451
|
// Provide aliases for supported request methods
|
3594
|
-
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
3452
|
+
utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
3595
3453
|
/*eslint func-names:0*/
|
3596
3454
|
Axios.prototype[method] = function(url, config) {
|
3597
3455
|
return this.request(mergeConfig(config || {}, {
|
@@ -3602,7 +3460,7 @@ utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData
|
|
3602
3460
|
};
|
3603
3461
|
});
|
3604
3462
|
|
3605
|
-
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
3463
|
+
utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
3606
3464
|
/*eslint func-names:0*/
|
3607
3465
|
|
3608
3466
|
function generateHTTPMethod(isForm) {
|
@@ -3774,7 +3632,7 @@ function spread(callback) {
|
|
3774
3632
|
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
3775
3633
|
*/
|
3776
3634
|
function isAxiosError(payload) {
|
3777
|
-
return utils.isObject(payload) && (payload.isAxiosError === true);
|
3635
|
+
return utils$1.isObject(payload) && (payload.isAxiosError === true);
|
3778
3636
|
}
|
3779
3637
|
|
3780
3638
|
const HttpStatusCode = {
|
@@ -3859,10 +3717,10 @@ function createInstance(defaultConfig) {
|
|
3859
3717
|
const instance = bind(Axios.prototype.request, context);
|
3860
3718
|
|
3861
3719
|
// Copy axios.prototype to instance
|
3862
|
-
utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});
|
3720
|
+
utils$1.extend(instance, Axios.prototype, context, {allOwnKeys: true});
|
3863
3721
|
|
3864
3722
|
// Copy context to instance
|
3865
|
-
utils.extend(instance, context, null, {allOwnKeys: true});
|
3723
|
+
utils$1.extend(instance, context, null, {allOwnKeys: true});
|
3866
3724
|
|
3867
3725
|
// Factory for creating new instances
|
3868
3726
|
instance.create = function create(instanceConfig) {
|
@@ -3906,7 +3764,7 @@ axios.mergeConfig = mergeConfig;
|
|
3906
3764
|
|
3907
3765
|
axios.AxiosHeaders = AxiosHeaders;
|
3908
3766
|
|
3909
|
-
axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
|
3767
|
+
axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
3910
3768
|
|
3911
3769
|
axios.getAdapter = adapters.getAdapter;
|
3912
3770
|
|
@@ -4314,7 +4172,7 @@ var VerdocsEndpoint = /** @class */ (function () {
|
|
4314
4172
|
|
4315
4173
|
exports.VerdocsEndpoint = VerdocsEndpoint;
|
4316
4174
|
exports.canPerformTemplateAction = canPerformTemplateAction;
|
4317
|
-
exports.
|
4175
|
+
exports.createTemplatev2 = createTemplatev2;
|
4318
4176
|
exports.deleteTemplate = deleteTemplate;
|
4319
4177
|
exports.getTemplate = getTemplate;
|
4320
4178
|
exports.getTemplates = getTemplates;
|