@evershop/evershop 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/common/Area.js +199 -12
- package/dist/components/common/Area.js.map +1 -1
- package/dist/components/common/Editor.js +2 -1
- package/dist/components/common/Editor.js.map +1 -1
- package/dist/components/common/ExtendableTable.js +1 -1
- package/dist/components/common/ExtendableTable.js.map +1 -1
- package/dist/components/common/StaticImage.js +2 -2
- package/dist/components/common/StaticImage.js.map +1 -1
- package/dist/components/common/form/Editor.scss +3 -1
- package/dist/components/common/form/ReactSelectCreatableField.d.ts +1 -1
- package/dist/components/common/form/SelectField.js +3 -3
- package/dist/components/common/form/SelectField.js.map +1 -1
- package/dist/components/common/ui/Badge.d.ts +1 -1
- package/dist/components/common/ui/Item.js +1 -1
- package/dist/components/common/ui/Item.js.map +1 -1
- package/dist/components/common/ui/Sonner.d.ts +5 -0
- package/dist/components/common/ui/Sonner.js +24 -0
- package/dist/components/common/ui/Sonner.js.map +1 -0
- package/dist/components/common/ui/Tabs.d.ts +1 -1
- package/dist/components/frontStore/Footer.js +3 -1
- package/dist/components/frontStore/Footer.js.map +1 -1
- package/dist/components/frontStore/Pagination.js +1 -1
- package/dist/components/frontStore/Pagination.js.map +1 -1
- package/dist/components/frontStore/cart/CartContext.d.ts +2 -2
- package/dist/components/frontStore/cart/DefaultCartItemList.js +5 -5
- package/dist/components/frontStore/cart/DefaultCartItemList.js.map +1 -1
- package/dist/components/frontStore/cart/DefaultMiniCartDropdown.js +2 -19
- package/dist/components/frontStore/cart/DefaultMiniCartDropdown.js.map +1 -1
- package/dist/components/frontStore/cart/DefaultMinicartDropdownSummary.d.ts +7 -0
- package/dist/components/frontStore/cart/DefaultMinicartDropdownSummary.js +29 -0
- package/dist/components/frontStore/cart/DefaultMinicartDropdownSummary.js.map +1 -0
- package/dist/components/frontStore/catalog/CategoryInfo.js +2 -2
- package/dist/components/frontStore/catalog/CategoryInfo.js.map +1 -1
- package/dist/components/frontStore/catalog/DefaultCategoryFilterRender.js +1 -1
- package/dist/components/frontStore/catalog/DefaultCategoryFilterRender.js.map +1 -1
- package/dist/components/frontStore/catalog/DefaultProductFilterRender.js +3 -3
- package/dist/components/frontStore/catalog/DefaultProductFilterRender.js.map +1 -1
- package/dist/components/frontStore/catalog/ProductSorting.d.ts +2 -1
- package/dist/components/frontStore/catalog/ProductSorting.js +7 -3
- package/dist/components/frontStore/catalog/ProductSorting.js.map +1 -1
- package/dist/components/frontStore/catalog/SearchBox.d.ts +1 -1
- package/dist/components/frontStore/checkout/CheckoutButton.js +19 -12
- package/dist/components/frontStore/checkout/CheckoutButton.js.map +1 -1
- package/dist/components/frontStore/checkout/CheckoutContext.d.ts +10 -9
- package/dist/components/frontStore/checkout/CheckoutContext.js +39 -25
- package/dist/components/frontStore/checkout/CheckoutContext.js.map +1 -1
- package/dist/components/frontStore/checkout/ContactInformation.js +12 -8
- package/dist/components/frontStore/checkout/ContactInformation.js.map +1 -1
- package/dist/components/frontStore/checkout/Payment.js +19 -12
- package/dist/components/frontStore/checkout/Payment.js.map +1 -1
- package/dist/components/frontStore/checkout/Shipment.js +19 -13
- package/dist/components/frontStore/checkout/Shipment.js.map +1 -1
- package/dist/components/frontStore/checkout/payment/PaymentMethods.js +1 -1
- package/dist/components/frontStore/checkout/payment/PaymentMethods.js.map +1 -1
- package/dist/components/frontStore/checkout/shipment/ShippingMethods.js +2 -2
- package/dist/components/frontStore/checkout/shipment/ShippingMethods.js.map +1 -1
- package/dist/components/frontStore/customer/CustomerContext.d.ts +3 -3
- package/dist/components/frontStore/customer/RegistrationForm.js +1 -1
- package/dist/components/frontStore/customer/address/addressForm/AddressForm.js +1 -1
- package/dist/components/frontStore/customer/address/addressForm/AddressForm.js.map +1 -1
- package/dist/lib/componee/scanForComponents.js.map +1 -1
- package/dist/lib/event/EventProcessor.d.ts +17 -0
- package/dist/lib/event/EventProcessor.js +63 -0
- package/dist/lib/event/EventProcessor.js.map +1 -0
- package/dist/lib/event/EventStorage.d.ts +36 -0
- package/dist/lib/event/EventStorage.js +49 -0
- package/dist/lib/event/EventStorage.js.map +1 -0
- package/dist/lib/event/callSubscibers.d.ts +1 -1
- package/dist/lib/event/callSubscibers.js +7 -11
- package/dist/lib/event/callSubscibers.js.map +1 -1
- package/dist/lib/event/event-manager.js +38 -71
- package/dist/lib/event/event-manager.js.map +1 -1
- package/dist/lib/event/loadSubscribers.d.ts +10 -1
- package/dist/lib/event/loadSubscribers.js +2 -4
- package/dist/lib/event/loadSubscribers.js.map +1 -1
- package/dist/lib/event/tests/unit/EventProcessor.test.d.ts +1 -0
- package/dist/lib/event/tests/unit/EventProcessor.test.js +196 -0
- package/dist/lib/event/tests/unit/EventProcessor.test.js.map +1 -0
- package/dist/lib/event/tests/unit/callSubscribers.test.d.ts +1 -0
- package/dist/lib/event/tests/unit/callSubscribers.test.js +57 -0
- package/dist/lib/event/tests/unit/callSubscribers.test.js.map +1 -0
- package/dist/lib/mail/emailHelper.d.ts +2 -2
- package/dist/lib/postgres/connection.d.ts +3 -1
- package/dist/lib/postgres/connection.js +10 -6
- package/dist/lib/postgres/connection.js.map +1 -1
- package/dist/lib/postgres/query.d.ts +296 -0
- package/dist/lib/postgres/query.js +42 -0
- package/dist/lib/postgres/query.js.map +1 -0
- package/dist/lib/util/getConfig.d.ts +6 -6
- package/dist/lib/util/registry.d.ts +17 -2
- package/dist/lib/util/registry.js.map +1 -1
- package/dist/lib/util/sanitizeHtml.d.ts +16 -0
- package/dist/lib/util/sanitizeHtml.js +45 -0
- package/dist/lib/util/sanitizeHtml.js.map +1 -0
- package/dist/lib/webpack/loaders/AreaLoader.js +0 -1
- package/dist/lib/webpack/loaders/AreaLoader.js.map +1 -1
- package/dist/lib/webpack/util/getTailwindSources.js +1 -1
- package/dist/lib/webpack/util/getTailwindSources.js.map +1 -1
- package/dist/modules/auth/api/refreshUserToken/refreshToken.js +4 -6
- package/dist/modules/auth/api/refreshUserToken/refreshToken.js.map +1 -1
- package/dist/modules/auth/bootstrap.d.ts +1 -1
- package/dist/modules/auth/bootstrap.js +16 -14
- package/dist/modules/auth/bootstrap.js.map +1 -1
- package/dist/modules/auth/services/buildAdminUserPayload.d.ts +10 -0
- package/dist/modules/auth/services/buildAdminUserPayload.js +19 -0
- package/dist/modules/auth/services/buildAdminUserPayload.js.map +1 -0
- package/dist/modules/auth/services/loginUserWithEmail.d.ts +3 -7
- package/dist/modules/auth/services/loginUserWithEmail.js +15 -6
- package/dist/modules/auth/services/loginUserWithEmail.js.map +1 -1
- package/dist/modules/auth/services/logoutUser.d.ts +3 -4
- package/dist/modules/auth/services/logoutUser.js +12 -1
- package/dist/modules/auth/services/logoutUser.js.map +1 -1
- package/dist/modules/base/api/global/[apiResponse]apiErrorHandler.d.ts +3 -1
- package/dist/modules/base/api/global/[apiResponse]apiErrorHandler.js.map +1 -1
- package/dist/modules/base/api/global/[auth]apiResponse[apiErrorHandler].d.ts +3 -1
- package/dist/modules/base/api/global/[auth]apiResponse[apiErrorHandler].js.map +1 -1
- package/dist/modules/base/api/global/[auth]payloadValidate.d.ts +3 -1
- package/dist/modules/base/api/global/[auth]payloadValidate.js +3 -2
- package/dist/modules/base/api/global/[auth]payloadValidate.js.map +1 -1
- package/dist/modules/base/api/global/[payloadValidate]escapeHtml.d.ts +3 -1
- package/dist/modules/base/api/global/[payloadValidate]escapeHtml.js +0 -2
- package/dist/modules/base/api/global/[payloadValidate]escapeHtml.js.map +1 -1
- package/dist/modules/base/migration/Version-1.0.2.d.ts +2 -0
- package/dist/modules/base/migration/Version-1.0.2.js +22 -0
- package/dist/modules/base/migration/Version-1.0.2.js.map +1 -0
- package/dist/modules/base/pages/admin/all/global.scss +1 -1
- package/dist/modules/base/services/escapePayload.js +20 -13
- package/dist/modules/base/services/escapePayload.js.map +1 -1
- package/dist/modules/base/services/markSkipEscape.d.ts +5 -0
- package/dist/modules/base/services/markSkipEscape.js +25 -20
- package/dist/modules/base/services/markSkipEscape.js.map +1 -1
- package/dist/modules/catalog/api/createAttribute/createAttribute[finish].d.ts +3 -1
- package/dist/modules/catalog/api/createCategory/[context]bodyParser[auth].d.ts +1 -1
- package/dist/modules/catalog/api/createCategory/[context]bodyParser[auth].js.map +1 -1
- package/dist/modules/catalog/api/createCategory/createCategory[finish].d.ts +5 -1
- package/dist/modules/catalog/api/createCategory/createCategory[finish].js.map +1 -1
- package/dist/modules/catalog/api/createCategory/finish[apiResponse].d.ts +3 -1
- package/dist/modules/catalog/api/createCategory/finish[apiResponse].js +2 -2
- package/dist/modules/catalog/api/createCategory/finish[apiResponse].js.map +1 -1
- package/dist/modules/catalog/api/createCategory/payloadSchema.json +76 -0
- package/dist/modules/catalog/api/createCollection/[context]bodyParser[auth].d.ts +1 -1
- package/dist/modules/catalog/api/createCollection/[context]bodyParser[auth].js.map +1 -1
- package/dist/modules/catalog/api/createCollection/createCollection[finish].d.ts +4 -1
- package/dist/modules/catalog/api/createCollection/createCollection[finish].js.map +1 -1
- package/dist/modules/catalog/api/createCollection/finish[apiResponse].d.ts +3 -1
- package/dist/modules/catalog/api/createCollection/finish[apiResponse].js +1 -1
- package/dist/modules/catalog/api/createCollection/finish[apiResponse].js.map +1 -1
- package/dist/modules/catalog/{services/collection/collectionDataSchema.json → api/createCollection/payloadSchema.json} +1 -0
- package/dist/modules/catalog/api/createProduct/[context]bodyParser[auth].d.ts +1 -1
- package/dist/modules/catalog/api/createProduct/[context]bodyParser[auth].js.map +1 -1
- package/dist/modules/catalog/api/createProduct/createProduct[finish].d.ts +5 -1
- package/dist/modules/catalog/api/createProduct/createProduct[finish].js.map +1 -1
- package/dist/modules/catalog/api/createProduct/finish[apiResponse].d.ts +3 -1
- package/dist/modules/catalog/api/createProduct/finish[apiResponse].js +2 -2
- package/dist/modules/catalog/api/createProduct/finish[apiResponse].js.map +1 -1
- package/dist/modules/catalog/api/createProduct/payloadSchema.json +76 -0
- package/dist/modules/catalog/api/updateAttribute/updateAttribute[finish].d.ts +3 -1
- package/dist/modules/catalog/api/updateCategory/[context]bodyParser[auth].d.ts +1 -1
- package/dist/modules/catalog/api/updateCategory/[context]bodyParser[auth].js.map +1 -1
- package/dist/modules/catalog/api/updateCategory/finish[apiResponse].d.ts +3 -1
- package/dist/modules/catalog/api/updateCategory/finish[apiResponse].js +2 -2
- package/dist/modules/catalog/api/updateCategory/finish[apiResponse].js.map +1 -1
- package/dist/modules/catalog/api/updateCategory/payloadSchema.json +76 -0
- package/dist/modules/catalog/api/updateCategory/updateCategory[finish].d.ts +5 -1
- package/dist/modules/catalog/api/updateCategory/updateCategory[finish].js +1 -1
- package/dist/modules/catalog/api/updateCategory/updateCategory[finish].js.map +1 -1
- package/dist/modules/catalog/api/updateCollection/[context]bodyParser[auth].d.ts +1 -1
- package/dist/modules/catalog/api/updateCollection/[context]bodyParser[auth].js.map +1 -1
- package/dist/modules/catalog/api/updateCollection/finish[apiResponse].d.ts +3 -1
- package/dist/modules/catalog/api/updateCollection/finish[apiResponse].js +1 -1
- package/dist/modules/catalog/api/updateCollection/finish[apiResponse].js.map +1 -1
- package/{src/modules/catalog/services/collection/collectionDataSchema.json → dist/modules/catalog/api/updateCollection/payloadSchema.json} +1 -0
- package/dist/modules/catalog/api/updateCollection/updateCollection[finish].d.ts +5 -1
- package/dist/modules/catalog/api/updateCollection/updateCollection[finish].js +1 -1
- package/dist/modules/catalog/api/updateCollection/updateCollection[finish].js.map +1 -1
- package/dist/modules/catalog/api/updateProduct/[context]bodyParser[auth].d.ts +1 -1
- package/dist/modules/catalog/api/updateProduct/[context]bodyParser[auth].js.map +1 -1
- package/dist/modules/catalog/api/updateProduct/finish[apiResponse].d.ts +3 -1
- package/dist/modules/catalog/api/updateProduct/finish[apiResponse].js +2 -2
- package/dist/modules/catalog/api/updateProduct/finish[apiResponse].js.map +1 -1
- package/dist/modules/catalog/api/updateProduct/payloadSchema.json +76 -0
- package/dist/modules/catalog/api/updateProduct/updateProduct[finish].d.ts +5 -1
- package/dist/modules/catalog/api/updateProduct/updateProduct[finish].js +1 -1
- package/dist/modules/catalog/api/updateProduct/updateProduct[finish].js.map +1 -1
- package/dist/modules/catalog/graphql/types/Category/Category.resolvers.d.ts +36 -37
- package/dist/modules/catalog/graphql/types/Category/Category.resolvers.js +0 -18
- package/dist/modules/catalog/graphql/types/Category/Category.resolvers.js.map +1 -1
- package/dist/modules/catalog/graphql/types/Collection/Collection.resolvers.js +1 -8
- package/dist/modules/catalog/graphql/types/Collection/Collection.resolvers.js.map +1 -1
- package/dist/modules/catalog/graphql/types/Product/Product.resolvers.js +0 -18
- package/dist/modules/catalog/graphql/types/Product/Product.resolvers.js.map +1 -1
- package/dist/modules/catalog/pages/admin/productEdit/variants/CreateVariant.js +4 -3
- package/dist/modules/catalog/pages/admin/productEdit/variants/CreateVariant.js.map +1 -1
- package/dist/modules/catalog/pages/admin/productEdit/variants/CreateVariantGroup.d.ts +1 -0
- package/dist/modules/catalog/pages/admin/productEdit/variants/CreateVariantGroup.js +12 -6
- package/dist/modules/catalog/pages/admin/productEdit/variants/CreateVariantGroup.js.map +1 -1
- package/dist/modules/catalog/pages/admin/productEdit/variants/EditVariant.js +4 -3
- package/dist/modules/catalog/pages/admin/productEdit/variants/EditVariant.js.map +1 -1
- package/dist/modules/catalog/pages/admin/productEdit/variants/New.js +6 -10
- package/dist/modules/catalog/pages/admin/productEdit/variants/New.js.map +1 -1
- package/dist/modules/catalog/pages/admin/productEdit/variants/VariantModal.d.ts +2 -0
- package/dist/modules/catalog/pages/admin/productEdit/variants/VariantModal.js +8 -2
- package/dist/modules/catalog/pages/admin/productEdit/variants/VariantModal.js.map +1 -1
- package/dist/modules/catalog/pages/admin/productEdit+productNew/General.js +4 -1
- package/dist/modules/catalog/pages/admin/productEdit+productNew/General.js.map +1 -1
- package/dist/modules/catalog/pages/frontStore/categoryView/CategoryView.js +1 -6
- package/dist/modules/catalog/pages/frontStore/categoryView/CategoryView.js.map +1 -1
- package/dist/modules/catalog/pages/frontStore/productView/ProductView.js +7 -1
- package/dist/modules/catalog/pages/frontStore/productView/ProductView.js.map +1 -1
- package/dist/modules/catalog/services/attribute/createProductAttribute.d.ts +78 -2
- package/dist/modules/catalog/services/attribute/createProductAttribute.js +25 -1
- package/dist/modules/catalog/services/attribute/createProductAttribute.js.map +1 -1
- package/dist/modules/catalog/services/attribute/deleteProductAttribute.d.ts +7 -1
- package/dist/modules/catalog/services/attribute/deleteProductAttribute.js +13 -1
- package/dist/modules/catalog/services/attribute/deleteProductAttribute.js.map +1 -1
- package/dist/modules/catalog/services/attribute/updateProductAttribute.d.ts +56 -2
- package/dist/modules/catalog/services/attribute/updateProductAttribute.js +28 -6
- package/dist/modules/catalog/services/attribute/updateProductAttribute.js.map +1 -1
- package/dist/modules/catalog/services/category/createCategory.d.ts +28 -2
- package/dist/modules/catalog/services/category/createCategory.js +18 -1
- package/dist/modules/catalog/services/category/createCategory.js.map +1 -1
- package/dist/modules/catalog/services/category/deleteCategory.d.ts +7 -1
- package/dist/modules/catalog/services/category/deleteCategory.js +13 -1
- package/dist/modules/catalog/services/category/deleteCategory.js.map +1 -1
- package/dist/modules/catalog/services/category/updateCategory.d.ts +25 -1
- package/dist/modules/catalog/services/category/updateCategory.js +26 -4
- package/dist/modules/catalog/services/category/updateCategory.js.map +1 -1
- package/dist/modules/catalog/services/collection/createCollection.d.ts +12 -3
- package/dist/modules/catalog/services/collection/createCollection.js +20 -20
- package/dist/modules/catalog/services/collection/createCollection.js.map +1 -1
- package/dist/modules/catalog/services/collection/deleteCollection.d.ts +7 -1
- package/dist/modules/catalog/services/collection/deleteCollection.js +13 -1
- package/dist/modules/catalog/services/collection/deleteCollection.js.map +1 -1
- package/dist/modules/catalog/services/collection/updateCollection.d.ts +9 -1
- package/dist/modules/catalog/services/collection/updateCollection.js +22 -24
- package/dist/modules/catalog/services/collection/updateCollection.js.map +1 -1
- package/dist/modules/catalog/services/index.d.ts +29 -18
- package/dist/modules/catalog/services/index.js +35 -18
- package/dist/modules/catalog/services/index.js.map +1 -1
- package/dist/modules/catalog/services/product/createProduct.d.ts +56 -4
- package/dist/modules/catalog/services/product/createProduct.js +36 -1
- package/dist/modules/catalog/services/product/createProduct.js.map +1 -1
- package/dist/modules/catalog/services/product/deleteProduct.d.ts +7 -2
- package/dist/modules/catalog/services/product/deleteProduct.js +13 -1
- package/dist/modules/catalog/services/product/deleteProduct.js.map +1 -1
- package/dist/modules/catalog/services/product/updateProduct.d.ts +58 -2
- package/dist/modules/catalog/services/product/updateProduct.js +43 -4
- package/dist/modules/catalog/services/product/updateProduct.js.map +1 -1
- package/dist/modules/checkout/pages/frontStore/cart/ShoppingCart.js +1 -3
- package/dist/modules/checkout/pages/frontStore/cart/ShoppingCart.js.map +1 -1
- package/dist/modules/checkout/pages/frontStore/checkout/Checkout.js +3 -1
- package/dist/modules/checkout/pages/frontStore/checkout/Checkout.js.map +1 -1
- package/dist/modules/checkout/services/addBillingAddress.d.ts +15 -0
- package/dist/modules/checkout/services/addBillingAddress.js +24 -6
- package/dist/modules/checkout/services/addBillingAddress.js.map +1 -1
- package/dist/modules/checkout/services/addCartItem.d.ts +12 -0
- package/dist/modules/checkout/services/addCartItem.js +7 -1
- package/dist/modules/checkout/services/addCartItem.js.map +1 -1
- package/dist/modules/checkout/services/addShippingAddress.d.ts +13 -0
- package/dist/modules/checkout/services/addShippingAddress.js +18 -6
- package/dist/modules/checkout/services/addShippingAddress.js.map +1 -1
- package/dist/modules/checkout/services/checkout.d.ts +19 -1
- package/dist/modules/checkout/services/checkout.js +12 -6
- package/dist/modules/checkout/services/checkout.js.map +1 -1
- package/dist/modules/checkout/services/index.d.ts +5 -3
- package/dist/modules/checkout/services/index.js +5 -3
- package/dist/modules/checkout/services/index.js.map +1 -1
- package/dist/modules/checkout/services/orderCreator.d.ts +48 -0
- package/dist/modules/checkout/services/orderCreator.js +25 -1
- package/dist/modules/checkout/services/orderCreator.js.map +1 -1
- package/dist/modules/checkout/services/removeCartItem.d.ts +8 -0
- package/dist/modules/checkout/services/removeCartItem.js +7 -1
- package/dist/modules/checkout/services/removeCartItem.js.map +1 -1
- package/dist/modules/checkout/services/updateCartItemQty.d.ts +14 -0
- package/dist/modules/checkout/services/updateCartItemQty.js +7 -1
- package/dist/modules/checkout/services/updateCartItemQty.js.map +1 -1
- package/dist/modules/cms/api/createCmsPage/[context]bodyParser[auth].d.ts +1 -1
- package/dist/modules/cms/api/createCmsPage/[context]bodyParser[auth].js.map +1 -1
- package/dist/modules/cms/api/createCmsPage/createPage[finish].d.ts +3 -1
- package/dist/modules/cms/api/createCmsPage/createPage[finish].js +1 -1
- package/dist/modules/cms/api/createCmsPage/createPage[finish].js.map +1 -1
- package/dist/modules/cms/api/createCmsPage/finish[apiResponse].d.ts +3 -1
- package/dist/modules/cms/api/createCmsPage/finish[apiResponse].js +2 -2
- package/dist/modules/cms/api/createCmsPage/finish[apiResponse].js.map +1 -1
- package/dist/modules/cms/api/createCmsPage/payloadSchema.json +76 -0
- package/dist/modules/cms/api/deleteCmsPage/deleteCmsPage.d.ts +3 -1
- package/dist/modules/cms/api/deleteCmsPage/deleteCmsPage.js +1 -1
- package/dist/modules/cms/api/deleteCmsPage/deleteCmsPage.js.map +1 -1
- package/dist/modules/cms/api/updateCmsPage/[context]bodyParser[auth].d.ts +1 -1
- package/dist/modules/cms/api/updateCmsPage/[context]bodyParser[auth].js.map +1 -1
- package/dist/modules/cms/api/updateCmsPage/finish[apiResponse].d.ts +3 -1
- package/dist/modules/cms/api/updateCmsPage/finish[apiResponse].js +2 -2
- package/dist/modules/cms/api/updateCmsPage/finish[apiResponse].js.map +1 -1
- package/dist/modules/cms/api/updateCmsPage/payloadSchema.json +76 -0
- package/dist/modules/cms/api/updateCmsPage/updatePage[finish].d.ts +2 -1
- package/dist/modules/cms/api/updateCmsPage/updatePage[finish].js.map +1 -1
- package/dist/modules/cms/bootstrap.d.ts +1 -1
- package/dist/modules/cms/bootstrap.js +18 -0
- package/dist/modules/cms/bootstrap.js.map +1 -1
- package/dist/modules/cms/components/BasicMenu.js +1 -1
- package/dist/modules/cms/components/BasicMenu.js.map +1 -1
- package/dist/modules/cms/graphql/types/CmsPage/CmsPage.resolvers.js +0 -18
- package/dist/modules/cms/graphql/types/CmsPage/CmsPage.resolvers.js.map +1 -1
- package/dist/modules/cms/graphql/types/Widget/Widget.resolvers.js +0 -17
- package/dist/modules/cms/graphql/types/Widget/Widget.resolvers.js.map +1 -1
- package/dist/modules/cms/services/index.d.ts +3 -0
- package/dist/modules/cms/services/index.js +3 -0
- package/dist/modules/cms/services/index.js.map +1 -1
- package/dist/modules/cms/services/page/createPage.d.ts +18 -2
- package/dist/modules/cms/services/page/createPage.js +25 -7
- package/dist/modules/cms/services/page/createPage.js.map +1 -1
- package/dist/modules/cms/services/page/deletePage.d.ts +6 -2
- package/dist/modules/cms/services/page/deletePage.js +18 -6
- package/dist/modules/cms/services/page/deletePage.js.map +1 -1
- package/dist/modules/cms/services/page/pageDataSchema.json +9 -1
- package/dist/modules/cms/services/page/updatePage.d.ts +22 -1
- package/dist/modules/cms/services/page/updatePage.js +19 -2
- package/dist/modules/cms/services/page/updatePage.js.map +1 -1
- package/dist/modules/cms/services/widget/createWidget.d.ts +12 -1
- package/dist/modules/cms/services/widget/createWidget.js +14 -2
- package/dist/modules/cms/services/widget/createWidget.js.map +1 -1
- package/dist/modules/cms/services/widget/deleteWidget.d.ts +7 -1
- package/dist/modules/cms/services/widget/deleteWidget.js +13 -1
- package/dist/modules/cms/services/widget/deleteWidget.js.map +1 -1
- package/dist/modules/cms/services/widget/updateWidget.d.ts +7 -1
- package/dist/modules/cms/services/widget/updateWidget.js +15 -3
- package/dist/modules/cms/services/widget/updateWidget.js.map +1 -1
- package/dist/modules/cod/pages/frontStore/checkout/CashOnDelivery.js +2 -2
- package/dist/modules/cod/pages/frontStore/checkout/CashOnDelivery.js.map +1 -1
- package/dist/modules/customer/api/refreshCustomerToken/refreshToken.js +4 -6
- package/dist/modules/customer/api/refreshCustomerToken/refreshToken.js.map +1 -1
- package/dist/modules/customer/pages/frontStore/login/LoginPage.js +10 -9
- package/dist/modules/customer/pages/frontStore/login/LoginPage.js.map +1 -1
- package/dist/modules/customer/pages/frontStore/register/RegisterPage.js +14 -13
- package/dist/modules/customer/pages/frontStore/register/RegisterPage.js.map +1 -1
- package/dist/modules/customer/services/customer/address/createCustomerAddress.d.ts +13 -0
- package/dist/modules/customer/services/customer/address/createCustomerAddress.js +13 -1
- package/dist/modules/customer/services/customer/address/createCustomerAddress.js.map +1 -1
- package/dist/modules/customer/services/customer/address/deleteCustomerAddress.d.ts +5 -0
- package/dist/modules/customer/services/customer/address/deleteCustomerAddress.js +13 -1
- package/dist/modules/customer/services/customer/address/deleteCustomerAddress.js.map +1 -1
- package/dist/modules/customer/services/customer/address/updateCustomerAddress.d.ts +13 -0
- package/dist/modules/customer/services/customer/address/updateCustomerAddress.js +13 -1
- package/dist/modules/customer/services/customer/address/updateCustomerAddress.js.map +1 -1
- package/dist/modules/customer/services/customer/buildCustomerPayload.d.ts +8 -0
- package/dist/modules/customer/services/customer/buildCustomerPayload.js +19 -0
- package/dist/modules/customer/services/customer/buildCustomerPayload.js.map +1 -0
- package/dist/modules/customer/services/customer/createCustomer.d.ts +19 -1
- package/dist/modules/customer/services/customer/createCustomer.js +17 -4
- package/dist/modules/customer/services/customer/createCustomer.js.map +1 -1
- package/dist/modules/customer/services/customer/deleteCustomer.d.ts +7 -2
- package/dist/modules/customer/services/customer/deleteCustomer.js +13 -1
- package/dist/modules/customer/services/customer/deleteCustomer.js.map +1 -1
- package/dist/modules/customer/services/customer/loginCustomerWithEmail.js +3 -4
- package/dist/modules/customer/services/customer/loginCustomerWithEmail.js.map +1 -1
- package/dist/modules/customer/services/customer/updateCustomer.d.ts +23 -1
- package/dist/modules/customer/services/customer/updateCustomer.js +13 -1
- package/dist/modules/customer/services/customer/updateCustomer.js.map +1 -1
- package/dist/modules/customer/services/customer/updatePassword.d.ts +13 -0
- package/dist/modules/customer/services/customer/updatePassword.js +13 -1
- package/dist/modules/customer/services/customer/updatePassword.js.map +1 -1
- package/dist/modules/customer/services/index.d.ts +17 -11
- package/dist/modules/customer/services/index.js +26 -11
- package/dist/modules/customer/services/index.js.map +1 -1
- package/dist/modules/oms/bootstrap.js +8 -8
- package/dist/modules/oms/bootstrap.js.map +1 -1
- package/dist/modules/oms/services/addOrderActivityLog.d.ts +20 -0
- package/dist/modules/oms/services/addOrderActivityLog.js +7 -1
- package/dist/modules/oms/services/addOrderActivityLog.js.map +1 -1
- package/dist/modules/oms/services/addPaymentTransaction.d.ts +3 -0
- package/dist/modules/oms/services/addPaymentTransaction.js +16 -0
- package/dist/modules/oms/services/addPaymentTransaction.js.map +1 -0
- package/dist/modules/oms/services/cancelOrder.d.ts +61 -0
- package/dist/modules/oms/services/cancelOrder.js +31 -1
- package/dist/modules/oms/services/cancelOrder.js.map +1 -1
- package/dist/modules/oms/services/createShipment.d.ts +20 -0
- package/dist/modules/oms/services/createShipment.js +7 -1
- package/dist/modules/oms/services/createShipment.js.map +1 -1
- package/dist/modules/oms/services/index.d.ts +4 -0
- package/dist/modules/oms/services/index.js +4 -0
- package/dist/modules/oms/services/index.js.map +1 -1
- package/dist/modules/oms/services/orderLoader.d.ts +8 -0
- package/dist/modules/oms/services/orderLoader.js +57 -0
- package/dist/modules/oms/services/orderLoader.js.map +1 -0
- package/dist/modules/oms/services/statusManager.d.ts +54 -0
- package/dist/modules/oms/services/statusManager.js +101 -0
- package/dist/modules/oms/services/statusManager.js.map +1 -0
- package/dist/modules/oms/services/updateOrderStatus.d.ts +37 -0
- package/dist/modules/oms/services/updateOrderStatus.js +34 -9
- package/dist/modules/oms/services/updateOrderStatus.js.map +1 -1
- package/dist/modules/oms/services/updatePaymentStatus.d.ts +26 -0
- package/dist/modules/oms/services/updatePaymentStatus.js +13 -1
- package/dist/modules/oms/services/updatePaymentStatus.js.map +1 -1
- package/dist/modules/oms/services/updateShipmentStatus.d.ts +26 -0
- package/dist/modules/oms/services/updateShipmentStatus.js +13 -1
- package/dist/modules/oms/services/updateShipmentStatus.js.map +1 -1
- package/dist/modules/paypal/api/paypalAuthorizePayment/[bodyParser]authorize.js +1 -1
- package/dist/modules/paypal/api/paypalAuthorizePayment/[bodyParser]authorize.js.map +1 -1
- package/dist/modules/paypal/api/paypalCaptureAuthorizedPayment/[bodyParser]capture.js +2 -2
- package/dist/modules/paypal/api/paypalCaptureAuthorizedPayment/[bodyParser]capture.js.map +1 -1
- package/dist/modules/paypal/api/paypalCapturePayment/[bodyParser]capture.js +1 -1
- package/dist/modules/paypal/api/paypalCapturePayment/[bodyParser]capture.js.map +1 -1
- package/dist/modules/paypal/bootstrap.d.ts +1 -1
- package/dist/modules/paypal/bootstrap.js +22 -2
- package/dist/modules/paypal/bootstrap.js.map +1 -1
- package/dist/modules/paypal/graphql/types/PaypalSetting/PaypalSetting.admin.resolvers.d.ts +1 -1
- package/dist/modules/paypal/migration/Version-1.0.0.d.ts +3 -0
- package/dist/modules/paypal/migration/Version-1.0.0.js +19 -0
- package/dist/modules/paypal/migration/Version-1.0.0.js.map +1 -0
- package/dist/modules/paypal/pages/admin/orderEdit/PaypalCaptureButton.js +1 -1
- package/dist/modules/paypal/pages/admin/orderEdit/PaypalCaptureButton.js.map +1 -1
- package/dist/modules/paypal/pages/frontStore/checkout/Paypal.js +8 -3
- package/dist/modules/paypal/pages/frontStore/checkout/Paypal.js.map +1 -1
- package/dist/modules/promotion/api/createCoupon/createCoupon[finish].d.ts +1 -1
- package/dist/modules/promotion/api/updateCoupon/updateCoupon[finish].d.ts +1 -1
- package/dist/modules/promotion/services/coupon/createCoupon.d.ts +45 -1
- package/dist/modules/promotion/services/coupon/createCoupon.js +17 -5
- package/dist/modules/promotion/services/coupon/createCoupon.js.map +1 -1
- package/dist/modules/promotion/services/coupon/deleteCoupon.d.ts +8 -1
- package/dist/modules/promotion/services/coupon/deleteCoupon.js +16 -4
- package/dist/modules/promotion/services/coupon/deleteCoupon.js.map +1 -1
- package/dist/modules/promotion/services/coupon/updateCoupon.d.ts +8 -1
- package/dist/modules/promotion/services/coupon/updateCoupon.js +27 -13
- package/dist/modules/promotion/services/coupon/updateCoupon.js.map +1 -1
- package/dist/modules/promotion/services/index.d.ts +6 -0
- package/dist/modules/promotion/services/index.js +10 -0
- package/dist/modules/promotion/services/index.js.map +1 -0
- package/dist/modules/setting/services/setting.d.ts +10 -1
- package/dist/modules/setting/services/setting.js +27 -0
- package/dist/modules/setting/services/setting.js.map +1 -1
- package/dist/modules/stripe/api/capturePaymentIntent/[context]bodyParser[auth].d.ts +1 -1
- package/dist/modules/stripe/api/capturePaymentIntent/[context]bodyParser[auth].js.map +1 -1
- package/dist/modules/stripe/api/capturePaymentIntent/capturePaymentIntent.d.ts +4 -1
- package/dist/modules/stripe/api/capturePaymentIntent/capturePaymentIntent.js +6 -4
- package/dist/modules/stripe/api/capturePaymentIntent/capturePaymentIntent.js.map +1 -1
- package/dist/modules/stripe/api/createPaymentIntent/[context]bodyParser[auth].d.ts +1 -1
- package/dist/modules/stripe/api/createPaymentIntent/[context]bodyParser[auth].js.map +1 -1
- package/dist/modules/stripe/api/createPaymentIntent/createPaymentIntent.d.ts +3 -1
- package/dist/modules/stripe/api/createPaymentIntent/createPaymentIntent.js +4 -4
- package/dist/modules/stripe/api/createPaymentIntent/createPaymentIntent.js.map +1 -1
- package/dist/modules/stripe/api/refundPaymentIntent/[context]bodyParser[auth].d.ts +1 -1
- package/dist/modules/stripe/api/refundPaymentIntent/[context]bodyParser[auth].js.map +1 -1
- package/dist/modules/stripe/api/refundPaymentIntent/refundPaymentIntent.d.ts +1 -1
- package/dist/modules/stripe/api/refundPaymentIntent/refundPaymentIntent.js +11 -7
- package/dist/modules/stripe/api/refundPaymentIntent/refundPaymentIntent.js.map +1 -1
- package/dist/modules/stripe/api/stripeWebHook/[bodyJson]webhook.d.ts +3 -1
- package/dist/modules/stripe/api/stripeWebHook/[bodyJson]webhook.js +6 -6
- package/dist/modules/stripe/api/stripeWebHook/[bodyJson]webhook.js.map +1 -1
- package/dist/modules/stripe/api/stripeWebHook/bodyJson.d.ts +1 -1
- package/dist/modules/stripe/api/stripeWebHook/bodyJson.js.map +1 -1
- package/dist/modules/stripe/bootstrap.d.ts +1 -1
- package/dist/modules/stripe/bootstrap.js +31 -15
- package/dist/modules/stripe/bootstrap.js.map +1 -1
- package/dist/modules/stripe/graphql/types/StripeSetting/StripeSetting.resolvers.d.ts +1 -1
- package/dist/modules/stripe/migration/Version-1.0.0.d.ts +3 -0
- package/dist/modules/stripe/migration/Version-1.0.0.js +19 -0
- package/dist/modules/stripe/migration/Version-1.0.0.js.map +1 -0
- package/dist/modules/stripe/pages/admin/orderEdit/StripeCaptureButton.js +1 -1
- package/dist/modules/stripe/pages/admin/orderEdit/StripeCaptureButton.js.map +1 -1
- package/dist/modules/stripe/pages/admin/orderEdit/StripeRefundButton.js +7 -3
- package/dist/modules/stripe/pages/admin/orderEdit/StripeRefundButton.js.map +1 -1
- package/dist/modules/stripe/pages/frontStore/checkout/Stripe.js +16 -7
- package/dist/modules/stripe/pages/frontStore/checkout/Stripe.js.map +1 -1
- package/dist/modules/stripe/pages/frontStore/stripeReturn/index.d.ts +3 -1
- package/dist/modules/stripe/pages/frontStore/stripeReturn/index.js +8 -4
- package/dist/modules/stripe/pages/frontStore/stripeReturn/index.js.map +1 -1
- package/dist/modules/stripe/services/cancelPayment.d.ts +1 -1
- package/dist/modules/stripe/services/cancelPayment.js +3 -3
- package/dist/modules/stripe/services/cancelPayment.js.map +1 -1
- package/dist/types/apiResponse.d.ts +1 -1
- package/dist/types/appContext.d.ts +7 -4
- package/dist/types/customerAddress.d.ts +1 -1
- package/dist/types/db/index.d.ts +61 -61
- package/dist/types/event.d.ts +27 -14
- package/dist/types/registry.d.ts +119 -0
- package/dist/types/registry.js +2 -0
- package/dist/types/registry.js.map +1 -0
- package/dist/types/widget.d.ts +3 -0
- package/package.json +21 -12
- package/src/components/common/Area.tsx +256 -40
- package/src/components/common/Editor.tsx +6 -3
- package/src/components/common/ExtendableTable.tsx +1 -1
- package/src/components/common/StaticImage.tsx +2 -2
- package/src/components/common/form/Editor.scss +3 -1
- package/src/components/common/form/ReactSelectCreatableField.tsx +1 -1
- package/src/components/common/form/SelectField.tsx +1 -1
- package/src/components/common/ui/Item.tsx +1 -1
- package/src/components/common/ui/Sonner.tsx +43 -0
- package/src/components/frontStore/Footer.tsx +2 -0
- package/src/components/frontStore/Pagination.tsx +1 -1
- package/src/components/frontStore/cart/CartContext.tsx +2 -2
- package/src/components/frontStore/cart/DefaultCartItemList.tsx +5 -5
- package/src/components/frontStore/cart/DefaultMiniCartDropdown.tsx +7 -37
- package/src/components/frontStore/cart/DefaultMinicartDropdownSummary.tsx +57 -0
- package/src/components/frontStore/catalog/CategoryInfo.tsx +2 -2
- package/src/components/frontStore/catalog/DefaultCategoryFilterRender.tsx +1 -1
- package/src/components/frontStore/catalog/DefaultProductFilterRender.tsx +3 -3
- package/src/components/frontStore/catalog/ProductSorting.tsx +13 -4
- package/src/components/frontStore/catalog/SearchBox.tsx +1 -1
- package/src/components/frontStore/checkout/CheckoutButton.tsx +40 -31
- package/src/components/frontStore/checkout/CheckoutContext.tsx +55 -36
- package/src/components/frontStore/checkout/ContactInformation.tsx +28 -23
- package/src/components/frontStore/checkout/Payment.tsx +36 -27
- package/src/components/frontStore/checkout/Shipment.tsx +35 -28
- package/src/components/frontStore/checkout/payment/PaymentMethods.tsx +1 -1
- package/src/components/frontStore/checkout/shipment/ShippingMethods.tsx +6 -2
- package/src/components/frontStore/customer/CustomerContext.tsx +5 -5
- package/src/components/frontStore/customer/RegistrationForm.tsx +1 -1
- package/src/components/frontStore/customer/address/addressForm/AddressForm.tsx +1 -0
- package/src/lib/componee/scanForComponents.ts +0 -1
- package/src/lib/event/EventProcessor.ts +78 -0
- package/src/lib/event/EventStorage.ts +74 -0
- package/src/lib/event/callSubscibers.ts +13 -0
- package/src/lib/event/event-manager.ts +96 -0
- package/src/lib/event/{loadSubscribers.js → loadSubscribers.ts} +20 -8
- package/src/lib/event/tests/unit/EventProcessor.test.js +262 -0
- package/src/lib/event/tests/unit/callSubscribers.test.js +77 -0
- package/src/lib/mail/emailHelper.ts +2 -2
- package/src/lib/postgres/connection.ts +11 -7
- package/src/lib/postgres/query.ts +582 -0
- package/src/lib/util/getConfig.ts +6 -6
- package/src/lib/util/registry.ts +31 -0
- package/src/lib/util/sanitizeHtml.ts +59 -0
- package/src/lib/webpack/loaders/AreaLoader.js +0 -1
- package/src/lib/webpack/util/getTailwindSources.ts +1 -1
- package/src/modules/auth/api/refreshUserToken/refreshToken.ts +4 -6
- package/src/modules/auth/bootstrap.ts +33 -0
- package/src/modules/auth/services/buildAdminUserPayload.ts +22 -0
- package/src/modules/auth/services/loginUserWithEmail.ts +36 -6
- package/src/modules/auth/services/logoutUser.ts +22 -1
- package/src/modules/base/api/global/{[apiResponse]apiErrorHandler.js → [apiResponse]apiErrorHandler.ts} +8 -1
- package/src/modules/base/api/global/{[auth]apiResponse[apiErrorHandler].js → [auth]apiResponse[apiErrorHandler].ts} +7 -1
- package/src/modules/base/api/global/{[auth]payloadValidate.js → [auth]payloadValidate.ts} +10 -3
- package/src/modules/base/api/global/[payloadValidate]escapeHtml.ts +12 -0
- package/src/modules/base/migration/Version-1.0.2.js +37 -0
- package/src/modules/base/pages/admin/all/global.scss +1 -1
- package/src/modules/base/services/{escapePayload.js → escapePayload.ts} +17 -11
- package/src/modules/base/services/markSkipEscape.ts +43 -0
- package/src/modules/catalog/api/createCategory/createCategory[finish].ts +10 -0
- package/src/modules/catalog/api/createCategory/{finish[apiResponse].js → finish[apiResponse].ts} +13 -4
- package/src/modules/catalog/api/createCategory/payloadSchema.json +76 -0
- package/src/modules/catalog/api/createCollection/{createCollection[finish].js → createCollection[finish].ts} +2 -1
- package/src/modules/catalog/api/{updateCollection/finish[apiResponse].js → createCollection/finish[apiResponse].ts} +12 -3
- package/src/modules/catalog/api/createCollection/payloadSchema.json +94 -0
- package/src/modules/catalog/api/createProduct/createProduct[finish].ts +10 -0
- package/src/modules/catalog/api/createProduct/{finish[apiResponse].js → finish[apiResponse].ts} +13 -4
- package/src/modules/catalog/api/createProduct/payloadSchema.json +76 -0
- package/src/modules/catalog/api/updateCategory/{finish[apiResponse].js → finish[apiResponse].ts} +13 -4
- package/src/modules/catalog/api/updateCategory/payloadSchema.json +76 -0
- package/src/modules/catalog/api/updateCategory/updateCategory[finish].ts +14 -0
- package/src/modules/catalog/api/{createCollection/finish[apiResponse].js → updateCollection/finish[apiResponse].ts} +12 -3
- package/src/modules/catalog/api/updateCollection/payloadSchema.json +94 -0
- package/src/modules/catalog/api/updateCollection/updateCollection[finish].ts +14 -0
- package/src/modules/catalog/api/updateProduct/{finish[apiResponse].js → finish[apiResponse].ts} +13 -4
- package/src/modules/catalog/api/updateProduct/payloadSchema.json +76 -0
- package/src/modules/catalog/api/updateProduct/updateProduct[finish].ts +14 -0
- package/src/modules/catalog/graphql/types/Category/{Category.resolvers.js → Category.resolvers.ts} +0 -21
- package/src/modules/catalog/graphql/types/Collection/Collection.resolvers.js +1 -8
- package/src/modules/catalog/graphql/types/Product/Product.resolvers.ts +0 -20
- package/src/modules/catalog/pages/admin/productEdit/variants/CreateVariant.tsx +6 -2
- package/src/modules/catalog/pages/admin/productEdit/variants/CreateVariantGroup.tsx +22 -11
- package/src/modules/catalog/pages/admin/productEdit/variants/EditVariant.tsx +10 -3
- package/src/modules/catalog/pages/admin/productEdit/variants/New.tsx +8 -23
- package/src/modules/catalog/pages/admin/productEdit/variants/VariantModal.tsx +10 -2
- package/src/modules/catalog/pages/admin/productEdit+productNew/General.tsx +5 -2
- package/src/modules/catalog/pages/frontStore/categoryView/CategoryView.tsx +4 -8
- package/src/modules/catalog/pages/frontStore/productView/ProductView.tsx +10 -1
- package/src/modules/catalog/services/attribute/createProductAttribute.ts +146 -8
- package/src/modules/catalog/services/attribute/deleteProductAttribute.ts +58 -4
- package/src/modules/catalog/services/attribute/updateProductAttribute.ts +128 -12
- package/src/modules/catalog/services/category/createCategory.ts +66 -6
- package/src/modules/catalog/services/category/deleteCategory.ts +61 -4
- package/src/modules/catalog/services/category/updateCategory.ts +75 -10
- package/src/modules/catalog/services/collection/createCollection.ts +71 -30
- package/src/modules/catalog/services/collection/deleteCollection.ts +58 -4
- package/src/modules/catalog/services/collection/updateCollection.ts +70 -35
- package/src/modules/catalog/services/index.ts +46 -35
- package/src/modules/catalog/services/product/createProduct.ts +155 -11
- package/src/modules/catalog/services/product/deleteProduct.ts +58 -4
- package/src/modules/catalog/services/product/updateProduct.ts +168 -17
- package/src/modules/checkout/pages/frontStore/cart/ShoppingCart.tsx +0 -2
- package/src/modules/checkout/pages/frontStore/checkout/Checkout.tsx +2 -0
- package/src/modules/checkout/services/addBillingAddress.ts +74 -6
- package/src/modules/checkout/services/addCartItem.ts +31 -1
- package/src/modules/checkout/services/addShippingAddress.ts +54 -6
- package/src/modules/checkout/services/checkout.ts +35 -7
- package/src/modules/checkout/services/index.ts +17 -3
- package/src/modules/checkout/services/orderCreator.ts +105 -1
- package/src/modules/checkout/services/removeCartItem.ts +27 -1
- package/src/modules/checkout/services/updateCartItemQty.ts +33 -1
- package/src/modules/cms/api/createCmsPage/createPage[finish].ts +12 -0
- package/src/modules/cms/api/createCmsPage/{finish[apiResponse].js → finish[apiResponse].ts} +10 -4
- package/src/modules/cms/api/createCmsPage/payloadSchema.json +76 -0
- package/src/modules/cms/api/deleteCmsPage/{deleteCmsPage.js → deleteCmsPage.ts} +8 -2
- package/src/modules/cms/api/updateCmsPage/{finish[apiResponse].js → finish[apiResponse].ts} +10 -4
- package/src/modules/cms/api/updateCmsPage/payloadSchema.json +76 -0
- package/src/modules/cms/api/updateCmsPage/{updatePage[finish].js → updatePage[finish].ts} +2 -1
- package/src/modules/cms/{bootstrap.js → bootstrap.ts} +24 -3
- package/src/modules/cms/components/BasicMenu.tsx +1 -1
- package/src/modules/cms/graphql/types/CmsPage/CmsPage.resolvers.ts +0 -21
- package/src/modules/cms/graphql/types/Widget/Widget.resolvers.js +0 -20
- package/src/modules/cms/services/index.ts +3 -0
- package/src/modules/cms/services/page/{createPage.js → createPage.ts} +65 -8
- package/src/modules/cms/services/page/deletePage.ts +109 -0
- package/src/modules/cms/services/page/pageDataSchema.json +9 -1
- package/src/modules/cms/services/page/{updatePage.js → updatePage.ts} +68 -6
- package/src/modules/cms/services/widget/createWidget.ts +120 -0
- package/src/modules/cms/services/widget/deleteWidget.ts +97 -0
- package/src/modules/cms/services/widget/updateWidget.js +17 -1
- package/src/modules/cms/services/widget/updateWidget.ts +139 -0
- package/src/modules/cod/pages/frontStore/checkout/CashOnDelivery.tsx +4 -2
- package/src/modules/customer/api/refreshCustomerToken/refreshToken.ts +4 -6
- package/src/modules/customer/pages/frontStore/login/LoginPage.tsx +26 -24
- package/src/modules/customer/pages/frontStore/register/RegisterPage.tsx +24 -22
- package/src/modules/customer/services/customer/address/createCustomerAddress.ts +54 -2
- package/src/modules/customer/services/customer/address/deleteCustomerAddress.ts +49 -2
- package/src/modules/customer/services/customer/address/updateCustomerAddress.ts +55 -3
- package/src/modules/customer/services/customer/buildCustomerPayload.ts +20 -0
- package/src/modules/customer/services/customer/createCustomer.ts +60 -7
- package/src/modules/customer/services/customer/deleteCustomer.ts +55 -5
- package/src/modules/customer/services/customer/loginCustomerWithEmail.ts +3 -4
- package/src/modules/customer/services/customer/updateCustomer.ts +62 -5
- package/src/modules/customer/services/customer/updatePassword.ts +56 -3
- package/src/modules/customer/services/index.ts +34 -27
- package/src/modules/oms/bootstrap.ts +9 -8
- package/src/modules/oms/services/addOrderActivityLog.ts +31 -1
- package/src/modules/oms/services/addPaymentTransaction.ts +26 -0
- package/src/modules/oms/services/cancelOrder.ts +131 -1
- package/src/modules/oms/services/createShipment.ts +31 -1
- package/src/modules/oms/services/index.ts +4 -0
- package/src/modules/oms/services/orderLoader.ts +73 -0
- package/src/modules/oms/services/statusManager.ts +159 -0
- package/src/modules/oms/services/updateOrderStatus.ts +101 -9
- package/src/modules/oms/services/updatePaymentStatus.ts +53 -1
- package/src/modules/oms/services/updateShipmentStatus.ts +53 -1
- package/src/modules/paypal/api/paypalAuthorizePayment/[bodyParser]authorize.ts +1 -1
- package/src/modules/paypal/api/paypalCaptureAuthorizedPayment/[bodyParser]capture.ts +10 -2
- package/src/modules/paypal/api/paypalCapturePayment/[bodyParser]capture.ts +5 -1
- package/src/modules/paypal/{bootstrap.js → bootstrap.ts} +23 -2
- package/src/modules/paypal/migration/Version-1.0.0.ts +24 -0
- package/src/modules/paypal/pages/admin/orderEdit/PaypalCaptureButton.tsx +1 -1
- package/src/modules/paypal/pages/frontStore/checkout/Paypal.tsx +9 -3
- package/src/modules/promotion/services/coupon/createCoupon.ts +147 -0
- package/src/modules/promotion/services/coupon/deleteCoupon.ts +100 -0
- package/src/modules/promotion/services/coupon/updateCoupon.ts +130 -0
- package/src/modules/promotion/services/index.ts +11 -0
- package/src/modules/setting/services/setting.ts +40 -2
- package/src/modules/stripe/api/capturePaymentIntent/{capturePaymentIntent.js → capturePaymentIntent.ts} +14 -5
- package/src/modules/stripe/api/createPaymentIntent/{createPaymentIntent.js → createPaymentIntent.ts} +11 -5
- package/src/modules/stripe/api/refundPaymentIntent/{refundPaymentIntent.js → refundPaymentIntent.ts} +11 -7
- package/src/modules/stripe/api/stripeWebHook/{[bodyJson]webhook.js → [bodyJson]webhook.ts} +30 -10
- package/src/modules/stripe/{bootstrap.js → bootstrap.ts} +40 -15
- package/src/modules/stripe/migration/Version-1.0.0.ts +24 -0
- package/src/modules/stripe/pages/admin/orderEdit/StripeCaptureButton.jsx +1 -1
- package/src/modules/stripe/pages/admin/orderEdit/StripeRefundButton.tsx +9 -3
- package/src/modules/stripe/pages/frontStore/checkout/Stripe.tsx +16 -7
- package/src/modules/stripe/pages/frontStore/stripeReturn/{index.js → index.ts} +15 -5
- package/src/modules/stripe/services/{cancelPayment.js → cancelPayment.ts} +4 -4
- package/src/types/apiResponse.ts +1 -1
- package/src/types/appContext.tsx +9 -4
- package/src/types/customerAddress.ts +1 -1
- package/src/types/db/index.ts +61 -61
- package/src/types/event.ts +29 -15
- package/src/types/registry.ts +160 -0
- package/src/types/widget.ts +3 -0
- package/src/lib/event/callSubscibers.js +0 -19
- package/src/lib/event/event-manager.js +0 -134
- package/src/modules/auth/bootstrap.js +0 -28
- package/src/modules/base/api/global/[payloadValidate]escapeHtml.js +0 -12
- package/src/modules/base/services/markSkipEscape.js +0 -30
- package/src/modules/catalog/api/createCategory/createCategory[finish].js +0 -8
- package/src/modules/catalog/api/createProduct/createProduct[finish].js +0 -8
- package/src/modules/catalog/api/updateCategory/updateCategory[finish].js +0 -8
- package/src/modules/catalog/api/updateCollection/updateCollection[finish].js +0 -8
- package/src/modules/catalog/api/updateProduct/updateProduct[finish].js +0 -8
- package/src/modules/cms/api/createCmsPage/createPage[finish].js +0 -10
- package/src/modules/cms/services/page/deletePage.js +0 -55
- package/src/modules/cms/services/widget/createWidget.js +0 -71
- package/src/modules/cms/services/widget/deleteWidget.js +0 -47
- package/src/modules/promotion/services/coupon/createCoupon.js +0 -75
- package/src/modules/promotion/services/coupon/deleteCoupon.js +0 -49
- package/src/modules/promotion/services/coupon/updateCoupon.js +0 -94
- package/src/types/request.d.ts +0 -7
- /package/src/modules/catalog/api/createCategory/{[context]bodyParser[auth].js → [context]bodyParser[auth].ts} +0 -0
- /package/src/modules/catalog/api/createCollection/{[context]bodyParser[auth].js → [context]bodyParser[auth].ts} +0 -0
- /package/src/modules/catalog/api/createProduct/{[context]bodyParser[auth].js → [context]bodyParser[auth].ts} +0 -0
- /package/src/modules/catalog/api/updateCategory/{[context]bodyParser[auth].js → [context]bodyParser[auth].ts} +0 -0
- /package/src/modules/catalog/api/updateCollection/{[context]bodyParser[auth].js → [context]bodyParser[auth].ts} +0 -0
- /package/src/modules/catalog/api/updateProduct/{[context]bodyParser[auth].js → [context]bodyParser[auth].ts} +0 -0
- /package/src/modules/cms/api/createCmsPage/{[context]bodyParser[auth].js → [context]bodyParser[auth].ts} +0 -0
- /package/src/modules/cms/api/updateCmsPage/{[context]bodyParser[auth].js → [context]bodyParser[auth].ts} +0 -0
- /package/src/modules/stripe/api/capturePaymentIntent/{[context]bodyParser[auth].js → [context]bodyParser[auth].ts} +0 -0
- /package/src/modules/stripe/api/createPaymentIntent/{[context]bodyParser[auth].js → [context]bodyParser[auth].ts} +0 -0
- /package/src/modules/stripe/api/refundPaymentIntent/{[context]bodyParser[auth].js → [context]bodyParser[auth].ts} +0 -0
- /package/src/modules/stripe/api/stripeWebHook/{bodyJson.js → bodyJson.ts} +0 -0
package/src/types/db/index.ts
CHANGED
|
@@ -130,19 +130,19 @@ export interface CartRow {
|
|
|
130
130
|
user_ip: string | null;
|
|
131
131
|
status: boolean;
|
|
132
132
|
coupon: string | null;
|
|
133
|
-
shipping_fee_excl_tax:
|
|
134
|
-
shipping_fee_incl_tax:
|
|
135
|
-
discount_amount:
|
|
136
|
-
sub_total:
|
|
137
|
-
sub_total_incl_tax:
|
|
138
|
-
sub_total_with_discount:
|
|
139
|
-
sub_total_with_discount_incl_tax:
|
|
133
|
+
shipping_fee_excl_tax: string | null;
|
|
134
|
+
shipping_fee_incl_tax: string | null;
|
|
135
|
+
discount_amount: string | null;
|
|
136
|
+
sub_total: string;
|
|
137
|
+
sub_total_incl_tax: string;
|
|
138
|
+
sub_total_with_discount: string;
|
|
139
|
+
sub_total_with_discount_incl_tax: string;
|
|
140
140
|
total_qty: number;
|
|
141
|
-
total_weight:
|
|
142
|
-
tax_amount:
|
|
143
|
-
tax_amount_before_discount:
|
|
144
|
-
shipping_tax_amount:
|
|
145
|
-
grand_total:
|
|
141
|
+
total_weight: string | null;
|
|
142
|
+
tax_amount: string;
|
|
143
|
+
tax_amount_before_discount: string;
|
|
144
|
+
shipping_tax_amount: string;
|
|
145
|
+
grand_total: string;
|
|
146
146
|
shipping_method: string | null;
|
|
147
147
|
shipping_method_name: string | null;
|
|
148
148
|
shipping_zone_id: number | null;
|
|
@@ -153,7 +153,7 @@ export interface CartRow {
|
|
|
153
153
|
shipping_note: string | null;
|
|
154
154
|
created_at: Date;
|
|
155
155
|
updated_at: Date;
|
|
156
|
-
total_tax_amount:
|
|
156
|
+
total_tax_amount: string | null;
|
|
157
157
|
no_shipping_required: boolean;
|
|
158
158
|
}
|
|
159
159
|
|
|
@@ -200,20 +200,20 @@ export interface CartItemRow {
|
|
|
200
200
|
product_sku: string;
|
|
201
201
|
product_name: string;
|
|
202
202
|
thumbnail: string | null;
|
|
203
|
-
product_weight:
|
|
204
|
-
product_price:
|
|
205
|
-
product_price_incl_tax:
|
|
203
|
+
product_weight: string | null;
|
|
204
|
+
product_price: string;
|
|
205
|
+
product_price_incl_tax: string;
|
|
206
206
|
qty: number;
|
|
207
|
-
final_price:
|
|
208
|
-
final_price_incl_tax:
|
|
209
|
-
tax_percent:
|
|
210
|
-
tax_amount:
|
|
211
|
-
tax_amount_before_discount:
|
|
212
|
-
discount_amount:
|
|
213
|
-
line_total:
|
|
214
|
-
line_total_with_discount:
|
|
215
|
-
line_total_incl_tax:
|
|
216
|
-
line_total_with_discount_incl_tax:
|
|
207
|
+
final_price: string;
|
|
208
|
+
final_price_incl_tax: string;
|
|
209
|
+
tax_percent: string;
|
|
210
|
+
tax_amount: string;
|
|
211
|
+
tax_amount_before_discount: string;
|
|
212
|
+
discount_amount: string;
|
|
213
|
+
line_total: string;
|
|
214
|
+
line_total_with_discount: string;
|
|
215
|
+
line_total_incl_tax: string;
|
|
216
|
+
line_total_with_discount_incl_tax: string;
|
|
217
217
|
variant_group_id: number | null;
|
|
218
218
|
variant_options: string | null;
|
|
219
219
|
product_custom_options: string | null;
|
|
@@ -345,7 +345,7 @@ export interface CouponRow {
|
|
|
345
345
|
uuid: string;
|
|
346
346
|
status: boolean;
|
|
347
347
|
description: string;
|
|
348
|
-
discount_amount:
|
|
348
|
+
discount_amount: string;
|
|
349
349
|
free_shipping: boolean;
|
|
350
350
|
discount_type: string;
|
|
351
351
|
coupon: string;
|
|
@@ -491,20 +491,20 @@ export interface OrderRow {
|
|
|
491
491
|
user_ip: string | null;
|
|
492
492
|
user_agent: string | null;
|
|
493
493
|
coupon: string | null;
|
|
494
|
-
shipping_fee_excl_tax:
|
|
495
|
-
shipping_fee_incl_tax:
|
|
496
|
-
discount_amount:
|
|
497
|
-
sub_total:
|
|
498
|
-
sub_total_incl_tax:
|
|
499
|
-
sub_total_with_discount:
|
|
500
|
-
sub_total_with_discount_incl_tax:
|
|
494
|
+
shipping_fee_excl_tax: string | null;
|
|
495
|
+
shipping_fee_incl_tax: string | null;
|
|
496
|
+
discount_amount: string | null;
|
|
497
|
+
sub_total: string;
|
|
498
|
+
sub_total_incl_tax: string;
|
|
499
|
+
sub_total_with_discount: string;
|
|
500
|
+
sub_total_with_discount_incl_tax: string;
|
|
501
501
|
total_qty: number;
|
|
502
|
-
total_weight:
|
|
503
|
-
tax_amount:
|
|
504
|
-
tax_amount_before_discount:
|
|
505
|
-
shipping_tax_amount:
|
|
502
|
+
total_weight: string | null;
|
|
503
|
+
tax_amount: string;
|
|
504
|
+
tax_amount_before_discount: string;
|
|
505
|
+
shipping_tax_amount: string;
|
|
506
506
|
shipping_note: string | null;
|
|
507
|
-
grand_total:
|
|
507
|
+
grand_total: string;
|
|
508
508
|
shipping_method: string | null;
|
|
509
509
|
shipping_method_name: string | null;
|
|
510
510
|
shipping_address_id: number | null;
|
|
@@ -515,7 +515,7 @@ export interface OrderRow {
|
|
|
515
515
|
payment_status: string;
|
|
516
516
|
created_at: Date;
|
|
517
517
|
updated_at: Date;
|
|
518
|
-
total_tax_amount:
|
|
518
|
+
total_tax_amount: string | null;
|
|
519
519
|
status: string | null;
|
|
520
520
|
no_shipping_required: boolean;
|
|
521
521
|
}
|
|
@@ -586,20 +586,20 @@ export interface OrderItemRow {
|
|
|
586
586
|
product_sku: string;
|
|
587
587
|
product_name: string;
|
|
588
588
|
thumbnail: string | null;
|
|
589
|
-
product_weight:
|
|
590
|
-
product_price:
|
|
591
|
-
product_price_incl_tax:
|
|
589
|
+
product_weight: string | null;
|
|
590
|
+
product_price: string;
|
|
591
|
+
product_price_incl_tax: string;
|
|
592
592
|
qty: number;
|
|
593
|
-
final_price:
|
|
594
|
-
final_price_incl_tax:
|
|
595
|
-
tax_percent:
|
|
596
|
-
tax_amount:
|
|
597
|
-
tax_amount_before_discount:
|
|
598
|
-
discount_amount:
|
|
599
|
-
line_total:
|
|
600
|
-
line_total_with_discount:
|
|
601
|
-
line_total_incl_tax:
|
|
602
|
-
line_total_with_discount_incl_tax:
|
|
593
|
+
final_price: string;
|
|
594
|
+
final_price_incl_tax: string;
|
|
595
|
+
tax_percent: string;
|
|
596
|
+
tax_amount: string;
|
|
597
|
+
tax_amount_before_discount: string;
|
|
598
|
+
discount_amount: string;
|
|
599
|
+
line_total: string;
|
|
600
|
+
line_total_with_discount: string;
|
|
601
|
+
line_total_incl_tax: string;
|
|
602
|
+
line_total_with_discount_incl_tax: string;
|
|
603
603
|
variant_group_id: number | null;
|
|
604
604
|
variant_options: string | null;
|
|
605
605
|
product_custom_options: string | null;
|
|
@@ -620,7 +620,7 @@ export interface PaymentTransactionRow {
|
|
|
620
620
|
payment_transaction_order_id: number;
|
|
621
621
|
transaction_id: string | null;
|
|
622
622
|
transaction_type: string;
|
|
623
|
-
amount:
|
|
623
|
+
amount: string;
|
|
624
624
|
parent_transaction_id: string | null;
|
|
625
625
|
payment_action: string | null;
|
|
626
626
|
additional_information: string | null;
|
|
@@ -647,8 +647,8 @@ export interface ProductRow {
|
|
|
647
647
|
visibility: boolean;
|
|
648
648
|
group_id: number | null;
|
|
649
649
|
sku: string;
|
|
650
|
-
price:
|
|
651
|
-
weight:
|
|
650
|
+
price: string;
|
|
651
|
+
weight: string | null;
|
|
652
652
|
tax_class: number | null;
|
|
653
653
|
status: boolean;
|
|
654
654
|
created_at: Date;
|
|
@@ -749,7 +749,7 @@ export interface ProductCustomOptionValueRow {
|
|
|
749
749
|
product_custom_option_value_id: number;
|
|
750
750
|
uuid: string;
|
|
751
751
|
option_id: number;
|
|
752
|
-
extra_price:
|
|
752
|
+
extra_price: string | null;
|
|
753
753
|
sort_order: number | null;
|
|
754
754
|
value: string;
|
|
755
755
|
}
|
|
@@ -938,11 +938,11 @@ export interface ShippingZoneMethodRow {
|
|
|
938
938
|
method_id: number;
|
|
939
939
|
zone_id: number;
|
|
940
940
|
is_enabled: boolean;
|
|
941
|
-
cost:
|
|
941
|
+
cost: string | null;
|
|
942
942
|
calculate_api: string | null;
|
|
943
943
|
condition_type: string | null;
|
|
944
|
-
max:
|
|
945
|
-
min:
|
|
944
|
+
max: string | null;
|
|
945
|
+
min: string | null;
|
|
946
946
|
price_based_cost: Record<string, unknown> | null;
|
|
947
947
|
weight_based_cost: Record<string, unknown> | null;
|
|
948
948
|
}
|
|
@@ -999,7 +999,7 @@ export interface TaxRateRow {
|
|
|
999
999
|
country: string;
|
|
1000
1000
|
province: string;
|
|
1001
1001
|
postcode: string;
|
|
1002
|
-
rate:
|
|
1002
|
+
rate: string;
|
|
1003
1003
|
is_compound: boolean;
|
|
1004
1004
|
priority: number;
|
|
1005
1005
|
}
|
package/src/types/event.ts
CHANGED
|
@@ -82,40 +82,54 @@ export interface EventDataRegistry {
|
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
|
-
* Fired when a new customer is registered
|
|
85
|
+
* Fired when a new customer is registered and status = 1 (account is active)
|
|
86
86
|
* Data: Complete customer table row
|
|
87
87
|
*/
|
|
88
88
|
customer_registered: CustomerRow;
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
|
-
* Fired when a new
|
|
92
|
-
* Data: Complete
|
|
91
|
+
* Fired when a new customer record is added to database, regardless of the status value
|
|
92
|
+
* Data: Complete customer table row
|
|
93
93
|
*/
|
|
94
|
-
|
|
94
|
+
customer_created: CustomerRow;
|
|
95
95
|
|
|
96
96
|
/**
|
|
97
|
-
* Fired when a
|
|
98
|
-
* Data: Complete
|
|
97
|
+
* Fired when a customer record in database is updated
|
|
98
|
+
* Data: Complete customer table row
|
|
99
99
|
*/
|
|
100
|
-
|
|
100
|
+
customer_updated: CustomerRow;
|
|
101
101
|
|
|
102
102
|
/**
|
|
103
|
-
* Fired when a
|
|
103
|
+
* Fired when a customer record is deleted
|
|
104
104
|
* Data: Complete customer table row
|
|
105
105
|
*/
|
|
106
|
-
|
|
106
|
+
customer_deleted: CustomerRow;
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
|
-
* Fired when a
|
|
110
|
-
* Data: Complete
|
|
109
|
+
* Fired when a new order record is created in database, regardless of the payment method or order status
|
|
110
|
+
* Data: Complete order table row
|
|
111
111
|
*/
|
|
112
|
-
|
|
112
|
+
order_created: OrderRow;
|
|
113
113
|
|
|
114
114
|
/**
|
|
115
|
-
* Fired when a
|
|
116
|
-
*
|
|
115
|
+
* Fired when a new order is placed
|
|
116
|
+
* (This means the order is created and the payment is successful (decided by the payment method, for example, for cod, the order is created when the order is placed, but for online payment, the order is created when the payment is successful))
|
|
117
117
|
*/
|
|
118
|
-
|
|
118
|
+
order_placed: OrderRow;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Fired when an order status is updated.
|
|
122
|
+
* Data: {
|
|
123
|
+
* orderId: number;
|
|
124
|
+
* before: string; // the previous order status
|
|
125
|
+
* after: string; // the new order status
|
|
126
|
+
* }
|
|
127
|
+
*/
|
|
128
|
+
order_status_updated: {
|
|
129
|
+
orderId: number;
|
|
130
|
+
before: string;
|
|
131
|
+
after: string;
|
|
132
|
+
};
|
|
119
133
|
}
|
|
120
134
|
|
|
121
135
|
/**
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import type { PurchaseUnit } from '@paypal/paypal-js';
|
|
2
|
+
import type { AnySchemaObject } from 'ajv';
|
|
3
|
+
import type { EmailData, SendEmailArguments } from '../lib/mail/emailHelper.js';
|
|
4
|
+
import type { AttributeData as CreateAttributeData } from '../modules/catalog/services/attribute/createProductAttribute.js';
|
|
5
|
+
import type { AttributeData as UpdateAttributeData } from '../modules/catalog/services/attribute/updateProductAttribute.js';
|
|
6
|
+
import type { CategoryData } from '../modules/catalog/services/category/createCategory.js';
|
|
7
|
+
import type { CollectionData } from '../modules/catalog/services/collection/createCollection.js';
|
|
8
|
+
import type { ProductData } from '../modules/catalog/services/product/createProduct.js';
|
|
9
|
+
import type { WidgetData } from '../modules/cms/services/widget/createWidget.js';
|
|
10
|
+
import type { CustomerData } from '../modules/customer/services/customer/createCustomer.js';
|
|
11
|
+
import type { CouponData } from '../modules/promotion/services/coupon/createCoupon.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Registry that maps value names to their data types.
|
|
15
|
+
* Extend this interface in your module to register custom values.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* // In your module's bootstrap or type declaration file
|
|
20
|
+
* declare module '@evershop/evershop/types/registry' {
|
|
21
|
+
* interface ValueRegistry {
|
|
22
|
+
* 'myCustomValue': MyDataType;
|
|
23
|
+
* }
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export interface ValueRegistry {
|
|
28
|
+
// ── Catalog: Product ──────────────────────────────────────────────────────
|
|
29
|
+
|
|
30
|
+
/** Product input data before the create transaction runs */
|
|
31
|
+
productDataBeforeCreate: ProductData;
|
|
32
|
+
/** Product input data before the update transaction runs */
|
|
33
|
+
productDataBeforeUpdate: ProductData;
|
|
34
|
+
/** AJV JSON schema used to validate product data on create */
|
|
35
|
+
createProductDataJsonSchema: AnySchemaObject;
|
|
36
|
+
/** AJV JSON schema used to validate product data on update */
|
|
37
|
+
updateProductDataJsonSchema: AnySchemaObject;
|
|
38
|
+
|
|
39
|
+
// ── Catalog: Category ─────────────────────────────────────────────────────
|
|
40
|
+
|
|
41
|
+
/** Category input data before the create transaction runs */
|
|
42
|
+
categoryDataBeforeCreate: CategoryData;
|
|
43
|
+
/** Category input data before the update transaction runs */
|
|
44
|
+
categoryDataBeforeUpdate: CategoryData;
|
|
45
|
+
/** AJV JSON schema used to validate category data on create */
|
|
46
|
+
createCategoryDataJsonSchema: AnySchemaObject;
|
|
47
|
+
/** AJV JSON schema used to validate category data on update */
|
|
48
|
+
updateCategoryDataJsonSchema: AnySchemaObject;
|
|
49
|
+
|
|
50
|
+
// ── Catalog: Attribute ────────────────────────────────────────────────────
|
|
51
|
+
|
|
52
|
+
/** Product attribute input data before the create transaction runs */
|
|
53
|
+
attributeDataBeforeCreate: CreateAttributeData;
|
|
54
|
+
/** Product attribute input data before the update transaction runs */
|
|
55
|
+
attributeDataBeforeUpdate: UpdateAttributeData;
|
|
56
|
+
/** AJV JSON schema used to validate attribute data on create */
|
|
57
|
+
createAttributeDataJsonSchema: AnySchemaObject;
|
|
58
|
+
/** AJV JSON schema used to validate attribute data on update */
|
|
59
|
+
updateAttributeDataJsonSchema: AnySchemaObject;
|
|
60
|
+
|
|
61
|
+
// ── Catalog: Collection ───────────────────────────────────────────────────
|
|
62
|
+
|
|
63
|
+
/** Collection input data before the update transaction runs */
|
|
64
|
+
collectionDataBeforeUpdate: CollectionData;
|
|
65
|
+
|
|
66
|
+
// ── Promotion: Coupon ─────────────────────────────────────────────────────
|
|
67
|
+
|
|
68
|
+
/** Coupon input data before the create transaction runs */
|
|
69
|
+
couponDataBeforeCreate: CouponData;
|
|
70
|
+
/** Coupon input data before the update transaction runs */
|
|
71
|
+
couponDataBeforeUpdate: Partial<CouponData>;
|
|
72
|
+
/** AJV JSON schema used to validate coupon data on create */
|
|
73
|
+
createCouponDataJsonSchema: AnySchemaObject;
|
|
74
|
+
/** AJV JSON schema used to validate coupon data on update */
|
|
75
|
+
updateCouponDataJsonSchema: AnySchemaObject;
|
|
76
|
+
|
|
77
|
+
// ── Customer ──────────────────────────────────────────────────────────────
|
|
78
|
+
|
|
79
|
+
/** Customer input data before the update transaction runs */
|
|
80
|
+
customerDataBeforeUpdate: CustomerData;
|
|
81
|
+
/** AJV JSON schema used to validate customer data on create */
|
|
82
|
+
createCustomerDataJsonSchema: AnySchemaObject;
|
|
83
|
+
/** AJV JSON schema used to validate customer data on update */
|
|
84
|
+
updateCustomerDataJsonSchema: AnySchemaObject;
|
|
85
|
+
|
|
86
|
+
// ── CMS: Page ─────────────────────────────────────────────────────────────
|
|
87
|
+
|
|
88
|
+
/** CMS page input data before the create transaction runs */
|
|
89
|
+
pageDataBeforeCreate: Record<string, unknown>;
|
|
90
|
+
/** CMS page input data before the update transaction runs */
|
|
91
|
+
pageDataBeforeUpdate: Record<string, unknown>;
|
|
92
|
+
/** AJV JSON schema used to validate page data on create */
|
|
93
|
+
createPageDataJsonSchema: AnySchemaObject;
|
|
94
|
+
/** AJV JSON schema used to validate page data on update */
|
|
95
|
+
updatePageDataJsonSchema: AnySchemaObject;
|
|
96
|
+
|
|
97
|
+
// ── CMS: Widget ───────────────────────────────────────────────────────────
|
|
98
|
+
|
|
99
|
+
/** Widget input data before the create transaction runs */
|
|
100
|
+
widgetDataBeforeCreate: WidgetData;
|
|
101
|
+
/** Widget input data before the update transaction runs */
|
|
102
|
+
widgetDataBeforeUpdate: WidgetData;
|
|
103
|
+
/** AJV JSON schema used to validate widget data on create */
|
|
104
|
+
createWidgetDataJsonSchema: AnySchemaObject;
|
|
105
|
+
/** AJV JSON schema used to validate widget data on update */
|
|
106
|
+
updateWidgetDataJsonSchema: AnySchemaObject;
|
|
107
|
+
|
|
108
|
+
// ── OMS ───────────────────────────────────────────────────────────────────
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Payment+shipment status → order status mapping.
|
|
112
|
+
* Keys are `"paymentStatus:shipmentStatus"` strings; values are order status strings.
|
|
113
|
+
*/
|
|
114
|
+
psoMapping: Record<string, string>;
|
|
115
|
+
|
|
116
|
+
// ── Email ─────────────────────────────────────────────────────────────────
|
|
117
|
+
|
|
118
|
+
/** Arguments passed to the email service before every `sendEmail` call */
|
|
119
|
+
emailArguments: SendEmailArguments;
|
|
120
|
+
/** Template data passed to every email template renderer */
|
|
121
|
+
emailTemplateData: EmailData;
|
|
122
|
+
|
|
123
|
+
/** Dynamic data injected into the order confirmation email */
|
|
124
|
+
orderConfirmationEmailData: EmailData;
|
|
125
|
+
/** Send-email arguments for the order confirmation email */
|
|
126
|
+
orderConfirmationEmailArguments: SendEmailArguments;
|
|
127
|
+
|
|
128
|
+
/** Dynamic data injected into the reset-password email */
|
|
129
|
+
resetPasswordEmailData: EmailData;
|
|
130
|
+
/** Send-email arguments for the reset-password email */
|
|
131
|
+
resetPasswordEmailArguments: SendEmailArguments;
|
|
132
|
+
|
|
133
|
+
/** Dynamic data injected into the customer welcome email */
|
|
134
|
+
customerWelcomeEmailData: EmailData;
|
|
135
|
+
/** Send-email arguments for the customer welcome email */
|
|
136
|
+
customerWelcomeEmailArguments: SendEmailArguments;
|
|
137
|
+
|
|
138
|
+
// ── Checkout ──────────────────────────────────────────────────────────────
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Cart `Item` instance before it is added to the cart.
|
|
142
|
+
* `Item` is implemented in JavaScript; cast to access specific members.
|
|
143
|
+
*/
|
|
144
|
+
cartItemBeforeAdd: unknown;
|
|
145
|
+
|
|
146
|
+
// ── PayPal ────────────────────────────────────────────────────────────────
|
|
147
|
+
|
|
148
|
+
/** PayPal purchase-unit amount object before it is sent to the PayPal Orders API */
|
|
149
|
+
paypalFinalAmount: PurchaseUnit['amount'];
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Extract value names from the registry.
|
|
154
|
+
*/
|
|
155
|
+
export type ValueName = keyof ValueRegistry;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Get the data type for a specific registry value.
|
|
159
|
+
*/
|
|
160
|
+
export type ValueData<K extends ValueName> = ValueRegistry[K];
|
package/src/types/widget.ts
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { error } from '../../lib/log/logger.js';
|
|
2
|
-
|
|
3
|
-
export async function callSubscribers(subscribers, eventData) {
|
|
4
|
-
const promises = subscribers.map(
|
|
5
|
-
(subscriber) =>
|
|
6
|
-
new Promise((resolve) => {
|
|
7
|
-
setTimeout(async () => {
|
|
8
|
-
try {
|
|
9
|
-
await subscriber(eventData);
|
|
10
|
-
} catch (e) {
|
|
11
|
-
error(e);
|
|
12
|
-
}
|
|
13
|
-
resolve();
|
|
14
|
-
}, 0);
|
|
15
|
-
})
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
await Promise.all(promises);
|
|
19
|
-
}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { del, select } from '@evershop/postgres-query-builder';
|
|
2
|
-
import { getEnabledExtensions } from '../../bin/extension/index.js';
|
|
3
|
-
import { loadBootstrapScript } from '../../bin/lib/bootstrap/bootstrap.js';
|
|
4
|
-
import { getCoreModules } from '../../bin/lib/loadModules.js';
|
|
5
|
-
import { pool } from '../../lib/postgres/connection.js';
|
|
6
|
-
import { debug, error } from '../log/logger.js';
|
|
7
|
-
import { lockHooks } from '../util/hookable.js';
|
|
8
|
-
import { lockRegistry } from '../util/registry.js';
|
|
9
|
-
import { callSubscribers } from './callSubscibers.js';
|
|
10
|
-
import { loadSubscribers } from './loadSubscribers.js';
|
|
11
|
-
|
|
12
|
-
const loadEventInterval = 10000;
|
|
13
|
-
const syncEventInterval = 2000;
|
|
14
|
-
const maxEvents = 10;
|
|
15
|
-
let events = [];
|
|
16
|
-
// Get the modules from the arguments
|
|
17
|
-
const modules = [...getCoreModules(), ...getEnabledExtensions()];
|
|
18
|
-
const subscribers = await loadSubscribers(modules);
|
|
19
|
-
|
|
20
|
-
const init = async () => {
|
|
21
|
-
/** Loading bootstrap script from modules */
|
|
22
|
-
try {
|
|
23
|
-
for (const module of modules) {
|
|
24
|
-
await loadBootstrapScript(module, {
|
|
25
|
-
...JSON.parse(process.env.bootstrapContext || '{}'),
|
|
26
|
-
process: 'event'
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
lockHooks();
|
|
30
|
-
lockRegistry();
|
|
31
|
-
} catch (e) {
|
|
32
|
-
error(e);
|
|
33
|
-
process.exit(0);
|
|
34
|
-
}
|
|
35
|
-
process.env.ALLOW_CONFIG_MUTATIONS = false;
|
|
36
|
-
setInterval(async () => {
|
|
37
|
-
// Load events
|
|
38
|
-
const newEvents = await loadEvents(maxEvents);
|
|
39
|
-
// Append the new events to the existing events
|
|
40
|
-
events = [...events, ...newEvents];
|
|
41
|
-
|
|
42
|
-
// Keep only the last 20 events
|
|
43
|
-
events = events.slice(-maxEvents);
|
|
44
|
-
|
|
45
|
-
// Call subscribers for each event
|
|
46
|
-
events.forEach((event) => {
|
|
47
|
-
if (event.status !== 'done' && event.status !== 'processing') {
|
|
48
|
-
executeSubscribers(event);
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
}, loadEventInterval);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
setInterval(async () => {
|
|
55
|
-
// Sync events
|
|
56
|
-
await syncEvents();
|
|
57
|
-
}, syncEventInterval);
|
|
58
|
-
|
|
59
|
-
async function loadEvents(count) {
|
|
60
|
-
// Only load events if the current events are less than the max events
|
|
61
|
-
if (events.length >= maxEvents) {
|
|
62
|
-
return [];
|
|
63
|
-
}
|
|
64
|
-
// Only load events that have subscribers
|
|
65
|
-
const eventNames = subscribers.map((subscriber) => subscriber.event);
|
|
66
|
-
|
|
67
|
-
const query = select().from('event');
|
|
68
|
-
if (eventNames.length > 0) {
|
|
69
|
-
query.where('name', 'IN', eventNames);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (events.length > 0) {
|
|
73
|
-
query.andWhere(
|
|
74
|
-
'uuid',
|
|
75
|
-
'NOT IN',
|
|
76
|
-
events.map((event) => event.uuid)
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
query.orderBy('event_id', 'ASC');
|
|
81
|
-
query.limit(0, count);
|
|
82
|
-
|
|
83
|
-
const results = await query.execute(pool);
|
|
84
|
-
return results;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
async function syncEvents() {
|
|
88
|
-
// Delete the events that have been executed
|
|
89
|
-
const completedEvents = events
|
|
90
|
-
.filter((event) => event.status === 'done')
|
|
91
|
-
.map((event) => event.uuid);
|
|
92
|
-
if (completedEvents.length > 0) {
|
|
93
|
-
await del('event').where('uuid', 'IN', completedEvents).execute(pool);
|
|
94
|
-
// Remove the events from the events array
|
|
95
|
-
events = events.filter((event) => event.status !== 'done');
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
async function executeSubscribers(event) {
|
|
100
|
-
event.status = 'processing';
|
|
101
|
-
const eventData = event.data;
|
|
102
|
-
// get subscribers for the event
|
|
103
|
-
const matchingSubscribers = subscribers
|
|
104
|
-
.filter((subscriber) => subscriber.event === event.name)
|
|
105
|
-
.map((subscriber) => subscriber.subscriber);
|
|
106
|
-
// Call subscribers
|
|
107
|
-
await callSubscribers(matchingSubscribers, eventData);
|
|
108
|
-
|
|
109
|
-
event.status = 'done';
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
process.on('SIGTERM', async () => {
|
|
113
|
-
debug('Event manager received SIGTERM, shutting down...');
|
|
114
|
-
try {
|
|
115
|
-
process.exit(0);
|
|
116
|
-
} catch (err) {
|
|
117
|
-
error('Error during shutdown:');
|
|
118
|
-
error(err);
|
|
119
|
-
process.exit(1); // Exit with an error code
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
process.on('SIGINT', async () => {
|
|
124
|
-
debug('Event manager received SIGINT, shutting down...');
|
|
125
|
-
try {
|
|
126
|
-
process.exit(0);
|
|
127
|
-
} catch (err) {
|
|
128
|
-
error('Error during shutdown:');
|
|
129
|
-
error(err);
|
|
130
|
-
process.exit(1); // Exit with an error code
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
init();
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { request } from 'express';
|
|
2
|
-
import { hookable } from '../../lib/util/hookable.js';
|
|
3
|
-
import { loginUserWithEmail } from './services/loginUserWithEmail.js';
|
|
4
|
-
import { logoutUser } from './services/logoutUser.js';
|
|
5
|
-
|
|
6
|
-
export default () => {
|
|
7
|
-
request.loginUserWithEmail = async function login(email, password, callback) {
|
|
8
|
-
await hookable(loginUserWithEmail.bind(this))(email, password);
|
|
9
|
-
if (this.session) {
|
|
10
|
-
this.session.save(callback);
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
request.logoutUser = function logout(callback) {
|
|
15
|
-
hookable(logoutUser.bind(this))();
|
|
16
|
-
if (this.session) {
|
|
17
|
-
this.session.save(callback);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
request.isUserLoggedIn = function isUserLoggedIn() {
|
|
22
|
-
return !!this.session.userID;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
request.getCurrentUser = function getCurrentUser() {
|
|
26
|
-
return this.locals.user;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import escapePayload from '../../services/escapePayload.js';
|
|
2
|
-
|
|
3
|
-
export default (request, response, next) => {
|
|
4
|
-
// return next();
|
|
5
|
-
if (request.method === 'GET') {
|
|
6
|
-
next();
|
|
7
|
-
} else {
|
|
8
|
-
// Escape the characters <, > from the payload
|
|
9
|
-
escapePayload(request.body);
|
|
10
|
-
next();
|
|
11
|
-
}
|
|
12
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import secret from './secret.js';
|
|
2
|
-
|
|
3
|
-
export default function markSkipEscape(obj, path) {
|
|
4
|
-
const keys = path.split('/');
|
|
5
|
-
let result = obj;
|
|
6
|
-
const lastKeyIndex = keys.length - 1;
|
|
7
|
-
for (let i = 0; i < lastKeyIndex; i += 1) {
|
|
8
|
-
const key = keys[i];
|
|
9
|
-
if (key === '') {
|
|
10
|
-
continue;
|
|
11
|
-
}
|
|
12
|
-
const match = key.match(/(.+)\[(\d+)\]/);
|
|
13
|
-
if (match) {
|
|
14
|
-
const prop = match[1];
|
|
15
|
-
const index = parseInt(match[2], 10);
|
|
16
|
-
result = result[prop][index];
|
|
17
|
-
} else {
|
|
18
|
-
result = result[key];
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
const lastKey = keys[lastKeyIndex];
|
|
22
|
-
const lastMatch = lastKey.match(/(.+)\[(\d+)\]/);
|
|
23
|
-
if (lastMatch) {
|
|
24
|
-
const prop = lastMatch[1];
|
|
25
|
-
const index = parseInt(lastMatch[2], 10);
|
|
26
|
-
result[prop][index] += secret;
|
|
27
|
-
} else {
|
|
28
|
-
result[lastKey] += secret;
|
|
29
|
-
}
|
|
30
|
-
}
|