@vritti/quantum-ui 0.2.9 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Alert.js +8 -31
- package/dist/Alert.js.map +1 -1
- package/dist/AppSelector.js +37 -0
- package/dist/AppSelector.js.map +1 -0
- package/dist/Avatar.js +5 -5
- package/dist/Avatar.js.map +1 -1
- package/dist/Badge.js +2 -28
- package/dist/Badge.js.map +1 -1
- package/dist/Badge2.js +30 -0
- package/dist/Badge2.js.map +1 -0
- package/dist/Breadcrumb.js +125 -0
- package/dist/Breadcrumb.js.map +1 -0
- package/dist/Button.js +8 -4
- package/dist/Button.js.map +1 -1
- package/dist/Button2.js +34 -15
- package/dist/Button2.js.map +1 -1
- package/dist/CardSkeleton.js +17 -0
- package/dist/CardSkeleton.js.map +1 -0
- package/dist/Chart.js +6195 -6401
- package/dist/Chart.js.map +1 -1
- package/dist/Checkbox.js +2 -289
- package/dist/Checkbox.js.map +1 -1
- package/dist/Checkbox2.js +293 -0
- package/dist/Checkbox2.js.map +1 -0
- package/dist/CheckboxGroup.js +74 -0
- package/dist/CheckboxGroup.js.map +1 -0
- package/dist/CloudProviderSelector.js +37 -0
- package/dist/CloudProviderSelector.js.map +1 -0
- package/dist/Collapsible.js +8 -0
- package/dist/Collapsible.js.map +1 -0
- package/dist/Combination.js +10 -2509
- package/dist/Combination.js.map +1 -1
- package/dist/ConfirmContext.js +75 -0
- package/dist/ConfirmContext.js.map +1 -0
- package/dist/CurrencySelector.js +194 -0
- package/dist/CurrencySelector.js.map +1 -0
- package/dist/DangerZoneSkeleton.js +52 -0
- package/dist/DangerZoneSkeleton.js.map +1 -0
- package/dist/DatePicker.js +36 -340
- package/dist/DatePicker.js.map +1 -1
- package/dist/DeploymentSelector.js +37 -0
- package/dist/DeploymentSelector.js.map +1 -0
- package/dist/Dialog.js +159 -0
- package/dist/Dialog.js.map +1 -0
- package/dist/DropdownMenu.js +66 -1423
- package/dist/DropdownMenu.js.map +1 -1
- package/dist/Empty.js +49 -0
- package/dist/Empty.js.map +1 -0
- package/dist/ErrorBoundary.js +255 -0
- package/dist/ErrorBoundary.js.map +1 -0
- package/dist/FeatureSelector.js +37 -0
- package/dist/FeatureSelector.js.map +1 -0
- package/dist/FilePreview.js +194 -0
- package/dist/FilePreview.js.map +1 -0
- package/dist/Form.js +1938 -19
- package/dist/Form.js.map +1 -1
- package/dist/HierarchyGraph.js +10729 -0
- package/dist/HierarchyGraph.js.map +1 -0
- package/dist/IndustrySelector.js +37 -0
- package/dist/IndustrySelector.js.map +1 -0
- package/dist/Input.js +22 -0
- package/dist/Input.js.map +1 -0
- package/dist/Label.js +1 -21
- package/dist/Label.js.map +1 -1
- package/dist/LocaleSelector.js +111 -0
- package/dist/LocaleSelector.js.map +1 -0
- package/dist/MicrofrontendSelector.js +19 -0
- package/dist/MicrofrontendSelector.js.map +1 -0
- package/dist/OTPField.js +28 -26
- package/dist/OTPField.js.map +1 -1
- package/dist/PageHeaderSkeleton.js +35 -0
- package/dist/PageHeaderSkeleton.js.map +1 -0
- package/dist/PasswordField.js +1 -49
- package/dist/PasswordField.js.map +1 -1
- package/dist/PhoneField.js +11 -16
- package/dist/PhoneField.js.map +1 -1
- package/dist/PlanSelector.js +37 -0
- package/dist/PlanSelector.js.map +1 -0
- package/dist/Progress.js +4 -3
- package/dist/Progress.js.map +1 -1
- package/dist/RadioGroup.js +392 -0
- package/dist/RadioGroup.js.map +1 -0
- package/dist/RegionSelector.js +37 -0
- package/dist/RegionSelector.js.map +1 -0
- package/dist/Select.js +780 -0
- package/dist/Select.js.map +1 -0
- package/dist/SelectFilter.js +387 -0
- package/dist/SelectFilter.js.map +1 -0
- package/dist/Sidebar.js +616 -0
- package/dist/Sidebar.js.map +1 -0
- package/dist/SingleSelect.js +429 -0
- package/dist/SingleSelect.js.map +1 -0
- package/dist/Sonner.js +6 -1135
- package/dist/Sonner.js.map +1 -1
- package/dist/Sortable.js +4517 -0
- package/dist/Sortable.js.map +1 -0
- package/dist/StepProgressIndicator.js +42 -0
- package/dist/StepProgressIndicator.js.map +1 -0
- package/dist/Switch.js +15 -15
- package/dist/Switch.js.map +1 -1
- package/dist/TabsSkeleton.js +188 -0
- package/dist/TabsSkeleton.js.map +1 -0
- package/dist/TextArea.js +16 -19
- package/dist/TextArea.js.map +1 -1
- package/dist/TextField.js +5 -20
- package/dist/TextField.js.map +1 -1
- package/dist/ThemeContext.js +2 -8
- package/dist/ThemeContext.js.map +1 -1
- package/dist/TimezoneSelector.js +144 -0
- package/dist/TimezoneSelector.js.map +1 -0
- package/dist/Toggle.js +2 -32
- package/dist/Toggle.js.map +1 -1
- package/dist/UploadFile.js +232 -0
- package/dist/UploadFile.js.map +1 -0
- package/dist/ValueFilter.js +123 -0
- package/dist/ValueFilter.js.map +1 -0
- package/dist/ViewTabs.js +218 -0
- package/dist/ViewTabs.js.map +1 -0
- package/dist/_commonjsHelpers.js +3 -1
- package/dist/_commonjsHelpers.js.map +1 -1
- package/dist/assets/quantum-ui.css +827 -57
- package/dist/axios.js +1239 -892
- package/dist/axios.js.map +1 -1
- package/dist/{chevron-down.js → chevron-left.js} +4 -4
- package/dist/chevron-left.js.map +1 -0
- package/dist/circle-alert.js +19 -0
- package/dist/circle-alert.js.map +1 -0
- package/dist/circle-check.js +18 -0
- package/dist/circle-check.js.map +1 -0
- package/dist/collapsible2.js +154 -0
- package/dist/collapsible2.js.map +1 -0
- package/dist/components/Badge.js +2 -1
- package/dist/components/Badge.js.map +1 -1
- package/dist/components/Breadcrumb.js +2 -0
- package/dist/components/Breadcrumb.js.map +1 -0
- package/dist/components/Card.js +1 -0
- package/dist/components/Card.js.map +1 -1
- package/dist/components/CheckboxGroup.js +2 -0
- package/dist/components/CheckboxGroup.js.map +1 -0
- package/dist/components/Collapsible.js +2 -0
- package/dist/components/Collapsible.js.map +1 -0
- package/dist/components/DangerZone.js +2 -0
- package/dist/components/DangerZone.js.map +1 -0
- package/dist/components/DataTable.js +2 -0
- package/dist/components/DataTable.js.map +1 -0
- package/dist/components/Dialog.js +2 -0
- package/dist/components/Dialog.js.map +1 -0
- package/dist/components/DropdownMenu.js +1 -1
- package/dist/components/Empty.js +2 -0
- package/dist/components/Empty.js.map +1 -0
- package/dist/components/ErrorBoundary.js +2 -0
- package/dist/components/ErrorBoundary.js.map +1 -0
- package/dist/components/FilePreview.js +2 -0
- package/dist/components/FilePreview.js.map +1 -0
- package/dist/components/HierarchyGraph.js +2 -0
- package/dist/components/HierarchyGraph.js.map +1 -0
- package/dist/components/PageHeader.js +2 -0
- package/dist/components/PageHeader.js.map +1 -0
- package/dist/components/RadioGroup.js +2 -0
- package/dist/components/RadioGroup.js.map +1 -0
- package/dist/components/RichTextEditor.js +4 -0
- package/dist/components/RichTextEditor.js.map +1 -0
- package/dist/components/Select.js +29 -0
- package/dist/components/Select.js.map +1 -0
- package/dist/components/Sidebar.js +2 -0
- package/dist/components/Sidebar.js.map +1 -0
- package/dist/components/Sortable.js +2 -0
- package/dist/components/Sortable.js.map +1 -0
- package/dist/components/StepProgressIndicator.js +2 -0
- package/dist/components/StepProgressIndicator.js.map +1 -0
- package/dist/components/Tabs.js +2 -0
- package/dist/components/Tabs.js.map +1 -0
- package/dist/components/UploadFile.js +2 -0
- package/dist/components/UploadFile.js.map +1 -0
- package/dist/components/ValueFilter.js +2 -0
- package/dist/components/ValueFilter.js.map +1 -0
- package/dist/components/ViewTabs.js +2 -0
- package/dist/components/ViewTabs.js.map +1 -0
- package/dist/context/index.js +1 -0
- package/dist/context/index.js.map +1 -1
- package/dist/dropdown-menu.js +1209 -0
- package/dist/dropdown-menu.js.map +1 -0
- package/dist/ellipsis.js +19 -0
- package/dist/ellipsis.js.map +1 -0
- package/dist/eye.js +52 -0
- package/dist/eye.js.map +1 -0
- package/dist/field.js +1 -1
- package/dist/file-text.js +27 -0
- package/dist/file-text.js.map +1 -0
- package/dist/grip-vertical.js +22 -0
- package/dist/grip-vertical.js.map +1 -0
- package/dist/hooks/index.js +3 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/image-component.js +614 -0
- package/dist/image-component.js.map +1 -0
- package/dist/index.js +49 -9
- package/dist/index.js.map +1 -1
- package/dist/index10.js +175 -94
- package/dist/index10.js.map +1 -1
- package/dist/index11.js +202 -67
- package/dist/index11.js.map +1 -1
- package/dist/index12.js +17 -38
- package/dist/index12.js.map +1 -1
- package/dist/index13.js +204 -188
- package/dist/index13.js.map +1 -1
- package/dist/index14.js +124 -192
- package/dist/index14.js.map +1 -1
- package/dist/index15.js +79 -0
- package/dist/index15.js.map +1 -0
- package/dist/index16.js +16 -0
- package/dist/index16.js.map +1 -0
- package/dist/index17.js +1137 -0
- package/dist/index17.js.map +1 -0
- package/dist/index18.js +41 -0
- package/dist/index18.js.map +1 -0
- package/dist/index19.js +314 -0
- package/dist/index19.js.map +1 -0
- package/dist/index2.js +54033 -55
- package/dist/index2.js.map +1 -1
- package/dist/index20.js +488 -0
- package/dist/index20.js.map +1 -0
- package/dist/index21.js +2540 -0
- package/dist/index21.js.map +1 -0
- package/dist/index22.js +36 -0
- package/dist/index22.js.map +1 -0
- package/dist/index23.js +13 -0
- package/dist/index23.js.map +1 -0
- package/dist/index24.js +8 -0
- package/dist/index24.js.map +1 -0
- package/dist/index25.js +35 -0
- package/dist/index25.js.map +1 -0
- package/dist/index26.js +65 -0
- package/dist/index26.js.map +1 -0
- package/dist/index27.js +16 -0
- package/dist/index27.js.map +1 -0
- package/dist/index28.js +41 -0
- package/dist/index28.js.map +1 -0
- package/dist/index29.js +84 -0
- package/dist/index29.js.map +1 -0
- package/dist/index3.js +42 -10
- package/dist/index3.js.map +1 -1
- package/dist/index30.js +199 -0
- package/dist/index30.js.map +1 -0
- package/dist/index4.js +290 -118
- package/dist/index4.js.map +1 -1
- package/dist/index5.js +96 -31
- package/dist/index5.js.map +1 -1
- package/dist/index6.js +36 -4
- package/dist/index6.js.map +1 -1
- package/dist/index7.js +1157 -11
- package/dist/index7.js.map +1 -1
- package/dist/index8.js +22 -42
- package/dist/index8.js.map +1 -1
- package/dist/index9.js +25 -35
- package/dist/index9.js.map +1 -1
- package/dist/lib/components/Alert/Alert.d.ts +2 -1
- package/dist/lib/components/Alert/Alert.d.ts.map +1 -1
- package/dist/lib/components/Breadcrumb/Breadcrumb.d.ts +17 -0
- package/dist/lib/components/Breadcrumb/Breadcrumb.d.ts.map +1 -0
- package/dist/lib/components/Breadcrumb/index.d.ts +4 -0
- package/dist/lib/components/Breadcrumb/index.d.ts.map +1 -0
- package/dist/lib/components/Button/Button.d.ts +3 -1
- package/dist/lib/components/Button/Button.d.ts.map +1 -1
- package/dist/lib/components/Card/CardSkeleton.d.ts +9 -0
- package/dist/lib/components/Card/CardSkeleton.d.ts.map +1 -0
- package/dist/lib/components/Card/index.d.ts +1 -0
- package/dist/lib/components/Card/index.d.ts.map +1 -1
- package/dist/lib/components/Chart/Chart.d.ts +1 -1
- package/dist/lib/components/Chart/Chart.d.ts.map +1 -1
- package/dist/lib/components/CheckboxGroup/CheckboxGroup.d.ts +24 -0
- package/dist/lib/components/CheckboxGroup/CheckboxGroup.d.ts.map +1 -0
- package/dist/lib/components/CheckboxGroup/index.d.ts +3 -0
- package/dist/lib/components/CheckboxGroup/index.d.ts.map +1 -0
- package/dist/lib/components/Collapsible/Collapsible.d.ts +5 -0
- package/dist/lib/components/Collapsible/Collapsible.d.ts.map +1 -0
- package/dist/lib/components/Collapsible/index.d.ts +2 -0
- package/dist/lib/components/Collapsible/index.d.ts.map +1 -0
- package/dist/lib/components/DangerZone/DangerZone.d.ts +13 -0
- package/dist/lib/components/DangerZone/DangerZone.d.ts.map +1 -0
- package/dist/lib/components/DangerZone/DangerZoneSkeleton.d.ts +9 -0
- package/dist/lib/components/DangerZone/DangerZoneSkeleton.d.ts.map +1 -0
- package/dist/lib/components/DangerZone/index.d.ts +4 -0
- package/dist/lib/components/DangerZone/index.d.ts.map +1 -0
- package/dist/lib/components/DataTable/DataTable.d.ts +6 -0
- package/dist/lib/components/DataTable/DataTable.d.ts.map +1 -0
- package/dist/lib/components/DataTable/components/DataTableColumnHeader.d.ts +12 -0
- package/dist/lib/components/DataTable/components/DataTableColumnHeader.d.ts.map +1 -0
- package/dist/lib/components/DataTable/components/DataTableEmpty.d.ts +13 -0
- package/dist/lib/components/DataTable/components/DataTableEmpty.d.ts.map +1 -0
- package/dist/lib/components/DataTable/components/DataTableFilters.d.ts +11 -0
- package/dist/lib/components/DataTable/components/DataTableFilters.d.ts.map +1 -0
- package/dist/lib/components/DataTable/components/DataTableImportDialog.d.ts +16 -0
- package/dist/lib/components/DataTable/components/DataTableImportDialog.d.ts.map +1 -0
- package/dist/lib/components/DataTable/components/DataTablePagination.d.ts +12 -0
- package/dist/lib/components/DataTable/components/DataTablePagination.d.ts.map +1 -0
- package/dist/lib/components/DataTable/components/DataTableRowDensity.d.ts +11 -0
- package/dist/lib/components/DataTable/components/DataTableRowDensity.d.ts.map +1 -0
- package/dist/lib/components/DataTable/components/DataTableSearch.d.ts +14 -0
- package/dist/lib/components/DataTable/components/DataTableSearch.d.ts.map +1 -0
- package/dist/lib/components/DataTable/components/DataTableSelectionBar.d.ts +14 -0
- package/dist/lib/components/DataTable/components/DataTableSelectionBar.d.ts.map +1 -0
- package/dist/lib/components/DataTable/components/DataTableViewOptions.d.ts +11 -0
- package/dist/lib/components/DataTable/components/DataTableViewOptions.d.ts.map +1 -0
- package/dist/lib/components/DataTable/components/DataTableViewTabs.d.ts +7 -0
- package/dist/lib/components/DataTable/components/DataTableViewTabs.d.ts.map +1 -0
- package/dist/lib/components/DataTable/components/DataTableViewsMenu.d.ts +14 -0
- package/dist/lib/components/DataTable/components/DataTableViewsMenu.d.ts.map +1 -0
- package/dist/lib/components/DataTable/components/FilterWrapper.d.ts +21 -0
- package/dist/lib/components/DataTable/components/FilterWrapper.d.ts.map +1 -0
- package/dist/lib/components/DataTable/components/RowActions.d.ts +20 -0
- package/dist/lib/components/DataTable/components/RowActions.d.ts.map +1 -0
- package/dist/lib/components/DataTable/hooks/useAutoUpsert.d.ts +3 -0
- package/dist/lib/components/DataTable/hooks/useAutoUpsert.d.ts.map +1 -0
- package/dist/lib/components/DataTable/hooks/useDataTable.d.ts +25 -0
- package/dist/lib/components/DataTable/hooks/useDataTable.d.ts.map +1 -0
- package/dist/lib/components/DataTable/index.d.ts +18 -0
- package/dist/lib/components/DataTable/index.d.ts.map +1 -0
- package/dist/lib/components/DataTable/store/store.d.ts +28 -0
- package/dist/lib/components/DataTable/store/store.d.ts.map +1 -0
- package/dist/lib/components/DataTable/store/useTableSlice.d.ts +18 -0
- package/dist/lib/components/DataTable/store/useTableSlice.d.ts.map +1 -0
- package/dist/lib/components/DataTable/types.d.ts +66 -0
- package/dist/lib/components/DataTable/types.d.ts.map +1 -0
- package/dist/lib/components/DataTable/utils.d.ts +10 -0
- package/dist/lib/components/DataTable/utils.d.ts.map +1 -0
- package/dist/lib/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/lib/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/lib/components/Dialog/Dialog.d.ts +31 -0
- package/dist/lib/components/Dialog/Dialog.d.ts.map +1 -0
- package/dist/lib/components/Dialog/index.d.ts +3 -0
- package/dist/lib/components/Dialog/index.d.ts.map +1 -0
- package/dist/lib/components/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/lib/components/DropdownMenu/types.d.ts +10 -1
- package/dist/lib/components/DropdownMenu/types.d.ts.map +1 -1
- package/dist/lib/components/Editor/context/editor-config-context.d.ts +9 -0
- package/dist/lib/components/Editor/context/editor-config-context.d.ts.map +1 -0
- package/dist/lib/components/Editor/context/toolbar-context.d.ts +18 -0
- package/dist/lib/components/Editor/context/toolbar-context.d.ts.map +1 -0
- package/dist/lib/components/Editor/editor-hooks/use-debounce.d.ts +2 -0
- package/dist/lib/components/Editor/editor-hooks/use-debounce.d.ts.map +1 -0
- package/dist/lib/components/Editor/editor-hooks/use-modal.d.ts +6 -0
- package/dist/lib/components/Editor/editor-hooks/use-modal.d.ts.map +1 -0
- package/dist/lib/components/Editor/editor-hooks/use-report.d.ts +2 -0
- package/dist/lib/components/Editor/editor-hooks/use-report.d.ts.map +1 -0
- package/dist/lib/components/Editor/editor-hooks/use-update-toolbar.d.ts +3 -0
- package/dist/lib/components/Editor/editor-hooks/use-update-toolbar.d.ts.map +1 -0
- package/dist/lib/components/Editor/editor-ui/button-group.d.ts +12 -0
- package/dist/lib/components/Editor/editor-ui/button-group.d.ts.map +1 -0
- package/dist/lib/components/Editor/editor-ui/button.d.ts +11 -0
- package/dist/lib/components/Editor/editor-ui/button.d.ts.map +1 -0
- package/dist/lib/components/Editor/editor-ui/code-button.d.ts +8 -0
- package/dist/lib/components/Editor/editor-ui/code-button.d.ts.map +1 -0
- package/dist/lib/components/Editor/editor-ui/color-picker.d.ts +92 -0
- package/dist/lib/components/Editor/editor-ui/color-picker.d.ts.map +1 -0
- package/dist/lib/components/Editor/editor-ui/command.d.ts +19 -0
- package/dist/lib/components/Editor/editor-ui/command.d.ts.map +1 -0
- package/dist/lib/components/Editor/editor-ui/content-editable.d.ts +9 -0
- package/dist/lib/components/Editor/editor-ui/content-editable.d.ts.map +1 -0
- package/dist/lib/components/Editor/editor-ui/dialog.d.ts +16 -0
- package/dist/lib/components/Editor/editor-ui/dialog.d.ts.map +1 -0
- package/dist/lib/components/Editor/editor-ui/image-component.d.ts +16 -0
- package/dist/lib/components/Editor/editor-ui/image-component.d.ts.map +1 -0
- package/dist/lib/components/Editor/editor-ui/image-resizer.d.ts +18 -0
- package/dist/lib/components/Editor/editor-ui/image-resizer.d.ts.map +1 -0
- package/dist/lib/components/Editor/editor-ui/input.d.ts +4 -0
- package/dist/lib/components/Editor/editor-ui/input.d.ts.map +1 -0
- package/dist/lib/components/Editor/editor-ui/label.d.ts +5 -0
- package/dist/lib/components/Editor/editor-ui/label.d.ts.map +1 -0
- package/dist/lib/components/Editor/editor-ui/popover.d.ts +8 -0
- package/dist/lib/components/Editor/editor-ui/popover.d.ts.map +1 -0
- package/dist/lib/components/Editor/editor-ui/scroll-area.d.ts +6 -0
- package/dist/lib/components/Editor/editor-ui/scroll-area.d.ts.map +1 -0
- package/dist/lib/components/Editor/editor-ui/select.d.ts +16 -0
- package/dist/lib/components/Editor/editor-ui/select.d.ts.map +1 -0
- package/dist/lib/components/Editor/editor-ui/separator.d.ts +5 -0
- package/dist/lib/components/Editor/editor-ui/separator.d.ts.map +1 -0
- package/dist/lib/components/Editor/editor-ui/tabs.d.ts +8 -0
- package/dist/lib/components/Editor/editor-ui/tabs.d.ts.map +1 -0
- package/dist/lib/components/Editor/editor-ui/toggle-group.d.ts +8 -0
- package/dist/lib/components/Editor/editor-ui/toggle-group.d.ts.map +1 -0
- package/dist/lib/components/Editor/editor-ui/toggle.d.ts +10 -0
- package/dist/lib/components/Editor/editor-ui/toggle.d.ts.map +1 -0
- package/dist/lib/components/Editor/editor-ui/tooltip.d.ts +8 -0
- package/dist/lib/components/Editor/editor-ui/tooltip.d.ts.map +1 -0
- package/dist/lib/components/Editor/index.d.ts +4 -0
- package/dist/lib/components/Editor/index.d.ts.map +1 -0
- package/dist/lib/components/Editor/nodes/autocomplete-node.d.ts +19 -0
- package/dist/lib/components/Editor/nodes/autocomplete-node.d.ts.map +1 -0
- package/dist/lib/components/Editor/nodes/embeds/tweet-node.d.ts +22 -0
- package/dist/lib/components/Editor/nodes/embeds/tweet-node.d.ts.map +1 -0
- package/dist/lib/components/Editor/nodes/embeds/youtube-node.d.ts +23 -0
- package/dist/lib/components/Editor/nodes/embeds/youtube-node.d.ts.map +1 -0
- package/dist/lib/components/Editor/nodes/emoji-node.d.ts +18 -0
- package/dist/lib/components/Editor/nodes/emoji-node.d.ts.map +1 -0
- package/dist/lib/components/Editor/nodes/image-node.d.ts +49 -0
- package/dist/lib/components/Editor/nodes/image-node.d.ts.map +1 -0
- package/dist/lib/components/Editor/nodes/keyword-node.d.ts +15 -0
- package/dist/lib/components/Editor/nodes/keyword-node.d.ts.map +1 -0
- package/dist/lib/components/Editor/nodes/layout-container-node.d.ts +23 -0
- package/dist/lib/components/Editor/nodes/layout-container-node.d.ts.map +1 -0
- package/dist/lib/components/Editor/nodes/layout-item-node.d.ts +15 -0
- package/dist/lib/components/Editor/nodes/layout-item-node.d.ts.map +1 -0
- package/dist/lib/components/Editor/nodes/mention-node.d.ts +21 -0
- package/dist/lib/components/Editor/nodes/mention-node.d.ts.map +1 -0
- package/dist/lib/components/Editor/nodes/nodes.d.ts +3 -0
- package/dist/lib/components/Editor/nodes/nodes.d.ts.map +1 -0
- package/dist/lib/components/Editor/nodes.d.ts +2 -0
- package/dist/lib/components/Editor/nodes.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/actions/actions-plugin.d.ts +4 -0
- package/dist/lib/components/Editor/plugins/actions/actions-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/actions/character-limit-plugin.d.ts +5 -0
- package/dist/lib/components/Editor/plugins/actions/character-limit-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/actions/clear-editor-plugin.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/actions/clear-editor-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/actions/counter-character-plugin.d.ts +6 -0
- package/dist/lib/components/Editor/plugins/actions/counter-character-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/actions/edit-mode-toggle-plugin.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/actions/edit-mode-toggle-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/actions/import-export-plugin.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/actions/import-export-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/actions/markdown-toggle-plugin.d.ts +6 -0
- package/dist/lib/components/Editor/plugins/actions/markdown-toggle-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/actions/max-length-plugin.d.ts +4 -0
- package/dist/lib/components/Editor/plugins/actions/max-length-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/actions/share-content-plugin.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/actions/share-content-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/actions/speech-to-text-plugin.d.ts +7 -0
- package/dist/lib/components/Editor/plugins/actions/speech-to-text-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/actions/tree-view-plugin.d.ts +3 -0
- package/dist/lib/components/Editor/plugins/actions/tree-view-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/auto-link-plugin.d.ts +3 -0
- package/dist/lib/components/Editor/plugins/auto-link-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/autocomplete-plugin.d.ts +11 -0
- package/dist/lib/components/Editor/plugins/autocomplete-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/code-action-menu-plugin.d.ts +4 -0
- package/dist/lib/components/Editor/plugins/code-action-menu-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/code-highlight-plugin.d.ts +3 -0
- package/dist/lib/components/Editor/plugins/code-highlight-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/component-picker-menu-plugin.d.ts +9 -0
- package/dist/lib/components/Editor/plugins/component-picker-menu-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/context-menu-plugin.d.ts +3 -0
- package/dist/lib/components/Editor/plugins/context-menu-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/drag-drop-paste-plugin.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/drag-drop-paste-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/draggable-block-plugin.d.ts +5 -0
- package/dist/lib/components/Editor/plugins/draggable-block-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/embeds/auto-embed-plugin.d.ts +18 -0
- package/dist/lib/components/Editor/plugins/embeds/auto-embed-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/embeds/twitter-plugin.d.ts +5 -0
- package/dist/lib/components/Editor/plugins/embeds/twitter-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/embeds/youtube-plugin.d.ts +5 -0
- package/dist/lib/components/Editor/plugins/embeds/youtube-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/emoji-picker-plugin.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/emoji-picker-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/emojis-plugin.d.ts +3 -0
- package/dist/lib/components/Editor/plugins/emojis-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/floating-link-editor-plugin.d.ts +7 -0
- package/dist/lib/components/Editor/plugins/floating-link-editor-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/floating-text-format-plugin.d.ts +7 -0
- package/dist/lib/components/Editor/plugins/floating-text-format-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/images-plugin.d.ts +25 -0
- package/dist/lib/components/Editor/plugins/images-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/keywords-plugin.d.ts +3 -0
- package/dist/lib/components/Editor/plugins/keywords-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/layout-plugin.d.ts +13 -0
- package/dist/lib/components/Editor/plugins/layout-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/link-plugin.d.ts +3 -0
- package/dist/lib/components/Editor/plugins/link-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/list-max-indent-level-plugin.d.ts +4 -0
- package/dist/lib/components/Editor/plugins/list-max-indent-level-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/mentions-plugin.d.ts +3 -0
- package/dist/lib/components/Editor/plugins/mentions-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/picker/alignment-picker-plugin.d.ts +5 -0
- package/dist/lib/components/Editor/plugins/picker/alignment-picker-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/picker/bulleted-list-picker-plugin.d.ts +3 -0
- package/dist/lib/components/Editor/plugins/picker/bulleted-list-picker-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/picker/check-list-picker-plugin.d.ts +3 -0
- package/dist/lib/components/Editor/plugins/picker/check-list-picker-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/picker/code-picker-plugin.d.ts +3 -0
- package/dist/lib/components/Editor/plugins/picker/code-picker-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/picker/columns-layout-picker-plugin.d.ts +3 -0
- package/dist/lib/components/Editor/plugins/picker/columns-layout-picker-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/picker/component-picker-menu-plugin.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/picker/component-picker-menu-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/picker/component-picker-option.d.ts +17 -0
- package/dist/lib/components/Editor/plugins/picker/component-picker-option.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/picker/divider-picker-plugin.d.ts +3 -0
- package/dist/lib/components/Editor/plugins/picker/divider-picker-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/picker/embeds-picker-plugin.d.ts +5 -0
- package/dist/lib/components/Editor/plugins/picker/embeds-picker-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/picker/heading-picker-plugin.d.ts +5 -0
- package/dist/lib/components/Editor/plugins/picker/heading-picker-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/picker/image-picker-plugin.d.ts +3 -0
- package/dist/lib/components/Editor/plugins/picker/image-picker-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/picker/numbered-list-picker-plugin.d.ts +3 -0
- package/dist/lib/components/Editor/plugins/picker/numbered-list-picker-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/picker/paragraph-picker-plugin.d.ts +3 -0
- package/dist/lib/components/Editor/plugins/picker/paragraph-picker-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/picker/quote-picker-plugin.d.ts +3 -0
- package/dist/lib/components/Editor/plugins/picker/quote-picker-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/picker/table-picker-plugin.d.ts +6 -0
- package/dist/lib/components/Editor/plugins/picker/table-picker-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/plugins.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/plugins.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/tab-focus-plugin.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/tab-focus-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/table-plugin.d.ts +34 -0
- package/dist/lib/components/Editor/plugins/table-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-format/block-format-data.d.ts +5 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-format/block-format-data.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-format/format-bulleted-list.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-format/format-bulleted-list.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-format/format-check-list.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-format/format-check-list.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-format/format-code-block.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-format/format-code-block.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-format/format-heading.d.ts +5 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-format/format-heading.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-format/format-numbered-list.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-format/format-numbered-list.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-format/format-paragraph.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-format/format-paragraph.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-format/format-quote.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-format/format-quote.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-format-toolbar-plugin.d.ts +4 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-format-toolbar-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-insert/insert-columns-layout.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-insert/insert-columns-layout.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-insert/insert-embeds.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-insert/insert-embeds.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-insert/insert-horizontal-rule.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-insert/insert-horizontal-rule.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-insert/insert-image.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-insert/insert-image.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-insert/insert-table.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-insert/insert-table.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-insert-plugin.d.ts +4 -0
- package/dist/lib/components/Editor/plugins/toolbar/block-insert-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/clear-formatting-toolbar-plugin.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/toolbar/clear-formatting-toolbar-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/code-language-toolbar-plugin.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/toolbar/code-language-toolbar-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/element-format-toolbar-plugin.d.ts +4 -0
- package/dist/lib/components/Editor/plugins/toolbar/element-format-toolbar-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/font-background-toolbar-plugin.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/toolbar/font-background-toolbar-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/font-color-toolbar-plugin.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/toolbar/font-color-toolbar-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/font-family-toolbar-plugin.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/toolbar/font-family-toolbar-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/font-format-toolbar-plugin.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/toolbar/font-format-toolbar-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/font-size-toolbar-plugin.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/toolbar/font-size-toolbar-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/history-toolbar-plugin.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/toolbar/history-toolbar-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/horizontal-rule-toolbar-plugin.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/toolbar/horizontal-rule-toolbar-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/image-toolbar-plugin.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/toolbar/image-toolbar-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/link-toolbar-plugin.d.ts +4 -0
- package/dist/lib/components/Editor/plugins/toolbar/link-toolbar-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/subsuper-toolbar-plugin.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/toolbar/subsuper-toolbar-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/table-toolbar-plugin.d.ts +2 -0
- package/dist/lib/components/Editor/plugins/toolbar/table-toolbar-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/toolbar/toolbar-plugin.d.ts +6 -0
- package/dist/lib/components/Editor/plugins/toolbar/toolbar-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins/typing-pref-plugin.d.ts +4 -0
- package/dist/lib/components/Editor/plugins/typing-pref-plugin.d.ts.map +1 -0
- package/dist/lib/components/Editor/plugins.d.ts +2 -0
- package/dist/lib/components/Editor/plugins.d.ts.map +1 -0
- package/dist/lib/components/Editor/shared/can-use-dom.d.ts +2 -0
- package/dist/lib/components/Editor/shared/can-use-dom.d.ts.map +1 -0
- package/dist/lib/components/Editor/shared/caret-from-point.d.ts +5 -0
- package/dist/lib/components/Editor/shared/caret-from-point.d.ts.map +1 -0
- package/dist/lib/components/Editor/shared/environment.d.ts +18 -0
- package/dist/lib/components/Editor/shared/environment.d.ts.map +1 -0
- package/dist/lib/components/Editor/shared/invariant.d.ts +2 -0
- package/dist/lib/components/Editor/shared/invariant.d.ts.map +1 -0
- package/dist/lib/components/Editor/shared/normalize-class-names.d.ts +2 -0
- package/dist/lib/components/Editor/shared/normalize-class-names.d.ts.map +1 -0
- package/dist/lib/components/Editor/shared/react-patches.d.ts +2 -0
- package/dist/lib/components/Editor/shared/react-patches.d.ts.map +1 -0
- package/dist/lib/components/Editor/shared/react-test-utils.d.ts +3 -0
- package/dist/lib/components/Editor/shared/react-test-utils.d.ts.map +1 -0
- package/dist/lib/components/Editor/shared/simple-diff-with-cursor.d.ts +6 -0
- package/dist/lib/components/Editor/shared/simple-diff-with-cursor.d.ts.map +1 -0
- package/dist/lib/components/Editor/shared/use-layout-effect.d.ts +4 -0
- package/dist/lib/components/Editor/shared/use-layout-effect.d.ts.map +1 -0
- package/dist/lib/components/Editor/shared/warn-only-once.d.ts +2 -0
- package/dist/lib/components/Editor/shared/warn-only-once.d.ts.map +1 -0
- package/dist/lib/components/Editor/themes/editor-theme.d.ts +3 -0
- package/dist/lib/components/Editor/themes/editor-theme.d.ts.map +1 -0
- package/dist/lib/components/Editor/transformers/index.d.ts +16 -0
- package/dist/lib/components/Editor/transformers/index.d.ts.map +1 -0
- package/dist/lib/components/Editor/transformers/markdown-emoji-transformer.d.ts +3 -0
- package/dist/lib/components/Editor/transformers/markdown-emoji-transformer.d.ts.map +1 -0
- package/dist/lib/components/Editor/transformers/markdown-hr-transformer.d.ts +3 -0
- package/dist/lib/components/Editor/transformers/markdown-hr-transformer.d.ts.map +1 -0
- package/dist/lib/components/Editor/transformers/markdown-image-transformer.d.ts +3 -0
- package/dist/lib/components/Editor/transformers/markdown-image-transformer.d.ts.map +1 -0
- package/dist/lib/components/Editor/transformers/markdown-table-transformer.d.ts +3 -0
- package/dist/lib/components/Editor/transformers/markdown-table-transformer.d.ts.map +1 -0
- package/dist/lib/components/Editor/transformers/markdown-tweet-transformer.d.ts +3 -0
- package/dist/lib/components/Editor/transformers/markdown-tweet-transformer.d.ts.map +1 -0
- package/dist/lib/components/Editor/types.d.ts +23 -0
- package/dist/lib/components/Editor/types.d.ts.map +1 -0
- package/dist/lib/components/Editor/utils/can-use-dom.d.ts +2 -0
- package/dist/lib/components/Editor/utils/can-use-dom.d.ts.map +1 -0
- package/dist/lib/components/Editor/utils/collapsible.d.ts +3 -0
- package/dist/lib/components/Editor/utils/collapsible.d.ts.map +1 -0
- package/dist/lib/components/Editor/utils/doc-serialization.d.ts +4 -0
- package/dist/lib/components/Editor/utils/doc-serialization.d.ts.map +1 -0
- package/dist/lib/components/Editor/utils/emoji-list.d.ts +21 -0
- package/dist/lib/components/Editor/utils/emoji-list.d.ts.map +1 -0
- package/dist/lib/components/Editor/utils/get-dom-range-rect.d.ts +2 -0
- package/dist/lib/components/Editor/utils/get-dom-range-rect.d.ts.map +1 -0
- package/dist/lib/components/Editor/utils/get-selected-node.d.ts +3 -0
- package/dist/lib/components/Editor/utils/get-selected-node.d.ts.map +1 -0
- package/dist/lib/components/Editor/utils/guard.d.ts +2 -0
- package/dist/lib/components/Editor/utils/guard.d.ts.map +1 -0
- package/dist/lib/components/Editor/utils/is-mobile-width.d.ts +2 -0
- package/dist/lib/components/Editor/utils/is-mobile-width.d.ts.map +1 -0
- package/dist/lib/components/Editor/utils/set-floating-elem-position-for-link-editor.d.ts +2 -0
- package/dist/lib/components/Editor/utils/set-floating-elem-position-for-link-editor.d.ts.map +1 -0
- package/dist/lib/components/Editor/utils/set-floating-elem-position.d.ts +2 -0
- package/dist/lib/components/Editor/utils/set-floating-elem-position.d.ts.map +1 -0
- package/dist/lib/components/Editor/utils/swipe.d.ts +5 -0
- package/dist/lib/components/Editor/utils/swipe.d.ts.map +1 -0
- package/dist/lib/components/Editor/utils/url.d.ts +3 -0
- package/dist/lib/components/Editor/utils/url.d.ts.map +1 -0
- package/dist/lib/components/Empty/Empty.d.ts +12 -0
- package/dist/lib/components/Empty/Empty.d.ts.map +1 -0
- package/dist/lib/components/Empty/index.d.ts +3 -0
- package/dist/lib/components/Empty/index.d.ts.map +1 -0
- package/dist/lib/components/ErrorBoundary/ErrorBoundary.d.ts +7 -0
- package/dist/lib/components/ErrorBoundary/ErrorBoundary.d.ts.map +1 -0
- package/dist/lib/components/ErrorBoundary/ErrorPage.d.ts +38 -0
- package/dist/lib/components/ErrorBoundary/ErrorPage.d.ts.map +1 -0
- package/dist/lib/components/ErrorBoundary/index.d.ts +3 -0
- package/dist/lib/components/ErrorBoundary/index.d.ts.map +1 -0
- package/dist/lib/components/FilePreview/FilePreview.d.ts +8 -0
- package/dist/lib/components/FilePreview/FilePreview.d.ts.map +1 -0
- package/dist/lib/components/FilePreview/index.d.ts +2 -0
- package/dist/lib/components/FilePreview/index.d.ts.map +1 -0
- package/dist/lib/components/Form/Form.d.ts +6 -3
- package/dist/lib/components/Form/Form.d.ts.map +1 -1
- package/dist/lib/components/HierarchyGraph/HierarchyGraph.d.ts +24 -0
- package/dist/lib/components/HierarchyGraph/HierarchyGraph.d.ts.map +1 -0
- package/dist/lib/components/HierarchyGraph/index.d.ts +5 -0
- package/dist/lib/components/HierarchyGraph/index.d.ts.map +1 -0
- package/dist/lib/components/PageHeader/PageHeader.d.ts +8 -0
- package/dist/lib/components/PageHeader/PageHeader.d.ts.map +1 -0
- package/dist/lib/components/PageHeader/PageHeaderSkeleton.d.ts +10 -0
- package/dist/lib/components/PageHeader/PageHeaderSkeleton.d.ts.map +1 -0
- package/dist/lib/components/PageHeader/index.d.ts +3 -0
- package/dist/lib/components/PageHeader/index.d.ts.map +1 -0
- package/dist/lib/components/PhoneField/PhoneField.d.ts +1 -0
- package/dist/lib/components/PhoneField/PhoneField.d.ts.map +1 -1
- package/dist/lib/components/RadioGroup/RadioGroup.d.ts +23 -0
- package/dist/lib/components/RadioGroup/RadioGroup.d.ts.map +1 -0
- package/dist/lib/components/RadioGroup/index.d.ts +3 -0
- package/dist/lib/components/RadioGroup/index.d.ts.map +1 -0
- package/dist/lib/components/Select/Select.d.ts +21 -0
- package/dist/lib/components/Select/Select.d.ts.map +1 -0
- package/dist/lib/components/Select/SelectFilter.d.ts +20 -0
- package/dist/lib/components/Select/SelectFilter.d.ts.map +1 -0
- package/dist/lib/components/Select/components/MultiSelect/MultiSelect.d.ts +27 -0
- package/dist/lib/components/Select/components/MultiSelect/MultiSelect.d.ts.map +1 -0
- package/dist/lib/components/Select/components/MultiSelect/MultiSelectFilter.d.ts +28 -0
- package/dist/lib/components/Select/components/MultiSelect/MultiSelectFilter.d.ts.map +1 -0
- package/dist/lib/components/Select/components/SingleSelect/SingleSelect.d.ts +41 -0
- package/dist/lib/components/Select/components/SingleSelect/SingleSelect.d.ts.map +1 -0
- package/dist/lib/components/Select/components/SingleSelect/SingleSelectFilter.d.ts +28 -0
- package/dist/lib/components/Select/components/SingleSelect/SingleSelectFilter.d.ts.map +1 -0
- package/dist/lib/components/Select/hooks/useMultiSelect.d.ts +33 -0
- package/dist/lib/components/Select/hooks/useMultiSelect.d.ts.map +1 -0
- package/dist/lib/components/Select/hooks/useSelect.d.ts +25 -0
- package/dist/lib/components/Select/hooks/useSelect.d.ts.map +1 -0
- package/dist/lib/components/Select/hooks/useSingleSelect.d.ts +31 -0
- package/dist/lib/components/Select/hooks/useSingleSelect.d.ts.map +1 -0
- package/dist/lib/components/Select/index.d.ts +40 -0
- package/dist/lib/components/Select/index.d.ts.map +1 -0
- package/dist/lib/components/Select/types.d.ts +38 -0
- package/dist/lib/components/Select/types.d.ts.map +1 -0
- package/dist/lib/components/Sidebar/Sidebar.d.ts +24 -0
- package/dist/lib/components/Sidebar/Sidebar.d.ts.map +1 -0
- package/dist/lib/components/Sidebar/index.d.ts +2 -0
- package/dist/lib/components/Sidebar/index.d.ts.map +1 -0
- package/dist/lib/components/Sortable/Sortable.d.ts +39 -0
- package/dist/lib/components/Sortable/Sortable.d.ts.map +1 -0
- package/dist/lib/components/Sortable/index.d.ts +3 -0
- package/dist/lib/components/Sortable/index.d.ts.map +1 -0
- package/dist/lib/components/StepProgressIndicator/StepProgressIndicator.d.ts +12 -0
- package/dist/lib/components/StepProgressIndicator/StepProgressIndicator.d.ts.map +1 -0
- package/dist/lib/components/StepProgressIndicator/index.d.ts +3 -0
- package/dist/lib/components/StepProgressIndicator/index.d.ts.map +1 -0
- package/dist/lib/components/Switch/Switch.d.ts.map +1 -1
- package/dist/lib/components/Tabs/Tabs.d.ts +27 -0
- package/dist/lib/components/Tabs/Tabs.d.ts.map +1 -0
- package/dist/lib/components/Tabs/TabsSkeleton.d.ts +11 -0
- package/dist/lib/components/Tabs/TabsSkeleton.d.ts.map +1 -0
- package/dist/lib/components/Tabs/index.d.ts +3 -0
- package/dist/lib/components/Tabs/index.d.ts.map +1 -0
- package/dist/lib/components/TextArea/TextArea.d.ts.map +1 -1
- package/dist/lib/components/TextField/TextField.d.ts.map +1 -1
- package/dist/lib/components/UploadFile/UploadFile.d.ts +26 -0
- package/dist/lib/components/UploadFile/UploadFile.d.ts.map +1 -0
- package/dist/lib/components/UploadFile/index.d.ts +2 -0
- package/dist/lib/components/UploadFile/index.d.ts.map +1 -0
- package/dist/lib/components/ValueFilter/ValueFilter.d.ts +11 -0
- package/dist/lib/components/ValueFilter/ValueFilter.d.ts.map +1 -0
- package/dist/lib/components/ValueFilter/index.d.ts +3 -0
- package/dist/lib/components/ValueFilter/index.d.ts.map +1 -0
- package/dist/lib/components/ViewTabs/ViewTabs.d.ts +23 -0
- package/dist/lib/components/ViewTabs/ViewTabs.d.ts.map +1 -0
- package/dist/lib/components/ViewTabs/index.d.ts +3 -0
- package/dist/lib/components/ViewTabs/index.d.ts.map +1 -0
- package/dist/lib/components/index.d.ts +21 -1
- package/dist/lib/components/index.d.ts.map +1 -1
- package/dist/lib/config/index.d.ts +6 -0
- package/dist/lib/config/index.d.ts.map +1 -1
- package/dist/lib/context/ConfirmContext.d.ts +21 -0
- package/dist/lib/context/ConfirmContext.d.ts.map +1 -0
- package/dist/lib/context/ThemeContext.d.ts +1 -1
- package/dist/lib/context/ThemeContext.d.ts.map +1 -1
- package/dist/lib/context/index.d.ts +2 -1
- package/dist/lib/context/index.d.ts.map +1 -1
- package/dist/lib/hooks/index.d.ts +7 -1
- package/dist/lib/hooks/index.d.ts.map +1 -1
- package/dist/lib/hooks/useConfirm.d.ts +4 -0
- package/dist/lib/hooks/useConfirm.d.ts.map +1 -0
- package/dist/lib/hooks/useDialog.d.ts +11 -0
- package/dist/lib/hooks/useDialog.d.ts.map +1 -0
- package/dist/lib/hooks/useIsMobile.d.ts +2 -0
- package/dist/lib/hooks/useIsMobile.d.ts.map +1 -0
- package/dist/lib/hooks/useSSE.d.ts +21 -0
- package/dist/lib/hooks/useSSE.d.ts.map +1 -0
- package/dist/lib/hooks/useSlugParams.d.ts +12 -0
- package/dist/lib/hooks/useSlugParams.d.ts.map +1 -0
- package/dist/lib/hooks/useTimer.d.ts +6 -0
- package/dist/lib/hooks/useTimer.d.ts.map +1 -0
- package/dist/lib/index.d.ts +3 -2
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/selects/app/AppFilter.d.ts +11 -0
- package/dist/lib/selects/app/AppFilter.d.ts.map +1 -0
- package/dist/lib/selects/app/AppSelector.d.ts +4 -0
- package/dist/lib/selects/app/AppSelector.d.ts.map +1 -0
- package/dist/lib/selects/app/index.d.ts +3 -0
- package/dist/lib/selects/app/index.d.ts.map +1 -0
- package/dist/lib/selects/app-code/AppCodeFilter.d.ts +11 -0
- package/dist/lib/selects/app-code/AppCodeFilter.d.ts.map +1 -0
- package/dist/lib/selects/app-code/AppCodeSelector.d.ts +4 -0
- package/dist/lib/selects/app-code/AppCodeSelector.d.ts.map +1 -0
- package/dist/lib/selects/app-code/index.d.ts +3 -0
- package/dist/lib/selects/app-code/index.d.ts.map +1 -0
- package/dist/lib/selects/cloud-provider/CloudProviderFilter.d.ts +11 -0
- package/dist/lib/selects/cloud-provider/CloudProviderFilter.d.ts.map +1 -0
- package/dist/lib/selects/cloud-provider/CloudProviderSelector.d.ts +4 -0
- package/dist/lib/selects/cloud-provider/CloudProviderSelector.d.ts.map +1 -0
- package/dist/lib/selects/cloud-provider/index.d.ts +3 -0
- package/dist/lib/selects/cloud-provider/index.d.ts.map +1 -0
- package/dist/lib/selects/currency/CurrencyFilter.d.ts +11 -0
- package/dist/lib/selects/currency/CurrencyFilter.d.ts.map +1 -0
- package/dist/lib/selects/currency/CurrencySelector.d.ts +4 -0
- package/dist/lib/selects/currency/CurrencySelector.d.ts.map +1 -0
- package/dist/lib/selects/currency/currencies.d.ts +3 -0
- package/dist/lib/selects/currency/currencies.d.ts.map +1 -0
- package/dist/lib/selects/currency/index.d.ts +3 -0
- package/dist/lib/selects/currency/index.d.ts.map +1 -0
- package/dist/lib/selects/deployment/DeploymentFilter.d.ts +11 -0
- package/dist/lib/selects/deployment/DeploymentFilter.d.ts.map +1 -0
- package/dist/lib/selects/deployment/DeploymentSelector.d.ts +4 -0
- package/dist/lib/selects/deployment/DeploymentSelector.d.ts.map +1 -0
- package/dist/lib/selects/deployment/index.d.ts +3 -0
- package/dist/lib/selects/deployment/index.d.ts.map +1 -0
- package/dist/lib/selects/feature/FeatureFilter.d.ts +11 -0
- package/dist/lib/selects/feature/FeatureFilter.d.ts.map +1 -0
- package/dist/lib/selects/feature/FeatureSelector.d.ts +4 -0
- package/dist/lib/selects/feature/FeatureSelector.d.ts.map +1 -0
- package/dist/lib/selects/feature/index.d.ts +3 -0
- package/dist/lib/selects/feature/index.d.ts.map +1 -0
- package/dist/lib/selects/index.d.ts +12 -0
- package/dist/lib/selects/index.d.ts.map +1 -0
- package/dist/lib/selects/industry/IndustryFilter.d.ts +11 -0
- package/dist/lib/selects/industry/IndustryFilter.d.ts.map +1 -0
- package/dist/lib/selects/industry/IndustrySelector.d.ts +4 -0
- package/dist/lib/selects/industry/IndustrySelector.d.ts.map +1 -0
- package/dist/lib/selects/industry/index.d.ts +3 -0
- package/dist/lib/selects/industry/index.d.ts.map +1 -0
- package/dist/lib/selects/locale/LocaleFilter.d.ts +11 -0
- package/dist/lib/selects/locale/LocaleFilter.d.ts.map +1 -0
- package/dist/lib/selects/locale/LocaleSelector.d.ts +4 -0
- package/dist/lib/selects/locale/LocaleSelector.d.ts.map +1 -0
- package/dist/lib/selects/locale/index.d.ts +3 -0
- package/dist/lib/selects/locale/index.d.ts.map +1 -0
- package/dist/lib/selects/locale/locales.d.ts +3 -0
- package/dist/lib/selects/locale/locales.d.ts.map +1 -0
- package/dist/lib/selects/microfrontend/MicrofrontendSelector.d.ts +4 -0
- package/dist/lib/selects/microfrontend/MicrofrontendSelector.d.ts.map +1 -0
- package/dist/lib/selects/microfrontend/index.d.ts +2 -0
- package/dist/lib/selects/microfrontend/index.d.ts.map +1 -0
- package/dist/lib/selects/plan/PlanFilter.d.ts +11 -0
- package/dist/lib/selects/plan/PlanFilter.d.ts.map +1 -0
- package/dist/lib/selects/plan/PlanSelector.d.ts +4 -0
- package/dist/lib/selects/plan/PlanSelector.d.ts.map +1 -0
- package/dist/lib/selects/plan/index.d.ts +3 -0
- package/dist/lib/selects/plan/index.d.ts.map +1 -0
- package/dist/lib/selects/region/RegionFilter.d.ts +11 -0
- package/dist/lib/selects/region/RegionFilter.d.ts.map +1 -0
- package/dist/lib/selects/region/RegionSelector.d.ts +4 -0
- package/dist/lib/selects/region/RegionSelector.d.ts.map +1 -0
- package/dist/lib/selects/region/index.d.ts +3 -0
- package/dist/lib/selects/region/index.d.ts.map +1 -0
- package/dist/lib/selects/timezone/TimezoneFilter.d.ts +11 -0
- package/dist/lib/selects/timezone/TimezoneFilter.d.ts.map +1 -0
- package/dist/lib/selects/timezone/TimezoneSelector.d.ts +4 -0
- package/dist/lib/selects/timezone/TimezoneSelector.d.ts.map +1 -0
- package/dist/lib/selects/timezone/index.d.ts +3 -0
- package/dist/lib/selects/timezone/index.d.ts.map +1 -0
- package/dist/lib/selects/timezone/timezones.d.ts +3 -0
- package/dist/lib/selects/timezone/timezones.d.ts.map +1 -0
- package/dist/lib/services/table-views.service.d.ts +25 -0
- package/dist/lib/services/table-views.service.d.ts.map +1 -0
- package/dist/lib/types/api-response.d.ts +21 -0
- package/dist/lib/types/api-response.d.ts.map +1 -0
- package/dist/lib/types/table-filter.d.ts +41 -0
- package/dist/lib/types/table-filter.d.ts.map +1 -0
- package/dist/lib/utils/axios.d.ts.map +1 -1
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/lib/utils/index.d.ts.map +1 -1
- package/dist/lib/utils/motion.d.ts +2 -0
- package/dist/lib/utils/motion.d.ts.map +1 -0
- package/dist/lib/utils/slug.d.ts +7 -0
- package/dist/lib/utils/slug.d.ts.map +1 -0
- package/dist/plus.js +18 -0
- package/dist/plus.js.map +1 -0
- package/dist/popover.js +33 -0
- package/dist/popover.js.map +1 -0
- package/dist/proxy.js +11392 -0
- package/dist/proxy.js.map +1 -0
- package/dist/react-error-boundary.js +67 -0
- package/dist/react-error-boundary.js.map +1 -0
- package/dist/select2.js +116 -0
- package/dist/select2.js.map +1 -0
- package/dist/selects/app-code.js +37 -0
- package/dist/selects/app-code.js.map +1 -0
- package/dist/selects/app.js +2 -0
- package/dist/selects/app.js.map +1 -0
- package/dist/selects/cloud-provider.js +2 -0
- package/dist/selects/cloud-provider.js.map +1 -0
- package/dist/selects/currency.js +2 -0
- package/dist/selects/currency.js.map +1 -0
- package/dist/selects/deployment.js +2 -0
- package/dist/selects/deployment.js.map +1 -0
- package/dist/selects/feature.js +2 -0
- package/dist/selects/feature.js.map +1 -0
- package/dist/selects/industry.js +2 -0
- package/dist/selects/industry.js.map +1 -0
- package/dist/selects/locale.js +2 -0
- package/dist/selects/locale.js.map +1 -0
- package/dist/selects/microfrontend.js +2 -0
- package/dist/selects/microfrontend.js.map +1 -0
- package/dist/selects/plan.js +2 -0
- package/dist/selects/plan.js.map +1 -0
- package/dist/selects/region.js +2 -0
- package/dist/selects/region.js.map +1 -0
- package/dist/selects/timezone.js +2 -0
- package/dist/selects/timezone.js.map +1 -0
- package/dist/separator2.js +1 -27
- package/dist/separator2.js.map +1 -1
- package/dist/shadcn/index.d.ts +2 -0
- package/dist/shadcn/index.d.ts.map +1 -1
- package/dist/shadcn/shadcnAlert/alert.d.ts.map +1 -1
- package/dist/shadcn/shadcnAlert/index.d.ts +1 -1
- package/dist/shadcn/shadcnAlert/index.d.ts.map +1 -1
- package/dist/shadcn/shadcnBadge/Badge.d.ts +1 -1
- package/dist/shadcn/shadcnBreadcrumb/breadcrumb.d.ts +18 -0
- package/dist/shadcn/shadcnBreadcrumb/breadcrumb.d.ts.map +1 -0
- package/dist/shadcn/shadcnBreadcrumb/index.d.ts +2 -0
- package/dist/shadcn/shadcnBreadcrumb/index.d.ts.map +1 -0
- package/dist/shadcn/shadcnButton/Button.d.ts +2 -2
- package/dist/shadcn/shadcnButton/Button.d.ts.map +1 -1
- package/dist/shadcn/shadcnCalendar/calendar.d.ts +1 -1
- package/dist/shadcn/shadcnCalendar/calendar.d.ts.map +1 -1
- package/dist/shadcn/shadcnChart/Chart.d.ts +2 -2
- package/dist/shadcn/shadcnChart/Chart.d.ts.map +1 -1
- package/dist/shadcn/shadcnCollapsible/collapsible.d.ts +7 -0
- package/dist/shadcn/shadcnCollapsible/collapsible.d.ts.map +1 -0
- package/dist/shadcn/shadcnCollapsible/index.d.ts +2 -0
- package/dist/shadcn/shadcnCollapsible/index.d.ts.map +1 -0
- package/dist/shadcn/shadcnDialog/dialog.d.ts +20 -0
- package/dist/shadcn/shadcnDialog/dialog.d.ts.map +1 -0
- package/dist/shadcn/shadcnDialog/index.d.ts +2 -0
- package/dist/shadcn/shadcnDialog/index.d.ts.map +1 -0
- package/dist/shadcn/shadcnDropdownMenu/dropdown-menu.d.ts +1 -1
- package/dist/shadcn/shadcnDropdownMenu/dropdown-menu.d.ts.map +1 -1
- package/dist/shadcn/shadcnForm/form.d.ts +1 -1
- package/dist/shadcn/shadcnForm/form.d.ts.map +1 -1
- package/dist/shadcn/shadcnInputOTP/InputOTP.d.ts +3 -3
- package/dist/shadcn/shadcnInputOTP/InputOTP.d.ts.map +1 -1
- package/dist/shadcn/shadcnMultiSelect/index.d.ts +3 -0
- package/dist/shadcn/shadcnMultiSelect/index.d.ts.map +1 -0
- package/dist/shadcn/shadcnMultiSelect/multi-select.d.ts +61 -0
- package/dist/shadcn/shadcnMultiSelect/multi-select.d.ts.map +1 -0
- package/dist/shadcn/shadcnProgress/Progress.d.ts +1 -1
- package/dist/shadcn/shadcnProgress/Progress.d.ts.map +1 -1
- package/dist/shadcn/shadcnRadioGroup/RadioGroup.d.ts +6 -0
- package/dist/shadcn/shadcnRadioGroup/RadioGroup.d.ts.map +1 -0
- package/dist/shadcn/shadcnRadioGroup/index.d.ts +2 -0
- package/dist/shadcn/shadcnRadioGroup/index.d.ts.map +1 -0
- package/dist/shadcn/shadcnSheet/sheet.d.ts +1 -1
- package/dist/shadcn/shadcnSheet/sheet.d.ts.map +1 -1
- package/dist/shadcn/shadcnSidebar/index.d.ts +2 -0
- package/dist/shadcn/shadcnSidebar/index.d.ts.map +1 -0
- package/dist/shadcn/shadcnSidebar/sidebar.d.ts +86 -0
- package/dist/shadcn/shadcnSidebar/sidebar.d.ts.map +1 -0
- package/dist/shadcn/shadcnSingleSelect/index.d.ts +3 -0
- package/dist/shadcn/shadcnSingleSelect/index.d.ts.map +1 -0
- package/dist/shadcn/shadcnSingleSelect/single-select.d.ts +61 -0
- package/dist/shadcn/shadcnSingleSelect/single-select.d.ts.map +1 -0
- package/dist/shadcn/shadcnSonner/sonner.d.ts +1 -1
- package/dist/shadcn/shadcnSonner/sonner.d.ts.map +1 -1
- package/dist/shadcn/shadcnSwitch/Switch.d.ts.map +1 -1
- package/dist/shadcn/shadcnTable/table.d.ts +1 -1
- package/dist/shadcn/shadcnTable/table.d.ts.map +1 -1
- package/dist/shadcn/shadcnTabs/index.d.ts +2 -0
- package/dist/shadcn/shadcnTabs/index.d.ts.map +1 -0
- package/dist/shadcn/shadcnTabs/tabs.d.ts +8 -0
- package/dist/shadcn/shadcnTabs/tabs.d.ts.map +1 -0
- package/dist/shadcn/shadcnTooltip/tooltip.d.ts +1 -1
- package/dist/shadcn/shadcnTooltip/tooltip.d.ts.map +1 -1
- package/dist/share-2.js +42 -0
- package/dist/share-2.js.map +1 -0
- package/dist/text-align-justify.js +34 -0
- package/dist/text-align-justify.js.map +1 -0
- package/dist/trash-2.js +55 -0
- package/dist/trash-2.js.map +1 -0
- package/dist/types/api-response.js +2 -0
- package/dist/types/api-response.js.map +1 -0
- package/dist/types/table-filter.js +17 -0
- package/dist/types/table-filter.js.map +1 -0
- package/dist/upload.js +19 -0
- package/dist/upload.js.map +1 -0
- package/dist/useConfirm.js +37 -0
- package/dist/useConfirm.js.map +1 -0
- package/dist/useDataTable.js +26545 -0
- package/dist/useDataTable.js.map +1 -0
- package/dist/useIsMobile.js +19 -0
- package/dist/useIsMobile.js.map +1 -0
- package/dist/useTheme.js.map +1 -1
- package/dist/useTimer.js +112 -0
- package/dist/useTimer.js.map +1 -0
- package/dist/utils/axios.js +1 -1
- package/dist/utils/motion.js +4425 -0
- package/dist/utils/motion.js.map +1 -0
- package/dist/utils/slug.js +15 -0
- package/dist/utils/slug.js.map +1 -0
- package/dist/utils.js +204 -39
- package/dist/utils.js.map +1 -1
- package/dist/value.js +820 -0
- package/dist/value.js.map +1 -0
- package/dist/x.js +18 -0
- package/dist/x.js.map +1 -0
- package/package.json +196 -7
- package/dist/SelectField.js +0 -1351
- package/dist/SelectField.js.map +0 -1
- package/dist/chevron-down.js.map +0 -1
- package/dist/components/SelectField.js +0 -2
- package/dist/components/SelectField.js.map +0 -1
- package/dist/lib/components/SelectField/SelectField.d.ts +0 -24
- package/dist/lib/components/SelectField/SelectField.d.ts.map +0 -1
- package/dist/lib/components/SelectField/index.d.ts +0 -3
- package/dist/lib/components/SelectField/index.d.ts.map +0 -1
package/dist/axios.js
CHANGED
|
@@ -1,74 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const defaultConfig = {
|
|
4
|
-
csrf: {
|
|
5
|
-
endpoint: "/csrf/token",
|
|
6
|
-
enabled: true,
|
|
7
|
-
headerName: "x-csrf-token"
|
|
8
|
-
},
|
|
9
|
-
axios: {
|
|
10
|
-
baseURL: "/api",
|
|
11
|
-
timeout: 3e4,
|
|
12
|
-
withCredentials: true,
|
|
13
|
-
headers: {
|
|
14
|
-
"Content-Type": "application/json",
|
|
15
|
-
Accept: "application/json"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
auth: {
|
|
19
|
-
tokenHeaderName: "Authorization",
|
|
20
|
-
tokenPrefix: "Bearer",
|
|
21
|
-
tokenEndpoint: "cloud-api/auth/token",
|
|
22
|
-
refreshEndpoint: "cloud-api/auth/refresh",
|
|
23
|
-
sessionRecoveryEnabled: true
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
const GLOBAL_CONFIG_KEY = "__QUANTUM_UI_CONFIG__";
|
|
27
|
-
function getGlobalConfig() {
|
|
28
|
-
if (typeof window !== "undefined") {
|
|
29
|
-
const globalWindow = window;
|
|
30
|
-
if (!globalWindow[GLOBAL_CONFIG_KEY]) {
|
|
31
|
-
globalWindow[GLOBAL_CONFIG_KEY] = { ...defaultConfig };
|
|
32
|
-
}
|
|
33
|
-
return globalWindow[GLOBAL_CONFIG_KEY] ?? { ...defaultConfig };
|
|
34
|
-
}
|
|
35
|
-
return { ...defaultConfig };
|
|
36
|
-
}
|
|
37
|
-
function setGlobalConfig(config) {
|
|
38
|
-
if (typeof window !== "undefined") {
|
|
39
|
-
window[GLOBAL_CONFIG_KEY] = config;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
function defineConfig(config) {
|
|
43
|
-
return config;
|
|
44
|
-
}
|
|
45
|
-
function configureQuantumUI(userConfig) {
|
|
46
|
-
const newConfig = {
|
|
47
|
-
csrf: {
|
|
48
|
-
...defaultConfig.csrf,
|
|
49
|
-
...userConfig.csrf || {}
|
|
50
|
-
},
|
|
51
|
-
axios: {
|
|
52
|
-
...defaultConfig.axios,
|
|
53
|
-
...userConfig.axios || {},
|
|
54
|
-
headers: {
|
|
55
|
-
...defaultConfig.axios.headers,
|
|
56
|
-
...userConfig.axios?.headers || {}
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
auth: {
|
|
60
|
-
...defaultConfig.auth,
|
|
61
|
-
...userConfig.auth || {}
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
setGlobalConfig(newConfig);
|
|
65
|
-
}
|
|
66
|
-
function getConfig() {
|
|
67
|
-
return getGlobalConfig();
|
|
68
|
-
}
|
|
69
|
-
function resetConfig() {
|
|
70
|
-
setGlobalConfig({ ...defaultConfig });
|
|
71
|
-
}
|
|
1
|
+
import { t as toast, g as generateToastId } from './toast.js';
|
|
72
2
|
|
|
73
3
|
/**
|
|
74
4
|
* Create a bound version of a function with a specified `this` context
|
|
@@ -85,30 +15,30 @@ function bind(fn, thisArg) {
|
|
|
85
15
|
|
|
86
16
|
// utils is a library of generic helper functions non-specific to axios
|
|
87
17
|
|
|
88
|
-
const {toString} = Object.prototype;
|
|
89
|
-
const {getPrototypeOf} = Object;
|
|
90
|
-
const {iterator, toStringTag} = Symbol;
|
|
18
|
+
const { toString } = Object.prototype;
|
|
19
|
+
const { getPrototypeOf } = Object;
|
|
20
|
+
const { iterator, toStringTag } = Symbol;
|
|
91
21
|
|
|
92
|
-
const kindOf = (cache => thing => {
|
|
93
|
-
|
|
94
|
-
|
|
22
|
+
const kindOf = ((cache) => (thing) => {
|
|
23
|
+
const str = toString.call(thing);
|
|
24
|
+
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
95
25
|
})(Object.create(null));
|
|
96
26
|
|
|
97
27
|
const kindOfTest = (type) => {
|
|
98
28
|
type = type.toLowerCase();
|
|
99
|
-
return (thing) => kindOf(thing) === type
|
|
29
|
+
return (thing) => kindOf(thing) === type;
|
|
100
30
|
};
|
|
101
31
|
|
|
102
|
-
const typeOfTest = type => thing => typeof thing === type;
|
|
32
|
+
const typeOfTest = (type) => (thing) => typeof thing === type;
|
|
103
33
|
|
|
104
34
|
/**
|
|
105
|
-
* Determine if a value is
|
|
35
|
+
* Determine if a value is a non-null object
|
|
106
36
|
*
|
|
107
37
|
* @param {Object} val The value to test
|
|
108
38
|
*
|
|
109
39
|
* @returns {boolean} True if value is an Array, otherwise false
|
|
110
40
|
*/
|
|
111
|
-
const {isArray} = Array;
|
|
41
|
+
const { isArray } = Array;
|
|
112
42
|
|
|
113
43
|
/**
|
|
114
44
|
* Determine if a value is undefined
|
|
@@ -127,8 +57,14 @@ const isUndefined = typeOfTest('undefined');
|
|
|
127
57
|
* @returns {boolean} True if value is a Buffer, otherwise false
|
|
128
58
|
*/
|
|
129
59
|
function isBuffer(val) {
|
|
130
|
-
return
|
|
131
|
-
|
|
60
|
+
return (
|
|
61
|
+
val !== null &&
|
|
62
|
+
!isUndefined(val) &&
|
|
63
|
+
val.constructor !== null &&
|
|
64
|
+
!isUndefined(val.constructor) &&
|
|
65
|
+
isFunction$1(val.constructor.isBuffer) &&
|
|
66
|
+
val.constructor.isBuffer(val)
|
|
67
|
+
);
|
|
132
68
|
}
|
|
133
69
|
|
|
134
70
|
/**
|
|
@@ -140,7 +76,6 @@ function isBuffer(val) {
|
|
|
140
76
|
*/
|
|
141
77
|
const isArrayBuffer = kindOfTest('ArrayBuffer');
|
|
142
78
|
|
|
143
|
-
|
|
144
79
|
/**
|
|
145
80
|
* Determine if a value is a view on an ArrayBuffer
|
|
146
81
|
*
|
|
@@ -150,10 +85,10 @@ const isArrayBuffer = kindOfTest('ArrayBuffer');
|
|
|
150
85
|
*/
|
|
151
86
|
function isArrayBufferView(val) {
|
|
152
87
|
let result;
|
|
153
|
-
if (
|
|
88
|
+
if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {
|
|
154
89
|
result = ArrayBuffer.isView(val);
|
|
155
90
|
} else {
|
|
156
|
-
result =
|
|
91
|
+
result = val && val.buffer && isArrayBuffer(val.buffer);
|
|
157
92
|
}
|
|
158
93
|
return result;
|
|
159
94
|
}
|
|
@@ -199,7 +134,7 @@ const isObject = (thing) => thing !== null && typeof thing === 'object';
|
|
|
199
134
|
* @param {*} thing The value to test
|
|
200
135
|
* @returns {boolean} True if value is a Boolean, otherwise false
|
|
201
136
|
*/
|
|
202
|
-
const isBoolean = thing => thing === true || thing === false;
|
|
137
|
+
const isBoolean = (thing) => thing === true || thing === false;
|
|
203
138
|
|
|
204
139
|
/**
|
|
205
140
|
* Determine if a value is a plain Object
|
|
@@ -214,7 +149,13 @@ const isPlainObject = (val) => {
|
|
|
214
149
|
}
|
|
215
150
|
|
|
216
151
|
const prototype = getPrototypeOf(val);
|
|
217
|
-
return (
|
|
152
|
+
return (
|
|
153
|
+
(prototype === null ||
|
|
154
|
+
prototype === Object.prototype ||
|
|
155
|
+
Object.getPrototypeOf(prototype) === null) &&
|
|
156
|
+
!(toStringTag in val) &&
|
|
157
|
+
!(iterator in val)
|
|
158
|
+
);
|
|
218
159
|
};
|
|
219
160
|
|
|
220
161
|
/**
|
|
@@ -256,6 +197,31 @@ const isDate = kindOfTest('Date');
|
|
|
256
197
|
*/
|
|
257
198
|
const isFile = kindOfTest('File');
|
|
258
199
|
|
|
200
|
+
/**
|
|
201
|
+
* Determine if a value is a React Native Blob
|
|
202
|
+
* React Native "blob": an object with a `uri` attribute. Optionally, it can
|
|
203
|
+
* also have a `name` and `type` attribute to specify filename and content type
|
|
204
|
+
*
|
|
205
|
+
* @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71
|
|
206
|
+
*
|
|
207
|
+
* @param {*} value The value to test
|
|
208
|
+
*
|
|
209
|
+
* @returns {boolean} True if value is a React Native Blob, otherwise false
|
|
210
|
+
*/
|
|
211
|
+
const isReactNativeBlob = (value) => {
|
|
212
|
+
return !!(value && typeof value.uri !== 'undefined');
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Determine if environment is React Native
|
|
217
|
+
* ReactNative `FormData` has a non-standard `getParts()` method
|
|
218
|
+
*
|
|
219
|
+
* @param {*} formData The formData to test
|
|
220
|
+
*
|
|
221
|
+
* @returns {boolean} True if environment is React Native, otherwise false
|
|
222
|
+
*/
|
|
223
|
+
const isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined';
|
|
224
|
+
|
|
259
225
|
/**
|
|
260
226
|
* Determine if a value is a Blob
|
|
261
227
|
*
|
|
@@ -290,17 +256,28 @@ const isStream = (val) => isObject(val) && isFunction$1(val.pipe);
|
|
|
290
256
|
*
|
|
291
257
|
* @returns {boolean} True if value is an FormData, otherwise false
|
|
292
258
|
*/
|
|
259
|
+
function getGlobal() {
|
|
260
|
+
if (typeof globalThis !== 'undefined') return globalThis;
|
|
261
|
+
if (typeof self !== 'undefined') return self;
|
|
262
|
+
if (typeof window !== 'undefined') return window;
|
|
263
|
+
if (typeof global !== 'undefined') return global;
|
|
264
|
+
return {};
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
const G = getGlobal();
|
|
268
|
+
const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;
|
|
269
|
+
|
|
293
270
|
const isFormData = (thing) => {
|
|
294
271
|
let kind;
|
|
295
272
|
return thing && (
|
|
296
|
-
(
|
|
273
|
+
(FormDataCtor && thing instanceof FormDataCtor) || (
|
|
297
274
|
isFunction$1(thing.append) && (
|
|
298
275
|
(kind = kindOf(thing)) === 'formdata' ||
|
|
299
276
|
// detect form-data instance
|
|
300
277
|
(kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
|
|
301
278
|
)
|
|
302
279
|
)
|
|
303
|
-
)
|
|
280
|
+
);
|
|
304
281
|
};
|
|
305
282
|
|
|
306
283
|
/**
|
|
@@ -312,7 +289,12 @@ const isFormData = (thing) => {
|
|
|
312
289
|
*/
|
|
313
290
|
const isURLSearchParams = kindOfTest('URLSearchParams');
|
|
314
291
|
|
|
315
|
-
const [isReadableStream, isRequest, isResponse, isHeaders] = [
|
|
292
|
+
const [isReadableStream, isRequest, isResponse, isHeaders] = [
|
|
293
|
+
'ReadableStream',
|
|
294
|
+
'Request',
|
|
295
|
+
'Response',
|
|
296
|
+
'Headers',
|
|
297
|
+
].map(kindOfTest);
|
|
316
298
|
|
|
317
299
|
/**
|
|
318
300
|
* Trim excess whitespace off the beginning and end of a string
|
|
@@ -321,9 +303,9 @@ const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream',
|
|
|
321
303
|
*
|
|
322
304
|
* @returns {String} The String freed of excess whitespace
|
|
323
305
|
*/
|
|
324
|
-
const trim = (str) =>
|
|
325
|
-
str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
|
|
326
|
-
|
|
306
|
+
const trim = (str) => {
|
|
307
|
+
return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
|
|
308
|
+
};
|
|
327
309
|
/**
|
|
328
310
|
* Iterate over an Array or an Object invoking a function for each item.
|
|
329
311
|
*
|
|
@@ -333,13 +315,14 @@ const trim = (str) => str.trim ?
|
|
|
333
315
|
* If 'obj' is an Object callback will be called passing
|
|
334
316
|
* the value, key, and complete object for each property.
|
|
335
317
|
*
|
|
336
|
-
* @param {Object|Array} obj The object to iterate
|
|
318
|
+
* @param {Object|Array<unknown>} obj The object to iterate
|
|
337
319
|
* @param {Function} fn The callback to invoke for each item
|
|
338
320
|
*
|
|
339
|
-
* @param {
|
|
321
|
+
* @param {Object} [options]
|
|
322
|
+
* @param {Boolean} [options.allOwnKeys = false]
|
|
340
323
|
* @returns {any}
|
|
341
324
|
*/
|
|
342
|
-
function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
325
|
+
function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
343
326
|
// Don't bother if no value provided
|
|
344
327
|
if (obj === null || typeof obj === 'undefined') {
|
|
345
328
|
return;
|
|
@@ -377,8 +360,16 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
|
377
360
|
}
|
|
378
361
|
}
|
|
379
362
|
|
|
363
|
+
/**
|
|
364
|
+
* Finds a key in an object, case-insensitive, returning the actual key name.
|
|
365
|
+
* Returns null if the object is a Buffer or if no match is found.
|
|
366
|
+
*
|
|
367
|
+
* @param {Object} obj - The object to search.
|
|
368
|
+
* @param {string} key - The key to find (case-insensitive).
|
|
369
|
+
* @returns {?string} The actual key name if found, otherwise null.
|
|
370
|
+
*/
|
|
380
371
|
function findKey(obj, key) {
|
|
381
|
-
if (isBuffer(obj)){
|
|
372
|
+
if (isBuffer(obj)) {
|
|
382
373
|
return null;
|
|
383
374
|
}
|
|
384
375
|
|
|
@@ -397,8 +388,8 @@ function findKey(obj, key) {
|
|
|
397
388
|
|
|
398
389
|
const _global = (() => {
|
|
399
390
|
/*eslint no-undef:0*/
|
|
400
|
-
if (typeof globalThis !==
|
|
401
|
-
return typeof self !==
|
|
391
|
+
if (typeof globalThis !== 'undefined') return globalThis;
|
|
392
|
+
return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : global;
|
|
402
393
|
})();
|
|
403
394
|
|
|
404
395
|
const isContextDefined = (context) => !isUndefined(context) && context !== _global;
|
|
@@ -413,7 +404,7 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
|
|
|
413
404
|
* Example:
|
|
414
405
|
*
|
|
415
406
|
* ```js
|
|
416
|
-
*
|
|
407
|
+
* const result = merge({foo: 123}, {foo: 456});
|
|
417
408
|
* console.log(result.foo); // outputs 456
|
|
418
409
|
* ```
|
|
419
410
|
*
|
|
@@ -422,10 +413,15 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
|
|
|
422
413
|
* @returns {Object} Result of all merge properties
|
|
423
414
|
*/
|
|
424
415
|
function merge(/* obj1, obj2, obj3, ... */) {
|
|
425
|
-
const {caseless, skipUndefined} = isContextDefined(this) && this || {};
|
|
416
|
+
const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
|
|
426
417
|
const result = {};
|
|
427
418
|
const assignValue = (val, key) => {
|
|
428
|
-
|
|
419
|
+
// Skip dangerous property names to prevent prototype pollution
|
|
420
|
+
if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
const targetKey = (caseless && findKey(result, key)) || key;
|
|
429
425
|
if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
|
|
430
426
|
result[targetKey] = merge(result[targetKey], val);
|
|
431
427
|
} else if (isPlainObject(val)) {
|
|
@@ -450,17 +446,32 @@ function merge(/* obj1, obj2, obj3, ... */) {
|
|
|
450
446
|
* @param {Object} b The object to copy properties from
|
|
451
447
|
* @param {Object} thisArg The object to bind function to
|
|
452
448
|
*
|
|
453
|
-
* @param {
|
|
449
|
+
* @param {Object} [options]
|
|
450
|
+
* @param {Boolean} [options.allOwnKeys]
|
|
454
451
|
* @returns {Object} The resulting value of object a
|
|
455
452
|
*/
|
|
456
|
-
const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
|
|
457
|
-
forEach(
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
453
|
+
const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
|
|
454
|
+
forEach(
|
|
455
|
+
b,
|
|
456
|
+
(val, key) => {
|
|
457
|
+
if (thisArg && isFunction$1(val)) {
|
|
458
|
+
Object.defineProperty(a, key, {
|
|
459
|
+
value: bind(val, thisArg),
|
|
460
|
+
writable: true,
|
|
461
|
+
enumerable: true,
|
|
462
|
+
configurable: true,
|
|
463
|
+
});
|
|
464
|
+
} else {
|
|
465
|
+
Object.defineProperty(a, key, {
|
|
466
|
+
value: val,
|
|
467
|
+
writable: true,
|
|
468
|
+
enumerable: true,
|
|
469
|
+
configurable: true,
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
},
|
|
473
|
+
{ allOwnKeys }
|
|
474
|
+
);
|
|
464
475
|
return a;
|
|
465
476
|
};
|
|
466
477
|
|
|
@@ -472,7 +483,7 @@ const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
|
|
|
472
483
|
* @returns {string} content value without BOM
|
|
473
484
|
*/
|
|
474
485
|
const stripBOM = (content) => {
|
|
475
|
-
if (content.charCodeAt(0) ===
|
|
486
|
+
if (content.charCodeAt(0) === 0xfeff) {
|
|
476
487
|
content = content.slice(1);
|
|
477
488
|
}
|
|
478
489
|
return content;
|
|
@@ -489,9 +500,14 @@ const stripBOM = (content) => {
|
|
|
489
500
|
*/
|
|
490
501
|
const inherits = (constructor, superConstructor, props, descriptors) => {
|
|
491
502
|
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
|
|
492
|
-
constructor.prototype
|
|
503
|
+
Object.defineProperty(constructor.prototype, 'constructor', {
|
|
504
|
+
value: constructor,
|
|
505
|
+
writable: true,
|
|
506
|
+
enumerable: false,
|
|
507
|
+
configurable: true,
|
|
508
|
+
});
|
|
493
509
|
Object.defineProperty(constructor, 'super', {
|
|
494
|
-
value: superConstructor.prototype
|
|
510
|
+
value: superConstructor.prototype,
|
|
495
511
|
});
|
|
496
512
|
props && Object.assign(constructor.prototype, props);
|
|
497
513
|
};
|
|
@@ -550,7 +566,6 @@ const endsWith = (str, searchString, position) => {
|
|
|
550
566
|
return lastIndex !== -1 && lastIndex === position;
|
|
551
567
|
};
|
|
552
568
|
|
|
553
|
-
|
|
554
569
|
/**
|
|
555
570
|
* Returns new array from array like object or null if failed
|
|
556
571
|
*
|
|
@@ -579,9 +594,9 @@ const toArray = (thing) => {
|
|
|
579
594
|
* @returns {Array}
|
|
580
595
|
*/
|
|
581
596
|
// eslint-disable-next-line func-names
|
|
582
|
-
const isTypedArray = (TypedArray => {
|
|
597
|
+
const isTypedArray = ((TypedArray) => {
|
|
583
598
|
// eslint-disable-next-line func-names
|
|
584
|
-
return thing => {
|
|
599
|
+
return (thing) => {
|
|
585
600
|
return TypedArray && thing instanceof TypedArray;
|
|
586
601
|
};
|
|
587
602
|
})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
|
|
@@ -629,16 +644,18 @@ const matchAll = (regExp, str) => {
|
|
|
629
644
|
/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
|
|
630
645
|
const isHTMLForm = kindOfTest('HTMLFormElement');
|
|
631
646
|
|
|
632
|
-
const toCamelCase = str => {
|
|
633
|
-
return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
}
|
|
637
|
-
);
|
|
647
|
+
const toCamelCase = (str) => {
|
|
648
|
+
return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
|
|
649
|
+
return p1.toUpperCase() + p2;
|
|
650
|
+
});
|
|
638
651
|
};
|
|
639
652
|
|
|
640
653
|
/* Creating a function that will check if an object has a property. */
|
|
641
|
-
const hasOwnProperty = (
|
|
654
|
+
const hasOwnProperty = (
|
|
655
|
+
({ hasOwnProperty }) =>
|
|
656
|
+
(obj, prop) =>
|
|
657
|
+
hasOwnProperty.call(obj, prop)
|
|
658
|
+
)(Object.prototype);
|
|
642
659
|
|
|
643
660
|
/**
|
|
644
661
|
* Determine if a value is a RegExp object
|
|
@@ -688,17 +705,25 @@ const freezeMethods = (obj) => {
|
|
|
688
705
|
|
|
689
706
|
if (!descriptor.set) {
|
|
690
707
|
descriptor.set = () => {
|
|
691
|
-
throw Error(
|
|
708
|
+
throw Error("Can not rewrite read-only method '" + name + "'");
|
|
692
709
|
};
|
|
693
710
|
}
|
|
694
711
|
});
|
|
695
712
|
};
|
|
696
713
|
|
|
714
|
+
/**
|
|
715
|
+
* Converts an array or a delimited string into an object set with values as keys and true as values.
|
|
716
|
+
* Useful for fast membership checks.
|
|
717
|
+
*
|
|
718
|
+
* @param {Array|string} arrayOrString - The array or string to convert.
|
|
719
|
+
* @param {string} delimiter - The delimiter to use if input is a string.
|
|
720
|
+
* @returns {Object} An object with keys from the array or string, values set to true.
|
|
721
|
+
*/
|
|
697
722
|
const toObjectSet = (arrayOrString, delimiter) => {
|
|
698
723
|
const obj = {};
|
|
699
724
|
|
|
700
725
|
const define = (arr) => {
|
|
701
|
-
arr.forEach(value => {
|
|
726
|
+
arr.forEach((value) => {
|
|
702
727
|
obj[value] = true;
|
|
703
728
|
});
|
|
704
729
|
};
|
|
@@ -711,11 +736,9 @@ const toObjectSet = (arrayOrString, delimiter) => {
|
|
|
711
736
|
const noop = () => {};
|
|
712
737
|
|
|
713
738
|
const toFiniteNumber = (value, defaultValue) => {
|
|
714
|
-
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
739
|
+
return value != null && Number.isFinite((value = +value)) ? value : defaultValue;
|
|
715
740
|
};
|
|
716
741
|
|
|
717
|
-
|
|
718
|
-
|
|
719
742
|
/**
|
|
720
743
|
* If the thing is a FormData object, return true, otherwise return false.
|
|
721
744
|
*
|
|
@@ -724,14 +747,24 @@ const toFiniteNumber = (value, defaultValue) => {
|
|
|
724
747
|
* @returns {boolean}
|
|
725
748
|
*/
|
|
726
749
|
function isSpecCompliantForm(thing) {
|
|
727
|
-
return !!(
|
|
750
|
+
return !!(
|
|
751
|
+
thing &&
|
|
752
|
+
isFunction$1(thing.append) &&
|
|
753
|
+
thing[toStringTag] === 'FormData' &&
|
|
754
|
+
thing[iterator]
|
|
755
|
+
);
|
|
728
756
|
}
|
|
729
757
|
|
|
758
|
+
/**
|
|
759
|
+
* Recursively converts an object to a JSON-compatible object, handling circular references and Buffers.
|
|
760
|
+
*
|
|
761
|
+
* @param {Object} obj - The object to convert.
|
|
762
|
+
* @returns {Object} The JSON-compatible object.
|
|
763
|
+
*/
|
|
730
764
|
const toJSONObject = (obj) => {
|
|
731
765
|
const stack = new Array(10);
|
|
732
766
|
|
|
733
767
|
const visit = (source, i) => {
|
|
734
|
-
|
|
735
768
|
if (isObject(source)) {
|
|
736
769
|
if (stack.indexOf(source) >= 0) {
|
|
737
770
|
return;
|
|
@@ -742,7 +775,7 @@ const toJSONObject = (obj) => {
|
|
|
742
775
|
return source;
|
|
743
776
|
}
|
|
744
777
|
|
|
745
|
-
if(!('toJSON' in source)) {
|
|
778
|
+
if (!('toJSON' in source)) {
|
|
746
779
|
stack[i] = source;
|
|
747
780
|
const target = isArray(source) ? [] : {};
|
|
748
781
|
|
|
@@ -763,45 +796,77 @@ const toJSONObject = (obj) => {
|
|
|
763
796
|
return visit(obj, 0);
|
|
764
797
|
};
|
|
765
798
|
|
|
799
|
+
/**
|
|
800
|
+
* Determines if a value is an async function.
|
|
801
|
+
*
|
|
802
|
+
* @param {*} thing - The value to test.
|
|
803
|
+
* @returns {boolean} True if value is an async function, otherwise false.
|
|
804
|
+
*/
|
|
766
805
|
const isAsyncFn = kindOfTest('AsyncFunction');
|
|
767
806
|
|
|
807
|
+
/**
|
|
808
|
+
* Determines if a value is thenable (has then and catch methods).
|
|
809
|
+
*
|
|
810
|
+
* @param {*} thing - The value to test.
|
|
811
|
+
* @returns {boolean} True if value is thenable, otherwise false.
|
|
812
|
+
*/
|
|
768
813
|
const isThenable = (thing) =>
|
|
769
|
-
thing &&
|
|
814
|
+
thing &&
|
|
815
|
+
(isObject(thing) || isFunction$1(thing)) &&
|
|
816
|
+
isFunction$1(thing.then) &&
|
|
817
|
+
isFunction$1(thing.catch);
|
|
770
818
|
|
|
771
819
|
// original code
|
|
772
820
|
// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
|
|
773
821
|
|
|
822
|
+
/**
|
|
823
|
+
* Provides a cross-platform setImmediate implementation.
|
|
824
|
+
* Uses native setImmediate if available, otherwise falls back to postMessage or setTimeout.
|
|
825
|
+
*
|
|
826
|
+
* @param {boolean} setImmediateSupported - Whether setImmediate is supported.
|
|
827
|
+
* @param {boolean} postMessageSupported - Whether postMessage is supported.
|
|
828
|
+
* @returns {Function} A function to schedule a callback asynchronously.
|
|
829
|
+
*/
|
|
774
830
|
const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
775
831
|
if (setImmediateSupported) {
|
|
776
832
|
return setImmediate;
|
|
777
833
|
}
|
|
778
834
|
|
|
779
|
-
return postMessageSupported
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
835
|
+
return postMessageSupported
|
|
836
|
+
? ((token, callbacks) => {
|
|
837
|
+
_global.addEventListener(
|
|
838
|
+
'message',
|
|
839
|
+
({ source, data }) => {
|
|
840
|
+
if (source === _global && data === token) {
|
|
841
|
+
callbacks.length && callbacks.shift()();
|
|
842
|
+
}
|
|
843
|
+
},
|
|
844
|
+
false
|
|
845
|
+
);
|
|
785
846
|
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
isFunction$1(_global.postMessage)
|
|
794
|
-
);
|
|
847
|
+
return (cb) => {
|
|
848
|
+
callbacks.push(cb);
|
|
849
|
+
_global.postMessage(token, '*');
|
|
850
|
+
};
|
|
851
|
+
})(`axios@${Math.random()}`, [])
|
|
852
|
+
: (cb) => setTimeout(cb);
|
|
853
|
+
})(typeof setImmediate === 'function', isFunction$1(_global.postMessage));
|
|
795
854
|
|
|
796
|
-
|
|
797
|
-
|
|
855
|
+
/**
|
|
856
|
+
* Schedules a microtask or asynchronous callback as soon as possible.
|
|
857
|
+
* Uses queueMicrotask if available, otherwise falls back to process.nextTick or _setImmediate.
|
|
858
|
+
*
|
|
859
|
+
* @type {Function}
|
|
860
|
+
*/
|
|
861
|
+
const asap =
|
|
862
|
+
typeof queueMicrotask !== 'undefined'
|
|
863
|
+
? queueMicrotask.bind(_global)
|
|
864
|
+
: (typeof process !== 'undefined' && process.nextTick) || _setImmediate;
|
|
798
865
|
|
|
799
866
|
// *********************
|
|
800
867
|
|
|
801
|
-
|
|
802
868
|
const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
|
|
803
869
|
|
|
804
|
-
|
|
805
870
|
const utils$1 = {
|
|
806
871
|
isArray,
|
|
807
872
|
isArrayBuffer,
|
|
@@ -821,6 +886,8 @@ const utils$1 = {
|
|
|
821
886
|
isUndefined,
|
|
822
887
|
isDate,
|
|
823
888
|
isFile,
|
|
889
|
+
isReactNativeBlob,
|
|
890
|
+
isReactNative,
|
|
824
891
|
isBlob,
|
|
825
892
|
isRegExp,
|
|
826
893
|
isFunction: isFunction$1,
|
|
@@ -859,42 +926,60 @@ const utils$1 = {
|
|
|
859
926
|
isThenable,
|
|
860
927
|
setImmediate: _setImmediate,
|
|
861
928
|
asap,
|
|
862
|
-
isIterable
|
|
929
|
+
isIterable,
|
|
863
930
|
};
|
|
864
931
|
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
* @param {Object} [config] The config.
|
|
871
|
-
* @param {Object} [request] The request.
|
|
872
|
-
* @param {Object} [response] The response.
|
|
873
|
-
*
|
|
874
|
-
* @returns {Error} The created error.
|
|
875
|
-
*/
|
|
876
|
-
function AxiosError$1(message, code, config, request, response) {
|
|
877
|
-
Error.call(this);
|
|
932
|
+
let AxiosError$1 = class AxiosError extends Error {
|
|
933
|
+
static from(error, code, config, request, response, customProps) {
|
|
934
|
+
const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
|
|
935
|
+
axiosError.cause = error;
|
|
936
|
+
axiosError.name = error.name;
|
|
878
937
|
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
}
|
|
938
|
+
// Preserve status from the original error if not already set from response
|
|
939
|
+
if (error.status != null && axiosError.status == null) {
|
|
940
|
+
axiosError.status = error.status;
|
|
941
|
+
}
|
|
884
942
|
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
code && (this.code = code);
|
|
888
|
-
config && (this.config = config);
|
|
889
|
-
request && (this.request = request);
|
|
890
|
-
if (response) {
|
|
891
|
-
this.response = response;
|
|
892
|
-
this.status = response.status ? response.status : null;
|
|
943
|
+
customProps && Object.assign(axiosError, customProps);
|
|
944
|
+
return axiosError;
|
|
893
945
|
}
|
|
894
|
-
}
|
|
895
946
|
|
|
896
|
-
|
|
897
|
-
|
|
947
|
+
/**
|
|
948
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
949
|
+
*
|
|
950
|
+
* @param {string} message The error message.
|
|
951
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
952
|
+
* @param {Object} [config] The config.
|
|
953
|
+
* @param {Object} [request] The request.
|
|
954
|
+
* @param {Object} [response] The response.
|
|
955
|
+
*
|
|
956
|
+
* @returns {Error} The created error.
|
|
957
|
+
*/
|
|
958
|
+
constructor(message, code, config, request, response) {
|
|
959
|
+
super(message);
|
|
960
|
+
|
|
961
|
+
// Make message enumerable to maintain backward compatibility
|
|
962
|
+
// The native Error constructor sets message as non-enumerable,
|
|
963
|
+
// but axios < v1.13.3 had it as enumerable
|
|
964
|
+
Object.defineProperty(this, 'message', {
|
|
965
|
+
value: message,
|
|
966
|
+
enumerable: true,
|
|
967
|
+
writable: true,
|
|
968
|
+
configurable: true
|
|
969
|
+
});
|
|
970
|
+
|
|
971
|
+
this.name = 'AxiosError';
|
|
972
|
+
this.isAxiosError = true;
|
|
973
|
+
code && (this.code = code);
|
|
974
|
+
config && (this.config = config);
|
|
975
|
+
request && (this.request = request);
|
|
976
|
+
if (response) {
|
|
977
|
+
this.response = response;
|
|
978
|
+
this.status = response.status;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
toJSON() {
|
|
898
983
|
return {
|
|
899
984
|
// Standard
|
|
900
985
|
message: this.message,
|
|
@@ -910,63 +995,25 @@ utils$1.inherits(AxiosError$1, Error, {
|
|
|
910
995
|
// Axios
|
|
911
996
|
config: utils$1.toJSONObject(this.config),
|
|
912
997
|
code: this.code,
|
|
913
|
-
status: this.status
|
|
998
|
+
status: this.status,
|
|
914
999
|
};
|
|
915
1000
|
}
|
|
916
|
-
});
|
|
917
|
-
|
|
918
|
-
const prototype$1 = AxiosError$1.prototype;
|
|
919
|
-
const descriptors = {};
|
|
920
|
-
|
|
921
|
-
[
|
|
922
|
-
'ERR_BAD_OPTION_VALUE',
|
|
923
|
-
'ERR_BAD_OPTION',
|
|
924
|
-
'ECONNABORTED',
|
|
925
|
-
'ETIMEDOUT',
|
|
926
|
-
'ERR_NETWORK',
|
|
927
|
-
'ERR_FR_TOO_MANY_REDIRECTS',
|
|
928
|
-
'ERR_DEPRECATED',
|
|
929
|
-
'ERR_BAD_RESPONSE',
|
|
930
|
-
'ERR_BAD_REQUEST',
|
|
931
|
-
'ERR_CANCELED',
|
|
932
|
-
'ERR_NOT_SUPPORT',
|
|
933
|
-
'ERR_INVALID_URL'
|
|
934
|
-
// eslint-disable-next-line func-names
|
|
935
|
-
].forEach(code => {
|
|
936
|
-
descriptors[code] = {value: code};
|
|
937
|
-
});
|
|
938
|
-
|
|
939
|
-
Object.defineProperties(AxiosError$1, descriptors);
|
|
940
|
-
Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
|
|
941
|
-
|
|
942
|
-
// eslint-disable-next-line func-names
|
|
943
|
-
AxiosError$1.from = (error, code, config, request, response, customProps) => {
|
|
944
|
-
const axiosError = Object.create(prototype$1);
|
|
945
|
-
|
|
946
|
-
utils$1.toFlatObject(error, axiosError, function filter(obj) {
|
|
947
|
-
return obj !== Error.prototype;
|
|
948
|
-
}, prop => {
|
|
949
|
-
return prop !== 'isAxiosError';
|
|
950
|
-
});
|
|
951
|
-
|
|
952
|
-
const msg = error && error.message ? error.message : 'Error';
|
|
953
|
-
|
|
954
|
-
// Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)
|
|
955
|
-
const errCode = code == null && error ? error.code : code;
|
|
956
|
-
AxiosError$1.call(axiosError, msg, errCode, config, request, response);
|
|
957
|
-
|
|
958
|
-
// Chain the original error on the standard field; non-enumerable to avoid JSON noise
|
|
959
|
-
if (error && axiosError.cause == null) {
|
|
960
|
-
Object.defineProperty(axiosError, 'cause', { value: error, configurable: true });
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
axiosError.name = (error && error.name) || 'Error';
|
|
964
|
-
|
|
965
|
-
customProps && Object.assign(axiosError, customProps);
|
|
966
|
-
|
|
967
|
-
return axiosError;
|
|
968
1001
|
};
|
|
969
1002
|
|
|
1003
|
+
// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
|
|
1004
|
+
AxiosError$1.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
|
|
1005
|
+
AxiosError$1.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
|
|
1006
|
+
AxiosError$1.ECONNABORTED = 'ECONNABORTED';
|
|
1007
|
+
AxiosError$1.ETIMEDOUT = 'ETIMEDOUT';
|
|
1008
|
+
AxiosError$1.ERR_NETWORK = 'ERR_NETWORK';
|
|
1009
|
+
AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
|
|
1010
|
+
AxiosError$1.ERR_DEPRECATED = 'ERR_DEPRECATED';
|
|
1011
|
+
AxiosError$1.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
|
|
1012
|
+
AxiosError$1.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
|
|
1013
|
+
AxiosError$1.ERR_CANCELED = 'ERR_CANCELED';
|
|
1014
|
+
AxiosError$1.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
|
|
1015
|
+
AxiosError$1.ERR_INVALID_URL = 'ERR_INVALID_URL';
|
|
1016
|
+
|
|
970
1017
|
// eslint-disable-next-line strict
|
|
971
1018
|
const httpAdapter = null;
|
|
972
1019
|
|
|
@@ -1003,11 +1050,14 @@ function removeBrackets(key) {
|
|
|
1003
1050
|
*/
|
|
1004
1051
|
function renderKey(path, key, dots) {
|
|
1005
1052
|
if (!path) return key;
|
|
1006
|
-
return path
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1053
|
+
return path
|
|
1054
|
+
.concat(key)
|
|
1055
|
+
.map(function each(token, i) {
|
|
1056
|
+
// eslint-disable-next-line no-param-reassign
|
|
1057
|
+
token = removeBrackets(token);
|
|
1058
|
+
return !dots && i ? '[' + token + ']' : token;
|
|
1059
|
+
})
|
|
1060
|
+
.join(dots ? '.' : '');
|
|
1011
1061
|
}
|
|
1012
1062
|
|
|
1013
1063
|
/**
|
|
@@ -1057,21 +1107,26 @@ function toFormData$1(obj, formData, options) {
|
|
|
1057
1107
|
formData = formData || new (FormData)();
|
|
1058
1108
|
|
|
1059
1109
|
// eslint-disable-next-line no-param-reassign
|
|
1060
|
-
options = utils$1.toFlatObject(
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1110
|
+
options = utils$1.toFlatObject(
|
|
1111
|
+
options,
|
|
1112
|
+
{
|
|
1113
|
+
metaTokens: true,
|
|
1114
|
+
dots: false,
|
|
1115
|
+
indexes: false,
|
|
1116
|
+
},
|
|
1117
|
+
false,
|
|
1118
|
+
function defined(option, source) {
|
|
1119
|
+
// eslint-disable-next-line no-eq-null,eqeqeq
|
|
1120
|
+
return !utils$1.isUndefined(source[option]);
|
|
1121
|
+
}
|
|
1122
|
+
);
|
|
1068
1123
|
|
|
1069
1124
|
const metaTokens = options.metaTokens;
|
|
1070
1125
|
// eslint-disable-next-line no-use-before-define
|
|
1071
1126
|
const visitor = options.visitor || defaultVisitor;
|
|
1072
1127
|
const dots = options.dots;
|
|
1073
1128
|
const indexes = options.indexes;
|
|
1074
|
-
const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
|
|
1129
|
+
const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
|
|
1075
1130
|
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
1076
1131
|
|
|
1077
1132
|
if (!utils$1.isFunction(visitor)) {
|
|
@@ -1113,6 +1168,11 @@ function toFormData$1(obj, formData, options) {
|
|
|
1113
1168
|
function defaultVisitor(value, key, path) {
|
|
1114
1169
|
let arr = value;
|
|
1115
1170
|
|
|
1171
|
+
if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
|
|
1172
|
+
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
1173
|
+
return false;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1116
1176
|
if (value && !path && typeof value === 'object') {
|
|
1117
1177
|
if (utils$1.endsWith(key, '{}')) {
|
|
1118
1178
|
// eslint-disable-next-line no-param-reassign
|
|
@@ -1121,17 +1181,22 @@ function toFormData$1(obj, formData, options) {
|
|
|
1121
1181
|
value = JSON.stringify(value);
|
|
1122
1182
|
} else if (
|
|
1123
1183
|
(utils$1.isArray(value) && isFlatArray(value)) ||
|
|
1124
|
-
((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
|
|
1125
|
-
|
|
1184
|
+
((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)))
|
|
1185
|
+
) {
|
|
1126
1186
|
// eslint-disable-next-line no-param-reassign
|
|
1127
1187
|
key = removeBrackets(key);
|
|
1128
1188
|
|
|
1129
1189
|
arr.forEach(function each(el, index) {
|
|
1130
|
-
!(utils$1.isUndefined(el) || el === null) &&
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1190
|
+
!(utils$1.isUndefined(el) || el === null) &&
|
|
1191
|
+
formData.append(
|
|
1192
|
+
// eslint-disable-next-line no-nested-ternary
|
|
1193
|
+
indexes === true
|
|
1194
|
+
? renderKey([key], index, dots)
|
|
1195
|
+
: indexes === null
|
|
1196
|
+
? key
|
|
1197
|
+
: key + '[]',
|
|
1198
|
+
convertValue(el)
|
|
1199
|
+
);
|
|
1135
1200
|
});
|
|
1136
1201
|
return false;
|
|
1137
1202
|
}
|
|
@@ -1151,7 +1216,7 @@ function toFormData$1(obj, formData, options) {
|
|
|
1151
1216
|
const exposedHelpers = Object.assign(predicates, {
|
|
1152
1217
|
defaultVisitor,
|
|
1153
1218
|
convertValue,
|
|
1154
|
-
isVisitable
|
|
1219
|
+
isVisitable,
|
|
1155
1220
|
});
|
|
1156
1221
|
|
|
1157
1222
|
function build(value, path) {
|
|
@@ -1164,9 +1229,9 @@ function toFormData$1(obj, formData, options) {
|
|
|
1164
1229
|
stack.push(value);
|
|
1165
1230
|
|
|
1166
1231
|
utils$1.forEach(value, function each(el, key) {
|
|
1167
|
-
const result =
|
|
1168
|
-
|
|
1169
|
-
|
|
1232
|
+
const result =
|
|
1233
|
+
!(utils$1.isUndefined(el) || el === null) &&
|
|
1234
|
+
visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
|
|
1170
1235
|
|
|
1171
1236
|
if (result === true) {
|
|
1172
1237
|
build(el, path ? path.concat(key) : [key]);
|
|
@@ -1201,7 +1266,7 @@ function encode$1(str) {
|
|
|
1201
1266
|
')': '%29',
|
|
1202
1267
|
'~': '%7E',
|
|
1203
1268
|
'%20': '+',
|
|
1204
|
-
'%00': '\x00'
|
|
1269
|
+
'%00': '\x00',
|
|
1205
1270
|
};
|
|
1206
1271
|
return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
|
|
1207
1272
|
return charMap[match];
|
|
@@ -1229,13 +1294,17 @@ prototype.append = function append(name, value) {
|
|
|
1229
1294
|
};
|
|
1230
1295
|
|
|
1231
1296
|
prototype.toString = function toString(encoder) {
|
|
1232
|
-
const _encode = encoder
|
|
1233
|
-
|
|
1234
|
-
|
|
1297
|
+
const _encode = encoder
|
|
1298
|
+
? function (value) {
|
|
1299
|
+
return encoder.call(this, value, encode$1);
|
|
1300
|
+
}
|
|
1301
|
+
: encode$1;
|
|
1235
1302
|
|
|
1236
|
-
return this._pairs
|
|
1237
|
-
|
|
1238
|
-
|
|
1303
|
+
return this._pairs
|
|
1304
|
+
.map(function each(pair) {
|
|
1305
|
+
return _encode(pair[0]) + '=' + _encode(pair[1]);
|
|
1306
|
+
}, '')
|
|
1307
|
+
.join('&');
|
|
1239
1308
|
};
|
|
1240
1309
|
|
|
1241
1310
|
/**
|
|
@@ -1247,11 +1316,11 @@ prototype.toString = function toString(encoder) {
|
|
|
1247
1316
|
* @returns {string} The encoded value.
|
|
1248
1317
|
*/
|
|
1249
1318
|
function encode(val) {
|
|
1250
|
-
return encodeURIComponent(val)
|
|
1251
|
-
replace(/%3A/gi, ':')
|
|
1252
|
-
replace(/%24/g, '$')
|
|
1253
|
-
replace(/%2C/gi, ',')
|
|
1254
|
-
replace(/%20/g, '+');
|
|
1319
|
+
return encodeURIComponent(val)
|
|
1320
|
+
.replace(/%3A/gi, ':')
|
|
1321
|
+
.replace(/%24/g, '$')
|
|
1322
|
+
.replace(/%2C/gi, ',')
|
|
1323
|
+
.replace(/%20/g, '+');
|
|
1255
1324
|
}
|
|
1256
1325
|
|
|
1257
1326
|
/**
|
|
@@ -1264,33 +1333,32 @@ function encode(val) {
|
|
|
1264
1333
|
* @returns {string} The formatted url
|
|
1265
1334
|
*/
|
|
1266
1335
|
function buildURL(url, params, options) {
|
|
1267
|
-
/*eslint no-param-reassign:0*/
|
|
1268
1336
|
if (!params) {
|
|
1269
1337
|
return url;
|
|
1270
1338
|
}
|
|
1271
|
-
|
|
1272
|
-
const _encode = options && options.encode || encode;
|
|
1273
1339
|
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1340
|
+
const _encode = (options && options.encode) || encode;
|
|
1341
|
+
|
|
1342
|
+
const _options = utils$1.isFunction(options)
|
|
1343
|
+
? {
|
|
1344
|
+
serialize: options,
|
|
1345
|
+
}
|
|
1346
|
+
: options;
|
|
1279
1347
|
|
|
1280
|
-
const serializeFn =
|
|
1348
|
+
const serializeFn = _options && _options.serialize;
|
|
1281
1349
|
|
|
1282
1350
|
let serializedParams;
|
|
1283
1351
|
|
|
1284
1352
|
if (serializeFn) {
|
|
1285
|
-
serializedParams = serializeFn(params,
|
|
1353
|
+
serializedParams = serializeFn(params, _options);
|
|
1286
1354
|
} else {
|
|
1287
|
-
serializedParams = utils$1.isURLSearchParams(params)
|
|
1288
|
-
params.toString()
|
|
1289
|
-
new AxiosURLSearchParams(params,
|
|
1355
|
+
serializedParams = utils$1.isURLSearchParams(params)
|
|
1356
|
+
? params.toString()
|
|
1357
|
+
: new AxiosURLSearchParams(params, _options).toString(_encode);
|
|
1290
1358
|
}
|
|
1291
1359
|
|
|
1292
1360
|
if (serializedParams) {
|
|
1293
|
-
const hashmarkIndex = url.indexOf(
|
|
1361
|
+
const hashmarkIndex = url.indexOf('#');
|
|
1294
1362
|
|
|
1295
1363
|
if (hashmarkIndex !== -1) {
|
|
1296
1364
|
url = url.slice(0, hashmarkIndex);
|
|
@@ -1311,6 +1379,7 @@ class InterceptorManager {
|
|
|
1311
1379
|
*
|
|
1312
1380
|
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
1313
1381
|
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
1382
|
+
* @param {Object} options The options for the interceptor, synchronous and runWhen
|
|
1314
1383
|
*
|
|
1315
1384
|
* @return {Number} An ID used to remove interceptor later
|
|
1316
1385
|
*/
|
|
@@ -1319,7 +1388,7 @@ class InterceptorManager {
|
|
|
1319
1388
|
fulfilled,
|
|
1320
1389
|
rejected,
|
|
1321
1390
|
synchronous: options ? options.synchronous : false,
|
|
1322
|
-
runWhen: options ? options.runWhen : null
|
|
1391
|
+
runWhen: options ? options.runWhen : null,
|
|
1323
1392
|
});
|
|
1324
1393
|
return this.handlers.length - 1;
|
|
1325
1394
|
}
|
|
@@ -1370,7 +1439,8 @@ class InterceptorManager {
|
|
|
1370
1439
|
const transitionalDefaults = {
|
|
1371
1440
|
silentJSONParsing: true,
|
|
1372
1441
|
forcedJSONParsing: true,
|
|
1373
|
-
clarifyTimeoutError: false
|
|
1442
|
+
clarifyTimeoutError: false,
|
|
1443
|
+
legacyInterceptorReqResOrdering: true,
|
|
1374
1444
|
};
|
|
1375
1445
|
|
|
1376
1446
|
const URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
|
|
@@ -1384,14 +1454,14 @@ const platform$1 = {
|
|
|
1384
1454
|
classes: {
|
|
1385
1455
|
URLSearchParams: URLSearchParams$1,
|
|
1386
1456
|
FormData: FormData$1,
|
|
1387
|
-
Blob: Blob$1
|
|
1457
|
+
Blob: Blob$1,
|
|
1388
1458
|
},
|
|
1389
|
-
protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
|
|
1459
|
+
protocols: ['http', 'https', 'file', 'blob', 'url', 'data'],
|
|
1390
1460
|
};
|
|
1391
1461
|
|
|
1392
1462
|
const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
1393
1463
|
|
|
1394
|
-
const _navigator = typeof navigator === 'object' && navigator || undefined;
|
|
1464
|
+
const _navigator = (typeof navigator === 'object' && navigator) || undefined;
|
|
1395
1465
|
|
|
1396
1466
|
/**
|
|
1397
1467
|
* Determine if we're running in a standard browser environment
|
|
@@ -1410,7 +1480,8 @@ const _navigator = typeof navigator === 'object' && navigator || undefined;
|
|
|
1410
1480
|
*
|
|
1411
1481
|
* @returns {boolean}
|
|
1412
1482
|
*/
|
|
1413
|
-
const hasStandardBrowserEnv =
|
|
1483
|
+
const hasStandardBrowserEnv =
|
|
1484
|
+
hasBrowserEnv &&
|
|
1414
1485
|
(!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
|
|
1415
1486
|
|
|
1416
1487
|
/**
|
|
@@ -1431,7 +1502,7 @@ const hasStandardBrowserWebWorkerEnv = (() => {
|
|
|
1431
1502
|
);
|
|
1432
1503
|
})();
|
|
1433
1504
|
|
|
1434
|
-
const origin = hasBrowserEnv && window.location.href || 'http://localhost';
|
|
1505
|
+
const origin = (hasBrowserEnv && window.location.href) || 'http://localhost';
|
|
1435
1506
|
|
|
1436
1507
|
const utils = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
1437
1508
|
__proto__: null,
|
|
@@ -1444,12 +1515,12 @@ const utils = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
|
1444
1515
|
|
|
1445
1516
|
const platform = {
|
|
1446
1517
|
...utils,
|
|
1447
|
-
...platform$1
|
|
1518
|
+
...platform$1,
|
|
1448
1519
|
};
|
|
1449
1520
|
|
|
1450
1521
|
function toURLEncodedForm(data, options) {
|
|
1451
1522
|
return toFormData$1(data, new platform.classes.URLSearchParams(), {
|
|
1452
|
-
visitor: function(value, key, path, helpers) {
|
|
1523
|
+
visitor: function (value, key, path, helpers) {
|
|
1453
1524
|
if (platform.isNode && utils$1.isBuffer(value)) {
|
|
1454
1525
|
this.append(key, value.toString('base64'));
|
|
1455
1526
|
return false;
|
|
@@ -1457,7 +1528,7 @@ function toURLEncodedForm(data, options) {
|
|
|
1457
1528
|
|
|
1458
1529
|
return helpers.defaultVisitor.apply(this, arguments);
|
|
1459
1530
|
},
|
|
1460
|
-
...options
|
|
1531
|
+
...options,
|
|
1461
1532
|
});
|
|
1462
1533
|
}
|
|
1463
1534
|
|
|
@@ -1473,7 +1544,7 @@ function parsePropPath(name) {
|
|
|
1473
1544
|
// foo.x.y.z
|
|
1474
1545
|
// foo-x-y-z
|
|
1475
1546
|
// foo x y z
|
|
1476
|
-
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
|
|
1547
|
+
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
|
|
1477
1548
|
return match[0] === '[]' ? '' : match[1] || match[0];
|
|
1478
1549
|
});
|
|
1479
1550
|
}
|
|
@@ -1577,96 +1648,107 @@ function stringifySafely(rawValue, parser, encoder) {
|
|
|
1577
1648
|
}
|
|
1578
1649
|
|
|
1579
1650
|
const defaults = {
|
|
1580
|
-
|
|
1581
1651
|
transitional: transitionalDefaults,
|
|
1582
1652
|
|
|
1583
1653
|
adapter: ['xhr', 'http', 'fetch'],
|
|
1584
1654
|
|
|
1585
|
-
transformRequest: [
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1655
|
+
transformRequest: [
|
|
1656
|
+
function transformRequest(data, headers) {
|
|
1657
|
+
const contentType = headers.getContentType() || '';
|
|
1658
|
+
const hasJSONContentType = contentType.indexOf('application/json') > -1;
|
|
1659
|
+
const isObjectPayload = utils$1.isObject(data);
|
|
1589
1660
|
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1661
|
+
if (isObjectPayload && utils$1.isHTMLForm(data)) {
|
|
1662
|
+
data = new FormData(data);
|
|
1663
|
+
}
|
|
1593
1664
|
|
|
1594
|
-
|
|
1665
|
+
const isFormData = utils$1.isFormData(data);
|
|
1595
1666
|
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1667
|
+
if (isFormData) {
|
|
1668
|
+
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
1669
|
+
}
|
|
1599
1670
|
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1671
|
+
if (
|
|
1672
|
+
utils$1.isArrayBuffer(data) ||
|
|
1673
|
+
utils$1.isBuffer(data) ||
|
|
1674
|
+
utils$1.isStream(data) ||
|
|
1675
|
+
utils$1.isFile(data) ||
|
|
1676
|
+
utils$1.isBlob(data) ||
|
|
1677
|
+
utils$1.isReadableStream(data)
|
|
1678
|
+
) {
|
|
1679
|
+
return data;
|
|
1680
|
+
}
|
|
1681
|
+
if (utils$1.isArrayBufferView(data)) {
|
|
1682
|
+
return data.buffer;
|
|
1683
|
+
}
|
|
1684
|
+
if (utils$1.isURLSearchParams(data)) {
|
|
1685
|
+
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
|
|
1686
|
+
return data.toString();
|
|
1687
|
+
}
|
|
1616
1688
|
|
|
1617
|
-
|
|
1689
|
+
let isFileList;
|
|
1618
1690
|
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1691
|
+
if (isObjectPayload) {
|
|
1692
|
+
if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
|
|
1693
|
+
return toURLEncodedForm(data, this.formSerializer).toString();
|
|
1694
|
+
}
|
|
1623
1695
|
|
|
1624
|
-
|
|
1625
|
-
|
|
1696
|
+
if (
|
|
1697
|
+
(isFileList = utils$1.isFileList(data)) ||
|
|
1698
|
+
contentType.indexOf('multipart/form-data') > -1
|
|
1699
|
+
) {
|
|
1700
|
+
const _FormData = this.env && this.env.FormData;
|
|
1626
1701
|
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1702
|
+
return toFormData$1(
|
|
1703
|
+
isFileList ? { 'files[]': data } : data,
|
|
1704
|
+
_FormData && new _FormData(),
|
|
1705
|
+
this.formSerializer
|
|
1706
|
+
);
|
|
1707
|
+
}
|
|
1632
1708
|
}
|
|
1633
|
-
}
|
|
1634
1709
|
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1710
|
+
if (isObjectPayload || hasJSONContentType) {
|
|
1711
|
+
headers.setContentType('application/json', false);
|
|
1712
|
+
return stringifySafely(data);
|
|
1713
|
+
}
|
|
1639
1714
|
|
|
1640
|
-
|
|
1641
|
-
|
|
1715
|
+
return data;
|
|
1716
|
+
},
|
|
1717
|
+
],
|
|
1642
1718
|
|
|
1643
|
-
transformResponse: [
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1719
|
+
transformResponse: [
|
|
1720
|
+
function transformResponse(data) {
|
|
1721
|
+
const transitional = this.transitional || defaults.transitional;
|
|
1722
|
+
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
1723
|
+
const JSONRequested = this.responseType === 'json';
|
|
1647
1724
|
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1725
|
+
if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
|
|
1726
|
+
return data;
|
|
1727
|
+
}
|
|
1651
1728
|
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1729
|
+
if (
|
|
1730
|
+
data &&
|
|
1731
|
+
utils$1.isString(data) &&
|
|
1732
|
+
((forcedJSONParsing && !this.responseType) || JSONRequested)
|
|
1733
|
+
) {
|
|
1734
|
+
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
1735
|
+
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
1655
1736
|
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1737
|
+
try {
|
|
1738
|
+
return JSON.parse(data, this.parseReviver);
|
|
1739
|
+
} catch (e) {
|
|
1740
|
+
if (strictJSONParsing) {
|
|
1741
|
+
if (e.name === 'SyntaxError') {
|
|
1742
|
+
throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
|
|
1743
|
+
}
|
|
1744
|
+
throw e;
|
|
1662
1745
|
}
|
|
1663
|
-
throw e;
|
|
1664
1746
|
}
|
|
1665
1747
|
}
|
|
1666
|
-
}
|
|
1667
1748
|
|
|
1668
|
-
|
|
1669
|
-
|
|
1749
|
+
return data;
|
|
1750
|
+
},
|
|
1751
|
+
],
|
|
1670
1752
|
|
|
1671
1753
|
/**
|
|
1672
1754
|
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
@@ -1682,7 +1764,7 @@ const defaults = {
|
|
|
1682
1764
|
|
|
1683
1765
|
env: {
|
|
1684
1766
|
FormData: platform.classes.FormData,
|
|
1685
|
-
Blob: platform.classes.Blob
|
|
1767
|
+
Blob: platform.classes.Blob,
|
|
1686
1768
|
},
|
|
1687
1769
|
|
|
1688
1770
|
validateStatus: function validateStatus(status) {
|
|
@@ -1691,10 +1773,10 @@ const defaults = {
|
|
|
1691
1773
|
|
|
1692
1774
|
headers: {
|
|
1693
1775
|
common: {
|
|
1694
|
-
|
|
1695
|
-
'Content-Type': undefined
|
|
1696
|
-
}
|
|
1697
|
-
}
|
|
1776
|
+
Accept: 'application/json, text/plain, */*',
|
|
1777
|
+
'Content-Type': undefined,
|
|
1778
|
+
},
|
|
1779
|
+
},
|
|
1698
1780
|
};
|
|
1699
1781
|
|
|
1700
1782
|
utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
|
@@ -1704,10 +1786,23 @@ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
|
|
1704
1786
|
// RawAxiosHeaders whose duplicates are ignored by node
|
|
1705
1787
|
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
|
1706
1788
|
const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
1707
|
-
'age',
|
|
1708
|
-
'
|
|
1709
|
-
'
|
|
1710
|
-
'
|
|
1789
|
+
'age',
|
|
1790
|
+
'authorization',
|
|
1791
|
+
'content-length',
|
|
1792
|
+
'content-type',
|
|
1793
|
+
'etag',
|
|
1794
|
+
'expires',
|
|
1795
|
+
'from',
|
|
1796
|
+
'host',
|
|
1797
|
+
'if-modified-since',
|
|
1798
|
+
'if-unmodified-since',
|
|
1799
|
+
'last-modified',
|
|
1800
|
+
'location',
|
|
1801
|
+
'max-forwards',
|
|
1802
|
+
'proxy-authorization',
|
|
1803
|
+
'referer',
|
|
1804
|
+
'retry-after',
|
|
1805
|
+
'user-agent',
|
|
1711
1806
|
]);
|
|
1712
1807
|
|
|
1713
1808
|
/**
|
|
@@ -1724,31 +1819,32 @@ const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
|
1724
1819
|
*
|
|
1725
1820
|
* @returns {Object} Headers parsed into an object
|
|
1726
1821
|
*/
|
|
1727
|
-
const parseHeaders = rawHeaders => {
|
|
1822
|
+
const parseHeaders = (rawHeaders) => {
|
|
1728
1823
|
const parsed = {};
|
|
1729
1824
|
let key;
|
|
1730
1825
|
let val;
|
|
1731
1826
|
let i;
|
|
1732
1827
|
|
|
1733
|
-
rawHeaders &&
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1828
|
+
rawHeaders &&
|
|
1829
|
+
rawHeaders.split('\n').forEach(function parser(line) {
|
|
1830
|
+
i = line.indexOf(':');
|
|
1831
|
+
key = line.substring(0, i).trim().toLowerCase();
|
|
1832
|
+
val = line.substring(i + 1).trim();
|
|
1737
1833
|
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1834
|
+
if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
|
|
1835
|
+
return;
|
|
1836
|
+
}
|
|
1741
1837
|
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1838
|
+
if (key === 'set-cookie') {
|
|
1839
|
+
if (parsed[key]) {
|
|
1840
|
+
parsed[key].push(val);
|
|
1841
|
+
} else {
|
|
1842
|
+
parsed[key] = [val];
|
|
1843
|
+
}
|
|
1745
1844
|
} else {
|
|
1746
|
-
parsed[key] = [val
|
|
1845
|
+
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
1747
1846
|
}
|
|
1748
|
-
}
|
|
1749
|
-
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
1750
|
-
}
|
|
1751
|
-
});
|
|
1847
|
+
});
|
|
1752
1848
|
|
|
1753
1849
|
return parsed;
|
|
1754
1850
|
};
|
|
@@ -1802,8 +1898,10 @@ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
|
1802
1898
|
}
|
|
1803
1899
|
|
|
1804
1900
|
function formatHeader(header) {
|
|
1805
|
-
return header
|
|
1806
|
-
.
|
|
1901
|
+
return header
|
|
1902
|
+
.trim()
|
|
1903
|
+
.toLowerCase()
|
|
1904
|
+
.replace(/([a-z\d])(\w*)/g, (w, char, str) => {
|
|
1807
1905
|
return char.toUpperCase() + str;
|
|
1808
1906
|
});
|
|
1809
1907
|
}
|
|
@@ -1811,12 +1909,12 @@ function formatHeader(header) {
|
|
|
1811
1909
|
function buildAccessors(obj, header) {
|
|
1812
1910
|
const accessorName = utils$1.toCamelCase(' ' + header);
|
|
1813
1911
|
|
|
1814
|
-
['get', 'set', 'has'].forEach(methodName => {
|
|
1912
|
+
['get', 'set', 'has'].forEach((methodName) => {
|
|
1815
1913
|
Object.defineProperty(obj, methodName + accessorName, {
|
|
1816
|
-
value: function(arg1, arg2, arg3) {
|
|
1914
|
+
value: function (arg1, arg2, arg3) {
|
|
1817
1915
|
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
1818
1916
|
},
|
|
1819
|
-
configurable: true
|
|
1917
|
+
configurable: true,
|
|
1820
1918
|
});
|
|
1821
1919
|
});
|
|
1822
1920
|
}
|
|
@@ -1838,7 +1936,12 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
1838
1936
|
|
|
1839
1937
|
const key = utils$1.findKey(self, lHeader);
|
|
1840
1938
|
|
|
1841
|
-
if
|
|
1939
|
+
if (
|
|
1940
|
+
!key ||
|
|
1941
|
+
self[key] === undefined ||
|
|
1942
|
+
_rewrite === true ||
|
|
1943
|
+
(_rewrite === undefined && self[key] !== false)
|
|
1944
|
+
) {
|
|
1842
1945
|
self[key || _header] = normalizeValue(_value);
|
|
1843
1946
|
}
|
|
1844
1947
|
}
|
|
@@ -1848,17 +1951,22 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
1848
1951
|
|
|
1849
1952
|
if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
|
|
1850
1953
|
setHeaders(header, valueOrRewrite);
|
|
1851
|
-
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
1954
|
+
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
1852
1955
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
1853
1956
|
} else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
|
|
1854
|
-
let obj = {},
|
|
1957
|
+
let obj = {},
|
|
1958
|
+
dest,
|
|
1959
|
+
key;
|
|
1855
1960
|
for (const entry of header) {
|
|
1856
1961
|
if (!utils$1.isArray(entry)) {
|
|
1857
1962
|
throw TypeError('Object iterator must return a key-value pair');
|
|
1858
1963
|
}
|
|
1859
1964
|
|
|
1860
|
-
obj[key = entry[0]] = (dest = obj[key])
|
|
1861
|
-
|
|
1965
|
+
obj[(key = entry[0])] = (dest = obj[key])
|
|
1966
|
+
? utils$1.isArray(dest)
|
|
1967
|
+
? [...dest, entry[1]]
|
|
1968
|
+
: [dest, entry[1]]
|
|
1969
|
+
: entry[1];
|
|
1862
1970
|
}
|
|
1863
1971
|
|
|
1864
1972
|
setHeaders(obj, valueOrRewrite);
|
|
@@ -1905,7 +2013,11 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
1905
2013
|
if (header) {
|
|
1906
2014
|
const key = utils$1.findKey(this, header);
|
|
1907
2015
|
|
|
1908
|
-
return !!(
|
|
2016
|
+
return !!(
|
|
2017
|
+
key &&
|
|
2018
|
+
this[key] !== undefined &&
|
|
2019
|
+
(!matcher || matchHeaderValue(this, this[key], key, matcher))
|
|
2020
|
+
);
|
|
1909
2021
|
}
|
|
1910
2022
|
|
|
1911
2023
|
return false;
|
|
@@ -1945,7 +2057,7 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
1945
2057
|
|
|
1946
2058
|
while (i--) {
|
|
1947
2059
|
const key = keys[i];
|
|
1948
|
-
if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
2060
|
+
if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
1949
2061
|
delete this[key];
|
|
1950
2062
|
deleted = true;
|
|
1951
2063
|
}
|
|
@@ -1989,7 +2101,9 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
1989
2101
|
const obj = Object.create(null);
|
|
1990
2102
|
|
|
1991
2103
|
utils$1.forEach(this, (value, header) => {
|
|
1992
|
-
value != null &&
|
|
2104
|
+
value != null &&
|
|
2105
|
+
value !== false &&
|
|
2106
|
+
(obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
|
|
1993
2107
|
});
|
|
1994
2108
|
|
|
1995
2109
|
return obj;
|
|
@@ -2000,11 +2114,13 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
2000
2114
|
}
|
|
2001
2115
|
|
|
2002
2116
|
toString() {
|
|
2003
|
-
return Object.entries(this.toJSON())
|
|
2117
|
+
return Object.entries(this.toJSON())
|
|
2118
|
+
.map(([header, value]) => header + ': ' + value)
|
|
2119
|
+
.join('\n');
|
|
2004
2120
|
}
|
|
2005
2121
|
|
|
2006
2122
|
getSetCookie() {
|
|
2007
|
-
return this.get(
|
|
2123
|
+
return this.get('set-cookie') || [];
|
|
2008
2124
|
}
|
|
2009
2125
|
|
|
2010
2126
|
get [Symbol.toStringTag]() {
|
|
@@ -2024,9 +2140,12 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
2024
2140
|
}
|
|
2025
2141
|
|
|
2026
2142
|
static accessor(header) {
|
|
2027
|
-
const internals =
|
|
2028
|
-
|
|
2029
|
-
|
|
2143
|
+
const internals =
|
|
2144
|
+
(this[$internals] =
|
|
2145
|
+
this[$internals] =
|
|
2146
|
+
{
|
|
2147
|
+
accessors: {},
|
|
2148
|
+
});
|
|
2030
2149
|
|
|
2031
2150
|
const accessors = internals.accessors;
|
|
2032
2151
|
const prototype = this.prototype;
|
|
@@ -2046,17 +2165,24 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
2046
2165
|
}
|
|
2047
2166
|
};
|
|
2048
2167
|
|
|
2049
|
-
AxiosHeaders$1.accessor([
|
|
2168
|
+
AxiosHeaders$1.accessor([
|
|
2169
|
+
'Content-Type',
|
|
2170
|
+
'Content-Length',
|
|
2171
|
+
'Accept',
|
|
2172
|
+
'Accept-Encoding',
|
|
2173
|
+
'User-Agent',
|
|
2174
|
+
'Authorization',
|
|
2175
|
+
]);
|
|
2050
2176
|
|
|
2051
2177
|
// reserved names hotfix
|
|
2052
|
-
utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({value}, key) => {
|
|
2178
|
+
utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
|
|
2053
2179
|
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
|
2054
2180
|
return {
|
|
2055
2181
|
get: () => value,
|
|
2056
2182
|
set(headerValue) {
|
|
2057
2183
|
this[mapped] = headerValue;
|
|
2058
|
-
}
|
|
2059
|
-
}
|
|
2184
|
+
},
|
|
2185
|
+
};
|
|
2060
2186
|
});
|
|
2061
2187
|
|
|
2062
2188
|
utils$1.freezeMethods(AxiosHeaders$1);
|
|
@@ -2088,24 +2214,22 @@ function isCancel$1(value) {
|
|
|
2088
2214
|
return !!(value && value.__CANCEL__);
|
|
2089
2215
|
}
|
|
2090
2216
|
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
__CANCEL__: true
|
|
2108
|
-
});
|
|
2217
|
+
let CanceledError$1 = class CanceledError extends AxiosError$1 {
|
|
2218
|
+
/**
|
|
2219
|
+
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
2220
|
+
*
|
|
2221
|
+
* @param {string=} message The message.
|
|
2222
|
+
* @param {Object=} config The config.
|
|
2223
|
+
* @param {Object=} request The request.
|
|
2224
|
+
*
|
|
2225
|
+
* @returns {CanceledError} The created error.
|
|
2226
|
+
*/
|
|
2227
|
+
constructor(message, config, request) {
|
|
2228
|
+
super(message == null ? 'canceled' : message, AxiosError$1.ERR_CANCELED, config, request);
|
|
2229
|
+
this.name = 'CanceledError';
|
|
2230
|
+
this.__CANCEL__ = true;
|
|
2231
|
+
}
|
|
2232
|
+
};
|
|
2109
2233
|
|
|
2110
2234
|
/**
|
|
2111
2235
|
* Resolve or reject a Promise based on response status.
|
|
@@ -2121,19 +2245,23 @@ function settle(resolve, reject, response) {
|
|
|
2121
2245
|
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
2122
2246
|
resolve(response);
|
|
2123
2247
|
} else {
|
|
2124
|
-
reject(
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2248
|
+
reject(
|
|
2249
|
+
new AxiosError$1(
|
|
2250
|
+
'Request failed with status code ' + response.status,
|
|
2251
|
+
[AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][
|
|
2252
|
+
Math.floor(response.status / 100) - 4
|
|
2253
|
+
],
|
|
2254
|
+
response.config,
|
|
2255
|
+
response.request,
|
|
2256
|
+
response
|
|
2257
|
+
)
|
|
2258
|
+
);
|
|
2131
2259
|
}
|
|
2132
2260
|
}
|
|
2133
2261
|
|
|
2134
2262
|
function parseProtocol(url) {
|
|
2135
2263
|
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
2136
|
-
return match && match[1] || '';
|
|
2264
|
+
return (match && match[1]) || '';
|
|
2137
2265
|
}
|
|
2138
2266
|
|
|
2139
2267
|
/**
|
|
@@ -2184,7 +2312,7 @@ function speedometer(samplesCount, min) {
|
|
|
2184
2312
|
|
|
2185
2313
|
const passed = startedAt && now - startedAt;
|
|
2186
2314
|
|
|
2187
|
-
return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
|
|
2315
|
+
return passed ? Math.round((bytesCount * 1000) / passed) : undefined;
|
|
2188
2316
|
};
|
|
2189
2317
|
}
|
|
2190
2318
|
|
|
@@ -2213,7 +2341,7 @@ function throttle(fn, freq) {
|
|
|
2213
2341
|
const throttled = (...args) => {
|
|
2214
2342
|
const now = Date.now();
|
|
2215
2343
|
const passed = now - timestamp;
|
|
2216
|
-
if (
|
|
2344
|
+
if (passed >= threshold) {
|
|
2217
2345
|
invoke(args, now);
|
|
2218
2346
|
} else {
|
|
2219
2347
|
lastArgs = args;
|
|
@@ -2235,7 +2363,7 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
|
2235
2363
|
let bytesNotified = 0;
|
|
2236
2364
|
const _speedometer = speedometer(50, 250);
|
|
2237
2365
|
|
|
2238
|
-
return throttle(e => {
|
|
2366
|
+
return throttle((e) => {
|
|
2239
2367
|
const loaded = e.loaded;
|
|
2240
2368
|
const total = e.lengthComputable ? e.total : undefined;
|
|
2241
2369
|
const progressBytes = loaded - bytesNotified;
|
|
@@ -2247,13 +2375,13 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
|
2247
2375
|
const data = {
|
|
2248
2376
|
loaded,
|
|
2249
2377
|
total,
|
|
2250
|
-
progress: total ?
|
|
2378
|
+
progress: total ? loaded / total : undefined,
|
|
2251
2379
|
bytes: progressBytes,
|
|
2252
2380
|
rate: rate ? rate : undefined,
|
|
2253
2381
|
estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
|
|
2254
2382
|
event: e,
|
|
2255
2383
|
lengthComputable: total != null,
|
|
2256
|
-
[isDownloadStream ? 'download' : 'upload']: true
|
|
2384
|
+
[isDownloadStream ? 'download' : 'upload']: true,
|
|
2257
2385
|
};
|
|
2258
2386
|
|
|
2259
2387
|
listener(data);
|
|
@@ -2263,77 +2391,82 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
|
2263
2391
|
const progressEventDecorator = (total, throttled) => {
|
|
2264
2392
|
const lengthComputable = total != null;
|
|
2265
2393
|
|
|
2266
|
-
return [
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2394
|
+
return [
|
|
2395
|
+
(loaded) =>
|
|
2396
|
+
throttled[0]({
|
|
2397
|
+
lengthComputable,
|
|
2398
|
+
total,
|
|
2399
|
+
loaded,
|
|
2400
|
+
}),
|
|
2401
|
+
throttled[1],
|
|
2402
|
+
];
|
|
2271
2403
|
};
|
|
2272
2404
|
|
|
2273
|
-
const asyncDecorator =
|
|
2405
|
+
const asyncDecorator =
|
|
2406
|
+
(fn) =>
|
|
2407
|
+
(...args) =>
|
|
2408
|
+
utils$1.asap(() => fn(...args));
|
|
2274
2409
|
|
|
2275
|
-
const isURLSameOrigin = platform.hasStandardBrowserEnv
|
|
2276
|
-
|
|
2410
|
+
const isURLSameOrigin = platform.hasStandardBrowserEnv
|
|
2411
|
+
? ((origin, isMSIE) => (url) => {
|
|
2412
|
+
url = new URL(url, platform.origin);
|
|
2277
2413
|
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
})(
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
)
|
|
2287
|
-
|
|
2288
|
-
const cookies = platform.hasStandardBrowserEnv ?
|
|
2414
|
+
return (
|
|
2415
|
+
origin.protocol === url.protocol &&
|
|
2416
|
+
origin.host === url.host &&
|
|
2417
|
+
(isMSIE || origin.port === url.port)
|
|
2418
|
+
);
|
|
2419
|
+
})(
|
|
2420
|
+
new URL(platform.origin),
|
|
2421
|
+
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
|
2422
|
+
)
|
|
2423
|
+
: () => true;
|
|
2289
2424
|
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2425
|
+
const cookies = platform.hasStandardBrowserEnv
|
|
2426
|
+
? // Standard browser envs support document.cookie
|
|
2427
|
+
{
|
|
2428
|
+
write(name, value, expires, path, domain, secure, sameSite) {
|
|
2429
|
+
if (typeof document === 'undefined') return;
|
|
2294
2430
|
|
|
2295
|
-
|
|
2431
|
+
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
2296
2432
|
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2433
|
+
if (utils$1.isNumber(expires)) {
|
|
2434
|
+
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
2435
|
+
}
|
|
2436
|
+
if (utils$1.isString(path)) {
|
|
2437
|
+
cookie.push(`path=${path}`);
|
|
2438
|
+
}
|
|
2439
|
+
if (utils$1.isString(domain)) {
|
|
2440
|
+
cookie.push(`domain=${domain}`);
|
|
2441
|
+
}
|
|
2442
|
+
if (secure === true) {
|
|
2443
|
+
cookie.push('secure');
|
|
2444
|
+
}
|
|
2445
|
+
if (utils$1.isString(sameSite)) {
|
|
2446
|
+
cookie.push(`SameSite=${sameSite}`);
|
|
2447
|
+
}
|
|
2312
2448
|
|
|
2313
|
-
|
|
2314
|
-
|
|
2449
|
+
document.cookie = cookie.join('; ');
|
|
2450
|
+
},
|
|
2315
2451
|
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2452
|
+
read(name) {
|
|
2453
|
+
if (typeof document === 'undefined') return null;
|
|
2454
|
+
const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
|
|
2455
|
+
return match ? decodeURIComponent(match[1]) : null;
|
|
2456
|
+
},
|
|
2321
2457
|
|
|
2322
|
-
|
|
2323
|
-
|
|
2458
|
+
remove(name) {
|
|
2459
|
+
this.write(name, '', Date.now() - 86400000, '/');
|
|
2460
|
+
},
|
|
2324
2461
|
}
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
return null;
|
|
2334
|
-
},
|
|
2335
|
-
remove() {}
|
|
2336
|
-
};
|
|
2462
|
+
: // Non-standard browser env (web workers, react-native) lack needed support.
|
|
2463
|
+
{
|
|
2464
|
+
write() {},
|
|
2465
|
+
read() {
|
|
2466
|
+
return null;
|
|
2467
|
+
},
|
|
2468
|
+
remove() {},
|
|
2469
|
+
};
|
|
2337
2470
|
|
|
2338
2471
|
/**
|
|
2339
2472
|
* Determines whether the specified URL is absolute
|
|
@@ -2346,6 +2479,10 @@ function isAbsoluteURL(url) {
|
|
|
2346
2479
|
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
|
2347
2480
|
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
|
2348
2481
|
// by any combination of letters, digits, plus, period, or hyphen.
|
|
2482
|
+
if (typeof url !== 'string') {
|
|
2483
|
+
return false;
|
|
2484
|
+
}
|
|
2485
|
+
|
|
2349
2486
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
2350
2487
|
}
|
|
2351
2488
|
|
|
@@ -2381,7 +2518,7 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
|
2381
2518
|
return requestedURL;
|
|
2382
2519
|
}
|
|
2383
2520
|
|
|
2384
|
-
const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
|
|
2521
|
+
const headersToObject = (thing) => (thing instanceof AxiosHeaders$1 ? { ...thing } : thing);
|
|
2385
2522
|
|
|
2386
2523
|
/**
|
|
2387
2524
|
* Config-specific merge-function which creates a new config-object
|
|
@@ -2399,7 +2536,7 @@ function mergeConfig$1(config1, config2) {
|
|
|
2399
2536
|
|
|
2400
2537
|
function getMergedValue(target, source, prop, caseless) {
|
|
2401
2538
|
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
2402
|
-
return utils$1.merge.call({caseless}, target, source);
|
|
2539
|
+
return utils$1.merge.call({ caseless }, target, source);
|
|
2403
2540
|
} else if (utils$1.isPlainObject(source)) {
|
|
2404
2541
|
return utils$1.merge({}, source);
|
|
2405
2542
|
} else if (utils$1.isArray(source)) {
|
|
@@ -2408,7 +2545,6 @@ function mergeConfig$1(config1, config2) {
|
|
|
2408
2545
|
return source;
|
|
2409
2546
|
}
|
|
2410
2547
|
|
|
2411
|
-
// eslint-disable-next-line consistent-return
|
|
2412
2548
|
function mergeDeepProperties(a, b, prop, caseless) {
|
|
2413
2549
|
if (!utils$1.isUndefined(b)) {
|
|
2414
2550
|
return getMergedValue(a, b, prop, caseless);
|
|
@@ -2471,11 +2607,13 @@ function mergeConfig$1(config1, config2) {
|
|
|
2471
2607
|
socketPath: defaultToConfig2,
|
|
2472
2608
|
responseEncoding: defaultToConfig2,
|
|
2473
2609
|
validateStatus: mergeDirectKeys,
|
|
2474
|
-
headers: (a, b, prop) =>
|
|
2610
|
+
headers: (a, b, prop) =>
|
|
2611
|
+
mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),
|
|
2475
2612
|
};
|
|
2476
2613
|
|
|
2477
|
-
utils$1.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
|
|
2478
|
-
|
|
2614
|
+
utils$1.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
|
|
2615
|
+
if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;
|
|
2616
|
+
const merge = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
|
|
2479
2617
|
const configValue = merge(config1[prop], config2[prop], prop);
|
|
2480
2618
|
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
2481
2619
|
});
|
|
@@ -2490,12 +2628,22 @@ const resolveConfig = (config) => {
|
|
|
2490
2628
|
|
|
2491
2629
|
newConfig.headers = headers = AxiosHeaders$1.from(headers);
|
|
2492
2630
|
|
|
2493
|
-
newConfig.url = buildURL(
|
|
2631
|
+
newConfig.url = buildURL(
|
|
2632
|
+
buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls),
|
|
2633
|
+
config.params,
|
|
2634
|
+
config.paramsSerializer
|
|
2635
|
+
);
|
|
2494
2636
|
|
|
2495
2637
|
// HTTP basic authentication
|
|
2496
2638
|
if (auth) {
|
|
2497
|
-
headers.set(
|
|
2498
|
-
|
|
2639
|
+
headers.set(
|
|
2640
|
+
'Authorization',
|
|
2641
|
+
'Basic ' +
|
|
2642
|
+
btoa(
|
|
2643
|
+
(auth.username || '') +
|
|
2644
|
+
':' +
|
|
2645
|
+
(auth.password ? unescape(encodeURIComponent(auth.password)) : '')
|
|
2646
|
+
)
|
|
2499
2647
|
);
|
|
2500
2648
|
}
|
|
2501
2649
|
|
|
@@ -2513,7 +2661,7 @@ const resolveConfig = (config) => {
|
|
|
2513
2661
|
}
|
|
2514
2662
|
});
|
|
2515
2663
|
}
|
|
2516
|
-
}
|
|
2664
|
+
}
|
|
2517
2665
|
|
|
2518
2666
|
// Add xsrf header
|
|
2519
2667
|
// This is only done if running in a standard browser environment.
|
|
@@ -2537,196 +2685,218 @@ const resolveConfig = (config) => {
|
|
|
2537
2685
|
|
|
2538
2686
|
const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
|
2539
2687
|
|
|
2540
|
-
const xhrAdapter = isXHRAdapterSupported &&
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2688
|
+
const xhrAdapter = isXHRAdapterSupported &&
|
|
2689
|
+
function (config) {
|
|
2690
|
+
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
2691
|
+
const _config = resolveConfig(config);
|
|
2692
|
+
let requestData = _config.data;
|
|
2693
|
+
const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
|
|
2694
|
+
let { responseType, onUploadProgress, onDownloadProgress } = _config;
|
|
2695
|
+
let onCanceled;
|
|
2696
|
+
let uploadThrottled, downloadThrottled;
|
|
2697
|
+
let flushUpload, flushDownload;
|
|
2549
2698
|
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2699
|
+
function done() {
|
|
2700
|
+
flushUpload && flushUpload(); // flush events
|
|
2701
|
+
flushDownload && flushDownload(); // flush events
|
|
2553
2702
|
|
|
2554
|
-
|
|
2703
|
+
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
|
2555
2704
|
|
|
2556
|
-
|
|
2557
|
-
|
|
2705
|
+
_config.signal && _config.signal.removeEventListener('abort', onCanceled);
|
|
2706
|
+
}
|
|
2558
2707
|
|
|
2559
|
-
|
|
2708
|
+
let request = new XMLHttpRequest();
|
|
2560
2709
|
|
|
2561
|
-
|
|
2710
|
+
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
2562
2711
|
|
|
2563
|
-
|
|
2564
|
-
|
|
2712
|
+
// Set the request timeout in MS
|
|
2713
|
+
request.timeout = _config.timeout;
|
|
2565
2714
|
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2715
|
+
function onloadend() {
|
|
2716
|
+
if (!request) {
|
|
2717
|
+
return;
|
|
2718
|
+
}
|
|
2719
|
+
// Prepare the response
|
|
2720
|
+
const responseHeaders = AxiosHeaders$1.from(
|
|
2721
|
+
'getAllResponseHeaders' in request && request.getAllResponseHeaders()
|
|
2722
|
+
);
|
|
2723
|
+
const responseData =
|
|
2724
|
+
!responseType || responseType === 'text' || responseType === 'json'
|
|
2725
|
+
? request.responseText
|
|
2726
|
+
: request.response;
|
|
2727
|
+
const response = {
|
|
2728
|
+
data: responseData,
|
|
2729
|
+
status: request.status,
|
|
2730
|
+
statusText: request.statusText,
|
|
2731
|
+
headers: responseHeaders,
|
|
2732
|
+
config,
|
|
2733
|
+
request,
|
|
2734
|
+
};
|
|
2735
|
+
|
|
2736
|
+
settle(
|
|
2737
|
+
function _resolve(value) {
|
|
2738
|
+
resolve(value);
|
|
2739
|
+
done();
|
|
2740
|
+
},
|
|
2741
|
+
function _reject(err) {
|
|
2742
|
+
reject(err);
|
|
2743
|
+
done();
|
|
2744
|
+
},
|
|
2745
|
+
response
|
|
2746
|
+
);
|
|
2747
|
+
|
|
2748
|
+
// Clean up request
|
|
2749
|
+
request = null;
|
|
2569
2750
|
}
|
|
2570
|
-
// Prepare the response
|
|
2571
|
-
const responseHeaders = AxiosHeaders$1.from(
|
|
2572
|
-
'getAllResponseHeaders' in request && request.getAllResponseHeaders()
|
|
2573
|
-
);
|
|
2574
|
-
const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
|
|
2575
|
-
request.responseText : request.response;
|
|
2576
|
-
const response = {
|
|
2577
|
-
data: responseData,
|
|
2578
|
-
status: request.status,
|
|
2579
|
-
statusText: request.statusText,
|
|
2580
|
-
headers: responseHeaders,
|
|
2581
|
-
config,
|
|
2582
|
-
request
|
|
2583
|
-
};
|
|
2584
2751
|
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
}
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2752
|
+
if ('onloadend' in request) {
|
|
2753
|
+
// Use onloadend if available
|
|
2754
|
+
request.onloadend = onloadend;
|
|
2755
|
+
} else {
|
|
2756
|
+
// Listen for ready state to emulate onloadend
|
|
2757
|
+
request.onreadystatechange = function handleLoad() {
|
|
2758
|
+
if (!request || request.readyState !== 4) {
|
|
2759
|
+
return;
|
|
2760
|
+
}
|
|
2592
2761
|
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2762
|
+
// The request errored out and we didn't get a response, this will be
|
|
2763
|
+
// handled by onerror instead
|
|
2764
|
+
// With one exception: request that using file: protocol, most browsers
|
|
2765
|
+
// will return status as 0 even though it's a successful request
|
|
2766
|
+
if (
|
|
2767
|
+
request.status === 0 &&
|
|
2768
|
+
!(request.responseURL && request.responseURL.indexOf('file:') === 0)
|
|
2769
|
+
) {
|
|
2770
|
+
return;
|
|
2771
|
+
}
|
|
2772
|
+
// readystate handler is calling before onerror or ontimeout handlers,
|
|
2773
|
+
// so we should call onloadend on the next 'tick'
|
|
2774
|
+
setTimeout(onloadend);
|
|
2775
|
+
};
|
|
2776
|
+
}
|
|
2596
2777
|
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
} else {
|
|
2601
|
-
// Listen for ready state to emulate onloadend
|
|
2602
|
-
request.onreadystatechange = function handleLoad() {
|
|
2603
|
-
if (!request || request.readyState !== 4) {
|
|
2778
|
+
// Handle browser request cancellation (as opposed to a manual cancellation)
|
|
2779
|
+
request.onabort = function handleAbort() {
|
|
2780
|
+
if (!request) {
|
|
2604
2781
|
return;
|
|
2605
2782
|
}
|
|
2606
2783
|
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
//
|
|
2610
|
-
|
|
2611
|
-
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
|
|
2612
|
-
return;
|
|
2613
|
-
}
|
|
2614
|
-
// readystate handler is calling before onerror or ontimeout handlers,
|
|
2615
|
-
// so we should call onloadend on the next 'tick'
|
|
2616
|
-
setTimeout(onloadend);
|
|
2784
|
+
reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
|
|
2785
|
+
|
|
2786
|
+
// Clean up request
|
|
2787
|
+
request = null;
|
|
2617
2788
|
};
|
|
2618
|
-
}
|
|
2619
2789
|
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2790
|
+
// Handle low level network errors
|
|
2791
|
+
request.onerror = function handleError(event) {
|
|
2792
|
+
// Browsers deliver a ProgressEvent in XHR onerror
|
|
2793
|
+
// (message may be empty; when present, surface it)
|
|
2794
|
+
// See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
|
|
2795
|
+
const msg = event && event.message ? event.message : 'Network Error';
|
|
2796
|
+
const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
|
|
2797
|
+
// attach the underlying event for consumers who want details
|
|
2798
|
+
err.event = event || null;
|
|
2799
|
+
reject(err);
|
|
2800
|
+
request = null;
|
|
2801
|
+
};
|
|
2802
|
+
|
|
2803
|
+
// Handle timeout
|
|
2804
|
+
request.ontimeout = function handleTimeout() {
|
|
2805
|
+
let timeoutErrorMessage = _config.timeout
|
|
2806
|
+
? 'timeout of ' + _config.timeout + 'ms exceeded'
|
|
2807
|
+
: 'timeout exceeded';
|
|
2808
|
+
const transitional = _config.transitional || transitionalDefaults;
|
|
2809
|
+
if (_config.timeoutErrorMessage) {
|
|
2810
|
+
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
2811
|
+
}
|
|
2812
|
+
reject(
|
|
2813
|
+
new AxiosError$1(
|
|
2814
|
+
timeoutErrorMessage,
|
|
2815
|
+
transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
|
|
2816
|
+
config,
|
|
2817
|
+
request
|
|
2818
|
+
)
|
|
2819
|
+
);
|
|
2625
2820
|
|
|
2626
|
-
|
|
2821
|
+
// Clean up request
|
|
2822
|
+
request = null;
|
|
2823
|
+
};
|
|
2627
2824
|
|
|
2628
|
-
//
|
|
2629
|
-
|
|
2630
|
-
};
|
|
2825
|
+
// Remove Content-Type if data is undefined
|
|
2826
|
+
requestData === undefined && requestHeaders.setContentType(null);
|
|
2631
2827
|
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
const msg = event && event.message ? event.message : 'Network Error';
|
|
2638
|
-
const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
|
|
2639
|
-
// attach the underlying event for consumers who want details
|
|
2640
|
-
err.event = event || null;
|
|
2641
|
-
reject(err);
|
|
2642
|
-
request = null;
|
|
2643
|
-
};
|
|
2644
|
-
|
|
2645
|
-
// Handle timeout
|
|
2646
|
-
request.ontimeout = function handleTimeout() {
|
|
2647
|
-
let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
2648
|
-
const transitional = _config.transitional || transitionalDefaults;
|
|
2649
|
-
if (_config.timeoutErrorMessage) {
|
|
2650
|
-
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
2828
|
+
// Add headers to the request
|
|
2829
|
+
if ('setRequestHeader' in request) {
|
|
2830
|
+
utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
|
2831
|
+
request.setRequestHeader(key, val);
|
|
2832
|
+
});
|
|
2651
2833
|
}
|
|
2652
|
-
reject(new AxiosError$1(
|
|
2653
|
-
timeoutErrorMessage,
|
|
2654
|
-
transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
|
|
2655
|
-
config,
|
|
2656
|
-
request));
|
|
2657
|
-
|
|
2658
|
-
// Clean up request
|
|
2659
|
-
request = null;
|
|
2660
|
-
};
|
|
2661
|
-
|
|
2662
|
-
// Remove Content-Type if data is undefined
|
|
2663
|
-
requestData === undefined && requestHeaders.setContentType(null);
|
|
2664
2834
|
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
});
|
|
2670
|
-
}
|
|
2835
|
+
// Add withCredentials to request if needed
|
|
2836
|
+
if (!utils$1.isUndefined(_config.withCredentials)) {
|
|
2837
|
+
request.withCredentials = !!_config.withCredentials;
|
|
2838
|
+
}
|
|
2671
2839
|
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2840
|
+
// Add responseType to request if needed
|
|
2841
|
+
if (responseType && responseType !== 'json') {
|
|
2842
|
+
request.responseType = _config.responseType;
|
|
2843
|
+
}
|
|
2676
2844
|
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2845
|
+
// Handle progress if needed
|
|
2846
|
+
if (onDownloadProgress) {
|
|
2847
|
+
[downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
|
|
2848
|
+
request.addEventListener('progress', downloadThrottled);
|
|
2849
|
+
}
|
|
2681
2850
|
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
request.addEventListener('progress', downloadThrottled);
|
|
2686
|
-
}
|
|
2851
|
+
// Not all browsers support upload events
|
|
2852
|
+
if (onUploadProgress && request.upload) {
|
|
2853
|
+
[uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
|
|
2687
2854
|
|
|
2688
|
-
|
|
2689
|
-
if (onUploadProgress && request.upload) {
|
|
2690
|
-
([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));
|
|
2855
|
+
request.upload.addEventListener('progress', uploadThrottled);
|
|
2691
2856
|
|
|
2692
|
-
|
|
2857
|
+
request.upload.addEventListener('loadend', flushUpload);
|
|
2858
|
+
}
|
|
2693
2859
|
|
|
2694
|
-
|
|
2695
|
-
|
|
2860
|
+
if (_config.cancelToken || _config.signal) {
|
|
2861
|
+
// Handle cancellation
|
|
2862
|
+
// eslint-disable-next-line func-names
|
|
2863
|
+
onCanceled = (cancel) => {
|
|
2864
|
+
if (!request) {
|
|
2865
|
+
return;
|
|
2866
|
+
}
|
|
2867
|
+
reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
|
|
2868
|
+
request.abort();
|
|
2869
|
+
request = null;
|
|
2870
|
+
};
|
|
2696
2871
|
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
return;
|
|
2872
|
+
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
2873
|
+
if (_config.signal) {
|
|
2874
|
+
_config.signal.aborted
|
|
2875
|
+
? onCanceled()
|
|
2876
|
+
: _config.signal.addEventListener('abort', onCanceled);
|
|
2703
2877
|
}
|
|
2704
|
-
reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
|
|
2705
|
-
request.abort();
|
|
2706
|
-
request = null;
|
|
2707
|
-
};
|
|
2708
|
-
|
|
2709
|
-
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
2710
|
-
if (_config.signal) {
|
|
2711
|
-
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
|
|
2712
2878
|
}
|
|
2713
|
-
}
|
|
2714
2879
|
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
if (protocol && platform.protocols.indexOf(protocol) === -1) {
|
|
2718
|
-
reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config));
|
|
2719
|
-
return;
|
|
2720
|
-
}
|
|
2880
|
+
const protocol = parseProtocol(_config.url);
|
|
2721
2881
|
|
|
2882
|
+
if (protocol && platform.protocols.indexOf(protocol) === -1) {
|
|
2883
|
+
reject(
|
|
2884
|
+
new AxiosError$1(
|
|
2885
|
+
'Unsupported protocol ' + protocol + ':',
|
|
2886
|
+
AxiosError$1.ERR_BAD_REQUEST,
|
|
2887
|
+
config
|
|
2888
|
+
)
|
|
2889
|
+
);
|
|
2890
|
+
return;
|
|
2891
|
+
}
|
|
2722
2892
|
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
};
|
|
2893
|
+
// Send the request
|
|
2894
|
+
request.send(requestData || null);
|
|
2895
|
+
});
|
|
2896
|
+
};
|
|
2727
2897
|
|
|
2728
2898
|
const composeSignals = (signals, timeout) => {
|
|
2729
|
-
const {length} = (signals = signals ? signals.filter(Boolean) : []);
|
|
2899
|
+
const { length } = (signals = signals ? signals.filter(Boolean) : []);
|
|
2730
2900
|
|
|
2731
2901
|
if (timeout || length) {
|
|
2732
2902
|
let controller = new AbortController();
|
|
@@ -2738,21 +2908,29 @@ const composeSignals = (signals, timeout) => {
|
|
|
2738
2908
|
aborted = true;
|
|
2739
2909
|
unsubscribe();
|
|
2740
2910
|
const err = reason instanceof Error ? reason : this.reason;
|
|
2741
|
-
controller.abort(
|
|
2911
|
+
controller.abort(
|
|
2912
|
+
err instanceof AxiosError$1
|
|
2913
|
+
? err
|
|
2914
|
+
: new CanceledError$1(err instanceof Error ? err.message : err)
|
|
2915
|
+
);
|
|
2742
2916
|
}
|
|
2743
2917
|
};
|
|
2744
2918
|
|
|
2745
|
-
let timer =
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2919
|
+
let timer =
|
|
2920
|
+
timeout &&
|
|
2921
|
+
setTimeout(() => {
|
|
2922
|
+
timer = null;
|
|
2923
|
+
onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
|
|
2924
|
+
}, timeout);
|
|
2749
2925
|
|
|
2750
2926
|
const unsubscribe = () => {
|
|
2751
2927
|
if (signals) {
|
|
2752
2928
|
timer && clearTimeout(timer);
|
|
2753
2929
|
timer = null;
|
|
2754
|
-
signals.forEach(signal => {
|
|
2755
|
-
signal.unsubscribe
|
|
2930
|
+
signals.forEach((signal) => {
|
|
2931
|
+
signal.unsubscribe
|
|
2932
|
+
? signal.unsubscribe(onabort)
|
|
2933
|
+
: signal.removeEventListener('abort', onabort);
|
|
2756
2934
|
});
|
|
2757
2935
|
signals = null;
|
|
2758
2936
|
}
|
|
@@ -2760,7 +2938,7 @@ const composeSignals = (signals, timeout) => {
|
|
|
2760
2938
|
|
|
2761
2939
|
signals.forEach((signal) => signal.addEventListener('abort', onabort));
|
|
2762
2940
|
|
|
2763
|
-
const {signal} = controller;
|
|
2941
|
+
const { signal } = controller;
|
|
2764
2942
|
|
|
2765
2943
|
signal.unsubscribe = () => utils$1.asap(unsubscribe);
|
|
2766
2944
|
|
|
@@ -2801,7 +2979,7 @@ const readStream = async function* (stream) {
|
|
|
2801
2979
|
const reader = stream.getReader();
|
|
2802
2980
|
try {
|
|
2803
2981
|
for (;;) {
|
|
2804
|
-
const {done, value} = await reader.read();
|
|
2982
|
+
const { done, value } = await reader.read();
|
|
2805
2983
|
if (done) {
|
|
2806
2984
|
break;
|
|
2807
2985
|
}
|
|
@@ -2824,64 +3002,69 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
|
2824
3002
|
}
|
|
2825
3003
|
};
|
|
2826
3004
|
|
|
2827
|
-
return new ReadableStream(
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
3005
|
+
return new ReadableStream(
|
|
3006
|
+
{
|
|
3007
|
+
async pull(controller) {
|
|
3008
|
+
try {
|
|
3009
|
+
const { done, value } = await iterator.next();
|
|
2831
3010
|
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
3011
|
+
if (done) {
|
|
3012
|
+
_onFinish();
|
|
3013
|
+
controller.close();
|
|
3014
|
+
return;
|
|
3015
|
+
}
|
|
2837
3016
|
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
3017
|
+
let len = value.byteLength;
|
|
3018
|
+
if (onProgress) {
|
|
3019
|
+
let loadedBytes = (bytes += len);
|
|
3020
|
+
onProgress(loadedBytes);
|
|
3021
|
+
}
|
|
3022
|
+
controller.enqueue(new Uint8Array(value));
|
|
3023
|
+
} catch (err) {
|
|
3024
|
+
_onFinish(err);
|
|
3025
|
+
throw err;
|
|
2842
3026
|
}
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
_onFinish(
|
|
2846
|
-
|
|
2847
|
-
}
|
|
3027
|
+
},
|
|
3028
|
+
cancel(reason) {
|
|
3029
|
+
_onFinish(reason);
|
|
3030
|
+
return iterator.return();
|
|
3031
|
+
},
|
|
2848
3032
|
},
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
return iterator.return();
|
|
3033
|
+
{
|
|
3034
|
+
highWaterMark: 2,
|
|
2852
3035
|
}
|
|
2853
|
-
|
|
2854
|
-
highWaterMark: 2
|
|
2855
|
-
})
|
|
3036
|
+
);
|
|
2856
3037
|
};
|
|
2857
3038
|
|
|
2858
3039
|
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
2859
3040
|
|
|
2860
|
-
const {isFunction} = utils$1;
|
|
3041
|
+
const { isFunction } = utils$1;
|
|
2861
3042
|
|
|
2862
|
-
const globalFetchAPI = (({Request, Response}) => ({
|
|
2863
|
-
Request,
|
|
3043
|
+
const globalFetchAPI = (({ Request, Response }) => ({
|
|
3044
|
+
Request,
|
|
3045
|
+
Response,
|
|
2864
3046
|
}))(utils$1.global);
|
|
2865
3047
|
|
|
2866
|
-
const {
|
|
2867
|
-
ReadableStream: ReadableStream$1, TextEncoder
|
|
2868
|
-
} = utils$1.global;
|
|
2869
|
-
|
|
3048
|
+
const { ReadableStream: ReadableStream$1, TextEncoder } = utils$1.global;
|
|
2870
3049
|
|
|
2871
3050
|
const test = (fn, ...args) => {
|
|
2872
3051
|
try {
|
|
2873
3052
|
return !!fn(...args);
|
|
2874
3053
|
} catch (e) {
|
|
2875
|
-
return false
|
|
3054
|
+
return false;
|
|
2876
3055
|
}
|
|
2877
3056
|
};
|
|
2878
3057
|
|
|
2879
3058
|
const factory = (env) => {
|
|
2880
|
-
env = utils$1.merge.call(
|
|
2881
|
-
|
|
2882
|
-
|
|
3059
|
+
env = utils$1.merge.call(
|
|
3060
|
+
{
|
|
3061
|
+
skipUndefined: true,
|
|
3062
|
+
},
|
|
3063
|
+
globalFetchAPI,
|
|
3064
|
+
env
|
|
3065
|
+
);
|
|
2883
3066
|
|
|
2884
|
-
const {fetch: envFetch, Request, Response} = env;
|
|
3067
|
+
const { fetch: envFetch, Request, Response } = env;
|
|
2885
3068
|
const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
|
|
2886
3069
|
const isRequestSupported = isFunction(Request);
|
|
2887
3070
|
const isResponseSupported = isFunction(Response);
|
|
@@ -2892,46 +3075,61 @@ const factory = (env) => {
|
|
|
2892
3075
|
|
|
2893
3076
|
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
|
|
2894
3077
|
|
|
2895
|
-
const encodeText =
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
3078
|
+
const encodeText =
|
|
3079
|
+
isFetchSupported &&
|
|
3080
|
+
(typeof TextEncoder === 'function'
|
|
3081
|
+
? (
|
|
3082
|
+
(encoder) => (str) =>
|
|
3083
|
+
encoder.encode(str)
|
|
3084
|
+
)(new TextEncoder())
|
|
3085
|
+
: async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
|
|
3086
|
+
|
|
3087
|
+
const supportsRequestStream =
|
|
3088
|
+
isRequestSupported &&
|
|
3089
|
+
isReadableStreamSupported &&
|
|
3090
|
+
test(() => {
|
|
3091
|
+
let duplexAccessed = false;
|
|
3092
|
+
|
|
3093
|
+
const hasContentType = new Request(platform.origin, {
|
|
3094
|
+
body: new ReadableStream$1(),
|
|
3095
|
+
method: 'POST',
|
|
3096
|
+
get duplex() {
|
|
3097
|
+
duplexAccessed = true;
|
|
3098
|
+
return 'half';
|
|
3099
|
+
},
|
|
3100
|
+
}).headers.has('Content-Type');
|
|
2911
3101
|
|
|
2912
|
-
|
|
2913
|
-
|
|
3102
|
+
return duplexAccessed && !hasContentType;
|
|
3103
|
+
});
|
|
2914
3104
|
|
|
2915
|
-
const supportsResponseStream =
|
|
3105
|
+
const supportsResponseStream =
|
|
3106
|
+
isResponseSupported &&
|
|
3107
|
+
isReadableStreamSupported &&
|
|
2916
3108
|
test(() => utils$1.isReadableStream(new Response('').body));
|
|
2917
3109
|
|
|
2918
3110
|
const resolvers = {
|
|
2919
|
-
stream: supportsResponseStream && ((res) => res.body)
|
|
3111
|
+
stream: supportsResponseStream && ((res) => res.body),
|
|
2920
3112
|
};
|
|
2921
3113
|
|
|
2922
|
-
isFetchSupported &&
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
3114
|
+
isFetchSupported &&
|
|
3115
|
+
(() => {
|
|
3116
|
+
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach((type) => {
|
|
3117
|
+
!resolvers[type] &&
|
|
3118
|
+
(resolvers[type] = (res, config) => {
|
|
3119
|
+
let method = res && res[type];
|
|
3120
|
+
|
|
3121
|
+
if (method) {
|
|
3122
|
+
return method.call(res);
|
|
3123
|
+
}
|
|
3124
|
+
|
|
3125
|
+
throw new AxiosError$1(
|
|
3126
|
+
`Response type '${type}' is not supported`,
|
|
3127
|
+
AxiosError$1.ERR_NOT_SUPPORT,
|
|
3128
|
+
config
|
|
3129
|
+
);
|
|
3130
|
+
});
|
|
2932
3131
|
});
|
|
2933
|
-
});
|
|
2934
|
-
})());
|
|
3132
|
+
})();
|
|
2935
3133
|
|
|
2936
3134
|
const getBodyLength = async (body) => {
|
|
2937
3135
|
if (body == null) {
|
|
@@ -2982,32 +3180,41 @@ const factory = (env) => {
|
|
|
2982
3180
|
responseType,
|
|
2983
3181
|
headers,
|
|
2984
3182
|
withCredentials = 'same-origin',
|
|
2985
|
-
fetchOptions
|
|
3183
|
+
fetchOptions,
|
|
2986
3184
|
} = resolveConfig(config);
|
|
2987
3185
|
|
|
2988
3186
|
let _fetch = envFetch || fetch;
|
|
2989
3187
|
|
|
2990
3188
|
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
|
2991
3189
|
|
|
2992
|
-
let composedSignal = composeSignals(
|
|
3190
|
+
let composedSignal = composeSignals(
|
|
3191
|
+
[signal, cancelToken && cancelToken.toAbortSignal()],
|
|
3192
|
+
timeout
|
|
3193
|
+
);
|
|
2993
3194
|
|
|
2994
3195
|
let request = null;
|
|
2995
3196
|
|
|
2996
|
-
const unsubscribe =
|
|
2997
|
-
composedSignal
|
|
2998
|
-
|
|
3197
|
+
const unsubscribe =
|
|
3198
|
+
composedSignal &&
|
|
3199
|
+
composedSignal.unsubscribe &&
|
|
3200
|
+
(() => {
|
|
3201
|
+
composedSignal.unsubscribe();
|
|
3202
|
+
});
|
|
2999
3203
|
|
|
3000
3204
|
let requestContentLength;
|
|
3001
3205
|
|
|
3002
3206
|
try {
|
|
3003
3207
|
if (
|
|
3004
|
-
onUploadProgress &&
|
|
3208
|
+
onUploadProgress &&
|
|
3209
|
+
supportsRequestStream &&
|
|
3210
|
+
method !== 'get' &&
|
|
3211
|
+
method !== 'head' &&
|
|
3005
3212
|
(requestContentLength = await resolveBodyLength(headers, data)) !== 0
|
|
3006
3213
|
) {
|
|
3007
3214
|
let _request = new Request(url, {
|
|
3008
3215
|
method: 'POST',
|
|
3009
3216
|
body: data,
|
|
3010
|
-
duplex:
|
|
3217
|
+
duplex: 'half',
|
|
3011
3218
|
});
|
|
3012
3219
|
|
|
3013
3220
|
let contentTypeHeader;
|
|
@@ -3032,7 +3239,7 @@ const factory = (env) => {
|
|
|
3032
3239
|
|
|
3033
3240
|
// Cloudflare Workers throws when credentials are defined
|
|
3034
3241
|
// see https://github.com/cloudflare/workerd/issues/902
|
|
3035
|
-
const isCredentialsSupported = isRequestSupported &&
|
|
3242
|
+
const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype;
|
|
3036
3243
|
|
|
3037
3244
|
const resolvedOptions = {
|
|
3038
3245
|
...fetchOptions,
|
|
@@ -3040,29 +3247,35 @@ const factory = (env) => {
|
|
|
3040
3247
|
method: method.toUpperCase(),
|
|
3041
3248
|
headers: headers.normalize().toJSON(),
|
|
3042
3249
|
body: data,
|
|
3043
|
-
duplex:
|
|
3044
|
-
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
3250
|
+
duplex: 'half',
|
|
3251
|
+
credentials: isCredentialsSupported ? withCredentials : undefined,
|
|
3045
3252
|
};
|
|
3046
3253
|
|
|
3047
3254
|
request = isRequestSupported && new Request(url, resolvedOptions);
|
|
3048
3255
|
|
|
3049
|
-
let response = await (isRequestSupported
|
|
3256
|
+
let response = await (isRequestSupported
|
|
3257
|
+
? _fetch(request, fetchOptions)
|
|
3258
|
+
: _fetch(url, resolvedOptions));
|
|
3050
3259
|
|
|
3051
|
-
const isStreamResponse =
|
|
3260
|
+
const isStreamResponse =
|
|
3261
|
+
supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
|
3052
3262
|
|
|
3053
3263
|
if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
|
|
3054
3264
|
const options = {};
|
|
3055
3265
|
|
|
3056
|
-
['status', 'statusText', 'headers'].forEach(prop => {
|
|
3266
|
+
['status', 'statusText', 'headers'].forEach((prop) => {
|
|
3057
3267
|
options[prop] = response[prop];
|
|
3058
3268
|
});
|
|
3059
3269
|
|
|
3060
3270
|
const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
|
|
3061
3271
|
|
|
3062
|
-
const [onProgress, flush] =
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3272
|
+
const [onProgress, flush] =
|
|
3273
|
+
(onDownloadProgress &&
|
|
3274
|
+
progressEventDecorator(
|
|
3275
|
+
responseContentLength,
|
|
3276
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
3277
|
+
)) ||
|
|
3278
|
+
[];
|
|
3066
3279
|
|
|
3067
3280
|
response = new Response(
|
|
3068
3281
|
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
@@ -3075,7 +3288,10 @@ const factory = (env) => {
|
|
|
3075
3288
|
|
|
3076
3289
|
responseType = responseType || 'text';
|
|
3077
3290
|
|
|
3078
|
-
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](
|
|
3291
|
+
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](
|
|
3292
|
+
response,
|
|
3293
|
+
config
|
|
3294
|
+
);
|
|
3079
3295
|
|
|
3080
3296
|
!isStreamResponse && unsubscribe && unsubscribe();
|
|
3081
3297
|
|
|
@@ -3086,43 +3302,50 @@ const factory = (env) => {
|
|
|
3086
3302
|
status: response.status,
|
|
3087
3303
|
statusText: response.statusText,
|
|
3088
3304
|
config,
|
|
3089
|
-
request
|
|
3305
|
+
request,
|
|
3090
3306
|
});
|
|
3091
|
-
})
|
|
3307
|
+
});
|
|
3092
3308
|
} catch (err) {
|
|
3093
3309
|
unsubscribe && unsubscribe();
|
|
3094
3310
|
|
|
3095
3311
|
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
|
3096
3312
|
throw Object.assign(
|
|
3097
|
-
new AxiosError$1(
|
|
3313
|
+
new AxiosError$1(
|
|
3314
|
+
'Network Error',
|
|
3315
|
+
AxiosError$1.ERR_NETWORK,
|
|
3316
|
+
config,
|
|
3317
|
+
request,
|
|
3318
|
+
err && err.response
|
|
3319
|
+
),
|
|
3098
3320
|
{
|
|
3099
|
-
cause: err.cause || err
|
|
3321
|
+
cause: err.cause || err,
|
|
3100
3322
|
}
|
|
3101
|
-
)
|
|
3323
|
+
);
|
|
3102
3324
|
}
|
|
3103
3325
|
|
|
3104
|
-
throw AxiosError$1.from(err, err && err.code, config, request);
|
|
3326
|
+
throw AxiosError$1.from(err, err && err.code, config, request, err && err.response);
|
|
3105
3327
|
}
|
|
3106
|
-
}
|
|
3328
|
+
};
|
|
3107
3329
|
};
|
|
3108
3330
|
|
|
3109
3331
|
const seedCache = new Map();
|
|
3110
3332
|
|
|
3111
3333
|
const getFetch = (config) => {
|
|
3112
3334
|
let env = (config && config.env) || {};
|
|
3113
|
-
const {fetch, Request, Response} = env;
|
|
3114
|
-
const seeds = [
|
|
3115
|
-
Request, Response, fetch
|
|
3116
|
-
];
|
|
3335
|
+
const { fetch, Request, Response } = env;
|
|
3336
|
+
const seeds = [Request, Response, fetch];
|
|
3117
3337
|
|
|
3118
|
-
let len = seeds.length,
|
|
3119
|
-
|
|
3338
|
+
let len = seeds.length,
|
|
3339
|
+
i = len,
|
|
3340
|
+
seed,
|
|
3341
|
+
target,
|
|
3342
|
+
map = seedCache;
|
|
3120
3343
|
|
|
3121
3344
|
while (i--) {
|
|
3122
3345
|
seed = seeds[i];
|
|
3123
3346
|
target = map.get(seed);
|
|
3124
3347
|
|
|
3125
|
-
target === undefined && map.set(seed, target =
|
|
3348
|
+
target === undefined && map.set(seed, (target = i ? new Map() : factory(env)));
|
|
3126
3349
|
|
|
3127
3350
|
map = target;
|
|
3128
3351
|
}
|
|
@@ -3138,7 +3361,7 @@ getFetch();
|
|
|
3138
3361
|
* - `http` for Node.js
|
|
3139
3362
|
* - `xhr` for browsers
|
|
3140
3363
|
* - `fetch` for fetch API-based requests
|
|
3141
|
-
*
|
|
3364
|
+
*
|
|
3142
3365
|
* @type {Object<string, Function|Object>}
|
|
3143
3366
|
*/
|
|
3144
3367
|
const knownAdapters = {
|
|
@@ -3146,7 +3369,7 @@ const knownAdapters = {
|
|
|
3146
3369
|
xhr: xhrAdapter,
|
|
3147
3370
|
fetch: {
|
|
3148
3371
|
get: getFetch,
|
|
3149
|
-
}
|
|
3372
|
+
},
|
|
3150
3373
|
};
|
|
3151
3374
|
|
|
3152
3375
|
// Assign adapter names for easier debugging and identification
|
|
@@ -3163,7 +3386,7 @@ utils$1.forEach(knownAdapters, (fn, value) => {
|
|
|
3163
3386
|
|
|
3164
3387
|
/**
|
|
3165
3388
|
* Render a rejection reason string for unknown or unsupported adapters
|
|
3166
|
-
*
|
|
3389
|
+
*
|
|
3167
3390
|
* @param {string} reason
|
|
3168
3391
|
* @returns {string}
|
|
3169
3392
|
*/
|
|
@@ -3171,17 +3394,18 @@ const renderReason = (reason) => `- ${reason}`;
|
|
|
3171
3394
|
|
|
3172
3395
|
/**
|
|
3173
3396
|
* Check if the adapter is resolved (function, null, or false)
|
|
3174
|
-
*
|
|
3397
|
+
*
|
|
3175
3398
|
* @param {Function|null|false} adapter
|
|
3176
3399
|
* @returns {boolean}
|
|
3177
3400
|
*/
|
|
3178
|
-
const isResolvedHandle = (adapter) =>
|
|
3401
|
+
const isResolvedHandle = (adapter) =>
|
|
3402
|
+
utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
|
3179
3403
|
|
|
3180
3404
|
/**
|
|
3181
3405
|
* Get the first suitable adapter from the provided list.
|
|
3182
3406
|
* Tries each adapter in order until a supported one is found.
|
|
3183
3407
|
* Throws an AxiosError if no adapter is suitable.
|
|
3184
|
-
*
|
|
3408
|
+
*
|
|
3185
3409
|
* @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function.
|
|
3186
3410
|
* @param {Object} config - Axios request configuration
|
|
3187
3411
|
* @throws {AxiosError} If no suitable adapter is available
|
|
@@ -3218,14 +3442,17 @@ function getAdapter$1(adapters, config) {
|
|
|
3218
3442
|
}
|
|
3219
3443
|
|
|
3220
3444
|
if (!adapter) {
|
|
3221
|
-
const reasons = Object.entries(rejectedReasons)
|
|
3222
|
-
|
|
3445
|
+
const reasons = Object.entries(rejectedReasons).map(
|
|
3446
|
+
([id, state]) =>
|
|
3447
|
+
`adapter ${id} ` +
|
|
3223
3448
|
(state === false ? 'is not supported by the environment' : 'is not available in the build')
|
|
3224
|
-
|
|
3449
|
+
);
|
|
3225
3450
|
|
|
3226
|
-
let s = length
|
|
3227
|
-
|
|
3228
|
-
|
|
3451
|
+
let s = length
|
|
3452
|
+
? reasons.length > 1
|
|
3453
|
+
? 'since :\n' + reasons.map(renderReason).join('\n')
|
|
3454
|
+
: ' ' + renderReason(reasons[0])
|
|
3455
|
+
: 'as no adapter specified';
|
|
3229
3456
|
|
|
3230
3457
|
throw new AxiosError$1(
|
|
3231
3458
|
`There is no suitable adapter to dispatch the request ` + s,
|
|
@@ -3250,7 +3477,7 @@ const adapters = {
|
|
|
3250
3477
|
* Exposes all known adapters
|
|
3251
3478
|
* @type {Object<string, Function|Object>}
|
|
3252
3479
|
*/
|
|
3253
|
-
adapters: knownAdapters
|
|
3480
|
+
adapters: knownAdapters,
|
|
3254
3481
|
};
|
|
3255
3482
|
|
|
3256
3483
|
/**
|
|
@@ -3283,10 +3510,7 @@ function dispatchRequest(config) {
|
|
|
3283
3510
|
config.headers = AxiosHeaders$1.from(config.headers);
|
|
3284
3511
|
|
|
3285
3512
|
// Transform request data
|
|
3286
|
-
config.data = transformData.call(
|
|
3287
|
-
config,
|
|
3288
|
-
config.transformRequest
|
|
3289
|
-
);
|
|
3513
|
+
config.data = transformData.call(config, config.transformRequest);
|
|
3290
3514
|
|
|
3291
3515
|
if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
|
|
3292
3516
|
config.headers.setContentType('application/x-www-form-urlencoded', false);
|
|
@@ -3294,39 +3518,38 @@ function dispatchRequest(config) {
|
|
|
3294
3518
|
|
|
3295
3519
|
const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
|
|
3296
3520
|
|
|
3297
|
-
return adapter(config).then(
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
// Transform response data
|
|
3301
|
-
response.data = transformData.call(
|
|
3302
|
-
config,
|
|
3303
|
-
config.transformResponse,
|
|
3304
|
-
response
|
|
3305
|
-
);
|
|
3306
|
-
|
|
3307
|
-
response.headers = AxiosHeaders$1.from(response.headers);
|
|
3308
|
-
|
|
3309
|
-
return response;
|
|
3310
|
-
}, function onAdapterRejection(reason) {
|
|
3311
|
-
if (!isCancel$1(reason)) {
|
|
3521
|
+
return adapter(config).then(
|
|
3522
|
+
function onAdapterResolution(response) {
|
|
3312
3523
|
throwIfCancellationRequested(config);
|
|
3313
3524
|
|
|
3314
3525
|
// Transform response data
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3526
|
+
response.data = transformData.call(config, config.transformResponse, response);
|
|
3527
|
+
|
|
3528
|
+
response.headers = AxiosHeaders$1.from(response.headers);
|
|
3529
|
+
|
|
3530
|
+
return response;
|
|
3531
|
+
},
|
|
3532
|
+
function onAdapterRejection(reason) {
|
|
3533
|
+
if (!isCancel$1(reason)) {
|
|
3534
|
+
throwIfCancellationRequested(config);
|
|
3535
|
+
|
|
3536
|
+
// Transform response data
|
|
3537
|
+
if (reason && reason.response) {
|
|
3538
|
+
reason.response.data = transformData.call(
|
|
3539
|
+
config,
|
|
3540
|
+
config.transformResponse,
|
|
3541
|
+
reason.response
|
|
3542
|
+
);
|
|
3543
|
+
reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
|
|
3544
|
+
}
|
|
3322
3545
|
}
|
|
3323
|
-
}
|
|
3324
3546
|
|
|
3325
|
-
|
|
3326
|
-
|
|
3547
|
+
return Promise.reject(reason);
|
|
3548
|
+
}
|
|
3549
|
+
);
|
|
3327
3550
|
}
|
|
3328
3551
|
|
|
3329
|
-
const VERSION$1 = "1.13.
|
|
3552
|
+
const VERSION$1 = "1.13.6";
|
|
3330
3553
|
|
|
3331
3554
|
const validators$1 = {};
|
|
3332
3555
|
|
|
@@ -3350,7 +3573,15 @@ const deprecatedWarnings = {};
|
|
|
3350
3573
|
*/
|
|
3351
3574
|
validators$1.transitional = function transitional(validator, version, message) {
|
|
3352
3575
|
function formatMessage(opt, desc) {
|
|
3353
|
-
return
|
|
3576
|
+
return (
|
|
3577
|
+
'[Axios v' +
|
|
3578
|
+
VERSION$1 +
|
|
3579
|
+
"] Transitional option '" +
|
|
3580
|
+
opt +
|
|
3581
|
+
"'" +
|
|
3582
|
+
desc +
|
|
3583
|
+
(message ? '. ' + message : '')
|
|
3584
|
+
);
|
|
3354
3585
|
}
|
|
3355
3586
|
|
|
3356
3587
|
// eslint-disable-next-line func-names
|
|
@@ -3382,7 +3613,7 @@ validators$1.spelling = function spelling(correctSpelling) {
|
|
|
3382
3613
|
// eslint-disable-next-line no-console
|
|
3383
3614
|
console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
|
|
3384
3615
|
return true;
|
|
3385
|
-
}
|
|
3616
|
+
};
|
|
3386
3617
|
};
|
|
3387
3618
|
|
|
3388
3619
|
/**
|
|
@@ -3408,7 +3639,10 @@ function assertOptions(options, schema, allowUnknown) {
|
|
|
3408
3639
|
const value = options[opt];
|
|
3409
3640
|
const result = value === undefined || validator(value, opt, options);
|
|
3410
3641
|
if (result !== true) {
|
|
3411
|
-
throw new AxiosError$1(
|
|
3642
|
+
throw new AxiosError$1(
|
|
3643
|
+
'option ' + opt + ' must be ' + result,
|
|
3644
|
+
AxiosError$1.ERR_BAD_OPTION_VALUE
|
|
3645
|
+
);
|
|
3412
3646
|
}
|
|
3413
3647
|
continue;
|
|
3414
3648
|
}
|
|
@@ -3420,7 +3654,7 @@ function assertOptions(options, schema, allowUnknown) {
|
|
|
3420
3654
|
|
|
3421
3655
|
const validator = {
|
|
3422
3656
|
assertOptions,
|
|
3423
|
-
validators: validators$1
|
|
3657
|
+
validators: validators$1,
|
|
3424
3658
|
};
|
|
3425
3659
|
|
|
3426
3660
|
const validators = validator.validators;
|
|
@@ -3437,7 +3671,7 @@ let Axios$1 = class Axios {
|
|
|
3437
3671
|
this.defaults = instanceConfig || {};
|
|
3438
3672
|
this.interceptors = {
|
|
3439
3673
|
request: new InterceptorManager(),
|
|
3440
|
-
response: new InterceptorManager()
|
|
3674
|
+
response: new InterceptorManager(),
|
|
3441
3675
|
};
|
|
3442
3676
|
}
|
|
3443
3677
|
|
|
@@ -3488,26 +3722,35 @@ let Axios$1 = class Axios {
|
|
|
3488
3722
|
|
|
3489
3723
|
config = mergeConfig$1(this.defaults, config);
|
|
3490
3724
|
|
|
3491
|
-
const {transitional, paramsSerializer, headers} = config;
|
|
3725
|
+
const { transitional, paramsSerializer, headers } = config;
|
|
3492
3726
|
|
|
3493
3727
|
if (transitional !== undefined) {
|
|
3494
|
-
validator.assertOptions(
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3728
|
+
validator.assertOptions(
|
|
3729
|
+
transitional,
|
|
3730
|
+
{
|
|
3731
|
+
silentJSONParsing: validators.transitional(validators.boolean),
|
|
3732
|
+
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
3733
|
+
clarifyTimeoutError: validators.transitional(validators.boolean),
|
|
3734
|
+
legacyInterceptorReqResOrdering: validators.transitional(validators.boolean),
|
|
3735
|
+
},
|
|
3736
|
+
false
|
|
3737
|
+
);
|
|
3499
3738
|
}
|
|
3500
3739
|
|
|
3501
3740
|
if (paramsSerializer != null) {
|
|
3502
3741
|
if (utils$1.isFunction(paramsSerializer)) {
|
|
3503
3742
|
config.paramsSerializer = {
|
|
3504
|
-
serialize: paramsSerializer
|
|
3743
|
+
serialize: paramsSerializer,
|
|
3505
3744
|
};
|
|
3506
3745
|
} else {
|
|
3507
|
-
validator.assertOptions(
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3746
|
+
validator.assertOptions(
|
|
3747
|
+
paramsSerializer,
|
|
3748
|
+
{
|
|
3749
|
+
encode: validators.function,
|
|
3750
|
+
serialize: validators.function,
|
|
3751
|
+
},
|
|
3752
|
+
true
|
|
3753
|
+
);
|
|
3511
3754
|
}
|
|
3512
3755
|
}
|
|
3513
3756
|
|
|
@@ -3518,26 +3761,25 @@ let Axios$1 = class Axios {
|
|
|
3518
3761
|
config.allowAbsoluteUrls = true;
|
|
3519
3762
|
}
|
|
3520
3763
|
|
|
3521
|
-
validator.assertOptions(
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3764
|
+
validator.assertOptions(
|
|
3765
|
+
config,
|
|
3766
|
+
{
|
|
3767
|
+
baseUrl: validators.spelling('baseURL'),
|
|
3768
|
+
withXsrfToken: validators.spelling('withXSRFToken'),
|
|
3769
|
+
},
|
|
3770
|
+
true
|
|
3771
|
+
);
|
|
3525
3772
|
|
|
3526
3773
|
// Set config.method
|
|
3527
3774
|
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
|
3528
3775
|
|
|
3529
3776
|
// Flatten headers
|
|
3530
|
-
let contextHeaders = headers && utils$1.merge(
|
|
3531
|
-
headers.common,
|
|
3532
|
-
headers[config.method]
|
|
3533
|
-
);
|
|
3777
|
+
let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
|
|
3534
3778
|
|
|
3535
|
-
headers &&
|
|
3536
|
-
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
|
3537
|
-
(method) => {
|
|
3779
|
+
headers &&
|
|
3780
|
+
utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], (method) => {
|
|
3538
3781
|
delete headers[method];
|
|
3539
|
-
}
|
|
3540
|
-
);
|
|
3782
|
+
});
|
|
3541
3783
|
|
|
3542
3784
|
config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
|
|
3543
3785
|
|
|
@@ -3551,7 +3793,15 @@ let Axios$1 = class Axios {
|
|
|
3551
3793
|
|
|
3552
3794
|
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
3553
3795
|
|
|
3554
|
-
|
|
3796
|
+
const transitional = config.transitional || transitionalDefaults;
|
|
3797
|
+
const legacyInterceptorReqResOrdering =
|
|
3798
|
+
transitional && transitional.legacyInterceptorReqResOrdering;
|
|
3799
|
+
|
|
3800
|
+
if (legacyInterceptorReqResOrdering) {
|
|
3801
|
+
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
3802
|
+
} else {
|
|
3803
|
+
requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
3804
|
+
}
|
|
3555
3805
|
});
|
|
3556
3806
|
|
|
3557
3807
|
const responseInterceptorChain = [];
|
|
@@ -3619,12 +3869,14 @@ let Axios$1 = class Axios {
|
|
|
3619
3869
|
// Provide aliases for supported request methods
|
|
3620
3870
|
utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
|
3621
3871
|
/*eslint func-names:0*/
|
|
3622
|
-
Axios$1.prototype[method] = function(url, config) {
|
|
3623
|
-
return this.request(
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3872
|
+
Axios$1.prototype[method] = function (url, config) {
|
|
3873
|
+
return this.request(
|
|
3874
|
+
mergeConfig$1(config || {}, {
|
|
3875
|
+
method,
|
|
3876
|
+
url,
|
|
3877
|
+
data: (config || {}).data,
|
|
3878
|
+
})
|
|
3879
|
+
);
|
|
3628
3880
|
};
|
|
3629
3881
|
});
|
|
3630
3882
|
|
|
@@ -3633,14 +3885,18 @@ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method)
|
|
|
3633
3885
|
|
|
3634
3886
|
function generateHTTPMethod(isForm) {
|
|
3635
3887
|
return function httpMethod(url, data, config) {
|
|
3636
|
-
return this.request(
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3888
|
+
return this.request(
|
|
3889
|
+
mergeConfig$1(config || {}, {
|
|
3890
|
+
method,
|
|
3891
|
+
headers: isForm
|
|
3892
|
+
? {
|
|
3893
|
+
'Content-Type': 'multipart/form-data',
|
|
3894
|
+
}
|
|
3895
|
+
: {},
|
|
3896
|
+
url,
|
|
3897
|
+
data,
|
|
3898
|
+
})
|
|
3899
|
+
);
|
|
3644
3900
|
};
|
|
3645
3901
|
}
|
|
3646
3902
|
|
|
@@ -3671,7 +3927,7 @@ let CancelToken$1 = class CancelToken {
|
|
|
3671
3927
|
const token = this;
|
|
3672
3928
|
|
|
3673
3929
|
// eslint-disable-next-line func-names
|
|
3674
|
-
this.promise.then(cancel => {
|
|
3930
|
+
this.promise.then((cancel) => {
|
|
3675
3931
|
if (!token._listeners) return;
|
|
3676
3932
|
|
|
3677
3933
|
let i = token._listeners.length;
|
|
@@ -3683,10 +3939,10 @@ let CancelToken$1 = class CancelToken {
|
|
|
3683
3939
|
});
|
|
3684
3940
|
|
|
3685
3941
|
// eslint-disable-next-line func-names
|
|
3686
|
-
this.promise.then = onfulfilled => {
|
|
3942
|
+
this.promise.then = (onfulfilled) => {
|
|
3687
3943
|
let _resolve;
|
|
3688
3944
|
// eslint-disable-next-line func-names
|
|
3689
|
-
const promise = new Promise(resolve => {
|
|
3945
|
+
const promise = new Promise((resolve) => {
|
|
3690
3946
|
token.subscribe(resolve);
|
|
3691
3947
|
_resolve = resolve;
|
|
3692
3948
|
}).then(onfulfilled);
|
|
@@ -3774,7 +4030,7 @@ let CancelToken$1 = class CancelToken {
|
|
|
3774
4030
|
});
|
|
3775
4031
|
return {
|
|
3776
4032
|
token,
|
|
3777
|
-
cancel
|
|
4033
|
+
cancel,
|
|
3778
4034
|
};
|
|
3779
4035
|
}
|
|
3780
4036
|
};
|
|
@@ -3786,7 +4042,7 @@ let CancelToken$1 = class CancelToken {
|
|
|
3786
4042
|
*
|
|
3787
4043
|
* ```js
|
|
3788
4044
|
* function f(x, y, z) {}
|
|
3789
|
-
*
|
|
4045
|
+
* const args = [1, 2, 3];
|
|
3790
4046
|
* f.apply(null, args);
|
|
3791
4047
|
* ```
|
|
3792
4048
|
*
|
|
@@ -3814,7 +4070,7 @@ function spread$1(callback) {
|
|
|
3814
4070
|
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
|
3815
4071
|
*/
|
|
3816
4072
|
function isAxiosError$1(payload) {
|
|
3817
|
-
return utils$1.isObject(payload) &&
|
|
4073
|
+
return utils$1.isObject(payload) && payload.isAxiosError === true;
|
|
3818
4074
|
}
|
|
3819
4075
|
|
|
3820
4076
|
const HttpStatusCode$1 = {
|
|
@@ -3905,10 +4161,10 @@ function createInstance(defaultConfig) {
|
|
|
3905
4161
|
const instance = bind(Axios$1.prototype.request, context);
|
|
3906
4162
|
|
|
3907
4163
|
// Copy axios.prototype to instance
|
|
3908
|
-
utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
|
|
4164
|
+
utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
|
|
3909
4165
|
|
|
3910
4166
|
// Copy context to instance
|
|
3911
|
-
utils$1.extend(instance, context, null, {allOwnKeys: true});
|
|
4167
|
+
utils$1.extend(instance, context, null, { allOwnKeys: true });
|
|
3912
4168
|
|
|
3913
4169
|
// Factory for creating new instances
|
|
3914
4170
|
instance.create = function create(instanceConfig) {
|
|
@@ -3952,7 +4208,7 @@ axios$1.mergeConfig = mergeConfig$1;
|
|
|
3952
4208
|
|
|
3953
4209
|
axios$1.AxiosHeaders = AxiosHeaders$1;
|
|
3954
4210
|
|
|
3955
|
-
axios$1.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
4211
|
+
axios$1.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
3956
4212
|
|
|
3957
4213
|
axios$1.getAdapter = adapters.getAdapter;
|
|
3958
4214
|
|
|
@@ -3979,9 +4235,87 @@ const {
|
|
|
3979
4235
|
HttpStatusCode,
|
|
3980
4236
|
formToJSON,
|
|
3981
4237
|
getAdapter,
|
|
3982
|
-
mergeConfig
|
|
4238
|
+
mergeConfig,
|
|
3983
4239
|
} = axios$1;
|
|
3984
4240
|
|
|
4241
|
+
const defaultConfig = {
|
|
4242
|
+
csrf: {
|
|
4243
|
+
endpoint: "csrf/token",
|
|
4244
|
+
enabled: true,
|
|
4245
|
+
headerName: "x-csrf-token"
|
|
4246
|
+
},
|
|
4247
|
+
axios: {
|
|
4248
|
+
baseURL: "/api",
|
|
4249
|
+
timeout: 3e4,
|
|
4250
|
+
withCredentials: true,
|
|
4251
|
+
headers: {
|
|
4252
|
+
"Content-Type": "application/json",
|
|
4253
|
+
Accept: "application/json"
|
|
4254
|
+
}
|
|
4255
|
+
},
|
|
4256
|
+
auth: {
|
|
4257
|
+
tokenHeaderName: "Authorization",
|
|
4258
|
+
tokenPrefix: "Bearer",
|
|
4259
|
+
tokenEndpoint: "auth/access-token",
|
|
4260
|
+
refreshEndpoint: "auth/refresh-tokens",
|
|
4261
|
+
sessionRecoveryEnabled: true
|
|
4262
|
+
},
|
|
4263
|
+
views: {
|
|
4264
|
+
viewsEndpoint: "table-views",
|
|
4265
|
+
statesEndpoint: "table-states"
|
|
4266
|
+
}
|
|
4267
|
+
};
|
|
4268
|
+
const GLOBAL_CONFIG_KEY = "__QUANTUM_UI_CONFIG__";
|
|
4269
|
+
function getGlobalConfig() {
|
|
4270
|
+
if (typeof window !== "undefined") {
|
|
4271
|
+
const globalWindow = window;
|
|
4272
|
+
if (!globalWindow[GLOBAL_CONFIG_KEY]) {
|
|
4273
|
+
globalWindow[GLOBAL_CONFIG_KEY] = { ...defaultConfig };
|
|
4274
|
+
}
|
|
4275
|
+
return globalWindow[GLOBAL_CONFIG_KEY] ?? { ...defaultConfig };
|
|
4276
|
+
}
|
|
4277
|
+
return { ...defaultConfig };
|
|
4278
|
+
}
|
|
4279
|
+
function setGlobalConfig(config) {
|
|
4280
|
+
if (typeof window !== "undefined") {
|
|
4281
|
+
window[GLOBAL_CONFIG_KEY] = config;
|
|
4282
|
+
}
|
|
4283
|
+
}
|
|
4284
|
+
function defineConfig(config) {
|
|
4285
|
+
return config;
|
|
4286
|
+
}
|
|
4287
|
+
function configureQuantumUI(userConfig) {
|
|
4288
|
+
const newConfig = {
|
|
4289
|
+
csrf: {
|
|
4290
|
+
...defaultConfig.csrf,
|
|
4291
|
+
...userConfig.csrf || {}
|
|
4292
|
+
},
|
|
4293
|
+
axios: {
|
|
4294
|
+
...defaultConfig.axios,
|
|
4295
|
+
...userConfig.axios || {},
|
|
4296
|
+
headers: {
|
|
4297
|
+
...defaultConfig.axios.headers,
|
|
4298
|
+
...userConfig.axios?.headers || {}
|
|
4299
|
+
}
|
|
4300
|
+
},
|
|
4301
|
+
auth: {
|
|
4302
|
+
...defaultConfig.auth,
|
|
4303
|
+
...userConfig.auth || {}
|
|
4304
|
+
},
|
|
4305
|
+
views: {
|
|
4306
|
+
...defaultConfig.views,
|
|
4307
|
+
...userConfig.views || {}
|
|
4308
|
+
}
|
|
4309
|
+
};
|
|
4310
|
+
setGlobalConfig(newConfig);
|
|
4311
|
+
}
|
|
4312
|
+
function getConfig() {
|
|
4313
|
+
return getGlobalConfig();
|
|
4314
|
+
}
|
|
4315
|
+
function resetConfig() {
|
|
4316
|
+
setGlobalConfig({ ...defaultConfig });
|
|
4317
|
+
}
|
|
4318
|
+
|
|
3985
4319
|
let accessToken = null;
|
|
3986
4320
|
let refreshTimer = null;
|
|
3987
4321
|
let sessionRecoveryPromise = null;
|
|
@@ -3996,6 +4330,9 @@ const getToken = () => accessToken;
|
|
|
3996
4330
|
const clearToken = () => {
|
|
3997
4331
|
accessToken = null;
|
|
3998
4332
|
cancelTokenRefresh();
|
|
4333
|
+
if (typeof window !== "undefined") {
|
|
4334
|
+
window.dispatchEvent(new CustomEvent("auth-state-change"));
|
|
4335
|
+
}
|
|
3999
4336
|
};
|
|
4000
4337
|
const setCsrfToken = (token) => {
|
|
4001
4338
|
if (token && typeof token === "string") {
|
|
@@ -4019,8 +4356,13 @@ async function recoverToken() {
|
|
|
4019
4356
|
return { success: true, expiresIn: response.data.expiresIn };
|
|
4020
4357
|
}
|
|
4021
4358
|
return { success: false, expiresIn: 0 };
|
|
4022
|
-
} catch {
|
|
4359
|
+
} catch (error) {
|
|
4023
4360
|
clearToken();
|
|
4361
|
+
if (axios$1.isAxiosError(error) && error.response?.status === 401) {
|
|
4362
|
+
const data = error.response.data;
|
|
4363
|
+
const title = data?.label || data?.title || "Session expired";
|
|
4364
|
+
toast.error(title, { description: data?.detail });
|
|
4365
|
+
}
|
|
4024
4366
|
return { success: false, expiresIn: 0 };
|
|
4025
4367
|
}
|
|
4026
4368
|
}
|
|
@@ -4053,7 +4395,7 @@ function scheduleTokenRefresh(expiresIn) {
|
|
|
4053
4395
|
refreshTimer = setTimeout(async () => {
|
|
4054
4396
|
const config = getConfig();
|
|
4055
4397
|
try {
|
|
4056
|
-
const response = await axios
|
|
4398
|
+
const response = await axios.post(
|
|
4057
4399
|
config.auth.refreshEndpoint,
|
|
4058
4400
|
{},
|
|
4059
4401
|
{
|
|
@@ -4068,7 +4410,6 @@ function scheduleTokenRefresh(expiresIn) {
|
|
|
4068
4410
|
}
|
|
4069
4411
|
} catch {
|
|
4070
4412
|
clearToken();
|
|
4071
|
-
redirectToLogin();
|
|
4072
4413
|
}
|
|
4073
4414
|
}, refreshAt);
|
|
4074
4415
|
}
|
|
@@ -4103,11 +4444,6 @@ async function fetchCsrfToken() {
|
|
|
4103
4444
|
})();
|
|
4104
4445
|
return csrfFetchPromise;
|
|
4105
4446
|
}
|
|
4106
|
-
function redirectToLogin() {
|
|
4107
|
-
if (typeof window !== "undefined") {
|
|
4108
|
-
window.location.href = "/login";
|
|
4109
|
-
}
|
|
4110
|
-
}
|
|
4111
4447
|
function getSubdomain() {
|
|
4112
4448
|
if (typeof window === "undefined") return null;
|
|
4113
4449
|
const parts = window.location.hostname.split(".");
|
|
@@ -4135,7 +4471,6 @@ axios.interceptors.request.use(async (config) => {
|
|
|
4135
4471
|
if (!isPublicRequest) {
|
|
4136
4472
|
const hasSession = await recoverTokenIfNeeded();
|
|
4137
4473
|
if (!hasSession) {
|
|
4138
|
-
redirectToLogin();
|
|
4139
4474
|
return Promise.reject(new Error("No valid session"));
|
|
4140
4475
|
}
|
|
4141
4476
|
}
|
|
@@ -4187,18 +4522,25 @@ axios.interceptors.response.use(
|
|
|
4187
4522
|
},
|
|
4188
4523
|
(error) => {
|
|
4189
4524
|
const config = error.config;
|
|
4190
|
-
const
|
|
4525
|
+
const method = config?.method?.toUpperCase();
|
|
4526
|
+
const isGet = method === "GET";
|
|
4527
|
+
const showError = isGet ? false : config?.showErrorToast ?? true;
|
|
4191
4528
|
const status = error.response?.status;
|
|
4192
4529
|
const errorData = error.response?.data;
|
|
4193
4530
|
const isPublicRequest = config?.public === true;
|
|
4194
4531
|
const toastId = config?._toastId;
|
|
4195
4532
|
if (status === 401 && !isPublicRequest) {
|
|
4196
|
-
if (
|
|
4197
|
-
|
|
4533
|
+
if (showError) {
|
|
4534
|
+
const errorTitle = errorData?.label || errorData?.title || "Session expired";
|
|
4535
|
+
const errorDescription = errorData?.detail;
|
|
4536
|
+
if (toastId) {
|
|
4537
|
+
toast.error(errorTitle, { id: toastId, description: errorDescription });
|
|
4538
|
+
} else {
|
|
4539
|
+
toast.error(errorTitle, { description: errorDescription });
|
|
4540
|
+
}
|
|
4198
4541
|
}
|
|
4199
4542
|
clearToken();
|
|
4200
4543
|
cancelTokenRefresh();
|
|
4201
|
-
redirectToLogin();
|
|
4202
4544
|
return Promise.reject(error);
|
|
4203
4545
|
}
|
|
4204
4546
|
if (showError && status && status >= 500) {
|
|
@@ -4209,20 +4551,25 @@ axios.interceptors.response.use(
|
|
|
4209
4551
|
toast.error("Server Error", { description: errorMessage });
|
|
4210
4552
|
}
|
|
4211
4553
|
}
|
|
4212
|
-
if (showError && !error.response) {
|
|
4554
|
+
if (showError && !error.response && axios$1.isAxiosError(error)) {
|
|
4213
4555
|
if (toastId) {
|
|
4214
4556
|
toast.error("Network Error", { id: toastId, description: "Please check your internet connection." });
|
|
4215
4557
|
} else {
|
|
4216
4558
|
toast.error("Network Error", { description: "Please check your internet connection." });
|
|
4217
4559
|
}
|
|
4218
4560
|
}
|
|
4219
|
-
if (
|
|
4220
|
-
const
|
|
4221
|
-
|
|
4561
|
+
if (showError && status && status >= 400 && status < 500 && status !== 401) {
|
|
4562
|
+
const errorTitle = errorData?.label || errorData?.title || "Request failed";
|
|
4563
|
+
const errorDescription = errorData?.detail;
|
|
4564
|
+
if (toastId) {
|
|
4565
|
+
toast.error(errorTitle, { id: toastId, description: errorDescription });
|
|
4566
|
+
} else {
|
|
4567
|
+
toast.error(errorTitle, { description: errorDescription });
|
|
4568
|
+
}
|
|
4222
4569
|
}
|
|
4223
4570
|
return Promise.reject(error);
|
|
4224
4571
|
}
|
|
4225
4572
|
);
|
|
4226
4573
|
|
|
4227
|
-
export { axios as a,
|
|
4574
|
+
export { axios as a, clearCsrfToken as b, cancelTokenRefresh as c, clearToken as d, configureQuantumUI as e, defineConfig as f, getConfig as g, getCsrfToken as h, getToken as i, resetConfig as j, setCsrfToken as k, setToken as l, recoverToken as r, scheduleTokenRefresh as s };
|
|
4228
4575
|
//# sourceMappingURL=axios.js.map
|