@mframework/core 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -0
- package/bin/create-adapter +18 -0
- package/bin/create-adapter.cjs +18 -0
- package/createNormalizer.ts +7 -0
- package/dist/adapters/auth.d.ts +9 -0
- package/dist/adapters/auth.js +1 -0
- package/dist/adapters/cart.d.ts +22 -0
- package/dist/adapters/cart.js +1 -0
- package/dist/adapters/catalog.d.ts +17 -0
- package/dist/adapters/catalog.js +1 -0
- package/dist/adapters/common.d.ts +9 -0
- package/dist/adapters/common.js +1 -0
- package/dist/adapters/search.d.ts +21 -0
- package/dist/adapters/search.js +1 -0
- package/dist/index.d.ts +70 -0
- package/dist/index.js +72 -0
- package/dist/plugins/defineAdapter.d.ts +6 -0
- package/dist/plugins/defineAdapter.js +3 -0
- package/dist/plugins/defineModule.d.ts +2 -0
- package/dist/plugins/defineModule.js +3 -0
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/index.js +3 -0
- package/dist/plugins/registry.d.ts +10 -0
- package/dist/plugins/registry.js +27 -0
- package/dist/runtime/app.d.ts +2 -0
- package/dist/runtime/app.js +20 -0
- package/dist/runtime/config.d.ts +7 -0
- package/dist/runtime/config.js +9 -0
- package/dist/runtime/context.d.ts +9 -0
- package/dist/runtime/context.js +11 -0
- package/dist/runtime/hooks.d.ts +5 -0
- package/dist/runtime/hooks.js +18 -0
- package/dist/runtime/lifecycle.d.ts +4 -0
- package/dist/runtime/lifecycle.js +5 -0
- package/dist/src/adapters/auth.d.ts +9 -0
- package/dist/src/adapters/auth.js +1 -0
- package/dist/src/adapters/cart.d.ts +22 -0
- package/dist/src/adapters/cart.js +1 -0
- package/dist/src/adapters/catalog.d.ts +17 -0
- package/dist/src/adapters/catalog.js +1 -0
- package/dist/src/adapters/common.d.ts +9 -0
- package/dist/src/adapters/common.js +1 -0
- package/dist/src/adapters/lists.d.ts +17 -0
- package/dist/src/adapters/lists.js +1 -0
- package/dist/src/adapters/search.d.ts +21 -0
- package/dist/src/adapters/search.js +1 -0
- package/dist/src/plugins/defineAdapter.d.ts +2 -0
- package/dist/src/plugins/defineAdapter.js +3 -0
- package/dist/src/plugins/defineModule.d.ts +2 -0
- package/dist/src/plugins/defineModule.js +3 -0
- package/dist/src/plugins/index.d.ts +1 -0
- package/dist/src/plugins/index.js +3 -0
- package/dist/src/plugins/registry.d.ts +14 -0
- package/dist/src/plugins/registry.js +46 -0
- package/dist/src/runtime/app.d.ts +6 -0
- package/dist/src/runtime/app.js +20 -0
- package/dist/src/runtime/config.d.ts +18 -0
- package/dist/src/runtime/config.js +20 -0
- package/dist/src/runtime/context.d.ts +9 -0
- package/dist/src/runtime/context.js +11 -0
- package/dist/src/runtime/hooks.d.ts +6 -0
- package/dist/src/runtime/hooks.js +21 -0
- package/dist/src/runtime/lifecycle.d.ts +4 -0
- package/dist/src/runtime/lifecycle.js +5 -0
- package/dist/src/types/adapters.d.ts +14 -0
- package/dist/src/types/adapters.js +1 -0
- package/dist/src/types/app.d.ts +13 -0
- package/dist/src/types/app.js +1 -0
- package/dist/src/types/auth/adapter.d.ts +6 -0
- package/dist/src/types/auth/adapter.js +1 -0
- package/dist/src/types/auth/inputs.d.ts +22 -0
- package/dist/src/types/auth/inputs.js +21 -0
- package/dist/src/types/auth/providers.d.ts +6 -0
- package/dist/src/types/auth/providers.js +1 -0
- package/dist/src/types/auth/session.d.ts +7 -0
- package/dist/src/types/auth/session.js +1 -0
- package/dist/src/types/auth/user.d.ts +9 -0
- package/dist/src/types/auth/user.js +1 -0
- package/dist/src/types/commerce/adapter.d.ts +18 -0
- package/dist/src/types/commerce/adapter.js +1 -0
- package/dist/src/types/commerce/cart.d.ts +14 -0
- package/dist/src/types/commerce/cart.js +1 -0
- package/dist/src/types/commerce/category.d.ts +7 -0
- package/dist/src/types/commerce/category.js +1 -0
- package/dist/src/types/commerce/order.d.ts +12 -0
- package/dist/src/types/commerce/order.js +1 -0
- package/dist/src/types/commerce/product.d.ts +28 -0
- package/dist/src/types/commerce/product.js +1 -0
- package/dist/src/types/compat/legacy.d.ts +21 -0
- package/dist/src/types/compat/legacy.js +1 -0
- package/dist/src/types/config.d.ts +8 -0
- package/dist/src/types/config.js +1 -0
- package/dist/src/types/core/common.d.ts +2 -0
- package/dist/src/types/core/common.js +1 -0
- package/dist/src/types/core/error.d.ts +5 -0
- package/dist/src/types/core/error.js +1 -0
- package/dist/src/types/core/id.d.ts +1 -0
- package/dist/src/types/core/id.js +1 -0
- package/dist/src/types/core/pagination.d.ts +6 -0
- package/dist/src/types/core/pagination.js +1 -0
- package/dist/src/types/core/result.d.ts +9 -0
- package/dist/src/types/core/result.js +1 -0
- package/dist/src/types/core/utility.d.ts +5 -0
- package/dist/src/types/core/utility.js +1 -0
- package/dist/src/types/events.d.ts +20 -0
- package/dist/src/types/events.js +22 -0
- package/dist/src/types/index.d.ts +38 -0
- package/dist/src/types/index.js +35 -0
- package/dist/src/types/module.d.ts +15 -0
- package/dist/src/types/module.js +1 -0
- package/dist/src/types/sdk/adapter.d.ts +5 -0
- package/dist/src/types/sdk/adapter.js +1 -0
- package/dist/src/types/sdk/endpoint.d.ts +7 -0
- package/dist/src/types/sdk/endpoint.js +1 -0
- package/dist/src/types/sdk/errors.d.ts +6 -0
- package/dist/src/types/sdk/errors.js +1 -0
- package/dist/src/types/sdk/request.d.ts +6 -0
- package/dist/src/types/sdk/request.js +1 -0
- package/dist/src/types/sdk/response.d.ts +5 -0
- package/dist/src/types/sdk/response.js +1 -0
- package/dist/src/types/search/adapter.d.ts +6 -0
- package/dist/src/types/search/adapter.js +1 -0
- package/dist/src/types/search/facet.d.ts +8 -0
- package/dist/src/types/search/facet.js +1 -0
- package/dist/src/types/search/opensearch.d.ts +21 -0
- package/dist/src/types/search/opensearch.js +1 -0
- package/dist/src/types/search/query.d.ts +17 -0
- package/dist/src/types/search/query.js +1 -0
- package/dist/src/types/search/result.d.ts +15 -0
- package/dist/src/types/search/result.js +1 -0
- package/dist/src/types/ui/api/global-search.d.ts +8 -0
- package/dist/src/types/ui/api/global-search.js +1 -0
- package/dist/src/types/ui/blocks/block-button-group.d.ts +6 -0
- package/dist/src/types/ui/blocks/block-button-group.js +1 -0
- package/dist/src/types/ui/blocks/block-button.d.ts +13 -0
- package/dist/src/types/ui/blocks/block-button.js +1 -0
- package/dist/src/types/ui/blocks/block-column.d.ts +18 -0
- package/dist/src/types/ui/blocks/block-column.js +1 -0
- package/dist/src/types/ui/blocks/block-cta.d.ts +11 -0
- package/dist/src/types/ui/blocks/block-cta.js +1 -0
- package/dist/src/types/ui/blocks/block-divider.d.ts +4 -0
- package/dist/src/types/ui/blocks/block-divider.js +1 -0
- package/dist/src/types/ui/blocks/block-faq.d.ts +11 -0
- package/dist/src/types/ui/blocks/block-faq.js +1 -0
- package/dist/src/types/ui/blocks/block-form.d.ts +7 -0
- package/dist/src/types/ui/blocks/block-form.js +1 -0
- package/dist/src/types/ui/blocks/block-gallery.d.ts +13 -0
- package/dist/src/types/ui/blocks/block-gallery.js +1 -0
- package/dist/src/types/ui/blocks/block-hero.d.ts +11 -0
- package/dist/src/types/ui/blocks/block-hero.js +1 -0
- package/dist/src/types/ui/blocks/block-html.d.ts +4 -0
- package/dist/src/types/ui/blocks/block-html.js +1 -0
- package/dist/src/types/ui/blocks/block-logocloud.d.ts +13 -0
- package/dist/src/types/ui/blocks/block-logocloud.js +1 -0
- package/dist/src/types/ui/blocks/block-quote.d.ts +10 -0
- package/dist/src/types/ui/blocks/block-quote.js +1 -0
- package/dist/src/types/ui/blocks/block-richtext.d.ts +7 -0
- package/dist/src/types/ui/blocks/block-richtext.js +1 -0
- package/dist/src/types/ui/blocks/block-steps.d.ts +21 -0
- package/dist/src/types/ui/blocks/block-steps.js +1 -0
- package/dist/src/types/ui/blocks/block-team.d.ts +6 -0
- package/dist/src/types/ui/blocks/block-team.js +1 -0
- package/dist/src/types/ui/blocks/block-testimonial.d.ts +13 -0
- package/dist/src/types/ui/blocks/block-testimonial.js +1 -0
- package/dist/src/types/ui/blocks/block-video.d.ts +9 -0
- package/dist/src/types/ui/blocks/block-video.js +1 -0
- package/dist/src/types/ui/blocks/block.d.ts +17 -0
- package/dist/src/types/ui/blocks/block.js +1 -0
- package/dist/src/types/ui/blocks/index.d.ts +18 -0
- package/dist/src/types/ui/blocks/index.js +1 -0
- package/dist/src/types/ui/component.d.ts +6 -0
- package/dist/src/types/ui/component.js +1 -0
- package/dist/src/types/ui/content/category.d.ts +10 -0
- package/dist/src/types/ui/content/category.js +1 -0
- package/dist/src/types/ui/content/form.d.ts +21 -0
- package/dist/src/types/ui/content/form.js +1 -0
- package/dist/src/types/ui/content/index.d.ts +6 -0
- package/dist/src/types/ui/content/index.js +1 -0
- package/dist/src/types/ui/content/page.d.ts +38 -0
- package/dist/src/types/ui/content/page.js +1 -0
- package/dist/src/types/ui/content/post.d.ts +38 -0
- package/dist/src/types/ui/content/post.js +1 -0
- package/dist/src/types/ui/content/team.d.ts +17 -0
- package/dist/src/types/ui/content/team.js +1 -0
- package/dist/src/types/ui/content/testimonial.d.ts +18 -0
- package/dist/src/types/ui/content/testimonial.js +1 -0
- package/dist/src/types/ui/form.d.ts +12 -0
- package/dist/src/types/ui/form.js +1 -0
- package/dist/src/types/ui/help/index.d.ts +51 -0
- package/dist/src/types/ui/help/index.js +1 -0
- package/dist/src/types/ui/meta/analytics.d.ts +21 -0
- package/dist/src/types/ui/meta/analytics.js +1 -0
- package/dist/src/types/ui/meta/config.d.ts +22 -0
- package/dist/src/types/ui/meta/config.js +1 -0
- package/dist/src/types/ui/meta/globals.d.ts +33 -0
- package/dist/src/types/ui/meta/globals.js +1 -0
- package/dist/src/types/ui/meta/index.d.ts +6 -0
- package/dist/src/types/ui/meta/index.js +1 -0
- package/dist/src/types/ui/meta/navigation.d.ts +31 -0
- package/dist/src/types/ui/meta/navigation.js +1 -0
- package/dist/src/types/ui/meta/redirect.d.ts +12 -0
- package/dist/src/types/ui/meta/redirect.js +1 -0
- package/dist/src/types/ui/meta/seo.d.ts +19 -0
- package/dist/src/types/ui/meta/seo.js +1 -0
- package/dist/src/types/ui/os/contact.d.ts +22 -0
- package/dist/src/types/ui/os/contact.js +1 -0
- package/dist/src/types/ui/os/conversation.d.ts +23 -0
- package/dist/src/types/ui/os/conversation.js +1 -0
- package/dist/src/types/ui/os/index.d.ts +16 -0
- package/dist/src/types/ui/os/index.js +1 -0
- package/dist/src/types/ui/os/organization.d.ts +51 -0
- package/dist/src/types/ui/os/organization.js +1 -0
- package/dist/src/types/ui/os/os-activity.d.ts +26 -0
- package/dist/src/types/ui/os/os-activity.js +1 -0
- package/dist/src/types/ui/os/os-deal.d.ts +42 -0
- package/dist/src/types/ui/os/os-deal.js +1 -0
- package/dist/src/types/ui/os/os-expense.d.ts +21 -0
- package/dist/src/types/ui/os/os-expense.js +1 -0
- package/dist/src/types/ui/os/os-invoice.d.ts +46 -0
- package/dist/src/types/ui/os/os-invoice.js +1 -0
- package/dist/src/types/ui/os/os-item.d.ts +17 -0
- package/dist/src/types/ui/os/os-item.js +1 -0
- package/dist/src/types/ui/os/os-payment.d.ts +27 -0
- package/dist/src/types/ui/os/os-payment.js +1 -0
- package/dist/src/types/ui/os/os-project.d.ts +45 -0
- package/dist/src/types/ui/os/os-project.js +1 -0
- package/dist/src/types/ui/os/os-proposal.d.ts +61 -0
- package/dist/src/types/ui/os/os-proposal.js +1 -0
- package/dist/src/types/ui/os/os-settings.d.ts +17 -0
- package/dist/src/types/ui/os/os-settings.js +1 -0
- package/dist/src/types/ui/os/os-subscription.d.ts +12 -0
- package/dist/src/types/ui/os/os-subscription.js +1 -0
- package/dist/src/types/ui/os/os-task.d.ts +32 -0
- package/dist/src/types/ui/os/os-task.js +1 -0
- package/dist/src/types/ui/os/os-tax-rate.d.ts +12 -0
- package/dist/src/types/ui/os/os-tax-rate.js +1 -0
- package/dist/src/types/ui/pageComponentMap.d.ts +2 -0
- package/dist/src/types/ui/pageComponentMap.js +7 -0
- package/dist/src/types/ui/pagination.d.ts +6 -0
- package/dist/src/types/ui/pagination.js +1 -0
- package/dist/src/types/ui/schema.d.ts +78 -0
- package/dist/src/types/ui/schema.js +1 -0
- package/dist/src/types/ui/state.d.ts +5 -0
- package/dist/src/types/ui/state.js +1 -0
- package/dist/src/types/ui/system/file.d.ts +47 -0
- package/dist/src/types/ui/system/file.js +1 -0
- package/dist/src/types/ui/system/folder.d.ts +8 -0
- package/dist/src/types/ui/system/folder.js +1 -0
- package/dist/src/types/ui/system/index.d.ts +4 -0
- package/dist/src/types/ui/system/index.js +1 -0
- package/dist/src/types/ui/system/role.d.ts +20 -0
- package/dist/src/types/ui/system/role.js +1 -0
- package/dist/src/types/ui/system/user.d.ts +57 -0
- package/dist/src/types/ui/system/user.js +1 -0
- package/dist/src/utils/adapterValidation.d.ts +2 -0
- package/dist/src/utils/adapterValidation.js +8 -0
- package/dist/src/utils/env.d.ts +7 -0
- package/dist/src/utils/env.js +20 -0
- package/dist/src/utils/errors.d.ts +9 -0
- package/dist/src/utils/errors.js +13 -0
- package/dist/src/utils/logger.d.ts +9 -0
- package/dist/src/utils/logger.js +29 -0
- package/dist/types/adapters.d.ts +12 -0
- package/dist/types/adapters.js +1 -0
- package/dist/types/app.d.ts +13 -0
- package/dist/types/app.js +1 -0
- package/dist/types/config.d.ts +8 -0
- package/dist/types/config.js +1 -0
- package/dist/types/events.d.ts +16 -0
- package/dist/types/events.js +22 -0
- package/dist/types/module.d.ts +15 -0
- package/dist/types/module.js +1 -0
- package/dist/utils/errors.d.ts +9 -0
- package/dist/utils/errors.js +13 -0
- package/dist/utils/logger.d.ts +9 -0
- package/dist/utils/logger.js +29 -0
- package/errors.ts +21 -0
- package/index.ts +93 -0
- package/package.json +39 -0
- package/src/adapters/auth.ts +11 -0
- package/src/adapters/cart.ts +27 -0
- package/src/adapters/catalog.ts +21 -0
- package/src/adapters/common.ts +10 -0
- package/src/adapters/lists.ts +23 -0
- package/src/adapters/search.ts +26 -0
- package/src/normalizers/factories/apiClientFactory/context.d.ts +14 -0
- package/src/normalizers/factories/apiClientFactory/index.d.ts +3 -0
- package/src/normalizers/factories/index.d.ts +19 -0
- package/src/normalizers/factories/useBillingFactory.d.ts +12 -0
- package/src/normalizers/factories/useCartFactory.d.ts +45 -0
- package/src/normalizers/factories/useCategoryFactory.d.ts +7 -0
- package/src/normalizers/factories/useContentFactory.d.ts +16 -0
- package/src/normalizers/factories/useFacetFactory.d.ts +6 -0
- package/src/normalizers/factories/useForgotPasswordFactory.d.ts +20 -0
- package/src/normalizers/factories/useMakeOrderFactory.d.ts +7 -0
- package/src/normalizers/factories/useProductFactory.d.ts +7 -0
- package/src/normalizers/factories/useReviewFactory.d.ts +10 -0
- package/src/normalizers/factories/useSearchFactory.d.ts +7 -0
- package/src/normalizers/factories/useShippingFactory.d.ts +12 -0
- package/src/normalizers/factories/useShippingProviderFactory.d.ts +14 -0
- package/src/normalizers/factories/useStoreFactory.d.ts +2 -0
- package/src/normalizers/factories/useUserBillingFactory.d.ts +27 -0
- package/src/normalizers/factories/useUserFactory.d.ts +32 -0
- package/src/normalizers/factories/useUserOrderFactory.d.ts +7 -0
- package/src/normalizers/factories/useUserShippingFactory.d.ts +27 -0
- package/src/normalizers/factories/useWishlistFactory.d.ts +24 -0
- package/src/normalizers/utils/context/index.d.ts +8 -0
- package/src/normalizers/utils/factoryParams/commonMethods.d.ts +2 -0
- package/src/normalizers/utils/factoryParams/index.d.ts +2 -0
- package/src/normalizers/utils/factoryParams/platformMethods.d.ts +2 -0
- package/src/normalizers/utils/helpers/index.d.ts +7 -0
- package/src/normalizers/utils/i18n-redirects/index.d.ts +12 -0
- package/src/normalizers/utils/logger/defaultLogger.d.ts +7 -0
- package/src/normalizers/utils/logger/index.d.ts +5 -0
- package/src/normalizers/utils/logger/makeMessageStyle.d.ts +2 -0
- package/src/normalizers/utils/logger/makeMethod.d.ts +2 -0
- package/src/normalizers/utils/logger/mask.d.ts +2 -0
- package/src/normalizers/utils/logger/types.d.ts +13 -0
- package/src/normalizers/utils/logger/utils.d.ts +4 -0
- package/src/normalizers/utils/shared/index.d.ts +4 -0
- package/src/normalizers/utils/ssr/index.d.ts +11 -0
- package/src/normalizers/utils/wrap/index.d.ts +3 -0
- package/src/plugins/defineAdapter.ts +5 -0
- package/src/plugins/defineModule.ts +5 -0
- package/src/plugins/index.ts +3 -0
- package/src/plugins/registry.ts +58 -0
- package/src/runtime/app.ts +31 -0
- package/src/runtime/config.ts +24 -0
- package/src/runtime/context.ts +18 -0
- package/src/runtime/hooks.ts +28 -0
- package/src/runtime/lifecycle.ts +16 -0
- package/src/types/adapters.ts +17 -0
- package/src/types/app.ts +15 -0
- package/src/types/auth/adapter.ts +7 -0
- package/src/types/auth/inputs.ts +33 -0
- package/src/types/auth/providers.ts +6 -0
- package/src/types/auth/session.ts +8 -0
- package/src/types/auth/user.ts +9 -0
- package/src/types/commerce/adapter.ts +21 -0
- package/src/types/commerce/cart.ts +16 -0
- package/src/types/commerce/category.ts +7 -0
- package/src/types/commerce/order.ts +13 -0
- package/src/types/commerce/product.ts +31 -0
- package/src/types/compat/legacy.ts +19 -0
- package/src/types/config.ts +9 -0
- package/src/types/core/common.ts +2 -0
- package/src/types/core/error.ts +11 -0
- package/src/types/core/id.ts +1 -0
- package/src/types/core/pagination.ts +6 -0
- package/src/types/core/result.ts +11 -0
- package/src/types/core/utility.ts +7 -0
- package/src/types/events.ts +47 -0
- package/src/types/index.ts +49 -0
- package/src/types/module.ts +18 -0
- package/src/types/sdk/adapter.ts +10 -0
- package/src/types/sdk/endpoint.ts +11 -0
- package/src/types/sdk/errors.ts +6 -0
- package/src/types/sdk/request.ts +6 -0
- package/src/types/sdk/response.ts +5 -0
- package/src/types/search/adapter.ts +7 -0
- package/src/types/search/facet.ts +9 -0
- package/src/types/search/opensearch.ts +19 -0
- package/src/types/search/query.ts +19 -0
- package/src/types/search/result.ts +17 -0
- package/src/types/ui/api/global-search.ts +8 -0
- package/src/types/ui/blocks/block-button-group.ts +7 -0
- package/src/types/ui/blocks/block-button.ts +14 -0
- package/src/types/ui/blocks/block-column.ts +20 -0
- package/src/types/ui/blocks/block-cta.ts +10 -0
- package/src/types/ui/blocks/block-divider.ts +4 -0
- package/src/types/ui/blocks/block-faq.ts +12 -0
- package/src/types/ui/blocks/block-form.ts +8 -0
- package/src/types/ui/blocks/block-gallery.ts +14 -0
- package/src/types/ui/blocks/block-hero.ts +12 -0
- package/src/types/ui/blocks/block-html.ts +4 -0
- package/src/types/ui/blocks/block-logocloud.ts +14 -0
- package/src/types/ui/blocks/block-quote.ts +11 -0
- package/src/types/ui/blocks/block-richtext.ts +7 -0
- package/src/types/ui/blocks/block-steps.ts +22 -0
- package/src/types/ui/blocks/block-team.ts +6 -0
- package/src/types/ui/blocks/block-testimonial.ts +14 -0
- package/src/types/ui/blocks/block-video.ts +10 -0
- package/src/types/ui/blocks/block.ts +49 -0
- package/src/types/ui/blocks/index.ts +18 -0
- package/src/types/ui/component.ts +7 -0
- package/src/types/ui/content/category.ts +11 -0
- package/src/types/ui/content/form.ts +20 -0
- package/src/types/ui/content/index.ts +6 -0
- package/src/types/ui/content/page.ts +76 -0
- package/src/types/ui/content/post.ts +39 -0
- package/src/types/ui/content/team.ts +16 -0
- package/src/types/ui/content/testimonial.ts +19 -0
- package/src/types/ui/env.d.ts +8 -0
- package/src/types/ui/form.ts +17 -0
- package/src/types/ui/help/index.ts +53 -0
- package/src/types/ui/meta/analytics.ts +18 -0
- package/src/types/ui/meta/config.ts +21 -0
- package/src/types/ui/meta/globals.ts +30 -0
- package/src/types/ui/meta/index.ts +6 -0
- package/src/types/ui/meta/navigation.ts +32 -0
- package/src/types/ui/meta/redirect.ts +13 -0
- package/src/types/ui/meta/seo.ts +19 -0
- package/src/types/ui/os/contact.ts +23 -0
- package/src/types/ui/os/conversation.ts +25 -0
- package/src/types/ui/os/index.ts +16 -0
- package/src/types/ui/os/organization.ts +54 -0
- package/src/types/ui/os/os-activity.ts +28 -0
- package/src/types/ui/os/os-deal.ts +45 -0
- package/src/types/ui/os/os-expense.ts +22 -0
- package/src/types/ui/os/os-invoice.ts +48 -0
- package/src/types/ui/os/os-item.ts +18 -0
- package/src/types/ui/os/os-payment.ts +29 -0
- package/src/types/ui/os/os-project.ts +47 -0
- package/src/types/ui/os/os-proposal.ts +84 -0
- package/src/types/ui/os/os-settings.ts +19 -0
- package/src/types/ui/os/os-subscription.ts +12 -0
- package/src/types/ui/os/os-task.ts +34 -0
- package/src/types/ui/os/os-tax-rate.ts +13 -0
- package/src/types/ui/pageComponentMap.ts +8 -0
- package/src/types/ui/pagination.ts +6 -0
- package/src/types/ui/schema.d.ts +39 -0
- package/src/types/ui/schema.ts +151 -0
- package/src/types/ui/state.ts +5 -0
- package/src/types/ui/system/file.ts +46 -0
- package/src/types/ui/system/folder.ts +8 -0
- package/src/types/ui/system/index.ts +4 -0
- package/src/types/ui/system/role.ts +21 -0
- package/src/types/ui/system/user.ts +56 -0
- package/src/utils/adapterValidation.ts +10 -0
- package/src/utils/env.ts +18 -0
- package/src/utils/errors.ts +15 -0
- package/src/utils/index.d.ts +11 -0
- package/src/utils/logger.ts +37 -0
- package/tsconfig.json +15 -0
- package/validation.ts +89 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface AlternateEventMap {
|
|
2
|
+
'app:ready': {
|
|
3
|
+
context: unknown;
|
|
4
|
+
};
|
|
5
|
+
'app:error': {
|
|
6
|
+
error: unknown;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export type AlternateEventKey = keyof AlternateEventMap;
|
|
10
|
+
export type AlternateEventHandler<K extends AlternateEventKey> = (payload: AlternateEventMap[K]) => void | Promise<void>;
|
|
11
|
+
export interface AlternateEventBus {
|
|
12
|
+
on<K extends AlternateEventKey>(event: K, handler: AlternateEventHandler<K>): void;
|
|
13
|
+
off<K extends AlternateEventKey>(event: K, handler: AlternateEventHandler<K>): void;
|
|
14
|
+
emit<K extends AlternateEventKey>(event: K, payload: AlternateEventMap[K]): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export declare function createEventBus(): AlternateEventBus;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function createEventBus() {
|
|
2
|
+
const handlers = new Map();
|
|
3
|
+
return {
|
|
4
|
+
on(event, handler) {
|
|
5
|
+
if (!handlers.has(event)) {
|
|
6
|
+
handlers.set(event, new Set());
|
|
7
|
+
}
|
|
8
|
+
handlers.get(event).add(handler);
|
|
9
|
+
},
|
|
10
|
+
off(event, handler) {
|
|
11
|
+
handlers.get(event)?.delete(handler);
|
|
12
|
+
},
|
|
13
|
+
async emit(event, payload) {
|
|
14
|
+
const set = handlers.get(event);
|
|
15
|
+
if (!set || set.size === 0)
|
|
16
|
+
return;
|
|
17
|
+
for (const handler of set) {
|
|
18
|
+
await handler(payload);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AlternateContext } from '../runtime/context';
|
|
2
|
+
import type { AlternateAdapterKey, AlternateAdapterOf } from './adapters';
|
|
3
|
+
export type AlternateModuleAdapters = Partial<{
|
|
4
|
+
[K in AlternateAdapterKey]: AlternateAdapterOf<K>;
|
|
5
|
+
}>;
|
|
6
|
+
export interface AlternateModuleLifecycle {
|
|
7
|
+
onAppInit?(ctx: AlternateContext): Promise<void> | void;
|
|
8
|
+
onBeforeRequest?(ctx: AlternateContext): Promise<void> | void;
|
|
9
|
+
onAfterRequest?(ctx: AlternateContext): Promise<void> | void;
|
|
10
|
+
}
|
|
11
|
+
export interface AlternateModule extends AlternateModuleLifecycle {
|
|
12
|
+
id: string;
|
|
13
|
+
adapters?: AlternateModuleAdapters;
|
|
14
|
+
setup?(ctx: AlternateContext): void | Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export class MeeoviError extends Error {
|
|
2
|
+
code;
|
|
3
|
+
cause;
|
|
4
|
+
constructor(message, options) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.name = 'MeeoviError';
|
|
7
|
+
this.code = options?.code;
|
|
8
|
+
this.cause = options?.cause;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export function isAlternateError(err) {
|
|
12
|
+
return err instanceof MeeoviError;
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type AlternateLogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
2
|
+
export interface AlternateLogger {
|
|
3
|
+
level: AlternateLogLevel;
|
|
4
|
+
debug(message: string, meta?: unknown): void;
|
|
5
|
+
info(message: string, meta?: unknown): void;
|
|
6
|
+
warn(message: string, meta?: unknown): void;
|
|
7
|
+
error(message: string, meta?: unknown): void;
|
|
8
|
+
}
|
|
9
|
+
export declare function createLogger(level?: AlternateLogLevel): AlternateLogger;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export function createLogger(level = 'info') {
|
|
2
|
+
const levels = ['debug', 'info', 'warn', 'error'];
|
|
3
|
+
function shouldLog(target) {
|
|
4
|
+
return levels.indexOf(target) >= levels.indexOf(level);
|
|
5
|
+
}
|
|
6
|
+
return {
|
|
7
|
+
level,
|
|
8
|
+
debug(message, meta) {
|
|
9
|
+
if (!shouldLog('debug'))
|
|
10
|
+
return;
|
|
11
|
+
console.debug(`[Alternate][debug] ${message}`, meta ?? '');
|
|
12
|
+
},
|
|
13
|
+
info(message, meta) {
|
|
14
|
+
if (!shouldLog('info'))
|
|
15
|
+
return;
|
|
16
|
+
console.info(`[Alternate][info] ${message}`, meta ?? '');
|
|
17
|
+
},
|
|
18
|
+
warn(message, meta) {
|
|
19
|
+
if (!shouldLog('warn'))
|
|
20
|
+
return;
|
|
21
|
+
console.warn(`[Alternate][warn] ${message}`, meta ?? '');
|
|
22
|
+
},
|
|
23
|
+
error(message, meta) {
|
|
24
|
+
if (!shouldLog('error'))
|
|
25
|
+
return;
|
|
26
|
+
console.error(`[Alternate][error] ${message}`, meta ?? '');
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
package/errors.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export class ValidationError extends Error {
|
|
2
|
+
path: string[]
|
|
3
|
+
code?: string
|
|
4
|
+
|
|
5
|
+
constructor(message: string, path: string[] = [], code?: string) {
|
|
6
|
+
super(message)
|
|
7
|
+
this.name = 'ValidationError'
|
|
8
|
+
this.path = path
|
|
9
|
+
this.code = code
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
toString() {
|
|
13
|
+
if (this.path && this.path.length) {
|
|
14
|
+
return `${this.name} [${this.path.join('.')}]: ${this.message}`
|
|
15
|
+
}
|
|
16
|
+
return `${this.name}: ${this.message}`
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const isValidationError = (v: unknown): v is ValidationError =>
|
|
21
|
+
v instanceof ValidationError
|
package/index.ts
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
export * from './src/runtime/app'
|
|
3
|
+
export * from './src/runtime/context'
|
|
4
|
+
export * from './src/runtime/config'
|
|
5
|
+
// src/index.ts
|
|
6
|
+
export * from './src/runtime/app'
|
|
7
|
+
export * from './src/runtime/context'
|
|
8
|
+
export * from './src/runtime/config'
|
|
9
|
+
export * from './src/runtime/hooks'
|
|
10
|
+
|
|
11
|
+
export * from './src/plugins/defineModule'
|
|
12
|
+
export * from './src/plugins/defineAdapter'
|
|
13
|
+
export * from './src/plugins/registry'
|
|
14
|
+
|
|
15
|
+
export * from './src/adapters/common'
|
|
16
|
+
export * from './src/adapters/auth'
|
|
17
|
+
export * from './src/adapters/search'
|
|
18
|
+
export * from './src/adapters/catalog'
|
|
19
|
+
export * from './src/adapters/cart'
|
|
20
|
+
export * from './src/adapters/lists'
|
|
21
|
+
|
|
22
|
+
export * from './src/types/module'
|
|
23
|
+
export * from './src/types/app'
|
|
24
|
+
export * from './src/types/config'
|
|
25
|
+
export * from './src/types/events'
|
|
26
|
+
|
|
27
|
+
//// Types and Utilities ////
|
|
28
|
+
|
|
29
|
+
// Core
|
|
30
|
+
export * from './src/types/core/result'
|
|
31
|
+
export * from './src/types/core/utility'
|
|
32
|
+
export * from './src/types/core/pagination'
|
|
33
|
+
export * from './src/types/core/id'
|
|
34
|
+
export { Maybe } from './src/types/core/common'
|
|
35
|
+
export * from './src/types/core/error'
|
|
36
|
+
|
|
37
|
+
// Auth
|
|
38
|
+
export * from './src/types/auth/user'
|
|
39
|
+
export * from './src/types/auth/session'
|
|
40
|
+
export * from './src/types/auth/providers'
|
|
41
|
+
export * from './src/types/auth/inputs'
|
|
42
|
+
export type { AuthAdapter } from './src/types/auth/adapter'
|
|
43
|
+
|
|
44
|
+
// Commerce
|
|
45
|
+
export * from './src/types/commerce/product'
|
|
46
|
+
export * from './src/types/commerce/cart'
|
|
47
|
+
export * from './src/types/commerce/order'
|
|
48
|
+
export * from './src/types/commerce/adapter'
|
|
49
|
+
export * from './src/types/commerce/category'
|
|
50
|
+
// Legacy compat exports (for older @mframework/types consumers)
|
|
51
|
+
// Export specific legacy names to avoid symbol collisions with other re-exports
|
|
52
|
+
export type { Product } from './src/types/compat/legacy'
|
|
53
|
+
export type { Session, User } from './src/types/compat/legacy'
|
|
54
|
+
|
|
55
|
+
// Search
|
|
56
|
+
export type { SearchQuery } from './src/types/search/query'
|
|
57
|
+
export type { SearchResult } from './src/types/search/result'
|
|
58
|
+
export * from './src/types/search/facet'
|
|
59
|
+
export * from './src/types/search/result'
|
|
60
|
+
export * from './src/types/search/opensearch'
|
|
61
|
+
export type { SearchAdapter } from './src/types/search/adapter'
|
|
62
|
+
|
|
63
|
+
// UI
|
|
64
|
+
export * from './src/types/ui/form'
|
|
65
|
+
export * from './src/types/ui/state'
|
|
66
|
+
export * from './src/types/ui/pagination'
|
|
67
|
+
export * from './src/types/ui/component'
|
|
68
|
+
export * from './src/types/ui/blocks'
|
|
69
|
+
export * from './src/types/ui/content'
|
|
70
|
+
export * from './src/types/ui/meta'
|
|
71
|
+
export * from './src/types/ui/system'
|
|
72
|
+
export * from './src/types/ui/help'
|
|
73
|
+
export * from './src/types/ui/os'
|
|
74
|
+
export * from './src/types/ui/schema'
|
|
75
|
+
|
|
76
|
+
// SDK
|
|
77
|
+
export * from './src/types/sdk/errors'
|
|
78
|
+
export * from './src/types/sdk/endpoint'
|
|
79
|
+
export * from './src/types/sdk/request'
|
|
80
|
+
export * from './src/types/sdk/response'
|
|
81
|
+
export * from './src/types/sdk/adapter'
|
|
82
|
+
|
|
83
|
+
// Normalizers
|
|
84
|
+
export * from './src/normalizers/factories'
|
|
85
|
+
export * from './src/normalizers/factories/apiClientFactory'
|
|
86
|
+
export * from './src/normalizers/utils/context'
|
|
87
|
+
export * from './src/normalizers/utils/factoryParams'
|
|
88
|
+
export * from './src/normalizers/utils/helpers'
|
|
89
|
+
export * from './src/normalizers/utils/i18n-redirects'
|
|
90
|
+
export * from './src/normalizers/utils/logger'
|
|
91
|
+
export * from './src/normalizers/utils/shared'
|
|
92
|
+
export * from './src/normalizers/utils/ssr'
|
|
93
|
+
export * from './src/normalizers/utils/wrap'
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mframework/core",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "The core package of the M Framework.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
17
|
+
"build": "tsc -p tsconfig.json"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"meeovi",
|
|
21
|
+
"mframework-framework",
|
|
22
|
+
"mframework-core",
|
|
23
|
+
"vue",
|
|
24
|
+
"react",
|
|
25
|
+
"typescript"
|
|
26
|
+
],
|
|
27
|
+
"author": "M Framework",
|
|
28
|
+
"type": "module",
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"typescript": "^5.9.3",
|
|
31
|
+
"zod": "^4.3.6"
|
|
32
|
+
},
|
|
33
|
+
"bin": {
|
|
34
|
+
"mframework-create-adapter": "./bin/create-adapter.cjs"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/node": "^25.0.10"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseAdapterConfig } from './common'
|
|
2
|
+
|
|
3
|
+
export interface AuthAdapterConfig extends BaseAdapterConfig {
|
|
4
|
+
provider: 'custom' | 'auth0' | 'cognito' | string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface AuthAdapter {
|
|
8
|
+
login(payload: unknown): Promise<unknown>
|
|
9
|
+
logout(): Promise<void>
|
|
10
|
+
getSession(): Promise<unknown | null>
|
|
11
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { BaseAdapter, BaseAdapterConfig } from './common'
|
|
2
|
+
|
|
3
|
+
export interface CartAdapterConfig extends BaseAdapterConfig {
|
|
4
|
+
provider: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface CartItem {
|
|
8
|
+
id: string
|
|
9
|
+
productId: string
|
|
10
|
+
quantity: number
|
|
11
|
+
[key: string]: unknown
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface Cart<TItem extends CartItem = CartItem> {
|
|
15
|
+
id: string
|
|
16
|
+
items: TItem[]
|
|
17
|
+
[key: string]: unknown
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface CartAdapter<TItem extends CartItem = CartItem>
|
|
21
|
+
extends BaseAdapter<CartAdapterConfig> {
|
|
22
|
+
type: 'cart'
|
|
23
|
+
getCart(id: string): Promise<Cart<TItem> | null>
|
|
24
|
+
addItem(cartId: string, item: TItem): Promise<Cart<TItem>>
|
|
25
|
+
removeItem(cartId: string, itemId: string): Promise<Cart<TItem>>
|
|
26
|
+
clearCart(cartId: string): Promise<Cart<TItem>>
|
|
27
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BaseAdapter, BaseAdapterConfig } from './common'
|
|
2
|
+
|
|
3
|
+
export interface CatalogAdapterConfig extends BaseAdapterConfig {
|
|
4
|
+
provider: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface CatalogProduct {
|
|
8
|
+
id: string
|
|
9
|
+
slug: string
|
|
10
|
+
name: string
|
|
11
|
+
price: number
|
|
12
|
+
[key: string]: unknown
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface CatalogAdapter<TProduct extends CatalogProduct = CatalogProduct>
|
|
16
|
+
extends BaseAdapter<CatalogAdapterConfig> {
|
|
17
|
+
type: 'catalog'
|
|
18
|
+
getProductById(id: string): Promise<TProduct | null>
|
|
19
|
+
getProductBySlug(slug: string): Promise<TProduct | null>
|
|
20
|
+
listProducts(params?: Record<string, unknown>): Promise<TProduct[]>
|
|
21
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BaseAdapter, BaseAdapterConfig } from './common'
|
|
2
|
+
|
|
3
|
+
export interface ListsAdapterConfig extends BaseAdapterConfig {
|
|
4
|
+
provider?: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface ListsAdapter extends BaseAdapter<ListsAdapterConfig> {
|
|
8
|
+
type: 'lists'
|
|
9
|
+
|
|
10
|
+
getList(id: string): Promise<any>
|
|
11
|
+
listLists(params?: Record<string, any>): Promise<any[]>
|
|
12
|
+
createList(data: Partial<any>): Promise<any>
|
|
13
|
+
updateList(id: string, data: Partial<any>): Promise<any>
|
|
14
|
+
deleteList(id: string): Promise<void>
|
|
15
|
+
|
|
16
|
+
addItem(listId: string, item: Partial<any>): Promise<any>
|
|
17
|
+
updateItem(listId: string, itemId: string, data: Partial<any>): Promise<any>
|
|
18
|
+
deleteItem(listId: string, itemId: string): Promise<void>
|
|
19
|
+
|
|
20
|
+
reorderItems?(listId: string, itemIds: string[]): Promise<void>
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default ListsAdapter
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BaseAdapter, BaseAdapterConfig } from './common'
|
|
2
|
+
|
|
3
|
+
export interface SearchAdapterConfig extends BaseAdapterConfig {
|
|
4
|
+
provider: string
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface SearchQuery {
|
|
8
|
+
term: string
|
|
9
|
+
filters?: Record<string, unknown>
|
|
10
|
+
page?: number
|
|
11
|
+
pageSize?: number
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface SearchResult<TItem = unknown> {
|
|
15
|
+
items: TItem[]
|
|
16
|
+
total: number
|
|
17
|
+
page: number
|
|
18
|
+
pageSize: number
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface SearchAdapter<TItem = unknown>
|
|
22
|
+
extends BaseAdapter<SearchAdapterConfig> {
|
|
23
|
+
type: 'search'
|
|
24
|
+
search(query: SearchQuery): Promise<SearchResult<TItem>>
|
|
25
|
+
suggest?(term: string): Promise<string[]>
|
|
26
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ApiClientMethod } from '../../types';
|
|
2
|
+
interface ApplyingContextHooks {
|
|
3
|
+
before: ({ callName, args }: {
|
|
4
|
+
callName: any;
|
|
5
|
+
args: any;
|
|
6
|
+
}) => any[];
|
|
7
|
+
after: ({ callName, args, response }: {
|
|
8
|
+
callName: any;
|
|
9
|
+
args: any;
|
|
10
|
+
response: any;
|
|
11
|
+
}) => any;
|
|
12
|
+
}
|
|
13
|
+
declare const applyContextToApi: (api: Record<string, ApiClientMethod>, context: any, hooks?: ApplyingContextHooks) => {};
|
|
14
|
+
export { applyContextToApi };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ApiClientFactoryParams, ApiClientConfig, ApiClientFactory } from '../../types';
|
|
2
|
+
declare const apiClientFactory: <ALL_SETTINGS extends ApiClientConfig, ALL_FUNCTIONS>(factoryParams: ApiClientFactoryParams<ALL_SETTINGS, ALL_FUNCTIONS>) => ApiClientFactory;
|
|
3
|
+
export { apiClientFactory };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from './apiClientFactory';
|
|
2
|
+
export * from './useBillingFactory';
|
|
3
|
+
export * from './useCartFactory';
|
|
4
|
+
export * from './useCategoryFactory';
|
|
5
|
+
export * from './useContentFactory';
|
|
6
|
+
export * from './useFacetFactory';
|
|
7
|
+
export * from './useMakeOrderFactory';
|
|
8
|
+
export * from './useProductFactory';
|
|
9
|
+
export * from './useReviewFactory';
|
|
10
|
+
export * from './useShippingFactory';
|
|
11
|
+
export * from './useUserBillingFactory';
|
|
12
|
+
export * from './useUserFactory';
|
|
13
|
+
export * from './useUserOrderFactory';
|
|
14
|
+
export * from './useUserShippingFactory';
|
|
15
|
+
export * from './useWishlistFactory';
|
|
16
|
+
export * from './useShippingProviderFactory';
|
|
17
|
+
export * from './useForgotPasswordFactory';
|
|
18
|
+
export * from './useStoreFactory';
|
|
19
|
+
export * from './useSearchFactory';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UseBilling, Context, FactoryParams, CustomQuery, PlatformApi } from '../types';
|
|
2
|
+
export interface UseBillingParams<BILLING, BILLING_PARAMS, API extends PlatformApi = any> extends FactoryParams<API> {
|
|
3
|
+
load: (context: Context, params: {
|
|
4
|
+
customQuery?: CustomQuery;
|
|
5
|
+
}) => Promise<BILLING>;
|
|
6
|
+
save: (context: Context, params: {
|
|
7
|
+
params: BILLING_PARAMS;
|
|
8
|
+
billingDetails: BILLING;
|
|
9
|
+
customQuery?: CustomQuery;
|
|
10
|
+
}) => Promise<BILLING>;
|
|
11
|
+
}
|
|
12
|
+
export declare const useBillingFactory: <BILLING, BILLING_PARAMS, API extends PlatformApi = any>(factoryParams: UseBillingParams<BILLING, BILLING_PARAMS, API>) => () => UseBilling<BILLING, BILLING_PARAMS, API>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { CustomQuery, UseCart, Context, FactoryParams, PlatformApi } from '../types';
|
|
2
|
+
export interface UseCartFactoryParams<CART, CART_ITEM, PRODUCT, API extends PlatformApi = any> extends FactoryParams<API> {
|
|
3
|
+
load: (context: Context, params: {
|
|
4
|
+
customQuery?: any;
|
|
5
|
+
}) => Promise<CART>;
|
|
6
|
+
addItem: (context: Context, params: {
|
|
7
|
+
currentCart: CART;
|
|
8
|
+
product: PRODUCT;
|
|
9
|
+
quantity: any;
|
|
10
|
+
customQuery?: CustomQuery;
|
|
11
|
+
}) => Promise<CART>;
|
|
12
|
+
removeItem: (context: Context, params: {
|
|
13
|
+
currentCart: CART;
|
|
14
|
+
product: CART_ITEM;
|
|
15
|
+
customQuery?: CustomQuery;
|
|
16
|
+
}) => Promise<CART>;
|
|
17
|
+
updateItemQty: (context: Context, params: {
|
|
18
|
+
currentCart: CART;
|
|
19
|
+
product: CART_ITEM;
|
|
20
|
+
quantity: number;
|
|
21
|
+
customQuery?: CustomQuery;
|
|
22
|
+
}) => Promise<CART>;
|
|
23
|
+
clear: (context: Context, params: {
|
|
24
|
+
currentCart: CART;
|
|
25
|
+
}) => Promise<CART>;
|
|
26
|
+
applyCoupon: (context: Context, params: {
|
|
27
|
+
currentCart: CART;
|
|
28
|
+
couponCode: string;
|
|
29
|
+
customQuery?: CustomQuery;
|
|
30
|
+
}) => Promise<{
|
|
31
|
+
updatedCart: CART;
|
|
32
|
+
}>;
|
|
33
|
+
removeCoupon: (context: Context, params: {
|
|
34
|
+
currentCart: CART;
|
|
35
|
+
couponCode: string;
|
|
36
|
+
customQuery?: CustomQuery;
|
|
37
|
+
}) => Promise<{
|
|
38
|
+
updatedCart: CART;
|
|
39
|
+
}>;
|
|
40
|
+
isInCart: (context: Context, params: {
|
|
41
|
+
currentCart: CART;
|
|
42
|
+
product: PRODUCT;
|
|
43
|
+
}) => boolean;
|
|
44
|
+
}
|
|
45
|
+
export declare const useCartFactory: <CART, CART_ITEM, PRODUCT, API extends PlatformApi = any>(factoryParams: UseCartFactoryParams<CART, CART_ITEM, PRODUCT, API>) => () => UseCart<CART, CART_ITEM, PRODUCT, API>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CustomQuery, UseCategory, Context, FactoryParams, PlatformApi } from '../types';
|
|
2
|
+
export interface UseCategoryFactoryParams<CATEGORY, CATEGORY_SEARCH_PARAMS, API extends PlatformApi = any> extends FactoryParams<API> {
|
|
3
|
+
categorySearch: (context: Context, params: CATEGORY_SEARCH_PARAMS & {
|
|
4
|
+
customQuery?: CustomQuery;
|
|
5
|
+
}) => Promise<CATEGORY[]>;
|
|
6
|
+
}
|
|
7
|
+
export declare function useCategoryFactory<CATEGORY, CATEGORY_SEARCH_PARAMS, API extends PlatformApi = any>(factoryParams: UseCategoryFactoryParams<CATEGORY, CATEGORY_SEARCH_PARAMS, API>): (id: string) => UseCategory<CATEGORY, CATEGORY_SEARCH_PARAMS, API>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RenderComponent, UseContent, Context, FactoryParams, PlatformApi } from '../types';
|
|
2
|
+
import type { PropType } from 'vue'
|
|
3
|
+
|
|
4
|
+
export interface UseContentFactoryParams<CONTENT, CONTENT_SEARCH_PARAMS, API extends PlatformApi = any> extends FactoryParams<API> {
|
|
5
|
+
search: (context: Context, params: CONTENT_SEARCH_PARAMS) => Promise<CONTENT>;
|
|
6
|
+
}
|
|
7
|
+
export declare function useContentFactory<CONTENT, CONTENT_SEARCH_PARAMS, API extends PlatformApi = any>(factoryParams: UseContentFactoryParams<CONTENT, CONTENT_SEARCH_PARAMS, API>): (id: string) => UseContent<CONTENT, CONTENT_SEARCH_PARAMS, API>;
|
|
8
|
+
export declare type RenderContentFactoryParams<CONTENT = any> = {
|
|
9
|
+
extractContent: (content: any) => CONTENT;
|
|
10
|
+
};
|
|
11
|
+
export declare function renderContentFactory(factoryParams: RenderContentFactoryParams<RenderComponent[]>): {
|
|
12
|
+
render: (createElement: any) => any;
|
|
13
|
+
props: {
|
|
14
|
+
content: PropType<any>;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UseFacet, FacetSearchResult, Context, FactoryParams } from '../types';
|
|
2
|
+
export interface UseFacetFactoryParams<SEARCH_DATA> extends FactoryParams {
|
|
3
|
+
search: (context: Context, params?: FacetSearchResult<SEARCH_DATA>) => Promise<SEARCH_DATA>;
|
|
4
|
+
}
|
|
5
|
+
declare const useFacetFactory: <SEARCH_DATA>(factoryParams: UseFacetFactoryParams<SEARCH_DATA>) => (id?: string) => UseFacet<SEARCH_DATA>;
|
|
6
|
+
export { useFacetFactory };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CustomQuery, Context, FactoryParams, UseForgotPassword } from '../types';
|
|
2
|
+
interface SetNewPasswordParams {
|
|
3
|
+
tokenValue: string;
|
|
4
|
+
newPassword: string;
|
|
5
|
+
}
|
|
6
|
+
interface ResetPasswordParams {
|
|
7
|
+
email: string;
|
|
8
|
+
}
|
|
9
|
+
export interface UseForgotPasswordFactoryParams<RESULT> extends FactoryParams {
|
|
10
|
+
resetPassword: (context: Context, params: ResetPasswordParams & {
|
|
11
|
+
currentResult: RESULT;
|
|
12
|
+
customQuery?: CustomQuery;
|
|
13
|
+
}) => Promise<RESULT>;
|
|
14
|
+
setNewPassword: (context: Context, params: SetNewPasswordParams & {
|
|
15
|
+
currentResult: RESULT;
|
|
16
|
+
customQuery?: CustomQuery;
|
|
17
|
+
}) => Promise<RESULT>;
|
|
18
|
+
}
|
|
19
|
+
export declare function useForgotPasswordFactory<RESULT>(factoryParams: UseForgotPasswordFactoryParams<RESULT>): () => UseForgotPassword<RESULT>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CustomQuery, Context, FactoryParams, UseMakeOrder, PlatformApi } from '../types';
|
|
2
|
+
export interface UseMakeOrderFactoryParams<ORDER, API extends PlatformApi = any> extends FactoryParams<API> {
|
|
3
|
+
make: (context: Context, params: {
|
|
4
|
+
customQuery?: CustomQuery;
|
|
5
|
+
}) => Promise<ORDER>;
|
|
6
|
+
}
|
|
7
|
+
export declare const useMakeOrderFactory: <ORDER, API extends PlatformApi = any>(factoryParams: UseMakeOrderFactoryParams<ORDER, API>) => () => UseMakeOrder<ORDER, API>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CustomQuery, ProductsSearchParams, UseProduct, Context, FactoryParams, PlatformApi } from '../types';
|
|
2
|
+
export interface UseProductFactoryParams<PRODUCTS, PRODUCT_SEARCH_PARAMS extends ProductsSearchParams, API extends PlatformApi = any> extends FactoryParams<API> {
|
|
3
|
+
productsSearch: (context: Context, params: PRODUCT_SEARCH_PARAMS & {
|
|
4
|
+
customQuery?: CustomQuery;
|
|
5
|
+
}) => Promise<PRODUCTS>;
|
|
6
|
+
}
|
|
7
|
+
export declare function useProductFactory<PRODUCTS, PRODUCT_SEARCH_PARAMS extends ProductsSearchParams, API extends PlatformApi = any>(factoryParams: UseProductFactoryParams<PRODUCTS, PRODUCT_SEARCH_PARAMS, API>): (id: string) => UseProduct<PRODUCTS, PRODUCT_SEARCH_PARAMS, API>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CustomQuery, UseReview, Context, FactoryParams, PlatformApi } from '../types';
|
|
2
|
+
export interface UseReviewFactoryParams<REVIEW, REVIEWS_SEARCH_PARAMS, REVIEW_ADD_PARAMS, API extends PlatformApi = any> extends FactoryParams<API> {
|
|
3
|
+
searchReviews: (context: Context, params: REVIEWS_SEARCH_PARAMS & {
|
|
4
|
+
customQuery?: CustomQuery;
|
|
5
|
+
}) => Promise<REVIEW>;
|
|
6
|
+
addReview: (context: Context, params: REVIEW_ADD_PARAMS & {
|
|
7
|
+
customQuery?: CustomQuery;
|
|
8
|
+
}) => Promise<REVIEW>;
|
|
9
|
+
}
|
|
10
|
+
export declare function useReviewFactory<REVIEW, REVIEWS_SEARCH_PARAMS, REVIEW_ADD_PARAMS, API extends PlatformApi = any>(factoryParams: UseReviewFactoryParams<REVIEW, REVIEWS_SEARCH_PARAMS, REVIEW_ADD_PARAMS, API>): (id: string) => UseReview<REVIEW, REVIEWS_SEARCH_PARAMS, REVIEW_ADD_PARAMS>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CustomQuery, UseSearch, Context, FactoryParams } from '../types';
|
|
2
|
+
export interface UseSearchFactoryParams<RESULT, SEARCH_PARAMS> extends FactoryParams {
|
|
3
|
+
search: (context: Context, params: SEARCH_PARAMS & {
|
|
4
|
+
customQuery?: CustomQuery;
|
|
5
|
+
}) => Promise<RESULT>;
|
|
6
|
+
}
|
|
7
|
+
export declare function useSearchFactory<RESULT, SEARCH_PARAMS>(factoryParams: UseSearchFactoryParams<RESULT, SEARCH_PARAMS>): (id: string) => UseSearch<RESULT, SEARCH_PARAMS>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UseShipping, Context, FactoryParams, CustomQuery, PlatformApi } from '../types';
|
|
2
|
+
export interface UseShippingParams<SHIPPING, SHIPPING_PARAMS, API extends PlatformApi = any> extends FactoryParams<API> {
|
|
3
|
+
load: (context: Context, params: {
|
|
4
|
+
customQuery?: CustomQuery;
|
|
5
|
+
}) => Promise<SHIPPING>;
|
|
6
|
+
save: (context: Context, params: {
|
|
7
|
+
params: SHIPPING_PARAMS;
|
|
8
|
+
shippingDetails: SHIPPING;
|
|
9
|
+
customQuery?: CustomQuery;
|
|
10
|
+
}) => Promise<SHIPPING>;
|
|
11
|
+
}
|
|
12
|
+
export declare const useShippingFactory: <SHIPPING, SHIPPING_PARAMS, API extends PlatformApi = any>(factoryParams: UseShippingParams<SHIPPING, SHIPPING_PARAMS, API>) => () => UseShipping<SHIPPING, SHIPPING_PARAMS, API>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UseShippingProvider, Context, FactoryParams, CustomQuery, PlatformApi } from '../types';
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
export interface UseShippingProviderParams<STATE, SHIPPING_METHOD, API extends PlatformApi = any> extends FactoryParams<API> {
|
|
4
|
+
load: (context: Context, params: {
|
|
5
|
+
state: Ref<STATE>;
|
|
6
|
+
customQuery?: CustomQuery;
|
|
7
|
+
}) => Promise<STATE>;
|
|
8
|
+
save: (context: Context, params: {
|
|
9
|
+
state: Ref<STATE>;
|
|
10
|
+
shippingMethod: SHIPPING_METHOD;
|
|
11
|
+
customQuery?: CustomQuery;
|
|
12
|
+
}) => Promise<STATE>;
|
|
13
|
+
}
|
|
14
|
+
export declare const useShippingProviderFactory: <STATE, SHIPPING_METHOD, API extends PlatformApi = any>(factoryParams: UseShippingProviderParams<STATE, SHIPPING_METHOD, API>) => () => UseShippingProvider<STATE, SHIPPING_METHOD, API>;
|