@verdocs/web-sdk 2.3.11 → 2.3.14
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/{Profiles-1a26e4eb.js → Profiles-54271244.js} +34 -0
- package/dist/cjs/{TemplateStore-192c6cf1.js → TemplateStore-d9936a68.js} +1 -1
- package/dist/cjs/{Types-fb95ed6b.js → Types-ee5afdf8.js} +1 -2
- package/dist/cjs/{VerdocsEndpoint-33b643eb.js → VerdocsEndpoint-2d85658d.js} +485 -304
- package/dist/cjs/{_commonjsHelpers-1fbbf0eb.js → _commonjsHelpers-0c557e26.js} +5 -0
- package/dist/cjs/interact.min-ba5cc513.js +13 -0
- package/dist/cjs/ipc-test.cjs.entry.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{utils-a3f0b70a.js → utils-2ddfdf9e.js} +2 -2
- package/dist/cjs/verdocs-activity-box.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-auth.cjs.entry.js +34 -8
- package/dist/cjs/verdocs-build.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-button-panel_2.cjs.entry.js +3 -12
- package/dist/cjs/{verdocs-contact-picker_3.cjs.entry.js → verdocs-contact-picker_2.cjs.entry.js} +5 -77
- 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 -3
- 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 +4 -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 +8 -9
- package/dist/cjs/verdocs-field-textbox.cjs.entry.js +8 -8
- 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-ok-dialog.cjs.entry.js +1 -2
- package/dist/cjs/verdocs-pagination_2.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-preview_8.cjs.entry.js +7 -8
- package/dist/cjs/verdocs-quick-functions_3.cjs.entry.js +220 -0
- package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-settings-api-keys_4.cjs.entry.js +36 -69
- package/dist/cjs/verdocs-settings.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +8 -11
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +46 -54
- 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/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.js +1 -20
- package/dist/collection/components/elements/verdocs-search-activity/verdocs-search-activity.css +66 -0
- package/dist/collection/components/elements/verdocs-search-activity/verdocs-search-activity.js +187 -0
- package/dist/collection/components/elements/verdocs-search-activity/verdocs-search-activity.stories.js +14 -0
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +34 -6
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +1 -2
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +4 -8
- package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.css +1 -4
- package/dist/collection/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.js +0 -1
- package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.css +0 -1
- package/dist/collection/components/fields/verdocs-field-dropdown/verdocs-field-dropdown.js +1 -0
- package/dist/collection/components/fields/verdocs-field-textarea/verdocs-field-textarea.js +1 -2
- package/dist/collection/components/fields/verdocs-field-textbox/verdocs-field-textbox.css +1 -1
- package/dist/collection/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.css +0 -1
- package/dist/collection/components/templates/verdocs-template-create/verdocs-template-create.js +2 -2
- package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.js +0 -10
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +35 -43
- package/dist/collection/utils/Types.js +1 -2
- package/dist/components/Organizations.js +32 -0
- package/dist/components/TemplateStore.js +1 -1
- package/dist/components/Types2.js +1 -2
- package/dist/components/VerdocsEndpoint.js +484 -304
- package/dist/components/_commonjsHelpers.js +5 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index3.js +29 -40
- package/dist/components/interact.min.js +6 -5
- package/dist/components/verdocs-auth.js +46 -12
- package/dist/components/verdocs-build.js +16 -22
- package/dist/components/verdocs-contact-picker2.js +1 -1
- package/dist/components/verdocs-envelope-sidebar.js +0 -1
- package/dist/components/verdocs-field-date.js +1 -1
- package/dist/components/verdocs-field-dropdown.js +1 -0
- package/dist/components/verdocs-field-textarea.js +4 -5
- package/dist/components/verdocs-field-textbox.js +4 -4
- package/dist/components/verdocs-field-timestamp.js +1 -1
- package/dist/components/verdocs-ok-dialog2.js +1 -3
- package/dist/components/verdocs-search-activity.d.ts +11 -0
- package/dist/components/verdocs-search-activity.js +6 -0
- package/dist/components/verdocs-search-activity2.js +170 -0
- package/dist/components/verdocs-search.js +8 -2
- package/dist/components/verdocs-send2.js +5 -12
- package/dist/components/verdocs-settings-organization2.js +1 -22
- package/dist/components/verdocs-sign.js +4 -8
- package/dist/components/verdocs-template-create2.js +2 -2
- package/dist/components/verdocs-template-field-properties2.js +0 -10
- package/dist/components/verdocs-template-fields2.js +38 -46
- package/dist/components/verdocs-template-roles2.js +4 -4
- package/dist/docs.json +108 -139
- package/dist/esm/{Profiles-d4df4d1c.js → Profiles-4cc942ef.js} +32 -1
- package/dist/esm/{TemplateStore-7149eda0.js → TemplateStore-018fc1db.js} +1 -1
- package/dist/esm/Types-de18e225.js +4 -0
- package/dist/esm/{VerdocsEndpoint-7922d31f.js → VerdocsEndpoint-b011af25.js} +484 -304
- package/dist/esm/{_commonjsHelpers-8a9f3b18.js → _commonjsHelpers-5ec8f9b7.js} +5 -1
- package/dist/esm/interact.min-cf83fa88.js +11 -0
- package/dist/esm/ipc-test.entry.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-e0ce2c22.js → utils-d269cea3.js} +2 -2
- package/dist/esm/verdocs-activity-box.entry.js +1 -1
- package/dist/esm/verdocs-auth.entry.js +34 -8
- package/dist/esm/verdocs-build.entry.js +2 -2
- package/dist/esm/verdocs-button-panel_2.entry.js +3 -12
- package/dist/esm/{verdocs-contact-picker_3.entry.js → verdocs-contact-picker_2.entry.js} +6 -77
- 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 -3
- 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 +4 -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 +8 -9
- package/dist/esm/verdocs-field-textbox.entry.js +8 -8
- 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-ok-dialog.entry.js +1 -2
- package/dist/esm/verdocs-pagination_2.entry.js +3 -3
- package/dist/esm/verdocs-preview_8.entry.js +7 -8
- package/dist/esm/verdocs-quick-functions_3.entry.js +214 -0
- package/dist/esm/verdocs-search.entry.js +1 -1
- package/dist/esm/verdocs-settings-api-keys_4.entry.js +34 -67
- package/dist/esm/verdocs-settings.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +8 -11
- package/dist/esm/verdocs-template-document-page_2.entry.js +4 -4
- package/dist/esm/verdocs-template-fields_4.entry.js +46 -54
- 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/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/Profiles-4cc942ef.js +1 -0
- package/dist/esm-es5/{TemplateStore-7149eda0.js → TemplateStore-018fc1db.js} +1 -1
- package/dist/esm-es5/Types-de18e225.js +1 -0
- package/dist/esm-es5/VerdocsEndpoint-b011af25.js +1 -0
- package/dist/esm-es5/_commonjsHelpers-5ec8f9b7.js +1 -0
- package/dist/esm-es5/interact.min-cf83fa88.js +1 -0
- package/dist/esm-es5/ipc-test.entry.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{utils-e0ce2c22.js → utils-d269cea3.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 -0
- 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-ok-dialog.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 -0
- 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/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/types/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.d.ts +0 -4
- package/dist/types/components/elements/verdocs-search-activity/verdocs-search-activity.d.ts +33 -0
- package/dist/types/components/{controls/verdocs-portal/verdocs-portal.stories.d.ts → elements/verdocs-search-activity/verdocs-search-activity.stories.d.ts} +6 -3
- package/dist/types/components/embeds/verdocs-auth/verdocs-auth.d.ts +2 -0
- package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +0 -1
- package/dist/types/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.d.ts +0 -1
- package/dist/types/components.d.ts +34 -50
- package/dist/types/utils/Types.d.ts +1 -1
- package/dist/types/utils/utils.d.ts +2 -2
- package/dist/verdocs-web-sdk/p-01166179.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-d1ea580b.system.entry.js → p-013d1556.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-04580be0.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-3f837e30.system.entry.js → p-04d7d759.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-05b3034f.entry.js → p-0ad1fd33.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-0d28cf05.js +1 -0
- package/dist/verdocs-web-sdk/{p-2ec8a9be.entry.js → p-0df58c57.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-da1c0295.system.entry.js → p-0e5449d1.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-686139a0.entry.js → p-0f94d635.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-0419a39f.system.entry.js → p-10af7aec.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-39f3f620.system.entry.js → p-126ba5d2.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ed639a7c.entry.js → p-137cedc8.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-8f8504e2.entry.js → p-1406ffd2.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-8e0d6152.system.entry.js → p-14aefeb2.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-15cb963a.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-17d0e5f4.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-23be436b.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-6d70fc87.system.entry.js → p-261d376e.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7144ab8e.system.entry.js → p-2f04fb38.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-30b4bd45.js +1 -0
- package/dist/verdocs-web-sdk/p-3305a941.system.js +1 -0
- package/dist/verdocs-web-sdk/{p-401a49cb.system.entry.js → p-343672f5.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-026eb575.system.entry.js → p-35769d0c.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-d2cee107.system.entry.js → p-37187046.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-083bdbc6.entry.js → p-39cbfe15.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7b3fed68.entry.js → p-3a702f79.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-f3a1060a.entry.js → p-3abfff14.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a7134b10.entry.js → p-3f9fbf94.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-409e992a.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-4a94ee00.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-73b9ef06.entry.js → p-4f439363.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7cbe51d8.system.entry.js → p-50ac71f3.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-51756c1b.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-345f88a3.system.entry.js → p-5c50a778.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-9c2bec77.system.entry.js → p-5df0fa7a.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-06fb711b.system.entry.js → p-609c7fab.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-0d4739c4.system.entry.js → p-62f090c7.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-6307e6ae.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-66d66e2b.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-599fa850.entry.js → p-6bda7dce.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-76907130.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-1eb38c2e.entry.js → p-77abc3ce.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-f49cb84b.entry.js → p-7805f0e0.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-47460aa0.entry.js → p-79dc4f76.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-7b63017c.js +1 -0
- package/dist/verdocs-web-sdk/p-7fd7152d.system.js +1 -0
- package/dist/verdocs-web-sdk/p-89aa696c.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-1efd342e.entry.js → p-8da1555a.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-961708ac.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-983da2f6.js +1 -0
- package/dist/verdocs-web-sdk/p-9934f3ec.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-2c47b92e.entry.js → p-9b07a2a7.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a59064f7.system.entry.js → p-a0b02d83.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-9b66a84a.system.entry.js → p-a171983b.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e6b68ad5.entry.js → p-a310f65b.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ee159b14.js → p-a35314fe.js} +1 -1
- package/dist/verdocs-web-sdk/{p-c58916d2.system.entry.js → p-a52a832b.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-a5425a9b.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-16849f44.system.entry.js → p-aa51514f.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7be5cb8c.entry.js → p-ace35be6.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-120f75b1.entry.js → p-af3e9624.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ecb7ea02.entry.js → p-b17a20b8.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-b2d698f7.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-393a9a2a.system.entry.js → p-b73415c3.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-bb2c866b.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-bbee73c8.system.js +1 -0
- package/dist/verdocs-web-sdk/{p-38679b8e.system.entry.js → p-bd0bc3dd.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-bfcf8ad2.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-b0bf091c.system.js → p-c694cf93.system.js} +1 -1
- package/dist/verdocs-web-sdk/p-cbbf849f.system.js +1 -0
- package/dist/verdocs-web-sdk/p-cbd0802f.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-9aff3ff0.entry.js → p-cf765153.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-f83a0c6e.system.entry.js → p-dd8845d4.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-de60d3a8.js +1 -0
- package/dist/verdocs-web-sdk/{p-4a1bc6e3.system.entry.js → p-df6a373e.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-5f736f85.system.entry.js → p-e3a9d167.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-eab67c09.js +1 -0
- package/dist/verdocs-web-sdk/{p-1fdb236c.system.js → p-eb595245.system.js} +1 -1
- package/dist/verdocs-web-sdk/p-ecf04564.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-ee195e5e.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-ce00ee85.entry.js → p-eef694e8.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-f04bf956.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-d7dbeec3.system.entry.js → p-f1257cd0.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-f65a1b9e.system.js +1 -0
- package/dist/verdocs-web-sdk/{p-0549358c.entry.js → p-fde6b724.entry.js} +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +7 -8
- package/dist/cjs/interact.min-a61b43b3.js +0 -12
- package/dist/cjs/verdocs-quick-functions_2.cjs.entry.js +0 -79
- package/dist/collection/components/controls/verdocs-portal/verdocs-portal.css +0 -0
- package/dist/collection/components/controls/verdocs-portal/verdocs-portal.js +0 -181
- package/dist/collection/components/controls/verdocs-portal/verdocs-portal.stories.js +0 -20
- package/dist/components/verdocs-portal.d.ts +0 -11
- package/dist/components/verdocs-portal.js +0 -6
- package/dist/components/verdocs-portal2.js +0 -93
- package/dist/custom-elements.json +0 -2067
- package/dist/esm/Types-1628dc71.js +0 -5
- package/dist/esm/interact.min-6a7b19a1.js +0 -10
- package/dist/esm/verdocs-quick-functions_2.entry.js +0 -74
- package/dist/esm-es5/Profiles-d4df4d1c.js +0 -1
- package/dist/esm-es5/Types-1628dc71.js +0 -1
- package/dist/esm-es5/VerdocsEndpoint-7922d31f.js +0 -1
- package/dist/esm-es5/_commonjsHelpers-8a9f3b18.js +0 -1
- package/dist/esm-es5/interact.min-6a7b19a1.js +0 -1
- package/dist/esm-es5/verdocs-contact-picker_3.entry.js +0 -1
- package/dist/esm-es5/verdocs-quick-functions_2.entry.js +0 -1
- package/dist/types/components/controls/verdocs-portal/verdocs-portal.d.ts +0 -37
- package/dist/verdocs-web-sdk/p-0c157d55.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-14b08edd.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-19ff8f86.system.js +0 -1
- package/dist/verdocs-web-sdk/p-1a3168af.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-1ba9f457.system.js +0 -1
- package/dist/verdocs-web-sdk/p-2fe75327.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-3019b350.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-32b26f8f.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-3e607686.js +0 -1
- package/dist/verdocs-web-sdk/p-3f5fb65b.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-4a3238f6.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-59c44eee.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-5aee3e25.js +0 -1
- package/dist/verdocs-web-sdk/p-5f434764.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-6827df7b.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-6a13105b.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-6b1735f4.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-7d5dbd9a.js +0 -1
- package/dist/verdocs-web-sdk/p-839f6f0d.js +0 -1
- package/dist/verdocs-web-sdk/p-90d54d8a.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-915883e6.js +0 -1
- package/dist/verdocs-web-sdk/p-974b4c02.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-992f92f4.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-9dcb8b6c.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-b101fae2.js +0 -1
- package/dist/verdocs-web-sdk/p-cd20fb77.system.js +0 -1
- package/dist/verdocs-web-sdk/p-d8cd6b59.system.js +0 -1
- package/dist/verdocs-web-sdk/p-dd277e69.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-e2ae3679.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-e2ff37fb.system.js +0 -1
- package/dist/verdocs-web-sdk/p-fa1621c8.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-fdf0a9de.entry.js +0 -1
@@ -149,6 +149,23 @@ var __generator = (undefined && undefined.__generator) || function (thisArg, bod
|
|
149
149
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
150
150
|
}
|
151
151
|
};
|
152
|
+
/**
|
153
|
+
* Get all templates accessible by the caller, with optional filters.
|
154
|
+
*
|
155
|
+
* ```typescript
|
156
|
+
* import {Templates} from '@verdocs/js-sdk/Templates';
|
157
|
+
*
|
158
|
+
* await Templates.getTemplates((VerdocsEndpoint.getDefault());
|
159
|
+
* await Templates.getTemplates((VerdocsEndpoint.getDefault(), { is_starred: true });
|
160
|
+
* await Templates.getTemplates((VerdocsEndpoint.getDefault(), { is_creator: true });
|
161
|
+
* await Templates.getTemplates((VerdocsEndpoint.getDefault(), { is_organization: true });
|
162
|
+
* ```
|
163
|
+
*/
|
164
|
+
var getTemplates = function (endpoint, params) {
|
165
|
+
return endpoint.api //
|
166
|
+
.post('/templates', { params: params })
|
167
|
+
.then(function (r) { return r.data; });
|
168
|
+
};
|
152
169
|
// export interface IListTemplatesParams {
|
153
170
|
// name?: string;
|
154
171
|
// sharing?: 'all' | 'personal' | 'shared' | 'public';
|
@@ -200,10 +217,10 @@ var ALLOWED_CREATE_FIELDS = [
|
|
200
217
|
* ```typescript
|
201
218
|
* import {Templates} from '@verdocs/js-sdk/Templates';
|
202
219
|
*
|
203
|
-
* const newTemplate = await Templates.
|
220
|
+
* const newTemplate = await Templates.createTemplate((VerdocsEndpoint.getDefault(), {...});
|
204
221
|
* ```
|
205
222
|
*/
|
206
|
-
var
|
223
|
+
var createTemplate = function (endpoint, params, onUploadProgress) {
|
207
224
|
var options = {
|
208
225
|
timeout: 120000,
|
209
226
|
onUploadProgress: function (event) {
|
@@ -213,19 +230,22 @@ var createTemplatev2 = function (endpoint, params, onUploadProgress) {
|
|
213
230
|
},
|
214
231
|
};
|
215
232
|
if (params.documents && params.documents[0] instanceof File) {
|
216
|
-
|
233
|
+
if (params.documents.length > 10) {
|
234
|
+
throw new Error('createTemplate() has a maximum of 10 documents that can be attached.');
|
235
|
+
}
|
236
|
+
var formData_1 = new FormData();
|
217
237
|
ALLOWED_CREATE_FIELDS.forEach(function (allowedKey) {
|
218
238
|
if (params[allowedKey] !== undefined) {
|
219
|
-
|
239
|
+
formData_1.append(allowedKey, params[allowedKey]);
|
220
240
|
}
|
221
241
|
});
|
222
242
|
params.documents.forEach(function (file) {
|
223
|
-
|
243
|
+
formData_1.append('documents', file, file.name);
|
224
244
|
});
|
225
|
-
return endpoint.api.post('/
|
245
|
+
return endpoint.api.post('/templates', formData_1, options).then(function (r) { return r.data; });
|
226
246
|
}
|
227
247
|
else {
|
228
|
-
return endpoint.api.post('/
|
248
|
+
return endpoint.api.post('/templates', params, options).then(function (r) { return r.data; });
|
229
249
|
}
|
230
250
|
};
|
231
251
|
/**
|
@@ -400,137 +420,277 @@ const denyList = new Set([
|
|
400
420
|
// TODO: Use `error?.code` when targeting Node.js 14
|
401
421
|
var isRetryAllowed = error => !denyList.has(error && error.code);
|
402
422
|
|
403
|
-
|
423
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
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
|
+
|
404
438
|
function isNetworkError(error) {
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
}
|
409
|
-
if (!error.code) {
|
410
|
-
return false;
|
411
|
-
}
|
412
|
-
// Prevents retrying timed out & cancelled requests
|
413
|
-
if (CODE_EXCLUDE_LIST.includes(error.code)) {
|
414
|
-
return false;
|
415
|
-
}
|
416
|
-
// Prevents retrying unsafe errors
|
417
|
-
return isRetryAllowed(error);
|
439
|
+
return !error.response && Boolean(error.code) && // Prevents retrying cancelled requests
|
440
|
+
error.code !== 'ECONNABORTED' && // Prevents retrying timed out requests
|
441
|
+
isRetryAllowed(error); // Prevents retrying unsafe errors
|
418
442
|
}
|
419
|
-
|
420
|
-
|
443
|
+
var SAFE_HTTP_METHODS = ['get', 'head', 'options'];
|
444
|
+
var IDEMPOTENT_HTTP_METHODS = SAFE_HTTP_METHODS.concat(['put', 'delete']);
|
445
|
+
/**
|
446
|
+
* @param {Error} error
|
447
|
+
* @return {boolean}
|
448
|
+
*/
|
449
|
+
|
421
450
|
function isRetryableError(error) {
|
422
|
-
|
423
|
-
(!error.response || (error.response.status >= 500 && error.response.status <= 599)));
|
451
|
+
return error.code !== 'ECONNABORTED' && (!error.response || error.response.status >= 500 && error.response.status <= 599);
|
424
452
|
}
|
453
|
+
/**
|
454
|
+
* @param {Error} error
|
455
|
+
* @return {boolean}
|
456
|
+
*/
|
457
|
+
|
425
458
|
function isSafeRequestError(error) {
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
459
|
+
if (!error.config) {
|
460
|
+
// Cannot determine if the request can be retried
|
461
|
+
return false;
|
462
|
+
}
|
463
|
+
|
464
|
+
return isRetryableError(error) && SAFE_HTTP_METHODS.indexOf(error.config.method) !== -1;
|
431
465
|
}
|
466
|
+
/**
|
467
|
+
* @param {Error} error
|
468
|
+
* @return {boolean}
|
469
|
+
*/
|
470
|
+
|
432
471
|
function isIdempotentRequestError(error) {
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
472
|
+
if (!error.config) {
|
473
|
+
// Cannot determine if the request can be retried
|
474
|
+
return false;
|
475
|
+
}
|
476
|
+
|
477
|
+
return isRetryableError(error) && IDEMPOTENT_HTTP_METHODS.indexOf(error.config.method) !== -1;
|
438
478
|
}
|
479
|
+
/**
|
480
|
+
* @param {Error} error
|
481
|
+
* @return {boolean}
|
482
|
+
*/
|
483
|
+
|
439
484
|
function isNetworkOrIdempotentRequestError(error) {
|
440
|
-
|
485
|
+
return isNetworkError(error) || isIdempotentRequestError(error);
|
441
486
|
}
|
487
|
+
/**
|
488
|
+
* @return {number} - delay in milliseconds, always 0
|
489
|
+
*/
|
490
|
+
|
442
491
|
function noDelay() {
|
443
|
-
|
492
|
+
return 0;
|
444
493
|
}
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
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;
|
449
506
|
}
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
507
|
+
/**
|
508
|
+
* Initializes and returns the retry state for the given request/config
|
509
|
+
* @param {AxiosRequestConfig} config
|
510
|
+
* @return {Object}
|
511
|
+
*/
|
512
|
+
|
513
|
+
function getCurrentState(config) {
|
514
|
+
var currentState = config[namespace] || {};
|
515
|
+
currentState.retryCount = currentState.retryCount || 0;
|
516
|
+
config[namespace] = currentState;
|
517
|
+
return currentState;
|
518
|
+
}
|
519
|
+
/**
|
520
|
+
* Returns the axios-retry options for the current request
|
521
|
+
* @param {AxiosRequestConfig} config
|
522
|
+
* @param {AxiosRetryConfig} defaultOptions
|
523
|
+
* @return {AxiosRetryConfig}
|
524
|
+
*/
|
525
|
+
|
526
|
+
|
457
527
|
function getRequestOptions(config, defaultOptions) {
|
458
|
-
|
528
|
+
return _objectSpread(_objectSpread({}, defaultOptions), config[namespace]);
|
459
529
|
}
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
530
|
+
/**
|
531
|
+
* @param {Axios} axios
|
532
|
+
* @param {AxiosRequestConfig} config
|
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
|
+
}
|
466
548
|
}
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
549
|
+
/**
|
550
|
+
* Checks retryCondition if request can be retried. Handles it's retruning value or Promise.
|
551
|
+
* @param {number} retries
|
552
|
+
* @param {Function} retryCondition
|
553
|
+
* @param {Object} currentState
|
554
|
+
* @param {Error} error
|
555
|
+
* @return {boolean}
|
556
|
+
*/
|
557
|
+
|
558
|
+
|
559
|
+
function shouldRetry(_x, _x2, _x3, _x4) {
|
560
|
+
return _shouldRetry.apply(this, arguments);
|
479
561
|
}
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
562
|
+
/**
|
563
|
+
* Adds response interceptors to an axios instance to retry requests failed due to network issues
|
564
|
+
*
|
565
|
+
* @example
|
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
|
+
|
484
622
|
if (typeof shouldRetryOrPromise === 'object') {
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
}
|
623
|
+
try {
|
624
|
+
var shouldRetryPromiseResult = yield shouldRetryOrPromise; // keep return true unless shouldRetryPromiseResult return false for compatibility
|
625
|
+
|
626
|
+
return shouldRetryPromiseResult !== false;
|
627
|
+
} catch (_err) {
|
628
|
+
return false;
|
629
|
+
}
|
493
630
|
}
|
631
|
+
|
494
632
|
return shouldRetryOrPromise;
|
633
|
+
});
|
634
|
+
return _shouldRetry.apply(this, arguments);
|
495
635
|
}
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
636
|
+
|
637
|
+
function axiosRetry(axios, defaultOptions) {
|
638
|
+
axios.interceptors.request.use(config => {
|
639
|
+
var currentState = getCurrentState(config);
|
640
|
+
currentState.lastRequestTime = Date.now();
|
641
|
+
return config;
|
642
|
+
});
|
643
|
+
axios.interceptors.response.use(null, /*#__PURE__*/function () {
|
644
|
+
var _ref = _asyncToGenerator(function* (error) {
|
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) {
|
505
674
|
return Promise.reject(error);
|
675
|
+
}
|
676
|
+
|
677
|
+
config.timeout = timeout;
|
506
678
|
}
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
fixConfig(axiosInstance, config);
|
515
|
-
if (!shouldResetTimeout && config.timeout && currentState.lastRequestTime) {
|
516
|
-
const lastRequestDuration = Date.now() - currentState.lastRequestTime;
|
517
|
-
const timeout = config.timeout - lastRequestDuration - delay;
|
518
|
-
if (timeout <= 0) {
|
519
|
-
return Promise.reject(error);
|
520
|
-
}
|
521
|
-
config.timeout = timeout;
|
522
|
-
}
|
523
|
-
config.transformRequest = [(data) => data];
|
524
|
-
await onRetry(currentState.retryCount, error, config);
|
525
|
-
return new Promise((resolve) => {
|
526
|
-
setTimeout(() => resolve(axiosInstance(config)), delay);
|
527
|
-
});
|
528
|
-
}
|
529
|
-
return Promise.reject(error);
|
679
|
+
|
680
|
+
config.transformRequest = [data => data];
|
681
|
+
onRetry(currentState.retryCount, error, config);
|
682
|
+
return new Promise(resolve => setTimeout(() => resolve(axios(config)), delay));
|
683
|
+
}
|
684
|
+
|
685
|
+
return Promise.reject(error);
|
530
686
|
});
|
531
|
-
|
532
|
-
|
533
|
-
|
687
|
+
|
688
|
+
return function (_x5) {
|
689
|
+
return _ref.apply(this, arguments);
|
690
|
+
};
|
691
|
+
}());
|
692
|
+
} // Compatibility with CommonJS
|
693
|
+
|
534
694
|
axiosRetry.isNetworkError = isNetworkError;
|
535
695
|
axiosRetry.isSafeRequestError = isSafeRequestError;
|
536
696
|
axiosRetry.isIdempotentRequestError = isIdempotentRequestError;
|
@@ -1210,7 +1370,7 @@ const isAsyncFn = kindOfTest('AsyncFunction');
|
|
1210
1370
|
const isThenable = (thing) =>
|
1211
1371
|
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
1212
1372
|
|
1213
|
-
const utils
|
1373
|
+
const utils = {
|
1214
1374
|
isArray,
|
1215
1375
|
isArrayBuffer,
|
1216
1376
|
isBuffer,
|
@@ -1292,7 +1452,7 @@ function AxiosError(message, code, config, request, response) {
|
|
1292
1452
|
response && (this.response = response);
|
1293
1453
|
}
|
1294
1454
|
|
1295
|
-
utils
|
1455
|
+
utils.inherits(AxiosError, Error, {
|
1296
1456
|
toJSON: function toJSON() {
|
1297
1457
|
return {
|
1298
1458
|
// Standard
|
@@ -1307,7 +1467,7 @@ utils$1.inherits(AxiosError, Error, {
|
|
1307
1467
|
columnNumber: this.columnNumber,
|
1308
1468
|
stack: this.stack,
|
1309
1469
|
// Axios
|
1310
|
-
config: utils
|
1470
|
+
config: utils.toJSONObject(this.config),
|
1311
1471
|
code: this.code,
|
1312
1472
|
status: this.response && this.response.status ? this.response.status : null
|
1313
1473
|
};
|
@@ -1342,7 +1502,7 @@ Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
|
|
1342
1502
|
AxiosError.from = (error, code, config, request, response, customProps) => {
|
1343
1503
|
const axiosError = Object.create(prototype$1);
|
1344
1504
|
|
1345
|
-
utils
|
1505
|
+
utils.toFlatObject(error, axiosError, function filter(obj) {
|
1346
1506
|
return obj !== Error.prototype;
|
1347
1507
|
}, prop => {
|
1348
1508
|
return prop !== 'isAxiosError';
|
@@ -1370,7 +1530,7 @@ const httpAdapter = null;
|
|
1370
1530
|
* @returns {boolean}
|
1371
1531
|
*/
|
1372
1532
|
function isVisitable(thing) {
|
1373
|
-
return utils
|
1533
|
+
return utils.isPlainObject(thing) || utils.isArray(thing);
|
1374
1534
|
}
|
1375
1535
|
|
1376
1536
|
/**
|
@@ -1381,7 +1541,7 @@ function isVisitable(thing) {
|
|
1381
1541
|
* @returns {string} the key without the brackets.
|
1382
1542
|
*/
|
1383
1543
|
function removeBrackets(key) {
|
1384
|
-
return utils
|
1544
|
+
return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;
|
1385
1545
|
}
|
1386
1546
|
|
1387
1547
|
/**
|
@@ -1410,10 +1570,10 @@ function renderKey(path, key, dots) {
|
|
1410
1570
|
* @returns {boolean}
|
1411
1571
|
*/
|
1412
1572
|
function isFlatArray(arr) {
|
1413
|
-
return utils
|
1573
|
+
return utils.isArray(arr) && !arr.some(isVisitable);
|
1414
1574
|
}
|
1415
1575
|
|
1416
|
-
const predicates = utils
|
1576
|
+
const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
|
1417
1577
|
return /^is[A-Z]/.test(prop);
|
1418
1578
|
});
|
1419
1579
|
|
@@ -1441,7 +1601,7 @@ const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop)
|
|
1441
1601
|
* @returns
|
1442
1602
|
*/
|
1443
1603
|
function toFormData(obj, formData, options) {
|
1444
|
-
if (!utils
|
1604
|
+
if (!utils.isObject(obj)) {
|
1445
1605
|
throw new TypeError('target must be an object');
|
1446
1606
|
}
|
1447
1607
|
|
@@ -1449,13 +1609,13 @@ function toFormData(obj, formData, options) {
|
|
1449
1609
|
formData = formData || new (FormData)();
|
1450
1610
|
|
1451
1611
|
// eslint-disable-next-line no-param-reassign
|
1452
|
-
options = utils
|
1612
|
+
options = utils.toFlatObject(options, {
|
1453
1613
|
metaTokens: true,
|
1454
1614
|
dots: false,
|
1455
1615
|
indexes: false
|
1456
1616
|
}, false, function defined(option, source) {
|
1457
1617
|
// eslint-disable-next-line no-eq-null,eqeqeq
|
1458
|
-
return !utils
|
1618
|
+
return !utils.isUndefined(source[option]);
|
1459
1619
|
});
|
1460
1620
|
|
1461
1621
|
const metaTokens = options.metaTokens;
|
@@ -1464,24 +1624,24 @@ function toFormData(obj, formData, options) {
|
|
1464
1624
|
const dots = options.dots;
|
1465
1625
|
const indexes = options.indexes;
|
1466
1626
|
const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
|
1467
|
-
const useBlob = _Blob && utils
|
1627
|
+
const useBlob = _Blob && utils.isSpecCompliantForm(formData);
|
1468
1628
|
|
1469
|
-
if (!utils
|
1629
|
+
if (!utils.isFunction(visitor)) {
|
1470
1630
|
throw new TypeError('visitor must be a function');
|
1471
1631
|
}
|
1472
1632
|
|
1473
1633
|
function convertValue(value) {
|
1474
1634
|
if (value === null) return '';
|
1475
1635
|
|
1476
|
-
if (utils
|
1636
|
+
if (utils.isDate(value)) {
|
1477
1637
|
return value.toISOString();
|
1478
1638
|
}
|
1479
1639
|
|
1480
|
-
if (!useBlob && utils
|
1640
|
+
if (!useBlob && utils.isBlob(value)) {
|
1481
1641
|
throw new AxiosError('Blob is not supported. Use a Buffer instead.');
|
1482
1642
|
}
|
1483
1643
|
|
1484
|
-
if (utils
|
1644
|
+
if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
|
1485
1645
|
return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
|
1486
1646
|
}
|
1487
1647
|
|
@@ -1502,20 +1662,20 @@ function toFormData(obj, formData, options) {
|
|
1502
1662
|
let arr = value;
|
1503
1663
|
|
1504
1664
|
if (value && !path && typeof value === 'object') {
|
1505
|
-
if (utils
|
1665
|
+
if (utils.endsWith(key, '{}')) {
|
1506
1666
|
// eslint-disable-next-line no-param-reassign
|
1507
1667
|
key = metaTokens ? key : key.slice(0, -2);
|
1508
1668
|
// eslint-disable-next-line no-param-reassign
|
1509
1669
|
value = JSON.stringify(value);
|
1510
1670
|
} else if (
|
1511
|
-
(utils
|
1512
|
-
((utils
|
1671
|
+
(utils.isArray(value) && isFlatArray(value)) ||
|
1672
|
+
((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))
|
1513
1673
|
)) {
|
1514
1674
|
// eslint-disable-next-line no-param-reassign
|
1515
1675
|
key = removeBrackets(key);
|
1516
1676
|
|
1517
1677
|
arr.forEach(function each(el, index) {
|
1518
|
-
!(utils
|
1678
|
+
!(utils.isUndefined(el) || el === null) && formData.append(
|
1519
1679
|
// eslint-disable-next-line no-nested-ternary
|
1520
1680
|
indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
|
1521
1681
|
convertValue(el)
|
@@ -1543,7 +1703,7 @@ function toFormData(obj, formData, options) {
|
|
1543
1703
|
});
|
1544
1704
|
|
1545
1705
|
function build(value, path) {
|
1546
|
-
if (utils
|
1706
|
+
if (utils.isUndefined(value)) return;
|
1547
1707
|
|
1548
1708
|
if (stack.indexOf(value) !== -1) {
|
1549
1709
|
throw Error('Circular reference detected in ' + path.join('.'));
|
@@ -1551,9 +1711,9 @@ function toFormData(obj, formData, options) {
|
|
1551
1711
|
|
1552
1712
|
stack.push(value);
|
1553
1713
|
|
1554
|
-
utils
|
1555
|
-
const result = !(utils
|
1556
|
-
formData, el, utils
|
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
|
1557
1717
|
);
|
1558
1718
|
|
1559
1719
|
if (result === true) {
|
@@ -1564,7 +1724,7 @@ function toFormData(obj, formData, options) {
|
|
1564
1724
|
stack.pop();
|
1565
1725
|
}
|
1566
1726
|
|
1567
|
-
if (!utils
|
1727
|
+
if (!utils.isObject(obj)) {
|
1568
1728
|
throw new TypeError('data must be an object');
|
1569
1729
|
}
|
1570
1730
|
|
@@ -1668,7 +1828,7 @@ function buildURL(url, params, options) {
|
|
1668
1828
|
if (serializeFn) {
|
1669
1829
|
serializedParams = serializeFn(params, options);
|
1670
1830
|
} else {
|
1671
|
-
serializedParams = utils
|
1831
|
+
serializedParams = utils.isURLSearchParams(params) ?
|
1672
1832
|
params.toString() :
|
1673
1833
|
new AxiosURLSearchParams(params, options).toString(_encode);
|
1674
1834
|
}
|
@@ -1743,7 +1903,7 @@ class InterceptorManager {
|
|
1743
1903
|
* @returns {void}
|
1744
1904
|
*/
|
1745
1905
|
forEach(fn) {
|
1746
|
-
utils
|
1906
|
+
utils.forEach(this.handlers, function forEachHandler(h) {
|
1747
1907
|
if (h !== null) {
|
1748
1908
|
fn(h);
|
1749
1909
|
}
|
@@ -1763,18 +1923,6 @@ const FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
|
|
1763
1923
|
|
1764
1924
|
const Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
|
1765
1925
|
|
1766
|
-
const platform$1 = {
|
1767
|
-
isBrowser: true,
|
1768
|
-
classes: {
|
1769
|
-
URLSearchParams: URLSearchParams$1,
|
1770
|
-
FormData: FormData$1,
|
1771
|
-
Blob: Blob$1
|
1772
|
-
},
|
1773
|
-
protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
|
1774
|
-
};
|
1775
|
-
|
1776
|
-
const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
|
1777
|
-
|
1778
1926
|
/**
|
1779
1927
|
* Determine if we're running in a standard browser environment
|
1780
1928
|
*
|
@@ -1792,10 +1940,18 @@ const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'unde
|
|
1792
1940
|
*
|
1793
1941
|
* @returns {boolean}
|
1794
1942
|
*/
|
1795
|
-
const
|
1796
|
-
|
1797
|
-
|
1798
|
-
|
1943
|
+
const isStandardBrowserEnv = (() => {
|
1944
|
+
let product;
|
1945
|
+
if (typeof navigator !== 'undefined' && (
|
1946
|
+
(product = navigator.product) === 'ReactNative' ||
|
1947
|
+
product === 'NativeScript' ||
|
1948
|
+
product === 'NS')
|
1949
|
+
) {
|
1950
|
+
return false;
|
1951
|
+
}
|
1952
|
+
|
1953
|
+
return typeof window !== 'undefined' && typeof document !== 'undefined';
|
1954
|
+
})();
|
1799
1955
|
|
1800
1956
|
/**
|
1801
1957
|
* Determine if we're running in a standard browser webWorker environment
|
@@ -1806,7 +1962,7 @@ const hasStandardBrowserEnv = (
|
|
1806
1962
|
* `typeof window !== 'undefined' && typeof document !== 'undefined'`.
|
1807
1963
|
* This leads to a problem when axios post `FormData` in webWorker
|
1808
1964
|
*/
|
1809
|
-
const
|
1965
|
+
const isStandardBrowserWebWorkerEnv = (() => {
|
1810
1966
|
return (
|
1811
1967
|
typeof WorkerGlobalScope !== 'undefined' &&
|
1812
1968
|
// eslint-disable-next-line no-undef
|
@@ -1815,25 +1971,22 @@ const hasStandardBrowserWebWorkerEnv = (() => {
|
|
1815
1971
|
);
|
1816
1972
|
})();
|
1817
1973
|
|
1818
|
-
const utils = /*#__PURE__*/Object.freeze({
|
1819
|
-
__proto__: null,
|
1820
|
-
hasBrowserEnv: hasBrowserEnv,
|
1821
|
-
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
1822
|
-
hasStandardBrowserEnv: hasStandardBrowserEnv
|
1823
|
-
});
|
1824
1974
|
|
1825
1975
|
const platform = {
|
1826
|
-
|
1827
|
-
|
1976
|
+
isBrowser: true,
|
1977
|
+
classes: {
|
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']
|
1828
1985
|
};
|
1829
1986
|
|
1830
1987
|
function toURLEncodedForm(data, options) {
|
1831
1988
|
return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
|
1832
1989
|
visitor: function(value, key, path, helpers) {
|
1833
|
-
if (platform.isNode && utils$1.isBuffer(value)) {
|
1834
|
-
this.append(key, value.toString('base64'));
|
1835
|
-
return false;
|
1836
|
-
}
|
1837
1990
|
|
1838
1991
|
return helpers.defaultVisitor.apply(this, arguments);
|
1839
1992
|
}
|
@@ -1852,7 +2005,7 @@ function parsePropPath(name) {
|
|
1852
2005
|
// foo.x.y.z
|
1853
2006
|
// foo-x-y-z
|
1854
2007
|
// foo x y z
|
1855
|
-
return utils
|
2008
|
+
return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
|
1856
2009
|
return match[0] === '[]' ? '' : match[1] || match[0];
|
1857
2010
|
});
|
1858
2011
|
}
|
@@ -1889,10 +2042,10 @@ function formDataToJSON(formData) {
|
|
1889
2042
|
let name = path[index++];
|
1890
2043
|
const isNumericKey = Number.isFinite(+name);
|
1891
2044
|
const isLast = index >= path.length;
|
1892
|
-
name = !name && utils
|
2045
|
+
name = !name && utils.isArray(target) ? target.length : name;
|
1893
2046
|
|
1894
2047
|
if (isLast) {
|
1895
|
-
if (utils
|
2048
|
+
if (utils.hasOwnProp(target, name)) {
|
1896
2049
|
target[name] = [target[name], value];
|
1897
2050
|
} else {
|
1898
2051
|
target[name] = value;
|
@@ -1901,23 +2054,23 @@ function formDataToJSON(formData) {
|
|
1901
2054
|
return !isNumericKey;
|
1902
2055
|
}
|
1903
2056
|
|
1904
|
-
if (!target[name] || !utils
|
2057
|
+
if (!target[name] || !utils.isObject(target[name])) {
|
1905
2058
|
target[name] = [];
|
1906
2059
|
}
|
1907
2060
|
|
1908
2061
|
const result = buildPath(path, value, target[name], index);
|
1909
2062
|
|
1910
|
-
if (result && utils
|
2063
|
+
if (result && utils.isArray(target[name])) {
|
1911
2064
|
target[name] = arrayToObject(target[name]);
|
1912
2065
|
}
|
1913
2066
|
|
1914
2067
|
return !isNumericKey;
|
1915
2068
|
}
|
1916
2069
|
|
1917
|
-
if (utils
|
2070
|
+
if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {
|
1918
2071
|
const obj = {};
|
1919
2072
|
|
1920
|
-
utils
|
2073
|
+
utils.forEachEntry(formData, (name, value) => {
|
1921
2074
|
buildPath(parsePropPath(name), value, obj, 0);
|
1922
2075
|
});
|
1923
2076
|
|
@@ -1938,10 +2091,10 @@ function formDataToJSON(formData) {
|
|
1938
2091
|
* @returns {string} A stringified version of the rawValue.
|
1939
2092
|
*/
|
1940
2093
|
function stringifySafely(rawValue, parser, encoder) {
|
1941
|
-
if (utils
|
2094
|
+
if (utils.isString(rawValue)) {
|
1942
2095
|
try {
|
1943
2096
|
(parser || JSON.parse)(rawValue);
|
1944
|
-
return utils
|
2097
|
+
return utils.trim(rawValue);
|
1945
2098
|
} catch (e) {
|
1946
2099
|
if (e.name !== 'SyntaxError') {
|
1947
2100
|
throw e;
|
@@ -1961,13 +2114,13 @@ const defaults = {
|
|
1961
2114
|
transformRequest: [function transformRequest(data, headers) {
|
1962
2115
|
const contentType = headers.getContentType() || '';
|
1963
2116
|
const hasJSONContentType = contentType.indexOf('application/json') > -1;
|
1964
|
-
const isObjectPayload = utils
|
2117
|
+
const isObjectPayload = utils.isObject(data);
|
1965
2118
|
|
1966
|
-
if (isObjectPayload && utils
|
2119
|
+
if (isObjectPayload && utils.isHTMLForm(data)) {
|
1967
2120
|
data = new FormData(data);
|
1968
2121
|
}
|
1969
2122
|
|
1970
|
-
const isFormData = utils
|
2123
|
+
const isFormData = utils.isFormData(data);
|
1971
2124
|
|
1972
2125
|
if (isFormData) {
|
1973
2126
|
if (!hasJSONContentType) {
|
@@ -1976,18 +2129,18 @@ const defaults = {
|
|
1976
2129
|
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
1977
2130
|
}
|
1978
2131
|
|
1979
|
-
if (utils
|
1980
|
-
utils
|
1981
|
-
utils
|
1982
|
-
utils
|
1983
|
-
utils
|
2132
|
+
if (utils.isArrayBuffer(data) ||
|
2133
|
+
utils.isBuffer(data) ||
|
2134
|
+
utils.isStream(data) ||
|
2135
|
+
utils.isFile(data) ||
|
2136
|
+
utils.isBlob(data)
|
1984
2137
|
) {
|
1985
2138
|
return data;
|
1986
2139
|
}
|
1987
|
-
if (utils
|
2140
|
+
if (utils.isArrayBufferView(data)) {
|
1988
2141
|
return data.buffer;
|
1989
2142
|
}
|
1990
|
-
if (utils
|
2143
|
+
if (utils.isURLSearchParams(data)) {
|
1991
2144
|
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
|
1992
2145
|
return data.toString();
|
1993
2146
|
}
|
@@ -1999,7 +2152,7 @@ const defaults = {
|
|
1999
2152
|
return toURLEncodedForm(data, this.formSerializer).toString();
|
2000
2153
|
}
|
2001
2154
|
|
2002
|
-
if ((isFileList = utils
|
2155
|
+
if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
|
2003
2156
|
const _FormData = this.env && this.env.FormData;
|
2004
2157
|
|
2005
2158
|
return toFormData(
|
@@ -2023,7 +2176,7 @@ const defaults = {
|
|
2023
2176
|
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
2024
2177
|
const JSONRequested = this.responseType === 'json';
|
2025
2178
|
|
2026
|
-
if (data && utils
|
2179
|
+
if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
|
2027
2180
|
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
2028
2181
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
2029
2182
|
|
@@ -2071,13 +2224,13 @@ const defaults = {
|
|
2071
2224
|
}
|
2072
2225
|
};
|
2073
2226
|
|
2074
|
-
utils
|
2227
|
+
utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
2075
2228
|
defaults.headers[method] = {};
|
2076
2229
|
});
|
2077
2230
|
|
2078
2231
|
// RawAxiosHeaders whose duplicates are ignored by node
|
2079
2232
|
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
2080
|
-
const ignoreDuplicateOf = utils
|
2233
|
+
const ignoreDuplicateOf = utils.toObjectSet([
|
2081
2234
|
'age', 'authorization', 'content-length', 'content-type', 'etag',
|
2082
2235
|
'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
|
2083
2236
|
'last-modified', 'location', 'max-forwards', 'proxy-authorization',
|
@@ -2138,7 +2291,7 @@ function normalizeValue(value) {
|
|
2138
2291
|
return value;
|
2139
2292
|
}
|
2140
2293
|
|
2141
|
-
return utils
|
2294
|
+
return utils.isArray(value) ? value.map(normalizeValue) : String(value);
|
2142
2295
|
}
|
2143
2296
|
|
2144
2297
|
function parseTokens(str) {
|
@@ -2156,7 +2309,7 @@ function parseTokens(str) {
|
|
2156
2309
|
const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
2157
2310
|
|
2158
2311
|
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
2159
|
-
if (utils
|
2312
|
+
if (utils.isFunction(filter)) {
|
2160
2313
|
return filter.call(this, value, header);
|
2161
2314
|
}
|
2162
2315
|
|
@@ -2164,13 +2317,13 @@ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
2164
2317
|
value = header;
|
2165
2318
|
}
|
2166
2319
|
|
2167
|
-
if (!utils
|
2320
|
+
if (!utils.isString(value)) return;
|
2168
2321
|
|
2169
|
-
if (utils
|
2322
|
+
if (utils.isString(filter)) {
|
2170
2323
|
return value.indexOf(filter) !== -1;
|
2171
2324
|
}
|
2172
2325
|
|
2173
|
-
if (utils
|
2326
|
+
if (utils.isRegExp(filter)) {
|
2174
2327
|
return filter.test(value);
|
2175
2328
|
}
|
2176
2329
|
}
|
@@ -2183,7 +2336,7 @@ function formatHeader(header) {
|
|
2183
2336
|
}
|
2184
2337
|
|
2185
2338
|
function buildAccessors(obj, header) {
|
2186
|
-
const accessorName = utils
|
2339
|
+
const accessorName = utils.toCamelCase(' ' + header);
|
2187
2340
|
|
2188
2341
|
['get', 'set', 'has'].forEach(methodName => {
|
2189
2342
|
Object.defineProperty(obj, methodName + accessorName, {
|
@@ -2210,7 +2363,7 @@ class AxiosHeaders {
|
|
2210
2363
|
throw new Error('header name must be a non-empty string');
|
2211
2364
|
}
|
2212
2365
|
|
2213
|
-
const key = utils
|
2366
|
+
const key = utils.findKey(self, lHeader);
|
2214
2367
|
|
2215
2368
|
if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
|
2216
2369
|
self[key || _header] = normalizeValue(_value);
|
@@ -2218,11 +2371,11 @@ class AxiosHeaders {
|
|
2218
2371
|
}
|
2219
2372
|
|
2220
2373
|
const setHeaders = (headers, _rewrite) =>
|
2221
|
-
utils
|
2374
|
+
utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
2222
2375
|
|
2223
|
-
if (utils
|
2376
|
+
if (utils.isPlainObject(header) || header instanceof this.constructor) {
|
2224
2377
|
setHeaders(header, valueOrRewrite);
|
2225
|
-
} else if(utils
|
2378
|
+
} else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
2226
2379
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
2227
2380
|
} else {
|
2228
2381
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
@@ -2235,7 +2388,7 @@ class AxiosHeaders {
|
|
2235
2388
|
header = normalizeHeader(header);
|
2236
2389
|
|
2237
2390
|
if (header) {
|
2238
|
-
const key = utils
|
2391
|
+
const key = utils.findKey(this, header);
|
2239
2392
|
|
2240
2393
|
if (key) {
|
2241
2394
|
const value = this[key];
|
@@ -2248,11 +2401,11 @@ class AxiosHeaders {
|
|
2248
2401
|
return parseTokens(value);
|
2249
2402
|
}
|
2250
2403
|
|
2251
|
-
if (utils
|
2404
|
+
if (utils.isFunction(parser)) {
|
2252
2405
|
return parser.call(this, value, key);
|
2253
2406
|
}
|
2254
2407
|
|
2255
|
-
if (utils
|
2408
|
+
if (utils.isRegExp(parser)) {
|
2256
2409
|
return parser.exec(value);
|
2257
2410
|
}
|
2258
2411
|
|
@@ -2265,7 +2418,7 @@ class AxiosHeaders {
|
|
2265
2418
|
header = normalizeHeader(header);
|
2266
2419
|
|
2267
2420
|
if (header) {
|
2268
|
-
const key = utils
|
2421
|
+
const key = utils.findKey(this, header);
|
2269
2422
|
|
2270
2423
|
return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
2271
2424
|
}
|
@@ -2281,7 +2434,7 @@ class AxiosHeaders {
|
|
2281
2434
|
_header = normalizeHeader(_header);
|
2282
2435
|
|
2283
2436
|
if (_header) {
|
2284
|
-
const key = utils
|
2437
|
+
const key = utils.findKey(self, _header);
|
2285
2438
|
|
2286
2439
|
if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
|
2287
2440
|
delete self[key];
|
@@ -2291,7 +2444,7 @@ class AxiosHeaders {
|
|
2291
2444
|
}
|
2292
2445
|
}
|
2293
2446
|
|
2294
|
-
if (utils
|
2447
|
+
if (utils.isArray(header)) {
|
2295
2448
|
header.forEach(deleteHeader);
|
2296
2449
|
} else {
|
2297
2450
|
deleteHeader(header);
|
@@ -2320,8 +2473,8 @@ class AxiosHeaders {
|
|
2320
2473
|
const self = this;
|
2321
2474
|
const headers = {};
|
2322
2475
|
|
2323
|
-
utils
|
2324
|
-
const key = utils
|
2476
|
+
utils.forEach(this, (value, header) => {
|
2477
|
+
const key = utils.findKey(headers, header);
|
2325
2478
|
|
2326
2479
|
if (key) {
|
2327
2480
|
self[key] = normalizeValue(value);
|
@@ -2350,8 +2503,8 @@ class AxiosHeaders {
|
|
2350
2503
|
toJSON(asStrings) {
|
2351
2504
|
const obj = Object.create(null);
|
2352
2505
|
|
2353
|
-
utils
|
2354
|
-
value != null && value !== false && (obj[header] = asStrings && utils
|
2506
|
+
utils.forEach(this, (value, header) => {
|
2507
|
+
value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
|
2355
2508
|
});
|
2356
2509
|
|
2357
2510
|
return obj;
|
@@ -2398,7 +2551,7 @@ class AxiosHeaders {
|
|
2398
2551
|
}
|
2399
2552
|
}
|
2400
2553
|
|
2401
|
-
utils
|
2554
|
+
utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
2402
2555
|
|
2403
2556
|
return this;
|
2404
2557
|
}
|
@@ -2407,7 +2560,7 @@ class AxiosHeaders {
|
|
2407
2560
|
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
|
2408
2561
|
|
2409
2562
|
// reserved names hotfix
|
2410
|
-
utils
|
2563
|
+
utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
|
2411
2564
|
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
2412
2565
|
return {
|
2413
2566
|
get: () => value,
|
@@ -2417,7 +2570,7 @@ utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
|
|
2417
2570
|
}
|
2418
2571
|
});
|
2419
2572
|
|
2420
|
-
utils
|
2573
|
+
utils.freezeMethods(AxiosHeaders);
|
2421
2574
|
|
2422
2575
|
/**
|
2423
2576
|
* Transform the data for a request or a response
|
@@ -2433,7 +2586,7 @@ function transformData(fns, response) {
|
|
2433
2586
|
const headers = AxiosHeaders.from(context.headers);
|
2434
2587
|
let data = context.data;
|
2435
2588
|
|
2436
|
-
utils
|
2589
|
+
utils.forEach(fns, function transform(fn) {
|
2437
2590
|
data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
|
2438
2591
|
});
|
2439
2592
|
|
@@ -2461,7 +2614,7 @@ function CanceledError(message, config, request) {
|
|
2461
2614
|
this.name = 'CanceledError';
|
2462
2615
|
}
|
2463
2616
|
|
2464
|
-
utils
|
2617
|
+
utils.inherits(CanceledError, AxiosError, {
|
2465
2618
|
__CANCEL__: true
|
2466
2619
|
});
|
2467
2620
|
|
@@ -2489,44 +2642,53 @@ function settle(resolve, reject, response) {
|
|
2489
2642
|
}
|
2490
2643
|
}
|
2491
2644
|
|
2492
|
-
const cookies = platform.
|
2493
|
-
|
2494
|
-
// Standard browser envs support document.cookie
|
2495
|
-
{
|
2496
|
-
write(name, value, expires, path, domain, secure) {
|
2497
|
-
const cookie = [name + '=' + encodeURIComponent(value)];
|
2645
|
+
const cookies = platform.isStandardBrowserEnv ?
|
2498
2646
|
|
2499
|
-
|
2647
|
+
// Standard browser envs support document.cookie
|
2648
|
+
(function standardBrowserEnv() {
|
2649
|
+
return {
|
2650
|
+
write: function write(name, value, expires, path, domain, secure) {
|
2651
|
+
const cookie = [];
|
2652
|
+
cookie.push(name + '=' + encodeURIComponent(value));
|
2500
2653
|
|
2501
|
-
|
2654
|
+
if (utils.isNumber(expires)) {
|
2655
|
+
cookie.push('expires=' + new Date(expires).toGMTString());
|
2656
|
+
}
|
2502
2657
|
|
2503
|
-
|
2658
|
+
if (utils.isString(path)) {
|
2659
|
+
cookie.push('path=' + path);
|
2660
|
+
}
|
2504
2661
|
|
2505
|
-
|
2662
|
+
if (utils.isString(domain)) {
|
2663
|
+
cookie.push('domain=' + domain);
|
2664
|
+
}
|
2506
2665
|
|
2507
|
-
|
2508
|
-
|
2666
|
+
if (secure === true) {
|
2667
|
+
cookie.push('secure');
|
2668
|
+
}
|
2509
2669
|
|
2510
|
-
|
2511
|
-
|
2512
|
-
return (match ? decodeURIComponent(match[3]) : null);
|
2513
|
-
},
|
2670
|
+
document.cookie = cookie.join('; ');
|
2671
|
+
},
|
2514
2672
|
|
2515
|
-
|
2516
|
-
|
2517
|
-
|
2518
|
-
|
2673
|
+
read: function read(name) {
|
2674
|
+
const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
2675
|
+
return (match ? decodeURIComponent(match[3]) : null);
|
2676
|
+
},
|
2519
2677
|
|
2520
|
-
|
2678
|
+
remove: function remove(name) {
|
2679
|
+
this.write(name, '', Date.now() - 86400000);
|
2680
|
+
}
|
2681
|
+
};
|
2682
|
+
})() :
|
2521
2683
|
|
2522
|
-
|
2523
|
-
{
|
2524
|
-
|
2525
|
-
|
2526
|
-
return null;
|
2527
|
-
|
2528
|
-
|
2529
|
-
};
|
2684
|
+
// Non standard browser env (web workers, react-native) lack needed support.
|
2685
|
+
(function nonStandardBrowserEnv() {
|
2686
|
+
return {
|
2687
|
+
write: function write() {},
|
2688
|
+
read: function read() { return null; },
|
2689
|
+
remove: function remove() {}
|
2690
|
+
};
|
2691
|
+
})();
|
2530
2692
|
|
2531
2693
|
/**
|
2532
2694
|
* Determines whether the specified URL is absolute
|
@@ -2573,7 +2735,7 @@ function buildFullPath(baseURL, requestedURL) {
|
|
2573
2735
|
return requestedURL;
|
2574
2736
|
}
|
2575
2737
|
|
2576
|
-
const isURLSameOrigin = platform.
|
2738
|
+
const isURLSameOrigin = platform.isStandardBrowserEnv ?
|
2577
2739
|
|
2578
2740
|
// Standard browser envs have full support of the APIs needed to test
|
2579
2741
|
// whether the request URL is of the same origin as current location.
|
@@ -2583,7 +2745,7 @@ const isURLSameOrigin = platform.hasStandardBrowserEnv ?
|
|
2583
2745
|
let originURL;
|
2584
2746
|
|
2585
2747
|
/**
|
2586
|
-
* Parse a URL to discover
|
2748
|
+
* Parse a URL to discover it's components
|
2587
2749
|
*
|
2588
2750
|
* @param {String} url The URL to be parsed
|
2589
2751
|
* @returns {Object}
|
@@ -2623,7 +2785,7 @@ const isURLSameOrigin = platform.hasStandardBrowserEnv ?
|
|
2623
2785
|
* @returns {boolean} True if URL shares the same origin, otherwise false
|
2624
2786
|
*/
|
2625
2787
|
return function isURLSameOrigin(requestURL) {
|
2626
|
-
const parsed = (utils
|
2788
|
+
const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
2627
2789
|
return (parsed.protocol === originURL.protocol &&
|
2628
2790
|
parsed.host === originURL.host);
|
2629
2791
|
};
|
@@ -2728,7 +2890,7 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
2728
2890
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
2729
2891
|
let requestData = config.data;
|
2730
2892
|
const requestHeaders = AxiosHeaders.from(config.headers).normalize();
|
2731
|
-
|
2893
|
+
const responseType = config.responseType;
|
2732
2894
|
let onCanceled;
|
2733
2895
|
function done() {
|
2734
2896
|
if (config.cancelToken) {
|
@@ -2742,13 +2904,14 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
2742
2904
|
|
2743
2905
|
let contentType;
|
2744
2906
|
|
2745
|
-
if (utils
|
2746
|
-
if (platform.
|
2907
|
+
if (utils.isFormData(requestData)) {
|
2908
|
+
if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {
|
2747
2909
|
requestHeaders.setContentType(false); // Let the browser set it
|
2748
|
-
} else if
|
2910
|
+
} else if(!requestHeaders.getContentType(/^\s*multipart\/form-data/)){
|
2911
|
+
requestHeaders.setContentType('multipart/form-data'); // mobile/desktop app frameworks
|
2912
|
+
} else if(utils.isString(contentType = requestHeaders.getContentType())){
|
2749
2913
|
// fix semicolon duplication issue for ReactNative FormData implementation
|
2750
|
-
|
2751
|
-
requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
|
2914
|
+
requestHeaders.setContentType(contentType.replace(/^\s*(multipart\/form-data);+/, '$1'));
|
2752
2915
|
}
|
2753
2916
|
}
|
2754
2917
|
|
@@ -2864,16 +3027,13 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
2864
3027
|
// Add xsrf header
|
2865
3028
|
// This is only done if running in a standard browser environment.
|
2866
3029
|
// Specifically not if we're in a web worker, or react-native.
|
2867
|
-
if(platform.
|
2868
|
-
|
2869
|
-
|
2870
|
-
|
2871
|
-
// Add xsrf header
|
2872
|
-
const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
|
3030
|
+
if (platform.isStandardBrowserEnv) {
|
3031
|
+
// Add xsrf header
|
3032
|
+
const xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath))
|
3033
|
+
&& config.xsrfCookieName && cookies.read(config.xsrfCookieName);
|
2873
3034
|
|
2874
|
-
|
2875
|
-
|
2876
|
-
}
|
3035
|
+
if (xsrfValue) {
|
3036
|
+
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
|
2877
3037
|
}
|
2878
3038
|
}
|
2879
3039
|
|
@@ -2882,13 +3042,13 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
2882
3042
|
|
2883
3043
|
// Add headers to the request
|
2884
3044
|
if ('setRequestHeader' in request) {
|
2885
|
-
utils
|
3045
|
+
utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
2886
3046
|
request.setRequestHeader(key, val);
|
2887
3047
|
});
|
2888
3048
|
}
|
2889
3049
|
|
2890
3050
|
// Add withCredentials to request if needed
|
2891
|
-
if (!utils
|
3051
|
+
if (!utils.isUndefined(config.withCredentials)) {
|
2892
3052
|
request.withCredentials = !!config.withCredentials;
|
2893
3053
|
}
|
2894
3054
|
|
@@ -2943,7 +3103,7 @@ const knownAdapters = {
|
|
2943
3103
|
xhr: xhrAdapter
|
2944
3104
|
};
|
2945
3105
|
|
2946
|
-
utils
|
3106
|
+
utils.forEach(knownAdapters, (fn, value) => {
|
2947
3107
|
if (fn) {
|
2948
3108
|
try {
|
2949
3109
|
Object.defineProperty(fn, 'name', {value});
|
@@ -2956,11 +3116,11 @@ utils$1.forEach(knownAdapters, (fn, value) => {
|
|
2956
3116
|
|
2957
3117
|
const renderReason = (reason) => `- ${reason}`;
|
2958
3118
|
|
2959
|
-
const isResolvedHandle = (adapter) => utils
|
3119
|
+
const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;
|
2960
3120
|
|
2961
3121
|
const adapters = {
|
2962
3122
|
getAdapter: (adapters) => {
|
2963
|
-
adapters = utils
|
3123
|
+
adapters = utils.isArray(adapters) ? adapters : [adapters];
|
2964
3124
|
|
2965
3125
|
const {length} = adapters;
|
2966
3126
|
let nameOrAdapter;
|
@@ -3101,11 +3261,11 @@ function mergeConfig(config1, config2) {
|
|
3101
3261
|
const config = {};
|
3102
3262
|
|
3103
3263
|
function getMergedValue(target, source, caseless) {
|
3104
|
-
if (utils
|
3105
|
-
return utils
|
3106
|
-
} else if (utils
|
3107
|
-
return utils
|
3108
|
-
} else if (utils
|
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)) {
|
3109
3269
|
return source.slice();
|
3110
3270
|
}
|
3111
3271
|
return source;
|
@@ -3113,25 +3273,25 @@ function mergeConfig(config1, config2) {
|
|
3113
3273
|
|
3114
3274
|
// eslint-disable-next-line consistent-return
|
3115
3275
|
function mergeDeepProperties(a, b, caseless) {
|
3116
|
-
if (!utils
|
3276
|
+
if (!utils.isUndefined(b)) {
|
3117
3277
|
return getMergedValue(a, b, caseless);
|
3118
|
-
} else if (!utils
|
3278
|
+
} else if (!utils.isUndefined(a)) {
|
3119
3279
|
return getMergedValue(undefined, a, caseless);
|
3120
3280
|
}
|
3121
3281
|
}
|
3122
3282
|
|
3123
3283
|
// eslint-disable-next-line consistent-return
|
3124
3284
|
function valueFromConfig2(a, b) {
|
3125
|
-
if (!utils
|
3285
|
+
if (!utils.isUndefined(b)) {
|
3126
3286
|
return getMergedValue(undefined, b);
|
3127
3287
|
}
|
3128
3288
|
}
|
3129
3289
|
|
3130
3290
|
// eslint-disable-next-line consistent-return
|
3131
3291
|
function defaultToConfig2(a, b) {
|
3132
|
-
if (!utils
|
3292
|
+
if (!utils.isUndefined(b)) {
|
3133
3293
|
return getMergedValue(undefined, b);
|
3134
|
-
} else if (!utils
|
3294
|
+
} else if (!utils.isUndefined(a)) {
|
3135
3295
|
return getMergedValue(undefined, a);
|
3136
3296
|
}
|
3137
3297
|
}
|
@@ -3156,7 +3316,6 @@ function mergeConfig(config1, config2) {
|
|
3156
3316
|
timeout: defaultToConfig2,
|
3157
3317
|
timeoutMessage: defaultToConfig2,
|
3158
3318
|
withCredentials: defaultToConfig2,
|
3159
|
-
withXSRFToken: defaultToConfig2,
|
3160
3319
|
adapter: defaultToConfig2,
|
3161
3320
|
responseType: defaultToConfig2,
|
3162
3321
|
xsrfCookieName: defaultToConfig2,
|
@@ -3177,16 +3336,16 @@ function mergeConfig(config1, config2) {
|
|
3177
3336
|
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
3178
3337
|
};
|
3179
3338
|
|
3180
|
-
utils
|
3339
|
+
utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
3181
3340
|
const merge = mergeMap[prop] || mergeDeepProperties;
|
3182
3341
|
const configValue = merge(config1[prop], config2[prop], prop);
|
3183
|
-
(utils
|
3342
|
+
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
3184
3343
|
});
|
3185
3344
|
|
3186
3345
|
return config;
|
3187
3346
|
}
|
3188
3347
|
|
3189
|
-
const VERSION = "1.
|
3348
|
+
const VERSION = "1.5.1";
|
3190
3349
|
|
3191
3350
|
const validators$1 = {};
|
3192
3351
|
|
@@ -3324,7 +3483,7 @@ class Axios {
|
|
3324
3483
|
}
|
3325
3484
|
|
3326
3485
|
if (paramsSerializer != null) {
|
3327
|
-
if (utils
|
3486
|
+
if (utils.isFunction(paramsSerializer)) {
|
3328
3487
|
config.paramsSerializer = {
|
3329
3488
|
serialize: paramsSerializer
|
3330
3489
|
};
|
@@ -3340,12 +3499,12 @@ class Axios {
|
|
3340
3499
|
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
3341
3500
|
|
3342
3501
|
// Flatten headers
|
3343
|
-
let contextHeaders = headers && utils
|
3502
|
+
let contextHeaders = headers && utils.merge(
|
3344
3503
|
headers.common,
|
3345
3504
|
headers[config.method]
|
3346
3505
|
);
|
3347
3506
|
|
3348
|
-
headers && utils
|
3507
|
+
headers && utils.forEach(
|
3349
3508
|
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
3350
3509
|
(method) => {
|
3351
3510
|
delete headers[method];
|
@@ -3432,7 +3591,7 @@ class Axios {
|
|
3432
3591
|
}
|
3433
3592
|
|
3434
3593
|
// Provide aliases for supported request methods
|
3435
|
-
utils
|
3594
|
+
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
3436
3595
|
/*eslint func-names:0*/
|
3437
3596
|
Axios.prototype[method] = function(url, config) {
|
3438
3597
|
return this.request(mergeConfig(config || {}, {
|
@@ -3443,7 +3602,7 @@ utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoDa
|
|
3443
3602
|
};
|
3444
3603
|
});
|
3445
3604
|
|
3446
|
-
utils
|
3605
|
+
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
3447
3606
|
/*eslint func-names:0*/
|
3448
3607
|
|
3449
3608
|
function generateHTTPMethod(isForm) {
|
@@ -3615,7 +3774,7 @@ function spread(callback) {
|
|
3615
3774
|
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
3616
3775
|
*/
|
3617
3776
|
function isAxiosError(payload) {
|
3618
|
-
return utils
|
3777
|
+
return utils.isObject(payload) && (payload.isAxiosError === true);
|
3619
3778
|
}
|
3620
3779
|
|
3621
3780
|
const HttpStatusCode = {
|
@@ -3700,10 +3859,10 @@ function createInstance(defaultConfig) {
|
|
3700
3859
|
const instance = bind(Axios.prototype.request, context);
|
3701
3860
|
|
3702
3861
|
// Copy axios.prototype to instance
|
3703
|
-
utils
|
3862
|
+
utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});
|
3704
3863
|
|
3705
3864
|
// Copy context to instance
|
3706
|
-
utils
|
3865
|
+
utils.extend(instance, context, null, {allOwnKeys: true});
|
3707
3866
|
|
3708
3867
|
// Factory for creating new instances
|
3709
3868
|
instance.create = function create(instanceConfig) {
|
@@ -3747,7 +3906,7 @@ axios.mergeConfig = mergeConfig;
|
|
3747
3906
|
|
3748
3907
|
axios.AxiosHeaders = AxiosHeaders;
|
3749
3908
|
|
3750
|
-
axios.formToJSON = thing => formDataToJSON(utils
|
3909
|
+
axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
|
3751
3910
|
|
3752
3911
|
axios.getAdapter = adapters.getAdapter;
|
3753
3912
|
|
@@ -3848,9 +4007,8 @@ var VerdocsEndpoint = /** @class */ (function () {
|
|
3848
4007
|
function VerdocsEndpoint(options) {
|
3849
4008
|
this.environment = 'verdocs';
|
3850
4009
|
this.sessionType = 'user';
|
3851
|
-
this.baseURL =
|
3852
|
-
|
3853
|
-
: 'https://api.verdocs.com');
|
4010
|
+
this.baseURL = 'https://api.verdocs.com';
|
4011
|
+
this.baseURLv2 = 'https://api-v2.verdocs.com';
|
3854
4012
|
this.clientID = 'not-set';
|
3855
4013
|
this.timeout = 60000;
|
3856
4014
|
this.token = null;
|
@@ -3863,13 +4021,13 @@ var VerdocsEndpoint = /** @class */ (function () {
|
|
3863
4021
|
* with Envelopes.
|
3864
4022
|
*/
|
3865
4023
|
this.session = null;
|
3866
|
-
this.baseURL = (options === null || options === void 0 ? void 0 : options.baseURL) ||
|
3867
|
-
this.
|
3868
|
-
this.
|
3869
|
-
this.
|
3870
|
-
this.
|
4024
|
+
this.baseURL = (options === null || options === void 0 ? void 0 : options.baseURL) || 'https://api.verdocs.com';
|
4025
|
+
this.baseURLv2 = (options === null || options === void 0 ? void 0 : options.baseURLv2) || 'https://api-v2.verdocs.com';
|
4026
|
+
this.timeout = (options === null || options === void 0 ? void 0 : options.timeout) || 60000;
|
4027
|
+
this.environment = (options === null || options === void 0 ? void 0 : options.environment) || 'verdocs';
|
4028
|
+
this.sessionType = (options === null || options === void 0 ? void 0 : options.sessionType) || 'user';
|
4029
|
+
this.clientID = (options === null || options === void 0 ? void 0 : options.clientID) || 'not-set';
|
3871
4030
|
this.api = axios.create({ baseURL: this.baseURL, timeout: this.timeout });
|
3872
|
-
window.console.log('[JS_SDK] Initializing', this.baseURL, window.location.origin);
|
3873
4031
|
// We set the default retries to zero because we only actually want this feature on certain calls for now
|
3874
4032
|
axiosRetry(this.api, {
|
3875
4033
|
retries: 0,
|
@@ -3885,7 +4043,7 @@ var VerdocsEndpoint = /** @class */ (function () {
|
|
3885
4043
|
VerdocsEndpoint.getDefault = function () {
|
3886
4044
|
if (!globalThis_1[ENDPOINT_KEY]) {
|
3887
4045
|
globalThis_1[ENDPOINT_KEY] = new VerdocsEndpoint();
|
3888
|
-
window.console.debug('[JS_SDK] Created default endpoint', globalThis_1[ENDPOINT_KEY]
|
4046
|
+
window.console.debug('[JS_SDK] Created default endpoint', globalThis_1[ENDPOINT_KEY]);
|
3889
4047
|
}
|
3890
4048
|
return globalThis_1[ENDPOINT_KEY];
|
3891
4049
|
};
|
@@ -3907,6 +4065,13 @@ var VerdocsEndpoint = /** @class */ (function () {
|
|
3907
4065
|
VerdocsEndpoint.prototype.getBaseURL = function () {
|
3908
4066
|
return this.baseURL;
|
3909
4067
|
};
|
4068
|
+
/**
|
4069
|
+
* Get the current base URL for the v2 APIs.
|
4070
|
+
* This should rarely be anything other than 'https://api-v2.verdocs.com'.
|
4071
|
+
*/
|
4072
|
+
VerdocsEndpoint.prototype.getBaseURLv2 = function () {
|
4073
|
+
return this.baseURLv2;
|
4074
|
+
};
|
3910
4075
|
/**
|
3911
4076
|
* Get the current client ID, if set.
|
3912
4077
|
*/
|
@@ -3974,6 +4139,21 @@ var VerdocsEndpoint = /** @class */ (function () {
|
|
3974
4139
|
this.api.defaults.baseURL = url;
|
3975
4140
|
return this;
|
3976
4141
|
};
|
4142
|
+
/**
|
4143
|
+
* Set the base URL for API calls. Should be called only upon direction from Verdocs Customer Solutions Engineering.
|
4144
|
+
*
|
4145
|
+
* ```typescript
|
4146
|
+
* import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
|
4147
|
+
*
|
4148
|
+
* const endpoint = new VerdocsEndpoint();
|
4149
|
+
* endpoint.setBaseURL('https://api.verdocs.com');
|
4150
|
+
* ```
|
4151
|
+
*/
|
4152
|
+
VerdocsEndpoint.prototype.setBaseURLv2 = function (url) {
|
4153
|
+
this.baseURLv2 = url;
|
4154
|
+
// NOTE: We do not set this on the Axios instance because v1 is still the standard.
|
4155
|
+
return this;
|
4156
|
+
};
|
3977
4157
|
/**
|
3978
4158
|
* Set the Client ID for Verdocs API calls.
|
3979
4159
|
*
|
@@ -4134,8 +4314,9 @@ var VerdocsEndpoint = /** @class */ (function () {
|
|
4134
4314
|
|
4135
4315
|
exports.VerdocsEndpoint = VerdocsEndpoint;
|
4136
4316
|
exports.canPerformTemplateAction = canPerformTemplateAction;
|
4137
|
-
exports.
|
4317
|
+
exports.createTemplate = createTemplate;
|
4138
4318
|
exports.deleteTemplate = deleteTemplate;
|
4139
4319
|
exports.getTemplate = getTemplate;
|
4320
|
+
exports.getTemplates = getTemplates;
|
4140
4321
|
exports.listTemplates = listTemplates;
|
4141
4322
|
exports.updateTemplate = updateTemplate;
|