ingeniuscliq-core 0.4.14 → 0.4.16
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/README.md +417 -0
- package/dist/_virtual/index.js +5 -0
- package/dist/_virtual/index2.js +3 -0
- package/dist/_virtual/use-sync-external-store-shim.development.js +3 -0
- package/dist/_virtual/use-sync-external-store-shim.production.js +3 -0
- package/dist/assets/logo.svg.js +3 -0
- package/dist/classes/CoreBuilder.d.ts +1 -0
- package/dist/classes/CoreBuilder.d.ts.map +1 -0
- package/dist/classes/CoreBuilder.js +4 -0
- package/dist/classes/index.d.ts +1 -0
- package/dist/classes/index.d.ts.map +1 -0
- package/dist/components/common/carousel/CustomCarousel.d.ts +2 -1
- package/dist/components/common/carousel/CustomCarousel.d.ts.map +1 -0
- package/dist/components/common/carousel/CustomCarousel.tsx +26 -0
- package/dist/components/common/carousel/CustomCarouselSection.d.ts +2 -1
- package/dist/components/common/carousel/CustomCarouselSection.d.ts.map +1 -0
- package/dist/components/common/carousel/CustomCarouselSection.tsx +41 -0
- package/dist/components/common/carousel/index.d.ts +3 -2
- package/dist/components/common/carousel/index.d.ts.map +1 -0
- package/dist/components/common/form/CustomFormField.d.ts +4 -2
- package/dist/components/common/form/CustomFormField.d.ts.map +1 -0
- package/dist/components/common/form/CustomFormField.tsx +29 -0
- package/dist/components/common/form/FormCheckbox.d.ts +5 -1
- package/dist/components/common/form/FormCheckbox.d.ts.map +1 -0
- package/dist/components/common/form/FormCheckbox.tsx +57 -0
- package/dist/components/common/form/FormInput.d.ts +4 -1
- package/dist/components/common/form/FormInput.d.ts.map +1 -0
- package/dist/components/common/form/FormInput.tsx +60 -0
- package/dist/components/common/form/FormSelect.d.ts +8 -2
- package/dist/components/common/form/FormSelect.d.ts.map +1 -0
- package/dist/components/common/form/FormSelect.tsx +78 -0
- package/dist/components/common/form/FormTextArea.d.ts +6 -4
- package/dist/components/common/form/FormTextArea.d.ts.map +1 -0
- package/dist/components/common/form/FormTextArea.tsx +57 -0
- package/dist/components/common/form/FormWrapper.d.ts +2 -1
- package/dist/components/common/form/FormWrapper.d.ts.map +1 -0
- package/dist/components/common/form/FormWrapper.tsx +21 -0
- package/dist/components/common/form/index.d.ts +4 -3
- package/dist/components/common/form/index.d.ts.map +1 -0
- package/dist/components/common/index.d.ts +2 -0
- package/dist/components/common/index.d.ts.map +1 -0
- package/dist/components/common/logo/Logo.d.ts +2 -1
- package/dist/components/common/logo/Logo.d.ts.map +1 -0
- package/dist/components/common/logo/Logo.tsx +40 -0
- package/dist/components/common/logo/index.d.ts +1 -0
- package/dist/components/common/logo/index.d.ts.map +1 -0
- package/dist/components/common/pagination/CustomPagination.d.ts +2 -1
- package/dist/components/common/pagination/CustomPagination.d.ts.map +1 -0
- package/dist/components/common/pagination/CustomPagination.tsx +64 -0
- package/dist/components/common/pagination/index.d.ts +1 -0
- package/dist/components/common/pagination/index.d.ts.map +1 -0
- package/dist/components/common/select/CustomSelect.d.ts +2 -1
- package/dist/components/common/select/CustomSelect.d.ts.map +1 -0
- package/dist/components/common/select/CustomSelect.tsx +27 -0
- package/dist/components/common/select/index.d.ts +1 -0
- package/dist/components/common/select/index.d.ts.map +1 -0
- package/dist/components/common/spinner/Spinner.d.ts +1 -0
- package/dist/components/common/spinner/Spinner.d.ts.map +1 -0
- package/dist/components/common/spinner/Spinner.tsx +32 -0
- package/dist/components/common/spinner/index.d.ts +1 -0
- package/dist/components/common/spinner/index.d.ts.map +1 -0
- package/dist/components/common/stepper/Stepper.d.ts +18 -0
- package/dist/components/common/stepper/Stepper.d.ts.map +1 -0
- package/dist/components/common/stepper/Stepper.tsx +59 -0
- package/dist/components/common/stepper/index.d.ts +2 -0
- package/dist/components/common/stepper/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +5 -4
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/layouts/CoreBaseLayout.d.ts +3 -1
- package/dist/components/layouts/CoreBaseLayout.d.ts.map +1 -0
- package/dist/components/layouts/CoreBaseLayout.tsx +19 -0
- package/dist/components/layouts/index.d.ts +1 -0
- package/dist/components/layouts/index.d.ts.map +1 -0
- package/dist/components/templates/CoreHomeLayout.d.ts +1 -0
- package/dist/components/templates/CoreHomeLayout.d.ts.map +1 -0
- package/dist/components/templates/CoreHomeLayout.tsx +8 -0
- package/dist/components/templates/CorePreviewLayout.d.ts +2 -1
- package/dist/components/templates/CorePreviewLayout.d.ts.map +1 -0
- package/dist/components/templates/CorePreviewLayout.tsx +27 -0
- package/dist/components/templates/index.d.ts +1 -0
- package/dist/components/templates/index.d.ts.map +1 -0
- package/dist/components/ui/accordion.d.ts +5 -4
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.tsx +44 -0
- package/dist/components/ui/alert-dialog.d.ts +18 -11
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.tsx +106 -0
- package/dist/components/ui/alert.d.ts +5 -5
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.tsx +49 -0
- package/dist/components/ui/avatar.d.ts +4 -3
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.tsx +40 -0
- package/dist/components/ui/badge.d.ts +5 -3
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.tsx +26 -0
- package/dist/components/ui/breadcrumb.d.ts +17 -8
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.tsx +88 -0
- package/dist/components/ui/button.d.ts +5 -3
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.tsx +47 -0
- package/dist/components/ui/card.d.ts +9 -8
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.tsx +68 -0
- package/dist/components/ui/carousel.d.ts +6 -6
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/carousel.tsx +191 -0
- package/dist/components/ui/checkbox.d.ts +2 -1
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.tsx +28 -0
- package/dist/components/ui/dialog.d.ts +19 -12
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.tsx +95 -0
- package/dist/components/ui/dropdown-menu.d.ts +24 -20
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.tsx +140 -0
- package/dist/components/ui/form.d.ts +6 -6
- package/dist/components/ui/form.d.ts.map +1 -0
- package/dist/components/ui/form.tsx +102 -0
- package/dist/components/ui/index.d.ts +2 -6
- package/dist/components/ui/index.d.ts.map +1 -0
- package/dist/components/ui/input.d.ts +3 -3
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.tsx +25 -0
- package/dist/components/ui/label.d.ts +3 -1
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.tsx +20 -0
- package/dist/components/ui/pagination.d.ts +27 -12
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/pagination.tsx +122 -0
- package/dist/components/ui/popover.d.ts +5 -4
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.tsx +24 -0
- package/dist/components/ui/radio-group.d.ts +3 -2
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group.tsx +34 -0
- package/dist/components/ui/select.d.ts +13 -12
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.tsx +128 -0
- package/dist/components/ui/separator.d.ts +2 -1
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.tsx +24 -0
- package/dist/components/ui/sheet.d.ts +26 -11
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sheet.tsx +106 -0
- package/dist/components/ui/skeleton.d.ts +3 -1
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.tsx +17 -0
- package/dist/components/ui/slider.d.ts +2 -1
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/slider.tsx +31 -0
- package/dist/components/ui/stepper.d.ts +40 -32
- package/dist/components/ui/stepper.d.ts.map +1 -0
- package/dist/components/ui/stepper.tsx +452 -0
- package/dist/components/ui/switch.d.ts +2 -1
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.tsx +27 -0
- package/dist/components/ui/table.d.ts +9 -8
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.tsx +80 -0
- package/dist/components/ui/tabs.d.ts +5 -4
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.tsx +45 -0
- package/dist/components/ui/textarea.d.ts +2 -1
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.tsx +22 -0
- package/dist/components/ui/tooltip.d.ts +5 -4
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.tsx +23 -0
- package/dist/constants/index.d.ts +2 -1
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/helpers/axiosGlobal.d.ts +7 -5
- package/dist/helpers/axiosGlobal.d.ts.map +1 -0
- package/dist/helpers/axiosGlobal.js +66 -0
- package/dist/helpers/image.d.ts +1 -0
- package/dist/helpers/image.d.ts.map +1 -0
- package/dist/helpers/image.js +11 -0
- package/dist/helpers/index.d.ts +1 -2
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/numbers.d.ts +1 -0
- package/dist/helpers/numbers.d.ts.map +1 -0
- package/dist/helpers/numbers.js +8 -0
- package/dist/helpers/strings.d.ts +1 -0
- package/dist/helpers/strings.d.ts.map +1 -0
- package/dist/helpers/strings.js +6 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +16 -0
- package/dist/hooks/useLanguage.d.ts +5 -0
- package/dist/hooks/useLanguage.d.ts.map +1 -0
- package/dist/hooks/useLanguage.js +32 -0
- package/dist/hooks/useNotification.d.ts +1 -0
- package/dist/hooks/useNotification.d.ts.map +1 -0
- package/dist/hooks/useNotification.js +17 -0
- package/dist/i18n/config.d.ts +82 -68
- package/dist/i18n/config.d.ts.map +1 -0
- package/dist/i18n/config.js +58 -0
- package/dist/i18n/index.d.ts +3 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/locales/en.json.js +12 -0
- package/dist/i18n/locales/es.json.js +12 -0
- package/dist/i18n/locales/fields/en.json.js +52 -0
- package/dist/i18n/locales/fields/es.json.js +52 -0
- package/dist/i18n/locales/messages/en.json.js +14 -0
- package/dist/i18n/locales/messages/es.json.js +14 -0
- package/dist/i18n/utils/getModuleNamespace.d.ts +16 -0
- package/dist/i18n/utils/getModuleNamespace.d.ts.map +1 -0
- package/dist/i18n/utils/getModuleNamespace.js +10 -0
- package/dist/i18n/utils/loadModuleTranslations.d.ts +5 -0
- package/dist/i18n/utils/loadModuleTranslations.d.ts.map +1 -0
- package/dist/i18n/utils/loadModuleTranslations.js +21 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +87 -20192
- package/dist/ingeniuscliq-core.css +1240 -0
- package/dist/lib/utils.d.ts +1 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +8 -0
- package/dist/modules/CoreAuth/classes/CoreAuthBuilder.d.ts +5 -3
- package/dist/modules/CoreAuth/classes/CoreAuthBuilder.d.ts.map +1 -0
- package/dist/modules/CoreAuth/classes/CoreAuthBuilder.js +185 -0
- package/dist/modules/CoreAuth/classes/index.d.ts +1 -0
- package/dist/modules/CoreAuth/classes/index.d.ts.map +1 -0
- package/dist/modules/CoreAuth/constants/auth.d.ts +1 -0
- package/dist/modules/CoreAuth/constants/auth.d.ts.map +1 -0
- package/dist/modules/CoreAuth/constants/auth.js +6 -0
- package/dist/modules/CoreAuth/constants/index.d.ts +1 -0
- package/dist/modules/CoreAuth/constants/index.d.ts.map +1 -0
- package/dist/modules/CoreAuth/context/AuthContext.d.ts +12 -0
- package/dist/modules/CoreAuth/context/AuthContext.d.ts.map +1 -0
- package/dist/modules/CoreAuth/context/AuthContext.tsx +4 -0
- package/dist/modules/CoreAuth/context/index.d.ts +2 -0
- package/dist/modules/CoreAuth/context/index.d.ts.map +1 -0
- package/dist/modules/CoreAuth/hooks/index.d.ts +1 -0
- package/dist/modules/CoreAuth/hooks/index.d.ts.map +1 -0
- package/dist/modules/CoreAuth/hooks/useAuth.d.ts +10 -9
- package/dist/modules/CoreAuth/hooks/useAuth.d.ts.map +1 -0
- package/dist/modules/CoreAuth/hooks/useAuth.js +38 -0
- package/dist/modules/CoreAuth/index.d.ts +8 -1
- package/dist/modules/CoreAuth/index.d.ts.map +1 -0
- package/dist/modules/CoreAuth/index.js +11 -0
- package/dist/modules/CoreAuth/locale/en.json.js +4 -0
- package/dist/modules/CoreAuth/locale/es.json.js +4 -0
- package/dist/modules/CoreAuth/registry/hooks/index.d.ts +1 -0
- package/dist/modules/CoreAuth/registry/hooks/index.d.ts.map +1 -0
- package/dist/modules/CoreAuth/registry/index.d.ts +1 -0
- package/dist/modules/CoreAuth/registry/index.d.ts.map +1 -0
- package/dist/modules/CoreAuth/registry/types/index.d.ts +1 -0
- package/dist/modules/CoreAuth/registry/types/index.d.ts.map +1 -0
- package/dist/modules/CoreAuth/services/base.d.ts +24 -5
- package/dist/modules/CoreAuth/services/base.d.ts.map +1 -0
- package/dist/modules/CoreAuth/services/base.js +53 -0
- package/dist/modules/CoreAuth/services/index.d.ts +1 -0
- package/dist/modules/CoreAuth/services/index.d.ts.map +1 -0
- package/dist/modules/CoreAuth/stores/authStore.d.ts +15 -8
- package/dist/modules/CoreAuth/stores/authStore.d.ts.map +1 -0
- package/dist/modules/CoreAuth/stores/authStore.js +13 -0
- package/dist/modules/CoreAuth/stores/index.d.ts +1 -0
- package/dist/modules/CoreAuth/stores/index.d.ts.map +1 -0
- package/dist/modules/CoreAuth/types/CoreAuth.d.ts +10 -6
- package/dist/modules/CoreAuth/types/CoreAuth.d.ts.map +1 -0
- package/dist/modules/CoreAuth/types/index.d.ts +1 -0
- package/dist/modules/CoreAuth/types/index.d.ts.map +1 -0
- package/dist/modules/CoreCustomization/classes/CoreCustomizationBuilder.d.ts +8 -8
- package/dist/modules/CoreCustomization/classes/CoreCustomizationBuilder.d.ts.map +1 -0
- package/dist/modules/CoreCustomization/classes/CoreCustomizationBuilder.js +82 -0
- package/dist/modules/CoreCustomization/classes/index.d.ts +1 -0
- package/dist/modules/CoreCustomization/classes/index.d.ts.map +1 -0
- package/dist/modules/CoreCustomization/index.d.ts +4 -1
- package/dist/modules/CoreCustomization/index.d.ts.map +1 -0
- package/dist/modules/CoreCustomization/index.js +9 -0
- package/dist/modules/CoreCustomization/locale/en.json.js +4 -0
- package/dist/modules/CoreCustomization/locale/es.json.js +4 -0
- package/dist/modules/CoreCustomization/registry/index.d.ts +1 -0
- package/dist/modules/CoreCustomization/registry/index.d.ts.map +1 -0
- package/dist/modules/CoreCustomization/registry/types/index.d.ts +1 -0
- package/dist/modules/CoreCustomization/registry/types/index.d.ts.map +1 -0
- package/dist/modules/CoreCustomization/services/base.d.ts +8 -1
- package/dist/modules/CoreCustomization/services/base.d.ts.map +1 -0
- package/dist/modules/CoreCustomization/services/base.js +21 -0
- package/dist/modules/CoreCustomization/services/index.d.ts +1 -0
- package/dist/modules/CoreCustomization/services/index.d.ts.map +1 -0
- package/dist/modules/CoreCustomization/types/CoreCustomization.d.ts +1 -0
- package/dist/modules/CoreCustomization/types/CoreCustomization.d.ts.map +1 -0
- package/dist/modules/CoreCustomization/types/index.d.ts +1 -0
- package/dist/modules/CoreCustomization/types/index.d.ts.map +1 -0
- package/dist/modules/CoreOrder/classes/CoreOrderBuilder.d.ts +4 -3
- package/dist/modules/CoreOrder/classes/CoreOrderBuilder.d.ts.map +1 -0
- package/dist/modules/CoreOrder/classes/CoreOrderBuilder.js +113 -0
- package/dist/modules/CoreOrder/classes/index.d.ts +1 -0
- package/dist/modules/CoreOrder/classes/index.d.ts.map +1 -0
- package/dist/modules/CoreOrder/index.d.ts +4 -1
- package/dist/modules/CoreOrder/index.d.ts.map +1 -0
- package/dist/modules/CoreOrder/index.js +9 -0
- package/dist/modules/CoreOrder/locale/en.json.js +4 -0
- package/dist/modules/CoreOrder/locale/es.json.js +4 -0
- package/dist/modules/CoreOrder/registry/hooks/index.d.ts +1 -0
- package/dist/modules/CoreOrder/registry/hooks/index.d.ts.map +1 -0
- package/dist/modules/CoreOrder/registry/index.d.ts +1 -0
- package/dist/modules/CoreOrder/registry/index.d.ts.map +1 -0
- package/dist/modules/CoreOrder/registry/types/index.d.ts +1 -0
- package/dist/modules/CoreOrder/registry/types/index.d.ts.map +1 -0
- package/dist/modules/CoreOrder/services/base.d.ts +17 -1
- package/dist/modules/CoreOrder/services/base.d.ts.map +1 -0
- package/dist/modules/CoreOrder/services/base.js +27 -0
- package/dist/modules/CoreOrder/services/index.d.ts +1 -0
- package/dist/modules/CoreOrder/services/index.d.ts.map +1 -0
- package/dist/modules/CoreOrder/types/CoreOrder.d.ts +1 -0
- package/dist/modules/CoreOrder/types/CoreOrder.d.ts.map +1 -0
- package/dist/modules/CoreOrder/types/index.d.ts +1 -0
- package/dist/modules/CoreOrder/types/index.d.ts.map +1 -0
- package/dist/modules/CoreOrder/types/interfaces/OrderActions.d.ts +1 -0
- package/dist/modules/CoreOrder/types/interfaces/OrderActions.d.ts.map +1 -0
- package/dist/modules/CoreOrder/types/interfaces/index.d.ts +1 -0
- package/dist/modules/CoreOrder/types/interfaces/index.d.ts.map +1 -0
- package/dist/modules/CorePayForm/classes/CorePayFormBuilder.d.ts +12 -11
- package/dist/modules/CorePayForm/classes/CorePayFormBuilder.d.ts.map +1 -0
- package/dist/modules/CorePayForm/classes/CorePayFormBuilder.js +67 -0
- package/dist/modules/CorePayForm/classes/index.d.ts +1 -0
- package/dist/modules/CorePayForm/classes/index.d.ts.map +1 -0
- package/dist/modules/CorePayForm/index.d.ts +4 -1
- package/dist/modules/CorePayForm/index.d.ts.map +1 -0
- package/dist/modules/CorePayForm/index.js +9 -0
- package/dist/modules/CorePayForm/locale/en.json.js +4 -0
- package/dist/modules/CorePayForm/locale/es.json.js +4 -0
- package/dist/modules/CorePayForm/registry/hooks/index.d.ts +1 -0
- package/dist/modules/CorePayForm/registry/hooks/index.d.ts.map +1 -0
- package/dist/modules/CorePayForm/registry/index.d.ts +1 -0
- package/dist/modules/CorePayForm/registry/index.d.ts.map +1 -0
- package/dist/modules/CorePayForm/registry/types/index.d.ts +1 -0
- package/dist/modules/CorePayForm/registry/types/index.d.ts.map +1 -0
- package/dist/modules/CorePayForm/services/base.d.ts +12 -1
- package/dist/modules/CorePayForm/services/base.d.ts.map +1 -0
- package/dist/modules/CorePayForm/services/base.js +21 -0
- package/dist/modules/CorePayForm/services/index.d.ts +1 -0
- package/dist/modules/CorePayForm/services/index.d.ts.map +1 -0
- package/dist/modules/CorePayForm/types/CorePayForm.d.ts +1 -0
- package/dist/modules/CorePayForm/types/CorePayForm.d.ts.map +1 -0
- package/dist/modules/CorePayForm/types/index.d.ts +1 -0
- package/dist/modules/CorePayForm/types/index.d.ts.map +1 -0
- package/dist/modules/CoreProduct/classes/CoreProductBuilder.d.ts +5 -4
- package/dist/modules/CoreProduct/classes/CoreProductBuilder.d.ts.map +1 -0
- package/dist/modules/CoreProduct/classes/CoreProductBuilder.js +120 -0
- package/dist/modules/CoreProduct/classes/index.d.ts +1 -0
- package/dist/modules/CoreProduct/classes/index.d.ts.map +1 -0
- package/dist/modules/CoreProduct/index.d.ts +4 -1
- package/dist/modules/CoreProduct/index.d.ts.map +1 -0
- package/dist/modules/CoreProduct/index.js +9 -0
- package/dist/modules/CoreProduct/locale/en.json.js +14 -0
- package/dist/modules/CoreProduct/locale/es.json.js +14 -0
- package/dist/modules/CoreProduct/registry/index.d.ts +1 -0
- package/dist/modules/CoreProduct/registry/index.d.ts.map +1 -0
- package/dist/modules/CoreProduct/registry/types/index.d.ts +1 -0
- package/dist/modules/CoreProduct/registry/types/index.d.ts.map +1 -0
- package/dist/modules/CoreProduct/services/base.d.ts +20 -7
- package/dist/modules/CoreProduct/services/base.d.ts.map +1 -0
- package/dist/modules/CoreProduct/services/base.js +35 -0
- package/dist/modules/CoreProduct/services/index.d.ts +1 -0
- package/dist/modules/CoreProduct/services/index.d.ts.map +1 -0
- package/dist/modules/CoreProduct/types/CoreProduct.d.ts +1 -0
- package/dist/modules/CoreProduct/types/CoreProduct.d.ts.map +1 -0
- package/dist/modules/CoreProduct/types/CoreProductCategory.d.ts +1 -0
- package/dist/modules/CoreProduct/types/CoreProductCategory.d.ts.map +1 -0
- package/dist/modules/CoreProduct/types/index.d.ts +1 -0
- package/dist/modules/CoreProduct/types/index.d.ts.map +1 -0
- package/dist/modules/CoreShipment/classes/CoreShipmentBuilder.d.ts +6 -5
- package/dist/modules/CoreShipment/classes/CoreShipmentBuilder.d.ts.map +1 -0
- package/dist/modules/CoreShipment/classes/CoreShipmentBuilder.js +172 -0
- package/dist/modules/CoreShipment/classes/index.d.ts +1 -0
- package/dist/modules/CoreShipment/classes/index.d.ts.map +1 -0
- package/dist/modules/CoreShipment/index.d.ts +4 -1
- package/dist/modules/CoreShipment/index.d.ts.map +1 -0
- package/dist/modules/CoreShipment/index.js +9 -0
- package/dist/modules/CoreShipment/locale/en.json.js +14 -0
- package/dist/modules/CoreShipment/locale/es.json.js +14 -0
- package/dist/modules/CoreShipment/registry/classes/index.d.ts +1 -0
- package/dist/modules/CoreShipment/registry/classes/index.d.ts.map +1 -0
- package/dist/modules/CoreShipment/registry/index.d.ts +1 -0
- package/dist/modules/CoreShipment/registry/index.d.ts.map +1 -0
- package/dist/modules/CoreShipment/registry/services/index.d.ts +1 -0
- package/dist/modules/CoreShipment/registry/services/index.d.ts.map +1 -0
- package/dist/modules/CoreShipment/registry/types/index.d.ts +1 -0
- package/dist/modules/CoreShipment/registry/types/index.d.ts.map +1 -0
- package/dist/modules/CoreShipment/services/base.d.ts +30 -2
- package/dist/modules/CoreShipment/services/base.d.ts.map +1 -0
- package/dist/modules/CoreShipment/services/base.js +63 -0
- package/dist/modules/CoreShipment/services/index.d.ts +1 -0
- package/dist/modules/CoreShipment/services/index.d.ts.map +1 -0
- package/dist/modules/CoreShipment/types/CoreShipment.d.ts +1 -0
- package/dist/modules/CoreShipment/types/CoreShipment.d.ts.map +1 -0
- package/dist/modules/CoreShipment/types/CoreShipment.js +7 -0
- package/dist/modules/CoreShipment/types/index.d.ts +1 -0
- package/dist/modules/CoreShipment/types/index.d.ts.map +1 -0
- package/dist/modules/CoreShopCart/classes/CoreShopCartBuilder.d.ts +16 -5
- package/dist/modules/CoreShopCart/classes/CoreShopCartBuilder.d.ts.map +1 -0
- package/dist/modules/CoreShopCart/classes/CoreShopCartBuilder.js +166 -0
- package/dist/modules/CoreShopCart/classes/index.d.ts +1 -0
- package/dist/modules/CoreShopCart/classes/index.d.ts.map +1 -0
- package/dist/modules/CoreShopCart/constants/index.d.ts +1 -0
- package/dist/modules/CoreShopCart/constants/index.d.ts.map +1 -0
- package/dist/modules/CoreShopCart/constants/shopCart.d.ts +1 -0
- package/dist/modules/CoreShopCart/constants/shopCart.d.ts.map +1 -0
- package/dist/modules/CoreShopCart/constants/shopCart.js +8 -0
- package/dist/modules/CoreShopCart/index.d.ts +1 -0
- package/dist/modules/CoreShopCart/index.d.ts.map +1 -0
- package/dist/modules/CoreShopCart/index.js +8 -0
- package/dist/modules/CoreShopCart/locale/en.json.js +4 -0
- package/dist/modules/CoreShopCart/locale/es.json.js +4 -0
- package/dist/modules/CoreShopCart/registry/hooks/index.d.ts +1 -0
- package/dist/modules/CoreShopCart/registry/hooks/index.d.ts.map +1 -0
- package/dist/modules/CoreShopCart/registry/index.d.ts +1 -0
- package/dist/modules/CoreShopCart/registry/index.d.ts.map +1 -0
- package/dist/modules/CoreShopCart/registry/types/index.d.ts +1 -0
- package/dist/modules/CoreShopCart/registry/types/index.d.ts.map +1 -0
- package/dist/modules/CoreShopCart/services/base.d.ts +23 -4
- package/dist/modules/CoreShopCart/services/base.d.ts.map +1 -0
- package/dist/modules/CoreShopCart/services/base.js +53 -0
- package/dist/modules/CoreShopCart/services/index.d.ts +1 -0
- package/dist/modules/CoreShopCart/services/index.d.ts.map +1 -0
- package/dist/modules/CoreShopCart/types/CoreShopCart.d.ts +1 -0
- package/dist/modules/CoreShopCart/types/CoreShopCart.d.ts.map +1 -0
- package/dist/modules/CoreShopCart/types/index.d.ts +1 -0
- package/dist/modules/CoreShopCart/types/index.d.ts.map +1 -0
- package/dist/modules/CoreShopCart/types/interfaces/CartActions.d.ts +1 -0
- package/dist/modules/CoreShopCart/types/interfaces/CartActions.d.ts.map +1 -0
- package/dist/modules/CoreShopCart/types/interfaces/index.d.ts +1 -0
- package/dist/modules/CoreShopCart/types/interfaces/index.d.ts.map +1 -0
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/registry/hooks/index.d.ts +1 -0
- package/dist/modules/registry/hooks/index.d.ts.map +1 -0
- package/dist/modules/registry/index.d.ts +1 -0
- package/dist/modules/registry/index.d.ts.map +1 -0
- package/dist/modules/registry/types/index.d.ts +1 -0
- package/dist/modules/registry/types/index.d.ts.map +1 -0
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +814 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +751 -0
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +350 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +161 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +137 -0
- package/dist/node_modules/@radix-ui/number/dist/index.js +6 -0
- package/dist/node_modules/@radix-ui/primitive/dist/index.js +11 -0
- package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +305 -0
- package/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.js +147 -0
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +25 -0
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +118 -0
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +270 -0
- package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +145 -0
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js +70 -0
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +39 -0
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +79 -0
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +321 -0
- package/dist/node_modules/@radix-ui/react-direction/dist/index.js +11 -0
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +211 -0
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +267 -0
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +29 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +207 -0
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +15 -0
- package/dist/node_modules/@radix-ui/react-label/dist/index.js +24 -0
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js +834 -0
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +299 -0
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +283 -0
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +17 -0
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +130 -0
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +43 -0
- package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +282 -0
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +223 -0
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +1156 -0
- package/dist/node_modules/@radix-ui/react-separator/dist/index.js +30 -0
- package/dist/node_modules/@radix-ui/react-slider/dist/index.js +554 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +99 -0
- package/dist/node_modules/@radix-ui/react-switch/dist/index.js +152 -0
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +187 -0
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +482 -0
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +12 -0
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +70 -0
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +18 -0
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +16 -0
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +7 -0
- package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +15 -0
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +40 -0
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +35 -0
- package/dist/node_modules/@stepperize/core/dist/index.js +3 -0
- package/dist/node_modules/@stepperize/react/dist/index.js +6 -0
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +137 -0
- package/dist/node_modules/axios/index.js +25 -0
- package/dist/node_modules/axios/lib/adapters/adapters.js +81 -0
- package/dist/node_modules/axios/lib/adapters/fetch.js +229 -0
- package/dist/node_modules/axios/lib/adapters/xhr.js +199 -0
- package/dist/node_modules/axios/lib/axios.js +86 -0
- package/dist/node_modules/axios/lib/cancel/CancelToken.js +133 -0
- package/dist/node_modules/axios/lib/cancel/CanceledError.js +23 -0
- package/dist/node_modules/axios/lib/cancel/isCancel.js +5 -0
- package/dist/node_modules/axios/lib/core/Axios.js +238 -0
- package/dist/node_modules/axios/lib/core/AxiosError.js +101 -0
- package/dist/node_modules/axios/lib/core/AxiosHeaders.js +312 -0
- package/dist/node_modules/axios/lib/core/InterceptorManager.js +69 -0
- package/dist/node_modules/axios/lib/core/buildFullPath.js +22 -0
- package/dist/node_modules/axios/lib/core/dispatchRequest.js +81 -0
- package/dist/node_modules/axios/lib/core/mergeConfig.js +106 -0
- package/dist/node_modules/axios/lib/core/settle.js +27 -0
- package/dist/node_modules/axios/lib/core/transformData.js +28 -0
- package/dist/node_modules/axios/lib/defaults/index.js +159 -0
- package/dist/node_modules/axios/lib/defaults/transitional.js +7 -0
- package/dist/node_modules/axios/lib/env/data.js +3 -0
- package/dist/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +56 -0
- package/dist/node_modules/axios/lib/helpers/HttpStatusCode.js +71 -0
- package/dist/node_modules/axios/lib/helpers/bind.js +7 -0
- package/dist/node_modules/axios/lib/helpers/buildURL.js +69 -0
- package/dist/node_modules/axios/lib/helpers/combineURLs.js +15 -0
- package/dist/node_modules/axios/lib/helpers/composeSignals.js +48 -0
- package/dist/node_modules/axios/lib/helpers/cookies.js +43 -0
- package/dist/node_modules/axios/lib/helpers/formDataToJSON.js +93 -0
- package/dist/node_modules/axios/lib/helpers/isAbsoluteURL.js +15 -0
- package/dist/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
- package/dist/node_modules/axios/lib/helpers/isURLSameOrigin.js +16 -0
- package/dist/node_modules/axios/lib/helpers/null.js +4 -0
- package/dist/node_modules/axios/lib/helpers/parseHeaders.js +55 -0
- package/dist/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
- package/dist/node_modules/axios/lib/helpers/progressEventReducer.js +46 -0
- package/dist/node_modules/axios/lib/helpers/resolveConfig.js +58 -0
- package/dist/node_modules/axios/lib/helpers/speedometer.js +53 -0
- package/dist/node_modules/axios/lib/helpers/spread.js +28 -0
- package/dist/node_modules/axios/lib/helpers/throttle.js +44 -0
- package/dist/node_modules/axios/lib/helpers/toFormData.js +219 -0
- package/dist/node_modules/axios/lib/helpers/toURLEncodedForm.js +19 -0
- package/dist/node_modules/axios/lib/helpers/trackStream.js +88 -0
- package/dist/node_modules/axios/lib/helpers/validator.js +99 -0
- package/dist/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
- package/dist/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
- package/dist/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +5 -0
- package/dist/node_modules/axios/lib/platform/browser/index.js +15 -0
- package/dist/node_modules/axios/lib/platform/common/utils.js +45 -0
- package/dist/node_modules/axios/lib/platform/index.js +9 -0
- package/dist/node_modules/axios/lib/utils.js +780 -0
- package/dist/node_modules/class-variance-authority/dist/index.js +44 -0
- package/dist/node_modules/clsx/dist/clsx.js +3 -0
- package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +1669 -0
- package/dist/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +37 -0
- package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +38 -0
- package/dist/node_modules/get-nonce/dist/es2015/index.js +8 -0
- package/dist/node_modules/lucide-react/dist/esm/Icon.js +43 -0
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +30 -0
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +20 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left.js +17 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-right.js +17 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/check.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis.js +18 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/x.js +17 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +28 -0
- package/dist/node_modules/react-hook-form/dist/index.esm.js +560 -0
- package/dist/node_modules/react-i18next/dist/es/IcuTransUtils/htmlEntityDecoder.js +210 -0
- package/dist/node_modules/react-i18next/dist/es/context.js +18 -0
- package/dist/node_modules/react-i18next/dist/es/defaults.js +22 -0
- package/dist/node_modules/react-i18next/dist/es/i18nInstance.js +7 -0
- package/dist/node_modules/react-i18next/dist/es/initReactI18next.js +12 -0
- package/dist/node_modules/react-i18next/dist/es/unescape.js +27 -0
- package/dist/node_modules/react-i18next/dist/es/useTranslation.js +157 -0
- package/dist/node_modules/react-i18next/dist/es/utils.js +63 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +9 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +167 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +38 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +21 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +110 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +5 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +7 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +56 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +10 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +31 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js +19 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +25 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +51 -0
- package/dist/node_modules/sonner/dist/index.js +299 -0
- package/dist/node_modules/tslib/tslib.es6.js +56 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +24 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +48 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +42 -0
- package/dist/node_modules/use-sidecar/dist/es2015/exports.js +21 -0
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js +77 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +106 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +77 -0
- package/dist/node_modules/use-sync-external-store/shim/index.js +19 -0
- package/dist/node_modules/zustand/esm/middleware.js +188 -0
- package/dist/node_modules/zustand/esm/react.js +22 -0
- package/dist/node_modules/zustand/esm/vanilla.js +24 -0
- package/dist/services/base.d.ts +1 -0
- package/dist/services/base.d.ts.map +1 -0
- package/dist/services/base.js +67 -0
- package/dist/services/factory.d.ts +14 -0
- package/dist/services/factory.d.ts.map +1 -0
- package/dist/services/factory.js +39 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/stores/customizationStore.d.ts +5 -27
- package/dist/stores/customizationStore.d.ts.map +1 -0
- package/dist/stores/customizationStore.js +7 -0
- package/dist/stores/index.d.ts +1 -0
- package/dist/stores/index.d.ts.map +1 -0
- package/dist/styles/index.d.ts +1 -0
- package/dist/styles/index.d.ts.map +1 -0
- package/dist/types/BaseResponseActions.d.ts +1 -0
- package/dist/types/BaseResponseActions.d.ts.map +1 -0
- package/dist/types/BaseStore.d.ts +1 -0
- package/dist/types/BaseStore.d.ts.map +1 -0
- package/dist/types/BaseType.d.ts +1 -0
- package/dist/types/BaseType.d.ts.map +1 -0
- package/dist/types/CoreImage.d.ts +1 -0
- package/dist/types/CoreImage.d.ts.map +1 -0
- package/dist/types/CoreMenu.d.ts +1 -0
- package/dist/types/CoreMenu.d.ts.map +1 -0
- package/dist/types/contracts/BaseApiResponse.d.ts +1 -0
- package/dist/types/contracts/BaseApiResponse.d.ts.map +1 -0
- package/dist/types/contracts/BasePagination.d.ts +1 -0
- package/dist/types/contracts/BasePagination.d.ts.map +1 -0
- package/dist/types/contracts/index.d.ts +1 -0
- package/dist/types/contracts/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/interfaces/BaseImageType.d.ts +1 -0
- package/dist/types/interfaces/BaseImageType.d.ts.map +1 -0
- package/dist/types/interfaces/BaseSlugType.d.ts +1 -0
- package/dist/types/interfaces/BaseSlugType.d.ts.map +1 -0
- package/dist/types/interfaces/BaseVisibleType.d.ts +1 -0
- package/dist/types/interfaces/BaseVisibleType.d.ts.map +1 -0
- package/dist/types/interfaces/index.d.ts +1 -0
- package/dist/types/interfaces/index.d.ts.map +1 -0
- package/dist/types/ui/carousel.d.ts +1 -0
- package/dist/types/ui/carousel.d.ts.map +1 -0
- package/dist/types/ui/index.d.ts +1 -0
- package/dist/types/ui/index.d.ts.map +1 -0
- package/dist/types/ui/main.d.ts +1 -0
- package/dist/types/ui/main.d.ts.map +1 -0
- package/dist/types/ui/template.d.ts +1 -0
- package/dist/types/ui/template.d.ts.map +1 -0
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/vite-env.d.ts +11 -0
- package/package.json +22 -15
- package/core/commands/common/constants.js +0 -10
- package/core/commands/helpers/index.js +0 -15
- package/core/commands/helpers/strings.js +0 -4
- package/core/commands/templates/locale.js +0 -14
- package/core/commands/templates/service.js +0 -12
- package/core/commands/templates/type.js +0 -10
- package/dist/assets/index.d.ts +0 -8
- package/dist/components/ui/calendar.d.ts +0 -4
- package/dist/components/ui/drawer.d.ts +0 -13
- package/dist/components/ui/navigation-menu.d.ts +0 -14
- package/dist/components/ui/sidebar.d.ts +0 -69
- package/dist/components/ui/sonner.d.ts +0 -3
- package/dist/constants/menu.d.ts +0 -2
- package/dist/helpers/template.d.ts +0 -2
- package/dist/helpers/tenant.d.ts +0 -2
- package/dist/index.css +0 -1
- package/dist/modules/CoreCustomization/registry/hooks/index.d.ts +0 -0
- package/dist/modules/CoreProduct/registry/hooks/index.d.ts +0 -0
- /package/{core → src/core}/commands/create-core-module.js +0 -0
- /package/{core → src/core}/commands/create-module.js +0 -0
- /package/{core → src/core}/commands/create-template.js +0 -0
- /package/{core → src/core}/commands/rollback-core-module.js +0 -0
- /package/{core → src/core}/commands/rollback-module.js +0 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import utils from '../utils.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} message The error message.
|
|
7
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
8
|
+
* @param {Object} [config] The config.
|
|
9
|
+
* @param {Object} [request] The request.
|
|
10
|
+
* @param {Object} [response] The response.
|
|
11
|
+
*
|
|
12
|
+
* @returns {Error} The created error.
|
|
13
|
+
*/
|
|
14
|
+
function AxiosError(message, code, config, request, response) {
|
|
15
|
+
Error.call(this);
|
|
16
|
+
|
|
17
|
+
if (Error.captureStackTrace) {
|
|
18
|
+
Error.captureStackTrace(this, this.constructor);
|
|
19
|
+
} else {
|
|
20
|
+
this.stack = (new Error()).stack;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
this.message = message;
|
|
24
|
+
this.name = 'AxiosError';
|
|
25
|
+
code && (this.code = code);
|
|
26
|
+
config && (this.config = config);
|
|
27
|
+
request && (this.request = request);
|
|
28
|
+
if (response) {
|
|
29
|
+
this.response = response;
|
|
30
|
+
this.status = response.status ? response.status : null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
utils.inherits(AxiosError, Error, {
|
|
35
|
+
toJSON: function toJSON() {
|
|
36
|
+
return {
|
|
37
|
+
// Standard
|
|
38
|
+
message: this.message,
|
|
39
|
+
name: this.name,
|
|
40
|
+
// Microsoft
|
|
41
|
+
description: this.description,
|
|
42
|
+
number: this.number,
|
|
43
|
+
// Mozilla
|
|
44
|
+
fileName: this.fileName,
|
|
45
|
+
lineNumber: this.lineNumber,
|
|
46
|
+
columnNumber: this.columnNumber,
|
|
47
|
+
stack: this.stack,
|
|
48
|
+
// Axios
|
|
49
|
+
config: utils.toJSONObject(this.config),
|
|
50
|
+
code: this.code,
|
|
51
|
+
status: this.status
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const prototype = AxiosError.prototype;
|
|
57
|
+
const descriptors = {};
|
|
58
|
+
|
|
59
|
+
[
|
|
60
|
+
'ERR_BAD_OPTION_VALUE',
|
|
61
|
+
'ERR_BAD_OPTION',
|
|
62
|
+
'ECONNABORTED',
|
|
63
|
+
'ETIMEDOUT',
|
|
64
|
+
'ERR_NETWORK',
|
|
65
|
+
'ERR_FR_TOO_MANY_REDIRECTS',
|
|
66
|
+
'ERR_DEPRECATED',
|
|
67
|
+
'ERR_BAD_RESPONSE',
|
|
68
|
+
'ERR_BAD_REQUEST',
|
|
69
|
+
'ERR_CANCELED',
|
|
70
|
+
'ERR_NOT_SUPPORT',
|
|
71
|
+
'ERR_INVALID_URL'
|
|
72
|
+
// eslint-disable-next-line func-names
|
|
73
|
+
].forEach(code => {
|
|
74
|
+
descriptors[code] = {value: code};
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
Object.defineProperties(AxiosError, descriptors);
|
|
78
|
+
Object.defineProperty(prototype, 'isAxiosError', {value: true});
|
|
79
|
+
|
|
80
|
+
// eslint-disable-next-line func-names
|
|
81
|
+
AxiosError.from = (error, code, config, request, response, customProps) => {
|
|
82
|
+
const axiosError = Object.create(prototype);
|
|
83
|
+
|
|
84
|
+
utils.toFlatObject(error, axiosError, function filter(obj) {
|
|
85
|
+
return obj !== Error.prototype;
|
|
86
|
+
}, prop => {
|
|
87
|
+
return prop !== 'isAxiosError';
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
AxiosError.call(axiosError, error.message, code, config, request, response);
|
|
91
|
+
|
|
92
|
+
axiosError.cause = error;
|
|
93
|
+
|
|
94
|
+
axiosError.name = error.name;
|
|
95
|
+
|
|
96
|
+
customProps && Object.assign(axiosError, customProps);
|
|
97
|
+
|
|
98
|
+
return axiosError;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export { AxiosError as default };
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import utils from '../utils.js';
|
|
2
|
+
import parseHeaders from '../helpers/parseHeaders.js';
|
|
3
|
+
|
|
4
|
+
const $internals = Symbol('internals');
|
|
5
|
+
|
|
6
|
+
function normalizeHeader(header) {
|
|
7
|
+
return header && String(header).trim().toLowerCase();
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function normalizeValue(value) {
|
|
11
|
+
if (value === false || value == null) {
|
|
12
|
+
return value;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return utils.isArray(value) ? value.map(normalizeValue) : String(value);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function parseTokens(str) {
|
|
19
|
+
const tokens = Object.create(null);
|
|
20
|
+
const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
21
|
+
let match;
|
|
22
|
+
|
|
23
|
+
while ((match = tokensRE.exec(str))) {
|
|
24
|
+
tokens[match[1]] = match[2];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return tokens;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
|
31
|
+
|
|
32
|
+
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
33
|
+
if (utils.isFunction(filter)) {
|
|
34
|
+
return filter.call(this, value, header);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (isHeaderNameFilter) {
|
|
38
|
+
value = header;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (!utils.isString(value)) return;
|
|
42
|
+
|
|
43
|
+
if (utils.isString(filter)) {
|
|
44
|
+
return value.indexOf(filter) !== -1;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (utils.isRegExp(filter)) {
|
|
48
|
+
return filter.test(value);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function formatHeader(header) {
|
|
53
|
+
return header.trim()
|
|
54
|
+
.toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
|
|
55
|
+
return char.toUpperCase() + str;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function buildAccessors(obj, header) {
|
|
60
|
+
const accessorName = utils.toCamelCase(' ' + header);
|
|
61
|
+
|
|
62
|
+
['get', 'set', 'has'].forEach(methodName => {
|
|
63
|
+
Object.defineProperty(obj, methodName + accessorName, {
|
|
64
|
+
value: function(arg1, arg2, arg3) {
|
|
65
|
+
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
66
|
+
},
|
|
67
|
+
configurable: true
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
class AxiosHeaders {
|
|
73
|
+
constructor(headers) {
|
|
74
|
+
headers && this.set(headers);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
set(header, valueOrRewrite, rewrite) {
|
|
78
|
+
const self = this;
|
|
79
|
+
|
|
80
|
+
function setHeader(_value, _header, _rewrite) {
|
|
81
|
+
const lHeader = normalizeHeader(_header);
|
|
82
|
+
|
|
83
|
+
if (!lHeader) {
|
|
84
|
+
throw new Error('header name must be a non-empty string');
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const key = utils.findKey(self, lHeader);
|
|
88
|
+
|
|
89
|
+
if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
|
|
90
|
+
self[key || _header] = normalizeValue(_value);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const setHeaders = (headers, _rewrite) =>
|
|
95
|
+
utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
|
96
|
+
|
|
97
|
+
if (utils.isPlainObject(header) || header instanceof this.constructor) {
|
|
98
|
+
setHeaders(header, valueOrRewrite);
|
|
99
|
+
} else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
100
|
+
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
101
|
+
} else if (utils.isObject(header) && utils.isIterable(header)) {
|
|
102
|
+
let obj = {}, dest, key;
|
|
103
|
+
for (const entry of header) {
|
|
104
|
+
if (!utils.isArray(entry)) {
|
|
105
|
+
throw TypeError('Object iterator must return a key-value pair');
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
obj[key = entry[0]] = (dest = obj[key]) ?
|
|
109
|
+
(utils.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
setHeaders(obj, valueOrRewrite);
|
|
113
|
+
} else {
|
|
114
|
+
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return this;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
get(header, parser) {
|
|
121
|
+
header = normalizeHeader(header);
|
|
122
|
+
|
|
123
|
+
if (header) {
|
|
124
|
+
const key = utils.findKey(this, header);
|
|
125
|
+
|
|
126
|
+
if (key) {
|
|
127
|
+
const value = this[key];
|
|
128
|
+
|
|
129
|
+
if (!parser) {
|
|
130
|
+
return value;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (parser === true) {
|
|
134
|
+
return parseTokens(value);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (utils.isFunction(parser)) {
|
|
138
|
+
return parser.call(this, value, key);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (utils.isRegExp(parser)) {
|
|
142
|
+
return parser.exec(value);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
throw new TypeError('parser must be boolean|regexp|function');
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
has(header, matcher) {
|
|
151
|
+
header = normalizeHeader(header);
|
|
152
|
+
|
|
153
|
+
if (header) {
|
|
154
|
+
const key = utils.findKey(this, header);
|
|
155
|
+
|
|
156
|
+
return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
delete(header, matcher) {
|
|
163
|
+
const self = this;
|
|
164
|
+
let deleted = false;
|
|
165
|
+
|
|
166
|
+
function deleteHeader(_header) {
|
|
167
|
+
_header = normalizeHeader(_header);
|
|
168
|
+
|
|
169
|
+
if (_header) {
|
|
170
|
+
const key = utils.findKey(self, _header);
|
|
171
|
+
|
|
172
|
+
if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
|
|
173
|
+
delete self[key];
|
|
174
|
+
|
|
175
|
+
deleted = true;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (utils.isArray(header)) {
|
|
181
|
+
header.forEach(deleteHeader);
|
|
182
|
+
} else {
|
|
183
|
+
deleteHeader(header);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return deleted;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
clear(matcher) {
|
|
190
|
+
const keys = Object.keys(this);
|
|
191
|
+
let i = keys.length;
|
|
192
|
+
let deleted = false;
|
|
193
|
+
|
|
194
|
+
while (i--) {
|
|
195
|
+
const key = keys[i];
|
|
196
|
+
if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
197
|
+
delete this[key];
|
|
198
|
+
deleted = true;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return deleted;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
normalize(format) {
|
|
206
|
+
const self = this;
|
|
207
|
+
const headers = {};
|
|
208
|
+
|
|
209
|
+
utils.forEach(this, (value, header) => {
|
|
210
|
+
const key = utils.findKey(headers, header);
|
|
211
|
+
|
|
212
|
+
if (key) {
|
|
213
|
+
self[key] = normalizeValue(value);
|
|
214
|
+
delete self[header];
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
const normalized = format ? formatHeader(header) : String(header).trim();
|
|
219
|
+
|
|
220
|
+
if (normalized !== header) {
|
|
221
|
+
delete self[header];
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
self[normalized] = normalizeValue(value);
|
|
225
|
+
|
|
226
|
+
headers[normalized] = true;
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
return this;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
concat(...targets) {
|
|
233
|
+
return this.constructor.concat(this, ...targets);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
toJSON(asStrings) {
|
|
237
|
+
const obj = Object.create(null);
|
|
238
|
+
|
|
239
|
+
utils.forEach(this, (value, header) => {
|
|
240
|
+
value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
return obj;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
[Symbol.iterator]() {
|
|
247
|
+
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
toString() {
|
|
251
|
+
return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
getSetCookie() {
|
|
255
|
+
return this.get("set-cookie") || [];
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
get [Symbol.toStringTag]() {
|
|
259
|
+
return 'AxiosHeaders';
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
static from(thing) {
|
|
263
|
+
return thing instanceof this ? thing : new this(thing);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
static concat(first, ...targets) {
|
|
267
|
+
const computed = new this(first);
|
|
268
|
+
|
|
269
|
+
targets.forEach((target) => computed.set(target));
|
|
270
|
+
|
|
271
|
+
return computed;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
static accessor(header) {
|
|
275
|
+
const internals = this[$internals] = (this[$internals] = {
|
|
276
|
+
accessors: {}
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
const accessors = internals.accessors;
|
|
280
|
+
const prototype = this.prototype;
|
|
281
|
+
|
|
282
|
+
function defineAccessor(_header) {
|
|
283
|
+
const lHeader = normalizeHeader(_header);
|
|
284
|
+
|
|
285
|
+
if (!accessors[lHeader]) {
|
|
286
|
+
buildAccessors(prototype, _header);
|
|
287
|
+
accessors[lHeader] = true;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
292
|
+
|
|
293
|
+
return this;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
|
|
298
|
+
|
|
299
|
+
// reserved names hotfix
|
|
300
|
+
utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
|
|
301
|
+
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
|
302
|
+
return {
|
|
303
|
+
get: () => value,
|
|
304
|
+
set(headerValue) {
|
|
305
|
+
this[mapped] = headerValue;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
utils.freezeMethods(AxiosHeaders);
|
|
311
|
+
|
|
312
|
+
export { AxiosHeaders as default };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import utils from '../utils.js';
|
|
2
|
+
|
|
3
|
+
class InterceptorManager {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.handlers = [];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Add a new interceptor to the stack
|
|
10
|
+
*
|
|
11
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
12
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
13
|
+
*
|
|
14
|
+
* @return {Number} An ID used to remove interceptor later
|
|
15
|
+
*/
|
|
16
|
+
use(fulfilled, rejected, options) {
|
|
17
|
+
this.handlers.push({
|
|
18
|
+
fulfilled,
|
|
19
|
+
rejected,
|
|
20
|
+
synchronous: options ? options.synchronous : false,
|
|
21
|
+
runWhen: options ? options.runWhen : null
|
|
22
|
+
});
|
|
23
|
+
return this.handlers.length - 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Remove an interceptor from the stack
|
|
28
|
+
*
|
|
29
|
+
* @param {Number} id The ID that was returned by `use`
|
|
30
|
+
*
|
|
31
|
+
* @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
|
|
32
|
+
*/
|
|
33
|
+
eject(id) {
|
|
34
|
+
if (this.handlers[id]) {
|
|
35
|
+
this.handlers[id] = null;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Clear all interceptors from the stack
|
|
41
|
+
*
|
|
42
|
+
* @returns {void}
|
|
43
|
+
*/
|
|
44
|
+
clear() {
|
|
45
|
+
if (this.handlers) {
|
|
46
|
+
this.handlers = [];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Iterate over all the registered interceptors
|
|
52
|
+
*
|
|
53
|
+
* This method is particularly useful for skipping over any
|
|
54
|
+
* interceptors that may have become `null` calling `eject`.
|
|
55
|
+
*
|
|
56
|
+
* @param {Function} fn The function to call for each interceptor
|
|
57
|
+
*
|
|
58
|
+
* @returns {void}
|
|
59
|
+
*/
|
|
60
|
+
forEach(fn) {
|
|
61
|
+
utils.forEach(this.handlers, function forEachHandler(h) {
|
|
62
|
+
if (h !== null) {
|
|
63
|
+
fn(h);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export { InterceptorManager as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import isAbsoluteURL from '../helpers/isAbsoluteURL.js';
|
|
2
|
+
import combineURLs from '../helpers/combineURLs.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Creates a new URL by combining the baseURL with the requestedURL,
|
|
6
|
+
* only when the requestedURL is not already an absolute URL.
|
|
7
|
+
* If the requestURL is absolute, this function returns the requestedURL untouched.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} baseURL The base URL
|
|
10
|
+
* @param {string} requestedURL Absolute or relative URL to combine
|
|
11
|
+
*
|
|
12
|
+
* @returns {string} The combined full path
|
|
13
|
+
*/
|
|
14
|
+
function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
15
|
+
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
|
16
|
+
if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
|
|
17
|
+
return combineURLs(baseURL, requestedURL);
|
|
18
|
+
}
|
|
19
|
+
return requestedURL;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { buildFullPath as default };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import transformData from './transformData.js';
|
|
2
|
+
import isCancel from '../cancel/isCancel.js';
|
|
3
|
+
import defaults from '../defaults/index.js';
|
|
4
|
+
import CanceledError from '../cancel/CanceledError.js';
|
|
5
|
+
import AxiosHeaders from './AxiosHeaders.js';
|
|
6
|
+
import adapters from '../adapters/adapters.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Throws a `CanceledError` if cancellation has been requested.
|
|
10
|
+
*
|
|
11
|
+
* @param {Object} config The config that is to be used for the request
|
|
12
|
+
*
|
|
13
|
+
* @returns {void}
|
|
14
|
+
*/
|
|
15
|
+
function throwIfCancellationRequested(config) {
|
|
16
|
+
if (config.cancelToken) {
|
|
17
|
+
config.cancelToken.throwIfRequested();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (config.signal && config.signal.aborted) {
|
|
21
|
+
throw new CanceledError(null, config);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Dispatch a request to the server using the configured adapter.
|
|
27
|
+
*
|
|
28
|
+
* @param {object} config The config that is to be used for the request
|
|
29
|
+
*
|
|
30
|
+
* @returns {Promise} The Promise to be fulfilled
|
|
31
|
+
*/
|
|
32
|
+
function dispatchRequest(config) {
|
|
33
|
+
throwIfCancellationRequested(config);
|
|
34
|
+
|
|
35
|
+
config.headers = AxiosHeaders.from(config.headers);
|
|
36
|
+
|
|
37
|
+
// Transform request data
|
|
38
|
+
config.data = transformData.call(
|
|
39
|
+
config,
|
|
40
|
+
config.transformRequest
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
|
|
44
|
+
config.headers.setContentType('application/x-www-form-urlencoded', false);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const adapter = adapters.getAdapter(config.adapter || defaults.adapter);
|
|
48
|
+
|
|
49
|
+
return adapter(config).then(function onAdapterResolution(response) {
|
|
50
|
+
throwIfCancellationRequested(config);
|
|
51
|
+
|
|
52
|
+
// Transform response data
|
|
53
|
+
response.data = transformData.call(
|
|
54
|
+
config,
|
|
55
|
+
config.transformResponse,
|
|
56
|
+
response
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
response.headers = AxiosHeaders.from(response.headers);
|
|
60
|
+
|
|
61
|
+
return response;
|
|
62
|
+
}, function onAdapterRejection(reason) {
|
|
63
|
+
if (!isCancel(reason)) {
|
|
64
|
+
throwIfCancellationRequested(config);
|
|
65
|
+
|
|
66
|
+
// Transform response data
|
|
67
|
+
if (reason && reason.response) {
|
|
68
|
+
reason.response.data = transformData.call(
|
|
69
|
+
config,
|
|
70
|
+
config.transformResponse,
|
|
71
|
+
reason.response
|
|
72
|
+
);
|
|
73
|
+
reason.response.headers = AxiosHeaders.from(reason.response.headers);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return Promise.reject(reason);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export { dispatchRequest as default };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import utils from '../utils.js';
|
|
2
|
+
import AxiosHeaders from './AxiosHeaders.js';
|
|
3
|
+
|
|
4
|
+
const headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Config-specific merge-function which creates a new config-object
|
|
8
|
+
* by merging two configuration objects together.
|
|
9
|
+
*
|
|
10
|
+
* @param {Object} config1
|
|
11
|
+
* @param {Object} config2
|
|
12
|
+
*
|
|
13
|
+
* @returns {Object} New object resulting from merging config2 to config1
|
|
14
|
+
*/
|
|
15
|
+
function mergeConfig(config1, config2) {
|
|
16
|
+
// eslint-disable-next-line no-param-reassign
|
|
17
|
+
config2 = config2 || {};
|
|
18
|
+
const config = {};
|
|
19
|
+
|
|
20
|
+
function getMergedValue(target, source, prop, caseless) {
|
|
21
|
+
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
|
22
|
+
return utils.merge.call({caseless}, target, source);
|
|
23
|
+
} else if (utils.isPlainObject(source)) {
|
|
24
|
+
return utils.merge({}, source);
|
|
25
|
+
} else if (utils.isArray(source)) {
|
|
26
|
+
return source.slice();
|
|
27
|
+
}
|
|
28
|
+
return source;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// eslint-disable-next-line consistent-return
|
|
32
|
+
function mergeDeepProperties(a, b, prop , caseless) {
|
|
33
|
+
if (!utils.isUndefined(b)) {
|
|
34
|
+
return getMergedValue(a, b, prop , caseless);
|
|
35
|
+
} else if (!utils.isUndefined(a)) {
|
|
36
|
+
return getMergedValue(undefined, a, prop , caseless);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// eslint-disable-next-line consistent-return
|
|
41
|
+
function valueFromConfig2(a, b) {
|
|
42
|
+
if (!utils.isUndefined(b)) {
|
|
43
|
+
return getMergedValue(undefined, b);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// eslint-disable-next-line consistent-return
|
|
48
|
+
function defaultToConfig2(a, b) {
|
|
49
|
+
if (!utils.isUndefined(b)) {
|
|
50
|
+
return getMergedValue(undefined, b);
|
|
51
|
+
} else if (!utils.isUndefined(a)) {
|
|
52
|
+
return getMergedValue(undefined, a);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// eslint-disable-next-line consistent-return
|
|
57
|
+
function mergeDirectKeys(a, b, prop) {
|
|
58
|
+
if (prop in config2) {
|
|
59
|
+
return getMergedValue(a, b);
|
|
60
|
+
} else if (prop in config1) {
|
|
61
|
+
return getMergedValue(undefined, a);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const mergeMap = {
|
|
66
|
+
url: valueFromConfig2,
|
|
67
|
+
method: valueFromConfig2,
|
|
68
|
+
data: valueFromConfig2,
|
|
69
|
+
baseURL: defaultToConfig2,
|
|
70
|
+
transformRequest: defaultToConfig2,
|
|
71
|
+
transformResponse: defaultToConfig2,
|
|
72
|
+
paramsSerializer: defaultToConfig2,
|
|
73
|
+
timeout: defaultToConfig2,
|
|
74
|
+
timeoutMessage: defaultToConfig2,
|
|
75
|
+
withCredentials: defaultToConfig2,
|
|
76
|
+
withXSRFToken: defaultToConfig2,
|
|
77
|
+
adapter: defaultToConfig2,
|
|
78
|
+
responseType: defaultToConfig2,
|
|
79
|
+
xsrfCookieName: defaultToConfig2,
|
|
80
|
+
xsrfHeaderName: defaultToConfig2,
|
|
81
|
+
onUploadProgress: defaultToConfig2,
|
|
82
|
+
onDownloadProgress: defaultToConfig2,
|
|
83
|
+
decompress: defaultToConfig2,
|
|
84
|
+
maxContentLength: defaultToConfig2,
|
|
85
|
+
maxBodyLength: defaultToConfig2,
|
|
86
|
+
beforeRedirect: defaultToConfig2,
|
|
87
|
+
transport: defaultToConfig2,
|
|
88
|
+
httpAgent: defaultToConfig2,
|
|
89
|
+
httpsAgent: defaultToConfig2,
|
|
90
|
+
cancelToken: defaultToConfig2,
|
|
91
|
+
socketPath: defaultToConfig2,
|
|
92
|
+
responseEncoding: defaultToConfig2,
|
|
93
|
+
validateStatus: mergeDirectKeys,
|
|
94
|
+
headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
utils.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
|
|
98
|
+
const merge = mergeMap[prop] || mergeDeepProperties;
|
|
99
|
+
const configValue = merge(config1[prop], config2[prop], prop);
|
|
100
|
+
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
return config;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export { mergeConfig as default };
|