@verdocs/web-sdk 1.1.0 → 1.4.2
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/Auth-adc80bd4.js +68 -0
- package/dist/cjs/{Transport-68c8b1f4.js → Token-1ec62bd3.js} +505 -178
- package/dist/cjs/buffer-es6-bc8199b1.js +2018 -0
- package/dist/cjs/{index-6fc067b7.js → index-589f3be8.js} +83 -366
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/popper-71bf3058.js +1790 -0
- package/dist/cjs/verdocs-auth.cjs.entry.js +12 -73
- package/dist/cjs/verdocs-button_2.cjs.entry.js +17 -10
- package/dist/cjs/verdocs-dropdown_12.cjs.entry.js +36 -1819
- package/dist/cjs/verdocs-initial-dialog.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-kba-dialog.cjs.entry.js +81 -0
- package/dist/cjs/verdocs-loader.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-organization-card.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-quick-functions.cjs.entry.js +31 -0
- package/dist/cjs/verdocs-search-activity_2.cjs.entry.js +228 -0
- package/dist/cjs/verdocs-search-tabs.cjs.entry.js +20 -0
- package/dist/cjs/verdocs-search.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-sign.cjs.entry.js +24 -29
- package/dist/cjs/verdocs-signature-dialog.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-status-indicator.cjs.entry.js +7529 -0
- package/dist/cjs/verdocs-template-card.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-template-tags.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-toggle.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-upload-dialog.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-web-sdk.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +8 -9
- package/dist/collection/components/controls/verdocs-button/verdocs-button.css +110 -34
- package/dist/collection/components/controls/verdocs-button/verdocs-button.js +85 -13
- package/dist/collection/components/controls/verdocs-button/verdocs-button.stories.js +41 -2
- package/dist/collection/components/controls/verdocs-dropdown/verdocs-dropdown.css +7 -10
- package/dist/collection/components/controls/verdocs-dropdown/verdocs-dropdown.js +1 -15
- package/dist/collection/components/controls/verdocs-loader/verdocs-loader.js +3 -0
- package/dist/collection/components/controls/verdocs-organization-card/verdocs-organization-card.css +4 -6
- package/dist/collection/components/controls/verdocs-status-indicator/accepted-dark.svg +4 -0
- package/dist/collection/components/controls/verdocs-status-indicator/accepted-light.svg +4 -0
- package/dist/collection/components/controls/verdocs-status-indicator/arrowright.svg +3 -0
- package/dist/collection/components/controls/verdocs-status-indicator/canceled-dark.svg +3 -0
- package/dist/collection/components/controls/verdocs-status-indicator/canceled-light.svg +3 -0
- package/dist/collection/components/controls/verdocs-status-indicator/complete-dark.svg +3 -0
- package/dist/collection/components/controls/verdocs-status-indicator/complete-light.svg +3 -0
- package/dist/collection/components/controls/verdocs-status-indicator/declined-dark.svg +3 -0
- package/dist/collection/components/controls/verdocs-status-indicator/declined-light.svg +3 -0
- package/dist/collection/components/controls/verdocs-status-indicator/in-progress-dark.svg +3 -0
- package/dist/collection/components/controls/verdocs-status-indicator/in-progress-light.svg +3 -0
- package/dist/collection/components/controls/verdocs-status-indicator/opened-dark.svg +4 -0
- package/dist/collection/components/controls/verdocs-status-indicator/opened-light.svg +4 -0
- package/dist/collection/components/controls/verdocs-status-indicator/pending-dark.svg +3 -0
- package/dist/collection/components/controls/verdocs-status-indicator/pending-light.svg +3 -0
- package/dist/collection/components/controls/verdocs-status-indicator/recipient-flow.js +218 -0
- package/dist/collection/components/controls/verdocs-status-indicator/signed-dark.svg +4 -0
- package/dist/collection/components/controls/verdocs-status-indicator/signed-light.svg +4 -0
- package/dist/collection/components/controls/verdocs-status-indicator/some-signed-dark.svg +3 -0
- package/dist/collection/components/controls/verdocs-status-indicator/some-signed-light.svg +3 -0
- package/dist/collection/components/controls/verdocs-status-indicator/submitted-dark.svg +3 -0
- package/dist/collection/components/controls/verdocs-status-indicator/submitted-light.svg +3 -0
- package/dist/collection/components/controls/verdocs-status-indicator/verdocs-status-indicator.css +48 -0
- package/dist/collection/components/controls/verdocs-status-indicator/verdocs-status-indicator.js +344 -0
- package/dist/collection/components/controls/verdocs-status-indicator/verdocs-status-indicator.stories.js +69 -0
- package/dist/collection/components/controls/verdocs-template-card/verdocs-template-card.css +5 -7
- package/dist/collection/components/controls/verdocs-template-tags/verdocs-template-tags.css +5 -7
- package/dist/collection/components/controls/verdocs-text-input/verdocs-text-input.css +4 -6
- package/dist/collection/components/controls/verdocs-toggle/verdocs-toggle.css +4 -6
- package/dist/collection/components/controls/verdocs-toggle/verdocs-toggle.stories.js +1 -1
- package/dist/collection/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.css +3 -4
- package/dist/collection/components/dialogs/verdocs-kba-dialog/question.svg +4 -0
- package/dist/collection/components/dialogs/verdocs-kba-dialog/verdocs-kba-dialog.css +95 -0
- package/dist/collection/components/dialogs/verdocs-kba-dialog/verdocs-kba-dialog.js +292 -0
- package/dist/collection/components/dialogs/verdocs-kba-dialog/verdocs-kba-dialog.stories.js +36 -0
- package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.css +3 -4
- package/dist/collection/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.css +5 -6
- package/dist/collection/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.js +2 -2
- package/dist/collection/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.css +3 -4
- package/dist/collection/components/elements/verdocs-field-attachment/verdocs-field-attachment.css +2 -4
- package/dist/collection/components/elements/verdocs-field-attachment/verdocs-field-attachment.stories.js +1 -1
- package/dist/collection/components/elements/verdocs-field-checkbox-group/verdocs-field-checkbox.css +1 -3
- package/dist/collection/components/elements/verdocs-field-checkbox-group/verdocs-field-checkbox.stories.js +1 -1
- package/dist/collection/components/elements/verdocs-field-date/verdocs-field-date.css +1 -3
- package/dist/collection/components/elements/verdocs-field-date/verdocs-field-date.stories.js +1 -1
- package/dist/collection/components/elements/verdocs-field-dropdown/verdocs-field-dropdown.css +1 -3
- package/dist/collection/components/elements/verdocs-field-dropdown/verdocs-field-dropdown.stories.js +1 -1
- package/dist/collection/components/elements/verdocs-field-initial/verdocs-field-initial.css +1 -3
- package/dist/collection/components/elements/verdocs-field-initial/verdocs-field-initial.stories.js +1 -1
- package/dist/collection/components/elements/verdocs-field-payment/verdocs-field-payment.css +1 -3
- package/dist/collection/components/elements/verdocs-field-payment/verdocs-field-payment.stories.js +1 -1
- package/dist/collection/components/elements/verdocs-field-radio-button-group/verdocs-field-radio-button.css +1 -3
- package/dist/collection/components/elements/verdocs-field-radio-button-group/verdocs-field-radio-button.stories.js +1 -1
- package/dist/collection/components/elements/verdocs-field-signature/verdocs-field-signature.css +1 -3
- package/dist/collection/components/elements/verdocs-field-signature/verdocs-field-signature.stories.js +1 -1
- package/dist/collection/components/elements/verdocs-field-textarea/verdocs-field-textarea.css +1 -3
- package/dist/collection/components/elements/verdocs-field-textarea/verdocs-field-textarea.stories.js +1 -1
- package/dist/collection/components/elements/verdocs-field-textbox/verdocs-field-textbox.css +1 -3
- package/dist/collection/components/elements/verdocs-field-textbox/verdocs-field-textbox.stories.js +1 -1
- package/dist/collection/components/elements/{search-quick-functions → verdocs-quick-functions}/document-icon.svg +0 -0
- package/dist/collection/components/elements/{search-quick-functions → verdocs-quick-functions}/template-icon.svg +0 -0
- package/dist/collection/components/elements/{search-quick-functions/search-quick-functions.css → verdocs-quick-functions/verdocs-quick-functions.css} +6 -8
- package/dist/collection/components/elements/{search-quick-functions/search-quick-functions.js → verdocs-quick-functions/verdocs-quick-functions.js} +9 -10
- package/dist/collection/components/elements/{search-quick-functions/search-quick-functions.stories.js → verdocs-quick-functions/verdocs-quick-functions.stories.js} +3 -3
- package/dist/collection/components/elements/{search-starred → verdocs-search-activity}/document-icon.svg +0 -0
- package/dist/collection/components/elements/{search-starred/search-starred.css → verdocs-search-activity/verdocs-search-activity.css} +13 -15
- package/dist/collection/components/elements/verdocs-search-activity/verdocs-search-activity.js +168 -0
- package/dist/collection/components/elements/verdocs-search-activity/verdocs-search-activity.stories.js +14 -0
- package/dist/collection/components/elements/{search-box → verdocs-search-box}/close.svg +0 -0
- package/dist/collection/components/elements/{search-box → verdocs-search-box}/search.svg +0 -0
- package/dist/collection/components/elements/{search-box/search-box.css → verdocs-search-box/verdocs-search-box.css} +10 -12
- package/dist/collection/components/elements/{search-box/search-box.js → verdocs-search-box/verdocs-search-box.js} +14 -15
- package/dist/collection/components/elements/{search-box/search-box.stories.js → verdocs-search-box/verdocs-search-box.stories.js} +3 -3
- package/dist/collection/components/elements/verdocs-search-tabs/verdocs-search-tabs.css +4 -0
- package/dist/collection/components/elements/verdocs-search-tabs/verdocs-search-tabs.js +19 -0
- package/dist/collection/components/elements/{search-tabs/search-tabs.stories.js → verdocs-search-tabs/verdocs-search-tabs.stories.js} +3 -3
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.css +3 -5
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +2 -2
- package/dist/collection/components/embeds/verdocs-search/verdocs-search.css +2 -4
- package/dist/collection/components/embeds/verdocs-search/verdocs-search.js +4 -4
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.css +2 -3
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +3 -6
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.stories.js +2 -2
- package/dist/collection/components/embeds/verdocs-view/verdocs-view.css +1 -3
- package/dist/components/Auth.js +64 -0
- package/dist/{esm/Transport-797d3c59.js → components/Token.js} +504 -178
- package/dist/{cjs/buffer-es6-ce0cdd81.js → components/buffer-es6.js} +38 -2
- package/dist/components/index.d.ts +53 -0
- package/dist/components/index.js +33 -0
- package/dist/components/popper.js +1788 -0
- package/dist/components/verdocs-auth.d.ts +11 -0
- package/dist/components/verdocs-auth.js +156 -0
- package/dist/components/verdocs-button.d.ts +11 -0
- package/dist/components/verdocs-button.js +6 -0
- package/dist/components/verdocs-button2.js +68 -0
- package/dist/components/verdocs-dropdown.d.ts +11 -0
- package/dist/components/verdocs-dropdown.js +6 -0
- package/dist/components/verdocs-dropdown2.js +94 -0
- package/dist/components/verdocs-field-attachment.d.ts +11 -0
- package/dist/components/verdocs-field-attachment.js +6 -0
- package/dist/components/verdocs-field-attachment2.js +88 -0
- package/dist/components/verdocs-field-checkbox.d.ts +11 -0
- package/dist/components/verdocs-field-checkbox.js +6 -0
- package/dist/components/verdocs-field-checkbox2.js +55 -0
- package/dist/components/verdocs-field-date.d.ts +11 -0
- package/dist/components/verdocs-field-date.js +6 -0
- package/dist/components/verdocs-field-date2.js +2775 -0
- package/dist/components/verdocs-field-dropdown.d.ts +11 -0
- package/dist/components/verdocs-field-dropdown.js +6 -0
- package/dist/components/verdocs-field-dropdown2.js +78 -0
- package/dist/components/verdocs-field-initial.d.ts +11 -0
- package/dist/components/verdocs-field-initial.js +6 -0
- package/dist/components/verdocs-field-initial2.js +86 -0
- package/dist/components/verdocs-field-payment.d.ts +11 -0
- package/dist/components/verdocs-field-payment.js +6 -0
- package/dist/components/verdocs-field-payment2.js +114 -0
- package/dist/components/verdocs-field-radio-button.d.ts +11 -0
- package/dist/components/verdocs-field-radio-button.js +6 -0
- package/dist/components/verdocs-field-radio-button2.js +66 -0
- package/dist/components/verdocs-field-signature.d.ts +11 -0
- package/dist/components/verdocs-field-signature.js +6 -0
- package/dist/components/verdocs-field-signature2.js +86 -0
- package/dist/components/verdocs-field-textarea.d.ts +11 -0
- package/dist/components/verdocs-field-textarea.js +6 -0
- package/dist/components/verdocs-field-textarea2.js +82 -0
- package/dist/components/verdocs-field-textbox.d.ts +11 -0
- package/dist/components/verdocs-field-textbox.js +6 -0
- package/dist/components/verdocs-field-textbox2.js +82 -0
- package/dist/components/verdocs-initial-dialog.d.ts +11 -0
- package/dist/components/verdocs-initial-dialog.js +6 -0
- package/dist/components/verdocs-initial-dialog2.js +272 -0
- package/dist/components/verdocs-kba-dialog.d.ts +11 -0
- package/dist/components/verdocs-kba-dialog.js +112 -0
- package/dist/components/verdocs-loader.d.ts +11 -0
- package/dist/components/verdocs-loader.js +6 -0
- package/dist/components/verdocs-loader2.js +30 -0
- package/dist/components/verdocs-ok-dialog.d.ts +11 -0
- package/dist/components/verdocs-ok-dialog.js +6 -0
- package/dist/components/verdocs-ok-dialog2.js +70 -0
- package/dist/components/verdocs-organization-card.d.ts +11 -0
- package/dist/components/verdocs-organization-card.js +38 -0
- package/dist/components/verdocs-quick-functions.d.ts +11 -0
- package/dist/components/verdocs-quick-functions.js +45 -0
- 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 +193 -0
- package/dist/components/verdocs-search-box.d.ts +11 -0
- package/dist/components/verdocs-search-box.js +6 -0
- package/dist/components/verdocs-search-box2.js +75 -0
- package/dist/components/verdocs-search-tabs.d.ts +11 -0
- package/dist/components/verdocs-search-tabs.js +36 -0
- package/dist/components/verdocs-search.d.ts +11 -0
- package/dist/components/verdocs-search.js +45 -0
- package/dist/components/verdocs-sign.d.ts +11 -0
- package/dist/components/verdocs-sign.js +628 -0
- package/dist/components/verdocs-signature-dialog.d.ts +11 -0
- package/dist/components/verdocs-signature-dialog.js +6 -0
- package/dist/components/verdocs-signature-dialog2.js +268 -0
- package/dist/components/verdocs-status-indicator.d.ts +11 -0
- package/dist/components/verdocs-status-indicator.js +7550 -0
- package/dist/components/verdocs-template-card.d.ts +11 -0
- package/dist/components/verdocs-template-card.js +54 -0
- package/dist/components/verdocs-template-tags.d.ts +11 -0
- package/dist/components/verdocs-template-tags.js +36 -0
- package/dist/components/verdocs-text-input.d.ts +11 -0
- package/dist/components/verdocs-text-input.js +6 -0
- package/dist/components/verdocs-text-input2.js +81 -0
- package/dist/components/verdocs-toggle.d.ts +11 -0
- package/dist/components/verdocs-toggle.js +53 -0
- package/dist/components/verdocs-upload-dialog.d.ts +11 -0
- package/dist/components/verdocs-upload-dialog.js +6 -0
- package/dist/components/verdocs-upload-dialog2.js +144 -0
- package/dist/components/verdocs-view.d.ts +11 -0
- package/dist/components/verdocs-view.js +6 -0
- package/dist/{custom-elements/index.js → components/verdocs-view2.js} +30 -11055
- package/dist/docs.d.ts +3 -0
- package/dist/docs.json +1341 -1084
- package/dist/esm/Auth-ff6040be.js +64 -0
- package/dist/esm/Token-a587e3ad.js +2325 -0
- package/dist/esm/{buffer-es6-681a33da.js → buffer-es6-136673c8.js} +39 -1
- package/dist/esm/{index-80d1b936.js → index-859bc689.js} +83 -367
- package/dist/esm/loader.js +3 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/popper-93ecb064.js +1788 -0
- package/dist/esm/verdocs-auth.entry.js +7 -68
- package/dist/esm/verdocs-button_2.entry.js +17 -10
- package/dist/esm/verdocs-dropdown_12.entry.js +28 -1811
- package/dist/esm/verdocs-initial-dialog.entry.js +3 -3
- package/dist/esm/verdocs-kba-dialog.entry.js +77 -0
- package/dist/esm/verdocs-loader.entry.js +2 -2
- package/dist/esm/verdocs-ok-dialog.entry.js +3 -3
- package/dist/esm/verdocs-organization-card.entry.js +3 -3
- package/dist/esm/verdocs-quick-functions.entry.js +27 -0
- package/dist/esm/verdocs-search-activity_2.entry.js +223 -0
- package/dist/esm/verdocs-search-tabs.entry.js +16 -0
- package/dist/esm/verdocs-search.entry.js +4 -4
- package/dist/esm/verdocs-sign.entry.js +16 -21
- package/dist/esm/verdocs-signature-dialog.entry.js +4 -4
- package/dist/esm/verdocs-status-indicator.entry.js +7525 -0
- package/dist/esm/verdocs-template-card.entry.js +3 -3
- package/dist/esm/verdocs-template-tags.entry.js +3 -3
- package/dist/esm/verdocs-toggle.entry.js +3 -3
- package/dist/esm/verdocs-upload-dialog.entry.js +3 -3
- package/dist/esm/verdocs-web-sdk.js +3 -3
- package/dist/esm-es5/Auth-ff6040be.js +1 -0
- package/dist/esm-es5/Token-a587e3ad.js +1 -0
- package/dist/esm-es5/{buffer-es6-681a33da.js → buffer-es6-136673c8.js} +2 -2
- package/dist/esm-es5/index-859bc689.js +2 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/popper-93ecb064.js +1 -0
- package/dist/esm-es5/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-button_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-dropdown_12.entry.js +2 -2
- package/dist/esm-es5/verdocs-initial-dialog.entry.js +1 -1
- package/dist/esm-es5/verdocs-kba-dialog.entry.js +1 -0
- package/dist/esm-es5/verdocs-loader.entry.js +1 -1
- package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
- package/dist/esm-es5/verdocs-organization-card.entry.js +1 -1
- package/dist/esm-es5/verdocs-quick-functions.entry.js +1 -0
- package/dist/esm-es5/verdocs-search-activity_2.entry.js +1 -0
- package/dist/esm-es5/verdocs-search-tabs.entry.js +1 -0
- package/dist/esm-es5/verdocs-search.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-signature-dialog.entry.js +1 -1
- package/dist/esm-es5/verdocs-status-indicator.entry.js +1 -0
- package/dist/esm-es5/verdocs-template-card.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-tags.entry.js +1 -1
- package/dist/esm-es5/verdocs-toggle.entry.js +1 -1
- package/dist/esm-es5/verdocs-upload-dialog.entry.js +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/types/components/controls/verdocs-button/verdocs-button.d.ts +26 -6
- package/dist/types/components/controls/verdocs-button/verdocs-button.stories.d.ts +4 -1
- package/dist/types/components/controls/verdocs-dropdown/verdocs-dropdown.d.ts +0 -14
- package/dist/types/components/controls/verdocs-loader/verdocs-loader.d.ts +3 -0
- package/dist/types/components/controls/verdocs-status-indicator/recipient-flow.d.ts +4 -0
- package/dist/types/components/controls/verdocs-status-indicator/verdocs-status-indicator.d.ts +42 -0
- package/dist/types/components/controls/{verdocs-document-status/verdocs-document-status.stories.d.ts → verdocs-status-indicator/verdocs-status-indicator.stories.d.ts} +4 -1
- package/dist/types/components/dialogs/verdocs-kba-dialog/verdocs-kba-dialog.d.ts +57 -0
- package/dist/types/components/dialogs/verdocs-kba-dialog/verdocs-kba-dialog.stories.d.ts +15 -0
- package/dist/types/components/elements/{search-quick-functions/search-quick-functions.d.ts → verdocs-quick-functions/verdocs-quick-functions.d.ts} +1 -1
- package/dist/types/components/elements/{search-quick-functions/search-quick-functions.stories.d.ts → verdocs-quick-functions/verdocs-quick-functions.stories.d.ts} +0 -0
- package/dist/types/components/elements/{search-starred/search-starred.d.ts → verdocs-search-activity/verdocs-search-activity.d.ts} +10 -3
- package/dist/types/components/elements/{search-starred/search-starred.stories.d.ts → verdocs-search-activity/verdocs-search-activity.stories.d.ts} +2 -2
- package/dist/types/components/elements/{search-box/search-box.d.ts → verdocs-search-box/verdocs-search-box.d.ts} +1 -1
- package/dist/types/components/elements/{search-box/search-box.stories.d.ts → verdocs-search-box/verdocs-search-box.stories.d.ts} +0 -0
- package/dist/types/components/elements/{search-tabs/search-tabs.d.ts → verdocs-search-tabs/verdocs-search-tabs.d.ts} +1 -1
- package/dist/types/components/elements/{search-tabs/search-tabs.stories.d.ts → verdocs-search-tabs/verdocs-search-tabs.stories.d.ts} +0 -0
- package/dist/types/components.d.ts +407 -222
- package/dist/verdocs-web-sdk/p-0353c423.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-11bc03a5.js +1 -0
- package/dist/verdocs-web-sdk/{p-993a0a23.system.entry.js → p-144e0842.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-15b7ed4d.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-d299cd16.system.entry.js → p-1f55d8ac.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-2bc58746.js +2 -0
- package/dist/verdocs-web-sdk/p-34bb9854.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-3d1eb63d.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-3f437456.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-432c3151.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-466cf9bf.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-4c66f794.js +1 -0
- package/dist/verdocs-web-sdk/p-5dfd73f9.system.js +7 -0
- package/dist/verdocs-web-sdk/p-6348272c.js +1 -0
- package/dist/verdocs-web-sdk/p-6393b2b4.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-66b19637.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-6802ef91.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-6ac9e6f8.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-6d65d54e.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-6fa6fb3c.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-829b235c.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-8795dbe8.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-88a300c5.system.js +1 -0
- package/dist/verdocs-web-sdk/p-8c6db319.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-8c6e29a5.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-92632d8e.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-96c0bf40.system.js +1 -0
- package/dist/verdocs-web-sdk/p-98d72550.system.entry.js +23 -0
- package/dist/verdocs-web-sdk/p-9b34c794.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-9fbb3fc2.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-a1fcf0c4.entry.js +23 -0
- package/dist/verdocs-web-sdk/p-b1cd24f7.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-bf2620cb.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-c2f97ef9.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-caed7818.system.js +2 -0
- package/dist/verdocs-web-sdk/p-cc127684.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-cd6d1fe5.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-d6206c17.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-da667373.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-e2e643c5.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-e3659c64.system.js +1 -0
- package/dist/verdocs-web-sdk/p-e609b2ee.system.js +1 -0
- package/dist/verdocs-web-sdk/p-e719f9ca.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-ed5baeb4.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-ef932a87.js +1 -0
- package/dist/verdocs-web-sdk/p-f0d0f959.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-f7e26fbd.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-f814d5cc.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-f9d431ef.entry.js +1 -0
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.js +2 -1
- package/package.json +34 -34
- package/dist/cjs/Token-65a1dc17.js +0 -71
- package/dist/cjs/index-4bf5cc66.js +0 -46
- package/dist/cjs/search-box_5.cjs.entry.js +0 -283
- package/dist/cjs/search-tabs.cjs.entry.js +0 -20
- package/dist/cjs/verdocs-document-status.cjs.entry.js +0 -54
- package/dist/collection/components/controls/verdocs-document-status/check.svg +0 -3
- package/dist/collection/components/controls/verdocs-document-status/pending.svg +0 -1
- package/dist/collection/components/controls/verdocs-document-status/stop.svg +0 -1
- package/dist/collection/components/controls/verdocs-document-status/verdocs-document-status.css +0 -18
- package/dist/collection/components/controls/verdocs-document-status/verdocs-document-status.js +0 -70
- package/dist/collection/components/controls/verdocs-document-status/verdocs-document-status.stories.js +0 -15
- package/dist/collection/components/controls/verdocs-document-status/x.svg +0 -1
- package/dist/collection/components/elements/search-recent/search-icon.svg +0 -1
- package/dist/collection/components/elements/search-recent/search-recent.css +0 -65
- package/dist/collection/components/elements/search-recent/search-recent.js +0 -98
- package/dist/collection/components/elements/search-recent/search-recent.stories.js +0 -12
- package/dist/collection/components/elements/search-saved/search-icon.svg +0 -1
- package/dist/collection/components/elements/search-saved/search-saved.css +0 -56
- package/dist/collection/components/elements/search-saved/search-saved.js +0 -98
- package/dist/collection/components/elements/search-saved/search-saved.stories.js +0 -12
- package/dist/collection/components/elements/search-starred/search-starred.js +0 -114
- package/dist/collection/components/elements/search-starred/search-starred.stories.js +0 -35
- package/dist/collection/components/elements/search-tabs/search-tabs.css +0 -3
- package/dist/collection/components/elements/search-tabs/search-tabs.js +0 -20
- package/dist/custom-elements/index.d.ts +0 -237
- package/dist/custom-elements.json +0 -727
- package/dist/esm/Token-a058076d.js +0 -69
- package/dist/esm/index-2b1938ea.js +0 -39
- package/dist/esm/search-box_5.entry.js +0 -275
- package/dist/esm/search-tabs.entry.js +0 -16
- package/dist/esm/verdocs-document-status.entry.js +0 -50
- package/dist/esm-es5/Token-a058076d.js +0 -1
- package/dist/esm-es5/Transport-797d3c59.js +0 -1
- package/dist/esm-es5/index-2b1938ea.js +0 -1
- package/dist/esm-es5/index-80d1b936.js +0 -1
- package/dist/esm-es5/search-box_5.entry.js +0 -1
- package/dist/esm-es5/search-tabs.entry.js +0 -1
- package/dist/esm-es5/verdocs-document-status.entry.js +0 -1
- package/dist/types/components/controls/verdocs-document-status/verdocs-document-status.d.ts +0 -11
- package/dist/types/components/elements/search-recent/search-recent.d.ts +0 -25
- package/dist/types/components/elements/search-recent/search-recent.stories.d.ts +0 -7
- package/dist/types/components/elements/search-saved/search-saved.d.ts +0 -25
- package/dist/types/components/elements/search-saved/search-saved.stories.d.ts +0 -7
- package/dist/verdocs-web-sdk/p-0956a3bc.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-24236b87.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-29abe078.js +0 -1
- package/dist/verdocs-web-sdk/p-2ded0974.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-30d908ea.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-37b07203.system.js +0 -1
- package/dist/verdocs-web-sdk/p-3a102b59.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-3b2cd409.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-3c70c740.system.js +0 -1
- package/dist/verdocs-web-sdk/p-403cb7cf.js +0 -1
- package/dist/verdocs-web-sdk/p-4a538cbc.js +0 -1
- package/dist/verdocs-web-sdk/p-5a6041c0.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-62ec194f.js +0 -1
- package/dist/verdocs-web-sdk/p-6327fd83.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-7f9a96d5.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-80c7bc0c.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-81b15287.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-82f4cb67.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-83dbc583.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-853e30f2.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-8739595c.system.js +0 -1
- package/dist/verdocs-web-sdk/p-89f5fc2b.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-94d6f88f.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-9a896baf.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-a415926b.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-a4fc6ad9.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-a73a1ff8.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-aec93cc9.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-b07ae79f.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-b13ee3be.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-ba8a7e2d.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-bdfa7db9.system.entry.js +0 -23
- package/dist/verdocs-web-sdk/p-cdae8dba.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-cec7e9ea.js +0 -1
- package/dist/verdocs-web-sdk/p-d03d748c.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-d82dc646.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-d9474f48.system.js +0 -7
- package/dist/verdocs-web-sdk/p-eaffa4b1.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-ee14709c.system.js +0 -1
- package/dist/verdocs-web-sdk/p-f4786f62.entry.js +0 -23
- package/dist/verdocs-web-sdk/p-fae1351f.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-fc3d921f.system.js +0 -1
- package/dist/verdocs-web-sdk/p-fcfe34db.entry.js +0 -1
|
@@ -1,56 +1,4 @@
|
|
|
1
|
-
import { p as process_1 } from './
|
|
2
|
-
|
|
3
|
-
// This file provides a polyfill for managing globals in both NodeJS and browser environments. This is
|
|
4
|
-
// an anti-pattern we'd hoped to avoid, but we have several projects dependending on one common library
|
|
5
|
-
// (this js-sdk) and we want that library to provide a common endpoint to all callers (so authentication
|
|
6
|
-
// tokens only need to be tracked in one place). The trouble is, one of those libraries is based on
|
|
7
|
-
// StencilJS and is compiling its modules into Web Components. Because of how module resolution works,
|
|
8
|
-
// when those Components load js-sdk they get a separate instance. Without messy options like having to
|
|
9
|
-
// pass raw data from the caller to each Component, or pass around references to a common Endpoint, they
|
|
10
|
-
// have no way to access authenticated sessions unless we make the Endpoint a true global.
|
|
11
|
-
//
|
|
12
|
-
// @credit https://github.com/medikoo/es5-ext/blob/master/global.js
|
|
13
|
-
// @credit https://mathiasbynens.be/notes/globalthis
|
|
14
|
-
var naiveFallback = function () {
|
|
15
|
-
if (typeof self === 'object' && self)
|
|
16
|
-
return self;
|
|
17
|
-
if (typeof window === 'object' && window)
|
|
18
|
-
return window;
|
|
19
|
-
throw new Error('Unable to resolve global `this`');
|
|
20
|
-
};
|
|
21
|
-
var globalThis_1 = (function () {
|
|
22
|
-
if (this)
|
|
23
|
-
return this;
|
|
24
|
-
// Unexpected strict mode (may happen if e.g. bundled into ESM module)
|
|
25
|
-
// Fallback to standard globalThis if available
|
|
26
|
-
if (typeof globalThis === 'object' && globalThis)
|
|
27
|
-
return globalThis;
|
|
28
|
-
// Thanks @mathiasbynens -> https://mathiasbynens.be/notes/globalthis
|
|
29
|
-
// In all ES5+ engines global object inherits from Object.prototype
|
|
30
|
-
// (if you approached one that doesn't please report)
|
|
31
|
-
try {
|
|
32
|
-
Object.defineProperty(Object.prototype, '__global__', {
|
|
33
|
-
get: function () {
|
|
34
|
-
return this;
|
|
35
|
-
},
|
|
36
|
-
configurable: true,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
catch (error) {
|
|
40
|
-
// Unfortunate case of updates to Object.prototype being restricted
|
|
41
|
-
// via preventExtensions, seal or freeze
|
|
42
|
-
return naiveFallback();
|
|
43
|
-
}
|
|
44
|
-
try {
|
|
45
|
-
// Safari case (window.__global__ works, but __global__ does not)
|
|
46
|
-
if (!__global__)
|
|
47
|
-
return naiveFallback();
|
|
48
|
-
return __global__;
|
|
49
|
-
}
|
|
50
|
-
finally {
|
|
51
|
-
delete Object.prototype.__global__;
|
|
52
|
-
}
|
|
53
|
-
})();
|
|
1
|
+
import { B as Buffer, p as process_1 } from './buffer-es6.js';
|
|
54
2
|
|
|
55
3
|
var bind = function bind(fn, thisArg) {
|
|
56
4
|
return function wrap() {
|
|
@@ -66,6 +14,22 @@ var bind = function bind(fn, thisArg) {
|
|
|
66
14
|
|
|
67
15
|
var toString = Object.prototype.toString;
|
|
68
16
|
|
|
17
|
+
// eslint-disable-next-line func-names
|
|
18
|
+
var kindOf = (function(cache) {
|
|
19
|
+
// eslint-disable-next-line func-names
|
|
20
|
+
return function(thing) {
|
|
21
|
+
var str = toString.call(thing);
|
|
22
|
+
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
23
|
+
};
|
|
24
|
+
})(Object.create(null));
|
|
25
|
+
|
|
26
|
+
function kindOfTest(type) {
|
|
27
|
+
type = type.toLowerCase();
|
|
28
|
+
return function isKindOf(thing) {
|
|
29
|
+
return kindOf(thing) === type;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
69
33
|
/**
|
|
70
34
|
* Determine if a value is an Array
|
|
71
35
|
*
|
|
@@ -100,22 +64,12 @@ function isBuffer(val) {
|
|
|
100
64
|
/**
|
|
101
65
|
* Determine if a value is an ArrayBuffer
|
|
102
66
|
*
|
|
67
|
+
* @function
|
|
103
68
|
* @param {Object} val The value to test
|
|
104
69
|
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
|
|
105
70
|
*/
|
|
106
|
-
|
|
107
|
-
return toString.call(val) === '[object ArrayBuffer]';
|
|
108
|
-
}
|
|
71
|
+
var isArrayBuffer = kindOfTest('ArrayBuffer');
|
|
109
72
|
|
|
110
|
-
/**
|
|
111
|
-
* Determine if a value is a FormData
|
|
112
|
-
*
|
|
113
|
-
* @param {Object} val The value to test
|
|
114
|
-
* @returns {boolean} True if value is an FormData, otherwise false
|
|
115
|
-
*/
|
|
116
|
-
function isFormData(val) {
|
|
117
|
-
return toString.call(val) === '[object FormData]';
|
|
118
|
-
}
|
|
119
73
|
|
|
120
74
|
/**
|
|
121
75
|
* Determine if a value is a view on an ArrayBuffer
|
|
@@ -170,7 +124,7 @@ function isObject(val) {
|
|
|
170
124
|
* @return {boolean} True if value is a plain Object, otherwise false
|
|
171
125
|
*/
|
|
172
126
|
function isPlainObject(val) {
|
|
173
|
-
if (
|
|
127
|
+
if (kindOf(val) !== 'object') {
|
|
174
128
|
return false;
|
|
175
129
|
}
|
|
176
130
|
|
|
@@ -181,32 +135,38 @@ function isPlainObject(val) {
|
|
|
181
135
|
/**
|
|
182
136
|
* Determine if a value is a Date
|
|
183
137
|
*
|
|
138
|
+
* @function
|
|
184
139
|
* @param {Object} val The value to test
|
|
185
140
|
* @returns {boolean} True if value is a Date, otherwise false
|
|
186
141
|
*/
|
|
187
|
-
|
|
188
|
-
return toString.call(val) === '[object Date]';
|
|
189
|
-
}
|
|
142
|
+
var isDate = kindOfTest('Date');
|
|
190
143
|
|
|
191
144
|
/**
|
|
192
145
|
* Determine if a value is a File
|
|
193
146
|
*
|
|
147
|
+
* @function
|
|
194
148
|
* @param {Object} val The value to test
|
|
195
149
|
* @returns {boolean} True if value is a File, otherwise false
|
|
196
150
|
*/
|
|
197
|
-
|
|
198
|
-
return toString.call(val) === '[object File]';
|
|
199
|
-
}
|
|
151
|
+
var isFile = kindOfTest('File');
|
|
200
152
|
|
|
201
153
|
/**
|
|
202
154
|
* Determine if a value is a Blob
|
|
203
155
|
*
|
|
156
|
+
* @function
|
|
204
157
|
* @param {Object} val The value to test
|
|
205
158
|
* @returns {boolean} True if value is a Blob, otherwise false
|
|
206
159
|
*/
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
160
|
+
var isBlob = kindOfTest('Blob');
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Determine if a value is a FileList
|
|
164
|
+
*
|
|
165
|
+
* @function
|
|
166
|
+
* @param {Object} val The value to test
|
|
167
|
+
* @returns {boolean} True if value is a File, otherwise false
|
|
168
|
+
*/
|
|
169
|
+
var isFileList = kindOfTest('FileList');
|
|
210
170
|
|
|
211
171
|
/**
|
|
212
172
|
* Determine if a value is a Function
|
|
@@ -229,14 +189,27 @@ function isStream(val) {
|
|
|
229
189
|
}
|
|
230
190
|
|
|
231
191
|
/**
|
|
232
|
-
* Determine if a value is a
|
|
192
|
+
* Determine if a value is a FormData
|
|
233
193
|
*
|
|
194
|
+
* @param {Object} thing The value to test
|
|
195
|
+
* @returns {boolean} True if value is an FormData, otherwise false
|
|
196
|
+
*/
|
|
197
|
+
function isFormData(thing) {
|
|
198
|
+
var pattern = '[object FormData]';
|
|
199
|
+
return thing && (
|
|
200
|
+
(typeof FormData === 'function' && thing instanceof FormData) ||
|
|
201
|
+
toString.call(thing) === pattern ||
|
|
202
|
+
(isFunction(thing.toString) && thing.toString() === pattern)
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Determine if a value is a URLSearchParams object
|
|
208
|
+
* @function
|
|
234
209
|
* @param {Object} val The value to test
|
|
235
210
|
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
|
|
236
211
|
*/
|
|
237
|
-
|
|
238
|
-
return toString.call(val) === '[object URLSearchParams]';
|
|
239
|
-
}
|
|
212
|
+
var isURLSearchParams = kindOfTest('URLSearchParams');
|
|
240
213
|
|
|
241
214
|
/**
|
|
242
215
|
* Trim excess whitespace off the beginning and end of a string
|
|
@@ -383,6 +356,94 @@ function stripBOM(content) {
|
|
|
383
356
|
return content;
|
|
384
357
|
}
|
|
385
358
|
|
|
359
|
+
/**
|
|
360
|
+
* Inherit the prototype methods from one constructor into another
|
|
361
|
+
* @param {function} constructor
|
|
362
|
+
* @param {function} superConstructor
|
|
363
|
+
* @param {object} [props]
|
|
364
|
+
* @param {object} [descriptors]
|
|
365
|
+
*/
|
|
366
|
+
|
|
367
|
+
function inherits(constructor, superConstructor, props, descriptors) {
|
|
368
|
+
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
|
|
369
|
+
constructor.prototype.constructor = constructor;
|
|
370
|
+
props && Object.assign(constructor.prototype, props);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Resolve object with deep prototype chain to a flat object
|
|
375
|
+
* @param {Object} sourceObj source object
|
|
376
|
+
* @param {Object} [destObj]
|
|
377
|
+
* @param {Function} [filter]
|
|
378
|
+
* @returns {Object}
|
|
379
|
+
*/
|
|
380
|
+
|
|
381
|
+
function toFlatObject(sourceObj, destObj, filter) {
|
|
382
|
+
var props;
|
|
383
|
+
var i;
|
|
384
|
+
var prop;
|
|
385
|
+
var merged = {};
|
|
386
|
+
|
|
387
|
+
destObj = destObj || {};
|
|
388
|
+
|
|
389
|
+
do {
|
|
390
|
+
props = Object.getOwnPropertyNames(sourceObj);
|
|
391
|
+
i = props.length;
|
|
392
|
+
while (i-- > 0) {
|
|
393
|
+
prop = props[i];
|
|
394
|
+
if (!merged[prop]) {
|
|
395
|
+
destObj[prop] = sourceObj[prop];
|
|
396
|
+
merged[prop] = true;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
sourceObj = Object.getPrototypeOf(sourceObj);
|
|
400
|
+
} while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
|
|
401
|
+
|
|
402
|
+
return destObj;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/*
|
|
406
|
+
* determines whether a string ends with the characters of a specified string
|
|
407
|
+
* @param {String} str
|
|
408
|
+
* @param {String} searchString
|
|
409
|
+
* @param {Number} [position= 0]
|
|
410
|
+
* @returns {boolean}
|
|
411
|
+
*/
|
|
412
|
+
function endsWith(str, searchString, position) {
|
|
413
|
+
str = String(str);
|
|
414
|
+
if (position === undefined || position > str.length) {
|
|
415
|
+
position = str.length;
|
|
416
|
+
}
|
|
417
|
+
position -= searchString.length;
|
|
418
|
+
var lastIndex = str.indexOf(searchString, position);
|
|
419
|
+
return lastIndex !== -1 && lastIndex === position;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Returns new array from array like object
|
|
425
|
+
* @param {*} [thing]
|
|
426
|
+
* @returns {Array}
|
|
427
|
+
*/
|
|
428
|
+
function toArray(thing) {
|
|
429
|
+
if (!thing) return null;
|
|
430
|
+
var i = thing.length;
|
|
431
|
+
if (isUndefined(i)) return null;
|
|
432
|
+
var arr = new Array(i);
|
|
433
|
+
while (i-- > 0) {
|
|
434
|
+
arr[i] = thing[i];
|
|
435
|
+
}
|
|
436
|
+
return arr;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
// eslint-disable-next-line func-names
|
|
440
|
+
var isTypedArray = (function(TypedArray) {
|
|
441
|
+
// eslint-disable-next-line func-names
|
|
442
|
+
return function(thing) {
|
|
443
|
+
return TypedArray && thing instanceof TypedArray;
|
|
444
|
+
};
|
|
445
|
+
})(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));
|
|
446
|
+
|
|
386
447
|
var utils = {
|
|
387
448
|
isArray: isArray,
|
|
388
449
|
isArrayBuffer: isArrayBuffer,
|
|
@@ -405,7 +466,15 @@ var utils = {
|
|
|
405
466
|
merge: merge,
|
|
406
467
|
extend: extend,
|
|
407
468
|
trim: trim,
|
|
408
|
-
stripBOM: stripBOM
|
|
469
|
+
stripBOM: stripBOM,
|
|
470
|
+
inherits: inherits,
|
|
471
|
+
toFlatObject: toFlatObject,
|
|
472
|
+
kindOf: kindOf,
|
|
473
|
+
kindOfTest: kindOfTest,
|
|
474
|
+
endsWith: endsWith,
|
|
475
|
+
toArray: toArray,
|
|
476
|
+
isTypedArray: isTypedArray,
|
|
477
|
+
isFileList: isFileList
|
|
409
478
|
};
|
|
410
479
|
|
|
411
480
|
function encode(val) {
|
|
@@ -536,26 +605,27 @@ var normalizeHeaderName = function normalizeHeaderName(headers, normalizedName)
|
|
|
536
605
|
};
|
|
537
606
|
|
|
538
607
|
/**
|
|
539
|
-
*
|
|
608
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
540
609
|
*
|
|
541
|
-
* @param {
|
|
542
|
-
* @param {Object} config The config.
|
|
610
|
+
* @param {string} message The error message.
|
|
543
611
|
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
612
|
+
* @param {Object} [config] The config.
|
|
544
613
|
* @param {Object} [request] The request.
|
|
545
614
|
* @param {Object} [response] The response.
|
|
546
|
-
* @returns {Error} The error.
|
|
615
|
+
* @returns {Error} The created error.
|
|
547
616
|
*/
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
617
|
+
function AxiosError(message, code, config, request, response) {
|
|
618
|
+
Error.call(this);
|
|
619
|
+
this.message = message;
|
|
620
|
+
this.name = 'AxiosError';
|
|
621
|
+
code && (this.code = code);
|
|
622
|
+
config && (this.config = config);
|
|
623
|
+
request && (this.request = request);
|
|
624
|
+
response && (this.response = response);
|
|
625
|
+
}
|
|
557
626
|
|
|
558
|
-
|
|
627
|
+
utils.inherits(AxiosError, Error, {
|
|
628
|
+
toJSON: function toJSON() {
|
|
559
629
|
return {
|
|
560
630
|
// Standard
|
|
561
631
|
message: this.message,
|
|
@@ -573,25 +643,125 @@ var enhanceError = function enhanceError(error, config, code, request, response)
|
|
|
573
643
|
code: this.code,
|
|
574
644
|
status: this.response && this.response.status ? this.response.status : null
|
|
575
645
|
};
|
|
576
|
-
}
|
|
577
|
-
|
|
646
|
+
}
|
|
647
|
+
});
|
|
648
|
+
|
|
649
|
+
var prototype = AxiosError.prototype;
|
|
650
|
+
var descriptors = {};
|
|
651
|
+
|
|
652
|
+
[
|
|
653
|
+
'ERR_BAD_OPTION_VALUE',
|
|
654
|
+
'ERR_BAD_OPTION',
|
|
655
|
+
'ECONNABORTED',
|
|
656
|
+
'ETIMEDOUT',
|
|
657
|
+
'ERR_NETWORK',
|
|
658
|
+
'ERR_FR_TOO_MANY_REDIRECTS',
|
|
659
|
+
'ERR_DEPRECATED',
|
|
660
|
+
'ERR_BAD_RESPONSE',
|
|
661
|
+
'ERR_BAD_REQUEST',
|
|
662
|
+
'ERR_CANCELED'
|
|
663
|
+
// eslint-disable-next-line func-names
|
|
664
|
+
].forEach(function(code) {
|
|
665
|
+
descriptors[code] = {value: code};
|
|
666
|
+
});
|
|
667
|
+
|
|
668
|
+
Object.defineProperties(AxiosError, descriptors);
|
|
669
|
+
Object.defineProperty(prototype, 'isAxiosError', {value: true});
|
|
670
|
+
|
|
671
|
+
// eslint-disable-next-line func-names
|
|
672
|
+
AxiosError.from = function(error, code, config, request, response, customProps) {
|
|
673
|
+
var axiosError = Object.create(prototype);
|
|
674
|
+
|
|
675
|
+
utils.toFlatObject(error, axiosError, function filter(obj) {
|
|
676
|
+
return obj !== Error.prototype;
|
|
677
|
+
});
|
|
678
|
+
|
|
679
|
+
AxiosError.call(axiosError, error.message, code, config, request, response);
|
|
680
|
+
|
|
681
|
+
axiosError.name = error.name;
|
|
682
|
+
|
|
683
|
+
customProps && Object.assign(axiosError, customProps);
|
|
684
|
+
|
|
685
|
+
return axiosError;
|
|
578
686
|
};
|
|
579
687
|
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
* @param {Object} [request] The request.
|
|
587
|
-
* @param {Object} [response] The response.
|
|
588
|
-
* @returns {Error} The created error.
|
|
589
|
-
*/
|
|
590
|
-
var createError = function createError(message, config, code, request, response) {
|
|
591
|
-
var error = new Error(message);
|
|
592
|
-
return enhanceError(error, config, code, request, response);
|
|
688
|
+
var AxiosError_1 = AxiosError;
|
|
689
|
+
|
|
690
|
+
var transitional = {
|
|
691
|
+
silentJSONParsing: true,
|
|
692
|
+
forcedJSONParsing: true,
|
|
693
|
+
clarifyTimeoutError: false
|
|
593
694
|
};
|
|
594
695
|
|
|
696
|
+
/**
|
|
697
|
+
* Convert a data object to FormData
|
|
698
|
+
* @param {Object} obj
|
|
699
|
+
* @param {?Object} [formData]
|
|
700
|
+
* @returns {Object}
|
|
701
|
+
**/
|
|
702
|
+
|
|
703
|
+
function toFormData(obj, formData) {
|
|
704
|
+
// eslint-disable-next-line no-param-reassign
|
|
705
|
+
formData = formData || new FormData();
|
|
706
|
+
|
|
707
|
+
var stack = [];
|
|
708
|
+
|
|
709
|
+
function convertValue(value) {
|
|
710
|
+
if (value === null) return '';
|
|
711
|
+
|
|
712
|
+
if (utils.isDate(value)) {
|
|
713
|
+
return value.toISOString();
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
|
|
717
|
+
return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
return value;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
function build(data, parentKey) {
|
|
724
|
+
if (utils.isPlainObject(data) || utils.isArray(data)) {
|
|
725
|
+
if (stack.indexOf(data) !== -1) {
|
|
726
|
+
throw Error('Circular reference detected in ' + parentKey);
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
stack.push(data);
|
|
730
|
+
|
|
731
|
+
utils.forEach(data, function each(value, key) {
|
|
732
|
+
if (utils.isUndefined(value)) return;
|
|
733
|
+
var fullKey = parentKey ? parentKey + '.' + key : key;
|
|
734
|
+
var arr;
|
|
735
|
+
|
|
736
|
+
if (value && !parentKey && typeof value === 'object') {
|
|
737
|
+
if (utils.endsWith(key, '{}')) {
|
|
738
|
+
// eslint-disable-next-line no-param-reassign
|
|
739
|
+
value = JSON.stringify(value);
|
|
740
|
+
} else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) {
|
|
741
|
+
// eslint-disable-next-line func-names
|
|
742
|
+
arr.forEach(function(el) {
|
|
743
|
+
!utils.isUndefined(el) && formData.append(fullKey, convertValue(el));
|
|
744
|
+
});
|
|
745
|
+
return;
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
build(value, fullKey);
|
|
750
|
+
});
|
|
751
|
+
|
|
752
|
+
stack.pop();
|
|
753
|
+
} else {
|
|
754
|
+
formData.append(parentKey, convertValue(data));
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
build(obj);
|
|
759
|
+
|
|
760
|
+
return formData;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
var toFormData_1 = toFormData;
|
|
764
|
+
|
|
595
765
|
/**
|
|
596
766
|
* Resolve or reject a Promise based on response status.
|
|
597
767
|
*
|
|
@@ -604,10 +774,10 @@ var settle = function settle(resolve, reject, response) {
|
|
|
604
774
|
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
605
775
|
resolve(response);
|
|
606
776
|
} else {
|
|
607
|
-
reject(
|
|
777
|
+
reject(new AxiosError_1(
|
|
608
778
|
'Request failed with status code ' + response.status,
|
|
779
|
+
[AxiosError_1.ERR_BAD_REQUEST, AxiosError_1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
|
|
609
780
|
response.config,
|
|
610
|
-
null,
|
|
611
781
|
response.request,
|
|
612
782
|
response
|
|
613
783
|
));
|
|
@@ -822,22 +992,27 @@ var isURLSameOrigin = (
|
|
|
822
992
|
);
|
|
823
993
|
|
|
824
994
|
/**
|
|
825
|
-
* A `
|
|
995
|
+
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
826
996
|
*
|
|
827
997
|
* @class
|
|
828
998
|
* @param {string=} message The message.
|
|
829
999
|
*/
|
|
830
|
-
function
|
|
831
|
-
|
|
1000
|
+
function CanceledError(message) {
|
|
1001
|
+
// eslint-disable-next-line no-eq-null,eqeqeq
|
|
1002
|
+
AxiosError_1.call(this, message == null ? 'canceled' : message, AxiosError_1.ERR_CANCELED);
|
|
1003
|
+
this.name = 'CanceledError';
|
|
832
1004
|
}
|
|
833
1005
|
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
};
|
|
1006
|
+
utils.inherits(CanceledError, AxiosError_1, {
|
|
1007
|
+
__CANCEL__: true
|
|
1008
|
+
});
|
|
837
1009
|
|
|
838
|
-
|
|
1010
|
+
var CanceledError_1 = CanceledError;
|
|
839
1011
|
|
|
840
|
-
var
|
|
1012
|
+
var parseProtocol = function parseProtocol(url) {
|
|
1013
|
+
var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
1014
|
+
return match && match[1] || '';
|
|
1015
|
+
};
|
|
841
1016
|
|
|
842
1017
|
var xhr = function xhrAdapter(config) {
|
|
843
1018
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
@@ -855,7 +1030,7 @@ var xhr = function xhrAdapter(config) {
|
|
|
855
1030
|
}
|
|
856
1031
|
}
|
|
857
1032
|
|
|
858
|
-
if (utils.isFormData(requestData)) {
|
|
1033
|
+
if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) {
|
|
859
1034
|
delete requestHeaders['Content-Type']; // Let the browser set it
|
|
860
1035
|
}
|
|
861
1036
|
|
|
@@ -869,6 +1044,7 @@ var xhr = function xhrAdapter(config) {
|
|
|
869
1044
|
}
|
|
870
1045
|
|
|
871
1046
|
var fullPath = buildFullPath(config.baseURL, config.url);
|
|
1047
|
+
|
|
872
1048
|
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
|
|
873
1049
|
|
|
874
1050
|
// Set the request timeout in MS
|
|
@@ -932,7 +1108,7 @@ var xhr = function xhrAdapter(config) {
|
|
|
932
1108
|
return;
|
|
933
1109
|
}
|
|
934
1110
|
|
|
935
|
-
reject(
|
|
1111
|
+
reject(new AxiosError_1('Request aborted', AxiosError_1.ECONNABORTED, config, request));
|
|
936
1112
|
|
|
937
1113
|
// Clean up request
|
|
938
1114
|
request = null;
|
|
@@ -942,7 +1118,7 @@ var xhr = function xhrAdapter(config) {
|
|
|
942
1118
|
request.onerror = function handleError() {
|
|
943
1119
|
// Real errors are hidden from us by the browser
|
|
944
1120
|
// onerror should only fire if it's a network error
|
|
945
|
-
reject(
|
|
1121
|
+
reject(new AxiosError_1('Network Error', AxiosError_1.ERR_NETWORK, config, request, request));
|
|
946
1122
|
|
|
947
1123
|
// Clean up request
|
|
948
1124
|
request = null;
|
|
@@ -951,14 +1127,14 @@ var xhr = function xhrAdapter(config) {
|
|
|
951
1127
|
// Handle timeout
|
|
952
1128
|
request.ontimeout = function handleTimeout() {
|
|
953
1129
|
var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
954
|
-
var transitional = config.transitional ||
|
|
1130
|
+
var transitional$1 = config.transitional || transitional;
|
|
955
1131
|
if (config.timeoutErrorMessage) {
|
|
956
1132
|
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
957
1133
|
}
|
|
958
|
-
reject(
|
|
1134
|
+
reject(new AxiosError_1(
|
|
959
1135
|
timeoutErrorMessage,
|
|
1136
|
+
transitional$1.clarifyTimeoutError ? AxiosError_1.ETIMEDOUT : AxiosError_1.ECONNABORTED,
|
|
960
1137
|
config,
|
|
961
|
-
transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',
|
|
962
1138
|
request));
|
|
963
1139
|
|
|
964
1140
|
// Clean up request
|
|
@@ -1019,7 +1195,7 @@ var xhr = function xhrAdapter(config) {
|
|
|
1019
1195
|
if (!request) {
|
|
1020
1196
|
return;
|
|
1021
1197
|
}
|
|
1022
|
-
reject(!cancel || (cancel && cancel.type) ? new
|
|
1198
|
+
reject(!cancel || (cancel && cancel.type) ? new CanceledError_1() : cancel);
|
|
1023
1199
|
request.abort();
|
|
1024
1200
|
request = null;
|
|
1025
1201
|
};
|
|
@@ -1034,11 +1210,22 @@ var xhr = function xhrAdapter(config) {
|
|
|
1034
1210
|
requestData = null;
|
|
1035
1211
|
}
|
|
1036
1212
|
|
|
1213
|
+
var protocol = parseProtocol(fullPath);
|
|
1214
|
+
|
|
1215
|
+
if (protocol && [ 'http', 'https', 'file' ].indexOf(protocol) === -1) {
|
|
1216
|
+
reject(new AxiosError_1('Unsupported protocol ' + protocol + ':', AxiosError_1.ERR_BAD_REQUEST, config));
|
|
1217
|
+
return;
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
|
|
1037
1221
|
// Send the request
|
|
1038
1222
|
request.send(requestData);
|
|
1039
1223
|
});
|
|
1040
1224
|
};
|
|
1041
1225
|
|
|
1226
|
+
// eslint-disable-next-line strict
|
|
1227
|
+
var _null = null;
|
|
1228
|
+
|
|
1042
1229
|
var DEFAULT_CONTENT_TYPE = {
|
|
1043
1230
|
'Content-Type': 'application/x-www-form-urlencoded'
|
|
1044
1231
|
};
|
|
@@ -1078,11 +1265,7 @@ function stringifySafely(rawValue, parser, encoder) {
|
|
|
1078
1265
|
|
|
1079
1266
|
var defaults = {
|
|
1080
1267
|
|
|
1081
|
-
transitional:
|
|
1082
|
-
silentJSONParsing: true,
|
|
1083
|
-
forcedJSONParsing: true,
|
|
1084
|
-
clarifyTimeoutError: false
|
|
1085
|
-
},
|
|
1268
|
+
transitional: transitional,
|
|
1086
1269
|
|
|
1087
1270
|
adapter: getDefaultAdapter(),
|
|
1088
1271
|
|
|
@@ -1106,10 +1289,20 @@ var defaults = {
|
|
|
1106
1289
|
setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
|
|
1107
1290
|
return data.toString();
|
|
1108
1291
|
}
|
|
1109
|
-
|
|
1292
|
+
|
|
1293
|
+
var isObjectPayload = utils.isObject(data);
|
|
1294
|
+
var contentType = headers && headers['Content-Type'];
|
|
1295
|
+
|
|
1296
|
+
var isFileList;
|
|
1297
|
+
|
|
1298
|
+
if ((isFileList = utils.isFileList(data)) || (isObjectPayload && contentType === 'multipart/form-data')) {
|
|
1299
|
+
var _FormData = this.env && this.env.FormData;
|
|
1300
|
+
return toFormData_1(isFileList ? {'files[]': data} : data, _FormData && new _FormData());
|
|
1301
|
+
} else if (isObjectPayload || contentType === 'application/json') {
|
|
1110
1302
|
setContentTypeIfUnset(headers, 'application/json');
|
|
1111
1303
|
return stringifySafely(data);
|
|
1112
1304
|
}
|
|
1305
|
+
|
|
1113
1306
|
return data;
|
|
1114
1307
|
}],
|
|
1115
1308
|
|
|
@@ -1125,7 +1318,7 @@ var defaults = {
|
|
|
1125
1318
|
} catch (e) {
|
|
1126
1319
|
if (strictJSONParsing) {
|
|
1127
1320
|
if (e.name === 'SyntaxError') {
|
|
1128
|
-
throw
|
|
1321
|
+
throw AxiosError_1.from(e, AxiosError_1.ERR_BAD_RESPONSE, this, null, this.response);
|
|
1129
1322
|
}
|
|
1130
1323
|
throw e;
|
|
1131
1324
|
}
|
|
@@ -1147,6 +1340,10 @@ var defaults = {
|
|
|
1147
1340
|
maxContentLength: -1,
|
|
1148
1341
|
maxBodyLength: -1,
|
|
1149
1342
|
|
|
1343
|
+
env: {
|
|
1344
|
+
FormData: _null
|
|
1345
|
+
},
|
|
1346
|
+
|
|
1150
1347
|
validateStatus: function validateStatus(status) {
|
|
1151
1348
|
return status >= 200 && status < 300;
|
|
1152
1349
|
},
|
|
@@ -1191,7 +1388,7 @@ var isCancel = function isCancel(value) {
|
|
|
1191
1388
|
};
|
|
1192
1389
|
|
|
1193
1390
|
/**
|
|
1194
|
-
* Throws a `
|
|
1391
|
+
* Throws a `CanceledError` if cancellation has been requested.
|
|
1195
1392
|
*/
|
|
1196
1393
|
function throwIfCancellationRequested(config) {
|
|
1197
1394
|
if (config.cancelToken) {
|
|
@@ -1199,7 +1396,7 @@ function throwIfCancellationRequested(config) {
|
|
|
1199
1396
|
}
|
|
1200
1397
|
|
|
1201
1398
|
if (config.signal && config.signal.aborted) {
|
|
1202
|
-
throw new
|
|
1399
|
+
throw new CanceledError_1();
|
|
1203
1400
|
}
|
|
1204
1401
|
}
|
|
1205
1402
|
|
|
@@ -1348,6 +1545,7 @@ var mergeConfig = function mergeConfig(config1, config2) {
|
|
|
1348
1545
|
'decompress': defaultToConfig2,
|
|
1349
1546
|
'maxContentLength': defaultToConfig2,
|
|
1350
1547
|
'maxBodyLength': defaultToConfig2,
|
|
1548
|
+
'beforeRedirect': defaultToConfig2,
|
|
1351
1549
|
'transport': defaultToConfig2,
|
|
1352
1550
|
'httpAgent': defaultToConfig2,
|
|
1353
1551
|
'httpsAgent': defaultToConfig2,
|
|
@@ -1367,11 +1565,12 @@ var mergeConfig = function mergeConfig(config1, config2) {
|
|
|
1367
1565
|
};
|
|
1368
1566
|
|
|
1369
1567
|
var data = {
|
|
1370
|
-
"version": "0.
|
|
1568
|
+
"version": "0.27.2"
|
|
1371
1569
|
};
|
|
1372
1570
|
|
|
1373
1571
|
var VERSION = data.version;
|
|
1374
1572
|
|
|
1573
|
+
|
|
1375
1574
|
var validators$1 = {};
|
|
1376
1575
|
|
|
1377
1576
|
// eslint-disable-next-line func-names
|
|
@@ -1398,7 +1597,10 @@ validators$1.transitional = function transitional(validator, version, message) {
|
|
|
1398
1597
|
// eslint-disable-next-line func-names
|
|
1399
1598
|
return function(value, opt, opts) {
|
|
1400
1599
|
if (validator === false) {
|
|
1401
|
-
throw new
|
|
1600
|
+
throw new AxiosError_1(
|
|
1601
|
+
formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
|
|
1602
|
+
AxiosError_1.ERR_DEPRECATED
|
|
1603
|
+
);
|
|
1402
1604
|
}
|
|
1403
1605
|
|
|
1404
1606
|
if (version && !deprecatedWarnings[opt]) {
|
|
@@ -1425,7 +1627,7 @@ validators$1.transitional = function transitional(validator, version, message) {
|
|
|
1425
1627
|
|
|
1426
1628
|
function assertOptions(options, schema, allowUnknown) {
|
|
1427
1629
|
if (typeof options !== 'object') {
|
|
1428
|
-
throw new
|
|
1630
|
+
throw new AxiosError_1('options must be an object', AxiosError_1.ERR_BAD_OPTION_VALUE);
|
|
1429
1631
|
}
|
|
1430
1632
|
var keys = Object.keys(options);
|
|
1431
1633
|
var i = keys.length;
|
|
@@ -1436,12 +1638,12 @@ function assertOptions(options, schema, allowUnknown) {
|
|
|
1436
1638
|
var value = options[opt];
|
|
1437
1639
|
var result = value === undefined || validator(value, opt, options);
|
|
1438
1640
|
if (result !== true) {
|
|
1439
|
-
throw new
|
|
1641
|
+
throw new AxiosError_1('option ' + opt + ' must be ' + result, AxiosError_1.ERR_BAD_OPTION_VALUE);
|
|
1440
1642
|
}
|
|
1441
1643
|
continue;
|
|
1442
1644
|
}
|
|
1443
1645
|
if (allowUnknown !== true) {
|
|
1444
|
-
throw
|
|
1646
|
+
throw new AxiosError_1('Unknown option ' + opt, AxiosError_1.ERR_BAD_OPTION);
|
|
1445
1647
|
}
|
|
1446
1648
|
}
|
|
1447
1649
|
}
|
|
@@ -1480,10 +1682,6 @@ Axios.prototype.request = function request(configOrUrl, config) {
|
|
|
1480
1682
|
config = configOrUrl || {};
|
|
1481
1683
|
}
|
|
1482
1684
|
|
|
1483
|
-
if (!config.url) {
|
|
1484
|
-
throw new Error('Provided config url is not valid');
|
|
1485
|
-
}
|
|
1486
|
-
|
|
1487
1685
|
config = mergeConfig(this.defaults, config);
|
|
1488
1686
|
|
|
1489
1687
|
// Set config.method
|
|
@@ -1566,11 +1764,9 @@ Axios.prototype.request = function request(configOrUrl, config) {
|
|
|
1566
1764
|
};
|
|
1567
1765
|
|
|
1568
1766
|
Axios.prototype.getUri = function getUri(config) {
|
|
1569
|
-
if (!config.url) {
|
|
1570
|
-
throw new Error('Provided config url is not valid');
|
|
1571
|
-
}
|
|
1572
1767
|
config = mergeConfig(this.defaults, config);
|
|
1573
|
-
|
|
1768
|
+
var fullPath = buildFullPath(config.baseURL, config.url);
|
|
1769
|
+
return buildURL(fullPath, config.params, config.paramsSerializer);
|
|
1574
1770
|
};
|
|
1575
1771
|
|
|
1576
1772
|
// Provide aliases for supported request methods
|
|
@@ -1587,13 +1783,23 @@ utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData
|
|
|
1587
1783
|
|
|
1588
1784
|
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
1589
1785
|
/*eslint func-names:0*/
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1786
|
+
|
|
1787
|
+
function generateHTTPMethod(isForm) {
|
|
1788
|
+
return function httpMethod(url, data, config) {
|
|
1789
|
+
return this.request(mergeConfig(config || {}, {
|
|
1790
|
+
method: method,
|
|
1791
|
+
headers: isForm ? {
|
|
1792
|
+
'Content-Type': 'multipart/form-data'
|
|
1793
|
+
} : {},
|
|
1794
|
+
url: url,
|
|
1795
|
+
data: data
|
|
1796
|
+
}));
|
|
1797
|
+
};
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1800
|
+
Axios.prototype[method] = generateHTTPMethod();
|
|
1801
|
+
|
|
1802
|
+
Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
|
|
1597
1803
|
});
|
|
1598
1804
|
|
|
1599
1805
|
var Axios_1 = Axios;
|
|
@@ -1652,13 +1858,13 @@ function CancelToken(executor) {
|
|
|
1652
1858
|
return;
|
|
1653
1859
|
}
|
|
1654
1860
|
|
|
1655
|
-
token.reason = new
|
|
1861
|
+
token.reason = new CanceledError_1(message);
|
|
1656
1862
|
resolvePromise(token.reason);
|
|
1657
1863
|
});
|
|
1658
1864
|
}
|
|
1659
1865
|
|
|
1660
1866
|
/**
|
|
1661
|
-
* Throws a `
|
|
1867
|
+
* Throws a `CanceledError` if cancellation has been requested.
|
|
1662
1868
|
*/
|
|
1663
1869
|
CancelToken.prototype.throwIfRequested = function throwIfRequested() {
|
|
1664
1870
|
if (this.reason) {
|
|
@@ -1781,10 +1987,17 @@ var axios$1 = createInstance(defaults_1);
|
|
|
1781
1987
|
axios$1.Axios = Axios_1;
|
|
1782
1988
|
|
|
1783
1989
|
// Expose Cancel & CancelToken
|
|
1784
|
-
axios$1.
|
|
1990
|
+
axios$1.CanceledError = CanceledError_1;
|
|
1785
1991
|
axios$1.CancelToken = CancelToken_1;
|
|
1786
1992
|
axios$1.isCancel = isCancel;
|
|
1787
1993
|
axios$1.VERSION = data.version;
|
|
1994
|
+
axios$1.toFormData = toFormData_1;
|
|
1995
|
+
|
|
1996
|
+
// Expose AxiosError class
|
|
1997
|
+
axios$1.AxiosError = AxiosError_1;
|
|
1998
|
+
|
|
1999
|
+
// alias for CanceledError for backward compatibility
|
|
2000
|
+
axios$1.Cancel = axios$1.CanceledError;
|
|
1788
2001
|
|
|
1789
2002
|
// Expose all/spread
|
|
1790
2003
|
axios$1.all = function all(promises) {
|
|
@@ -1803,9 +2016,14 @@ axios_1.default = _default;
|
|
|
1803
2016
|
|
|
1804
2017
|
var axios = axios_1;
|
|
1805
2018
|
|
|
2019
|
+
var requestLogger = function (r) {
|
|
2020
|
+
// tslint:disable-next-line
|
|
2021
|
+
console.debug("[JS-SDK] ".concat(r.method.toUpperCase(), " ").concat(r.baseURL).concat(r.url), r.data ? JSON.stringify(r.data) : '');
|
|
2022
|
+
return r;
|
|
2023
|
+
};
|
|
1806
2024
|
/**
|
|
1807
|
-
*
|
|
1808
|
-
*
|
|
2025
|
+
* VerdocsEndpoint is a class wrapper for a specific connection and authorization context for calling the Verdocs APIs.
|
|
2026
|
+
* Endpoints can be used for isolated session tasks.
|
|
1809
2027
|
* For instance, ephemeral signing sessions may be created independently of a caller's status as an authenticated user.
|
|
1810
2028
|
* In that case, an Endpoint can be created and authenticated, used for calls related to signing operations, then
|
|
1811
2029
|
* discarded once signing is complete.
|
|
@@ -1821,31 +2039,19 @@ var axios = axios_1;
|
|
|
1821
2039
|
* .setClientID('1234)
|
|
1822
2040
|
* .setTimeout(5000);
|
|
1823
2041
|
* ```
|
|
1824
|
-
*
|
|
1825
|
-
* @module
|
|
1826
2042
|
*/
|
|
1827
|
-
var requestLogger = function (r) {
|
|
1828
|
-
// tslint:disable-next-line
|
|
1829
|
-
console.debug("[JS-SDK] ".concat(r.method.toUpperCase(), " ").concat(r.baseURL).concat(r.url), r.data ? JSON.stringify(r.data) : '');
|
|
1830
|
-
return r;
|
|
1831
|
-
};
|
|
1832
2043
|
var VerdocsEndpoint = /** @class */ (function () {
|
|
1833
2044
|
/**
|
|
1834
|
-
* Create a new
|
|
2045
|
+
* Create a new VerdocsEndpoint to call Verdocs platform services.
|
|
1835
2046
|
*
|
|
1836
2047
|
* ```typescript
|
|
1837
2048
|
* import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
|
|
1838
|
-
*
|
|
1839
|
-
* console.log('Current timeout', Transport.getEndpoint().defaults.timeout);
|
|
2049
|
+
* const endpoint = new VerdocsEndpoint();
|
|
1840
2050
|
* ```
|
|
1841
2051
|
*/
|
|
1842
|
-
function VerdocsEndpoint(
|
|
1843
|
-
var _b = _a === void 0 ? {} : _a, baseURL = _b.baseURL, timeout = _b.timeout;
|
|
2052
|
+
function VerdocsEndpoint() {
|
|
1844
2053
|
this.requestLoggerId = null;
|
|
1845
|
-
this.api = axios.create({
|
|
1846
|
-
baseURL: baseURL || 'https://api.verdocs.com',
|
|
1847
|
-
timeout: timeout || 6000,
|
|
1848
|
-
});
|
|
2054
|
+
this.api = axios.create({ baseURL: 'https://api.verdocs.com', timeout: 3000 });
|
|
1849
2055
|
}
|
|
1850
2056
|
/**
|
|
1851
2057
|
* Set the timeout for API calls in milliseconds. 2000-4000ms is recommended for most purposes. 3000ms is the default.
|
|
@@ -1950,6 +2156,58 @@ var VerdocsEndpoint = /** @class */ (function () {
|
|
|
1950
2156
|
return VerdocsEndpoint;
|
|
1951
2157
|
}());
|
|
1952
2158
|
|
|
2159
|
+
// This file provides a polyfill for managing globals in both NodeJS and browser environments. This is
|
|
2160
|
+
// an anti-pattern we'd hoped to avoid, but we have several projects dependending on one common library
|
|
2161
|
+
// (this js-sdk) and we want that library to provide a common endpoint to all callers (so authentication
|
|
2162
|
+
// tokens only need to be tracked in one place). The trouble is, one of those libraries is based on
|
|
2163
|
+
// StencilJS and is compiling its modules into Web Components. Because of how module resolution works,
|
|
2164
|
+
// when those Components load js-sdk they get a separate instance. Without messy options like having to
|
|
2165
|
+
// pass raw data from the caller to each Component, or pass around references to a common Endpoint, they
|
|
2166
|
+
// have no way to access authenticated sessions unless we make the Endpoint a true global.
|
|
2167
|
+
//
|
|
2168
|
+
// @credit https://github.com/medikoo/es5-ext/blob/master/global.js
|
|
2169
|
+
// @credit https://mathiasbynens.be/notes/globalthis
|
|
2170
|
+
var naiveFallback = function () {
|
|
2171
|
+
if (typeof self === 'object' && self)
|
|
2172
|
+
return self;
|
|
2173
|
+
if (typeof window === 'object' && window)
|
|
2174
|
+
return window;
|
|
2175
|
+
throw new Error('Unable to resolve global `this`');
|
|
2176
|
+
};
|
|
2177
|
+
var globalThis_1 = (function () {
|
|
2178
|
+
if (this)
|
|
2179
|
+
return this;
|
|
2180
|
+
// Unexpected strict mode (may happen if e.g. bundled into ESM module)
|
|
2181
|
+
// Fallback to standard globalThis if available
|
|
2182
|
+
if (typeof globalThis === 'object' && globalThis)
|
|
2183
|
+
return globalThis;
|
|
2184
|
+
// Thanks @mathiasbynens -> https://mathiasbynens.be/notes/globalthis
|
|
2185
|
+
// In all ES5+ engines global object inherits from Object.prototype
|
|
2186
|
+
// (if you approached one that doesn't please report)
|
|
2187
|
+
try {
|
|
2188
|
+
Object.defineProperty(Object.prototype, '__global__', {
|
|
2189
|
+
get: function () {
|
|
2190
|
+
return this;
|
|
2191
|
+
},
|
|
2192
|
+
configurable: true,
|
|
2193
|
+
});
|
|
2194
|
+
}
|
|
2195
|
+
catch (error) {
|
|
2196
|
+
// Unfortunate case of updates to Object.prototype being restricted
|
|
2197
|
+
// via preventExtensions, seal or freeze
|
|
2198
|
+
return naiveFallback();
|
|
2199
|
+
}
|
|
2200
|
+
try {
|
|
2201
|
+
// Safari case (window.__global__ works, but __global__ does not)
|
|
2202
|
+
if (!__global__)
|
|
2203
|
+
return naiveFallback();
|
|
2204
|
+
return __global__;
|
|
2205
|
+
}
|
|
2206
|
+
finally {
|
|
2207
|
+
delete Object.prototype.__global__;
|
|
2208
|
+
}
|
|
2209
|
+
})();
|
|
2210
|
+
|
|
1953
2211
|
/**
|
|
1954
2212
|
* The Transport is a global singleton used to call Verdocs APIs. There can only be one Transport per application, and
|
|
1955
2213
|
* its configuration settings are shared for all callers. This is a simplified form of the Endpoint class where most
|
|
@@ -1961,7 +2219,7 @@ var VerdocsEndpoint = /** @class */ (function () {
|
|
|
1961
2219
|
// Also see globalThis for comments about why we're doing this in the first place.
|
|
1962
2220
|
var ENDPOINT_KEY = Symbol.for('verdocs-api-endpoint');
|
|
1963
2221
|
if (!globalThis_1[ENDPOINT_KEY]) {
|
|
1964
|
-
globalThis_1[ENDPOINT_KEY] = new VerdocsEndpoint(
|
|
2222
|
+
globalThis_1[ENDPOINT_KEY] = new VerdocsEndpoint();
|
|
1965
2223
|
}
|
|
1966
2224
|
var globalEndpoint = globalThis_1[ENDPOINT_KEY];
|
|
1967
2225
|
var activeEndpoint = globalEndpoint;
|
|
@@ -1996,4 +2254,72 @@ var setActiveEndpoint = function (e) {
|
|
|
1996
2254
|
activeEndpoint = e || globalEndpoint;
|
|
1997
2255
|
};
|
|
1998
2256
|
|
|
1999
|
-
|
|
2257
|
+
/* tslint:disable:no-bitwise */
|
|
2258
|
+
var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
2259
|
+
// Regular expression to check formal correctness of base64 encoded strings
|
|
2260
|
+
var b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
|
|
2261
|
+
/**
|
|
2262
|
+
* Simplified, Node/Browser-safe alternative to atob() for base64 decoding.
|
|
2263
|
+
* Modified from https://github.com/MaxArt2501/base64-js/blob/master/base64.js
|
|
2264
|
+
*/
|
|
2265
|
+
var AtoB = function (str) {
|
|
2266
|
+
// atob can work with strings with whitespaces, even inside the encoded part,
|
|
2267
|
+
// but only \t, \n, \f, \r and ' ', which can be stripped.
|
|
2268
|
+
str = String(str).replace(/[\t\n\f\r ]+/g, '');
|
|
2269
|
+
if (!b64re.test(str))
|
|
2270
|
+
throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
|
|
2271
|
+
// Adding the padding if missing, for semplicity
|
|
2272
|
+
str += '=='.slice(2 - (str.length & 3));
|
|
2273
|
+
var bitmap;
|
|
2274
|
+
var result = '';
|
|
2275
|
+
var r1;
|
|
2276
|
+
var r2;
|
|
2277
|
+
var i = 0;
|
|
2278
|
+
for (; i < str.length;) {
|
|
2279
|
+
bitmap =
|
|
2280
|
+
(b64.indexOf(str.charAt(i++)) << 18) |
|
|
2281
|
+
(b64.indexOf(str.charAt(i++)) << 12) |
|
|
2282
|
+
((r1 = b64.indexOf(str.charAt(i++))) << 6) |
|
|
2283
|
+
(r2 = b64.indexOf(str.charAt(i++)));
|
|
2284
|
+
result +=
|
|
2285
|
+
r1 === 64
|
|
2286
|
+
? String.fromCharCode((bitmap >> 16) & 255)
|
|
2287
|
+
: r2 === 64
|
|
2288
|
+
? String.fromCharCode((bitmap >> 16) & 255, (bitmap >> 8) & 255)
|
|
2289
|
+
: String.fromCharCode((bitmap >> 16) & 255, (bitmap >> 8) & 255, bitmap & 255);
|
|
2290
|
+
}
|
|
2291
|
+
return result;
|
|
2292
|
+
};
|
|
2293
|
+
/**
|
|
2294
|
+
* Decode the body of a JWT. This helper may allow front-end applications to avoid a dependency on `jsonwebtoken` in
|
|
2295
|
+
* many cases. Note that this should only be used for true JWTs. Opaque tokens will cause this to throw.
|
|
2296
|
+
*/
|
|
2297
|
+
var decodeTokenBody = function (token) { return JSON.parse(AtoB((token || '').split('.')[1] || '')); };
|
|
2298
|
+
/**
|
|
2299
|
+
* Decode the body of an Verdocs access token. Note that raw tokens contain namespaced fields, e.g.
|
|
2300
|
+
* `https://verdocs.com/profile_id`. To make these tokens easier to use in front-end code, this name-spacing
|
|
2301
|
+
* will be removed. Note that user and signing sessions have different access token formats. The calling
|
|
2302
|
+
* application should distinguish between the two based on the context of the authenticated session, or by
|
|
2303
|
+
* the presence of the `document_id` field, which will only be present for signing sessions.
|
|
2304
|
+
*/
|
|
2305
|
+
var decodeAccessTokenBody = function (token) {
|
|
2306
|
+
var decoded;
|
|
2307
|
+
try {
|
|
2308
|
+
decoded = decodeTokenBody(token);
|
|
2309
|
+
if (decoded === null) {
|
|
2310
|
+
return null;
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2313
|
+
catch (e) {
|
|
2314
|
+
return null;
|
|
2315
|
+
}
|
|
2316
|
+
Object.keys(decoded).forEach(function (key) {
|
|
2317
|
+
if (typeof key === 'string' && key.startsWith('https://verdocs.com/')) {
|
|
2318
|
+
decoded[key.replace('https://verdocs.com/', '')] = decoded[key];
|
|
2319
|
+
delete decoded[key];
|
|
2320
|
+
}
|
|
2321
|
+
});
|
|
2322
|
+
return decoded;
|
|
2323
|
+
};
|
|
2324
|
+
|
|
2325
|
+
export { VerdocsEndpoint as V, decodeAccessTokenBody as d, getEndpoint as g, setActiveEndpoint as s };
|