@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
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { getDelegate } from '../../../../lib/middleware/delegate.js';
|
|
2
2
|
import { buildUrl } from '../../../../lib/router/buildUrl.js';
|
|
3
3
|
import { OK } from '../../../../lib/util/httpStatus.js';
|
|
4
|
+
import { EvershopRequest } from '../../../../types/request.js';
|
|
5
|
+
import { EvershopResponse } from '../../../../types/response.js';
|
|
4
6
|
|
|
5
|
-
export default async (
|
|
6
|
-
|
|
7
|
+
export default async (
|
|
8
|
+
request: EvershopRequest,
|
|
9
|
+
response: EvershopResponse,
|
|
10
|
+
next
|
|
11
|
+
) => {
|
|
12
|
+
const page = await getDelegate<Record<string, any>>('updatePage', request);
|
|
7
13
|
response.status(OK);
|
|
8
14
|
response.json({
|
|
9
15
|
data: {
|
|
@@ -17,13 +23,13 @@ export default async (request, response, next) => {
|
|
|
17
23
|
},
|
|
18
24
|
{
|
|
19
25
|
rel: 'edit',
|
|
20
|
-
href: buildUrl('cmsPageEdit', { id: page
|
|
26
|
+
href: buildUrl('cmsPageEdit', { id: page?.uuid }),
|
|
21
27
|
action: 'GET',
|
|
22
28
|
types: ['text/xml']
|
|
23
29
|
},
|
|
24
30
|
{
|
|
25
31
|
rel: 'view',
|
|
26
|
-
href: buildUrl('cmsPageView', { url_key: page
|
|
32
|
+
href: buildUrl('cmsPageView', { url_key: page?.url_key }),
|
|
27
33
|
action: 'GET',
|
|
28
34
|
types: ['text/xml']
|
|
29
35
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"properties": {
|
|
4
|
+
"content": {
|
|
5
|
+
"type": "array",
|
|
6
|
+
"skipEscape": true,
|
|
7
|
+
"items": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"properties": {
|
|
10
|
+
"id": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"errorMessage": {
|
|
13
|
+
"type": "Content block ID must be a string"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"size": {
|
|
17
|
+
"type": "number",
|
|
18
|
+
"errorMessage": {
|
|
19
|
+
"type": "Content block size must be a number"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"columns": {
|
|
23
|
+
"type": "array",
|
|
24
|
+
"items": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"properties": {
|
|
27
|
+
"id": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"errorMessage": {
|
|
30
|
+
"type": "Column ID must be a string"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"size": {
|
|
34
|
+
"type": "number",
|
|
35
|
+
"errorMessage": {
|
|
36
|
+
"type": "Column size must be a number"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"data": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"errorMessage": {
|
|
42
|
+
"type": "Column data must be an object"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"required": ["id", "size", "data"],
|
|
47
|
+
"errorMessage": {
|
|
48
|
+
"required": {
|
|
49
|
+
"id": "Column ID is required",
|
|
50
|
+
"size": "Column size is required",
|
|
51
|
+
"data": "Column data is required"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"errorMessage": {
|
|
56
|
+
"type": "Columns must be an array"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"required": ["id", "size", "columns"],
|
|
61
|
+
"errorMessage": {
|
|
62
|
+
"required": {
|
|
63
|
+
"id": "Content block ID is required",
|
|
64
|
+
"size": "Content block size is required",
|
|
65
|
+
"columns": "Content block columns are required"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"default": [],
|
|
70
|
+
"errorMessage": {
|
|
71
|
+
"type": "Content must be an array"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"additionalProperties": true
|
|
76
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { EvershopRequest } from '../../../../types/request.js';
|
|
1
2
|
import updatePage from '../../services/page/updatePage.js';
|
|
2
3
|
|
|
3
|
-
export default async (request, response) => {
|
|
4
|
+
export default async (request: EvershopRequest, response) => {
|
|
4
5
|
const data = request.body;
|
|
5
6
|
const page = await updatePage(request.params.id, data, {
|
|
6
7
|
routeId: request.currentRoute.id
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
|
+
import { JSONSchemaType } from 'ajv';
|
|
2
3
|
import config from 'config';
|
|
3
4
|
import { CONSTANTS } from '../../lib/helpers.js';
|
|
4
5
|
import { defaultPaginationFilters } from '../../lib/util/defaultPaginationFilters.js';
|
|
@@ -7,6 +8,7 @@ import { addProcessor } from '../../lib/util/registry.js';
|
|
|
7
8
|
import { registerWidget } from '../../lib/widget/widgetManager.js';
|
|
8
9
|
import { registerDefaultPageCollectionFilters } from '../../modules/cms/services/registerDefaultPageCollectionFilters.js';
|
|
9
10
|
import { registerDefaultWidgetCollectionFilters } from '../../modules/cms/services/registerDefaultWidgetCollectionFilters.js';
|
|
11
|
+
import { Route } from '../../types/route.js';
|
|
10
12
|
|
|
11
13
|
export default () => {
|
|
12
14
|
addProcessor('configurationSchema', (schema) => {
|
|
@@ -184,6 +186,7 @@ export default () => {
|
|
|
184
186
|
),
|
|
185
187
|
name: 'Menu',
|
|
186
188
|
description: 'Navigation links',
|
|
189
|
+
defaultSettings: {},
|
|
187
190
|
enabled: true
|
|
188
191
|
});
|
|
189
192
|
|
|
@@ -194,6 +197,7 @@ export default () => {
|
|
|
194
197
|
'cms/components/BannerSetting.js'
|
|
195
198
|
),
|
|
196
199
|
component: path.resolve(CONSTANTS.MODULESPATH, 'cms/components/Banner.js'),
|
|
200
|
+
defaultSettings: {},
|
|
197
201
|
name: 'Banner',
|
|
198
202
|
description: 'Image with call-to-action',
|
|
199
203
|
enabled: true
|
|
@@ -209,6 +213,7 @@ export default () => {
|
|
|
209
213
|
CONSTANTS.MODULESPATH,
|
|
210
214
|
'cms/components/Slideshow.js'
|
|
211
215
|
),
|
|
216
|
+
defaultSettings: {},
|
|
212
217
|
name: 'Simple Slideshow',
|
|
213
218
|
description: 'Rotating image carousel',
|
|
214
219
|
enabled: true
|
|
@@ -220,21 +225,37 @@ export default () => {
|
|
|
220
225
|
registerDefaultPageCollectionFilters,
|
|
221
226
|
1
|
|
222
227
|
);
|
|
223
|
-
addProcessor(
|
|
228
|
+
addProcessor<Array<any>>(
|
|
224
229
|
'cmsPageCollectionFilters',
|
|
225
230
|
(filters) => [...filters, ...defaultPaginationFilters],
|
|
226
231
|
2
|
|
227
232
|
);
|
|
228
233
|
|
|
229
234
|
// Reigtering the default filters for widget collection
|
|
230
|
-
addProcessor(
|
|
235
|
+
addProcessor<Array<any>>(
|
|
231
236
|
'widgetCollectionFilters',
|
|
232
237
|
registerDefaultWidgetCollectionFilters,
|
|
233
238
|
1
|
|
234
239
|
);
|
|
235
|
-
addProcessor(
|
|
240
|
+
addProcessor<Array<any>>(
|
|
236
241
|
'widgetCollectionFilters',
|
|
237
242
|
(filters) => [...filters, ...defaultPaginationFilters],
|
|
238
243
|
2
|
|
239
244
|
);
|
|
245
|
+
|
|
246
|
+
addProcessor('payloadSchema', function (schema: JSONSchemaType<any>) {
|
|
247
|
+
const ctx = this as { route: Route };
|
|
248
|
+
const route = ctx.route;
|
|
249
|
+
if (route.id === 'createWidget' || route.id === 'updateWidget') {
|
|
250
|
+
schema.properties.settings = {
|
|
251
|
+
properties: {
|
|
252
|
+
text: {
|
|
253
|
+
type: 'string',
|
|
254
|
+
skipEscape: true
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
return schema;
|
|
260
|
+
});
|
|
240
261
|
};
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
NavigationMenuLink,
|
|
7
7
|
NavigationMenuList,
|
|
8
8
|
NavigationMenuTrigger
|
|
9
|
-
} from '@
|
|
9
|
+
} from '@components/common/ui/NavigationMenu.js';
|
|
10
10
|
import { cn } from '@evershop/evershop/lib/util/cn';
|
|
11
11
|
import React from 'react';
|
|
12
12
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import sanitize from 'sanitize-html';
|
|
2
1
|
import { v4 as uuidv4 } from 'uuid';
|
|
3
2
|
import { buildUrl } from '../../../../../lib/router/buildUrl.js';
|
|
4
3
|
import { camelCase } from '../../../../../lib/util/camelCase.js';
|
|
@@ -41,26 +40,6 @@ export default {
|
|
|
41
40
|
content: ({ content }) => {
|
|
42
41
|
try {
|
|
43
42
|
const json = JSON.parse(content);
|
|
44
|
-
// Loop through each row and find the columns with raw block type. Use dompurify to sanitize the HTML content.
|
|
45
|
-
json.forEach((row: any) => {
|
|
46
|
-
row.columns.forEach((column: any) => {
|
|
47
|
-
column.data.blocks.forEach((block: any) => {
|
|
48
|
-
if (block.type === 'raw' && block.data.html) {
|
|
49
|
-
const replacements = {
|
|
50
|
-
'<': '<',
|
|
51
|
-
'>': '>'
|
|
52
|
-
};
|
|
53
|
-
const jsonText = block.data.html
|
|
54
|
-
? block.data.html.replace(
|
|
55
|
-
/<|>/g,
|
|
56
|
-
(match) => replacements[match]
|
|
57
|
-
)
|
|
58
|
-
: '';
|
|
59
|
-
block.data.html = sanitize(jsonText);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
43
|
return json;
|
|
65
44
|
} catch (e) {
|
|
66
45
|
// This is for backward compatibility. If the content is not a JSON string then it is a raw HTML block
|
|
@@ -56,26 +56,6 @@ export default {
|
|
|
56
56
|
return { text: [], className };
|
|
57
57
|
}
|
|
58
58
|
const json = JSON.parse(text);
|
|
59
|
-
// Loop through each row and find the columns with raw block type. Use dompurify to sanitize the HTML content.
|
|
60
|
-
json.forEach((row) => {
|
|
61
|
-
row.columns.forEach((column) => {
|
|
62
|
-
column.data.blocks.forEach((block) => {
|
|
63
|
-
if (block.type === 'raw' && block.data.html) {
|
|
64
|
-
const replacements = {
|
|
65
|
-
'<': '<',
|
|
66
|
-
'>': '>'
|
|
67
|
-
};
|
|
68
|
-
const jsonText = block.data.html
|
|
69
|
-
? block.data.html.replace(
|
|
70
|
-
/<|>/g,
|
|
71
|
-
(match) => replacements[match]
|
|
72
|
-
)
|
|
73
|
-
: '';
|
|
74
|
-
block.data.html = sanitizeHtml(jsonText);
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
59
|
return {
|
|
80
60
|
text: json,
|
|
81
61
|
className
|
|
@@ -5,15 +5,17 @@ import {
|
|
|
5
5
|
startTransaction
|
|
6
6
|
} from '@evershop/postgres-query-builder';
|
|
7
7
|
import { getConnection } from '../../../../lib/postgres/connection.js';
|
|
8
|
-
import { hookable } from '../../../../lib/util/hookable.js';
|
|
8
|
+
import { hookable, hookBefore, hookAfter } from '../../../../lib/util/hookable.js';
|
|
9
9
|
import {
|
|
10
10
|
getValue,
|
|
11
11
|
getValueSync
|
|
12
12
|
} from '../../../../lib/util/registry.js';
|
|
13
|
+
import { sanitizeRawHtml } from '../../../../lib/util/sanitizeHtml.js';
|
|
14
|
+
import type { CmsPageRow, CmsPageDescriptionRow } from '../../../../types/db/index.js';
|
|
13
15
|
import { getAjv } from '../../../base/services/getAjv.js';
|
|
14
16
|
import pageDataSchema from './pageDataSchema.json' with { type: 'json' };
|
|
15
17
|
|
|
16
|
-
function validatePageDataBeforeInsert(data) {
|
|
18
|
+
function validatePageDataBeforeInsert(data): any {
|
|
17
19
|
const ajv = getAjv();
|
|
18
20
|
pageDataSchema.required = [
|
|
19
21
|
'status',
|
|
@@ -22,7 +24,7 @@ function validatePageDataBeforeInsert(data) {
|
|
|
22
24
|
'content',
|
|
23
25
|
'meta_title'
|
|
24
26
|
];
|
|
25
|
-
const jsonSchema = getValueSync('createPageDataJsonSchema', pageDataSchema);
|
|
27
|
+
const jsonSchema = getValueSync('createPageDataJsonSchema', pageDataSchema, {});
|
|
26
28
|
const validate = ajv.compile(jsonSchema);
|
|
27
29
|
const valid = validate(data);
|
|
28
30
|
if (valid) {
|
|
@@ -32,7 +34,7 @@ function validatePageDataBeforeInsert(data) {
|
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
|
|
35
|
-
async function insertPageData(data, connection) {
|
|
37
|
+
async function insertPageData(data, connection): Promise<CmsPageRow & CmsPageDescriptionRow> {
|
|
36
38
|
const page = await insert('cms_page').given(data).execute(connection);
|
|
37
39
|
const description = await insert('cms_page_description')
|
|
38
40
|
.given(data)
|
|
@@ -50,14 +52,17 @@ async function insertPageData(data, connection) {
|
|
|
50
52
|
* @param {Object} data
|
|
51
53
|
* @param {Object} context
|
|
52
54
|
*/
|
|
53
|
-
async function createPage(data, context) {
|
|
55
|
+
const _createPage = async function createPage(data, context): Promise<CmsPageRow & CmsPageDescriptionRow> {
|
|
54
56
|
const connection = await getConnection();
|
|
55
57
|
await startTransaction(connection);
|
|
56
58
|
try {
|
|
57
59
|
const pageData = await getValue('pageDataBeforeCreate', data);
|
|
58
60
|
// Validate page data
|
|
59
61
|
validatePageDataBeforeInsert(pageData);
|
|
60
|
-
|
|
62
|
+
// Sanitize raw HTML blocks in EditorJS content
|
|
63
|
+
if (pageData.content) {
|
|
64
|
+
sanitizeRawHtml(pageData.content);
|
|
65
|
+
}
|
|
61
66
|
// Insert page data
|
|
62
67
|
const page = await hookable(insertPageData, { ...context, connection })(
|
|
63
68
|
pageData,
|
|
@@ -72,11 +77,63 @@ async function createPage(data, context) {
|
|
|
72
77
|
}
|
|
73
78
|
}
|
|
74
79
|
|
|
75
|
-
export
|
|
80
|
+
export async function createPage(data, context): Promise<CmsPageRow & CmsPageDescriptionRow> {
|
|
76
81
|
// Make sure the context is either not provided or is an object
|
|
77
82
|
if (context && typeof context !== 'object') {
|
|
78
83
|
throw new Error('Context must be an object');
|
|
79
84
|
}
|
|
80
|
-
const page = await hookable(
|
|
85
|
+
const page = await hookable(_createPage, context)(data, context);
|
|
81
86
|
return page;
|
|
82
87
|
};
|
|
88
|
+
|
|
89
|
+
export function hookBeforeInsertPageData(
|
|
90
|
+
callback: (
|
|
91
|
+
this: Record<string, any>,
|
|
92
|
+
...args: [
|
|
93
|
+
data: any,
|
|
94
|
+
connection: any
|
|
95
|
+
]
|
|
96
|
+
) => void | Promise<void>,
|
|
97
|
+
priority: number = 10
|
|
98
|
+
): void {
|
|
99
|
+
hookBefore('insertPageData', callback, priority);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function hookAfterInsertPageData(
|
|
103
|
+
callback: (
|
|
104
|
+
this: Record<string, any>,
|
|
105
|
+
...args: [
|
|
106
|
+
data: any,
|
|
107
|
+
connection: any
|
|
108
|
+
]
|
|
109
|
+
) => void | Promise<void>,
|
|
110
|
+
priority: number = 10
|
|
111
|
+
): void {
|
|
112
|
+
hookAfter('insertPageData', callback, priority);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function hookBeforeCreatePage(
|
|
116
|
+
callback: (
|
|
117
|
+
this: Record<string, any>,
|
|
118
|
+
...args: [
|
|
119
|
+
data: any,
|
|
120
|
+
context: any
|
|
121
|
+
]
|
|
122
|
+
) => void | Promise<void>,
|
|
123
|
+
priority: number = 10
|
|
124
|
+
): void {
|
|
125
|
+
hookBefore('createPage', callback, priority);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function hookAfterCreatePage(
|
|
129
|
+
callback: (
|
|
130
|
+
this: Record<string, any>,
|
|
131
|
+
...args: [
|
|
132
|
+
data: any,
|
|
133
|
+
context: any
|
|
134
|
+
]
|
|
135
|
+
) => void | Promise<void>,
|
|
136
|
+
priority: number = 10
|
|
137
|
+
): void {
|
|
138
|
+
hookAfter('createPage', callback, priority);
|
|
139
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import {
|
|
2
|
+
commit,
|
|
3
|
+
del,
|
|
4
|
+
rollback,
|
|
5
|
+
select,
|
|
6
|
+
startTransaction
|
|
7
|
+
} from '@evershop/postgres-query-builder';
|
|
8
|
+
import { getConnection } from '../../../../lib/postgres/connection.js';
|
|
9
|
+
import {
|
|
10
|
+
hookable,
|
|
11
|
+
hookBefore,
|
|
12
|
+
hookAfter
|
|
13
|
+
} from '../../../../lib/util/hookable.js';
|
|
14
|
+
import type {
|
|
15
|
+
CmsPageRow,
|
|
16
|
+
CmsPageDescriptionRow
|
|
17
|
+
} from '../../../../types/db/index.js';
|
|
18
|
+
|
|
19
|
+
async function deletePageData(uuid, connection): Promise<void> {
|
|
20
|
+
await del('cms_page').where('uuid', '=', uuid).execute(connection);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Delete page service. This service will delete a page with all related data
|
|
24
|
+
* @param {String} uuid
|
|
25
|
+
* @param {Object} context
|
|
26
|
+
*/
|
|
27
|
+
const _deletePage = async function deletePage(
|
|
28
|
+
uuid,
|
|
29
|
+
context
|
|
30
|
+
): Promise<CmsPageRow & CmsPageDescriptionRow> {
|
|
31
|
+
const connection = await getConnection();
|
|
32
|
+
await startTransaction(connection);
|
|
33
|
+
try {
|
|
34
|
+
const query = select().from('cms_page');
|
|
35
|
+
query
|
|
36
|
+
.leftJoin('cms_page_description')
|
|
37
|
+
.on(
|
|
38
|
+
'cms_page_description.cms_page_description_cms_page_id',
|
|
39
|
+
'=',
|
|
40
|
+
'cms_page.cms_page_id'
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
const page = await query.where('uuid', '=', uuid).load(connection);
|
|
44
|
+
if (!page) {
|
|
45
|
+
throw new Error('Invalid page id');
|
|
46
|
+
}
|
|
47
|
+
await hookable(deletePageData, { ...context, page, connection })(
|
|
48
|
+
uuid,
|
|
49
|
+
connection
|
|
50
|
+
);
|
|
51
|
+
await commit(connection);
|
|
52
|
+
return page;
|
|
53
|
+
} catch (e) {
|
|
54
|
+
await rollback(connection);
|
|
55
|
+
throw e;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export async function deletePage(
|
|
60
|
+
uuid,
|
|
61
|
+
context
|
|
62
|
+
): Promise<CmsPageRow & CmsPageDescriptionRow> {
|
|
63
|
+
// Make sure the context is either not provided or is an object
|
|
64
|
+
if (context && typeof context !== 'object') {
|
|
65
|
+
throw new Error('Context must be an object');
|
|
66
|
+
}
|
|
67
|
+
const page = await hookable(_deletePage, context)(uuid, context);
|
|
68
|
+
return page;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function hookBeforeDeletePageData(
|
|
72
|
+
callback: (
|
|
73
|
+
this: Record<string, any>,
|
|
74
|
+
...args: [uuid: any, connection: any]
|
|
75
|
+
) => void | Promise<void>,
|
|
76
|
+
priority: number = 10
|
|
77
|
+
): void {
|
|
78
|
+
hookBefore('deletePageData', callback, priority);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function hookAfterDeletePageData(
|
|
82
|
+
callback: (
|
|
83
|
+
this: Record<string, any>,
|
|
84
|
+
...args: [uuid: any, connection: any]
|
|
85
|
+
) => void | Promise<void>,
|
|
86
|
+
priority: number = 10
|
|
87
|
+
): void {
|
|
88
|
+
hookAfter('deletePageData', callback, priority);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function hookBeforeDeletePage(
|
|
92
|
+
callback: (
|
|
93
|
+
this: Record<string, any>,
|
|
94
|
+
...args: [uuid: any, context: any]
|
|
95
|
+
) => void | Promise<void>,
|
|
96
|
+
priority: number = 10
|
|
97
|
+
): void {
|
|
98
|
+
hookBefore('deletePage', callback, priority);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function hookAfterDeletePage(
|
|
102
|
+
callback: (
|
|
103
|
+
this: Record<string, any>,
|
|
104
|
+
...args: [uuid: any, context: any]
|
|
105
|
+
) => void | Promise<void>,
|
|
106
|
+
priority: number = 10
|
|
107
|
+
): void {
|
|
108
|
+
hookAfter('deletePage', callback, priority);
|
|
109
|
+
}
|
|
@@ -6,18 +6,20 @@ import {
|
|
|
6
6
|
update
|
|
7
7
|
} from '@evershop/postgres-query-builder';
|
|
8
8
|
import { getConnection } from '../../../../lib/postgres/connection.js';
|
|
9
|
-
import { hookable } from '../../../../lib/util/hookable.js';
|
|
9
|
+
import { hookable, hookBefore, hookAfter } from '../../../../lib/util/hookable.js';
|
|
10
10
|
import {
|
|
11
11
|
getValue,
|
|
12
12
|
getValueSync
|
|
13
13
|
} from '../../../../lib/util/registry.js';
|
|
14
|
+
import { sanitizeRawHtml } from '../../../../lib/util/sanitizeHtml.js';
|
|
15
|
+
import type { CmsPageRow, CmsPageDescriptionRow } from '../../../../types/db/index.js';
|
|
14
16
|
import { getAjv } from '../../../base/services/getAjv.js';
|
|
15
17
|
import pageDataSchema from './pageDataSchema.json' with { type: 'json' };
|
|
16
18
|
|
|
17
|
-
function validatePageDataBeforeInsert(data) {
|
|
19
|
+
function validatePageDataBeforeInsert(data): any {
|
|
18
20
|
const ajv = getAjv();
|
|
19
21
|
pageDataSchema.required = ['status'];
|
|
20
|
-
const jsonSchema = getValueSync('updatePageDataJsonSchema', pageDataSchema);
|
|
22
|
+
const jsonSchema = getValueSync('updatePageDataJsonSchema', pageDataSchema, {});
|
|
21
23
|
const validate = ajv.compile(jsonSchema);
|
|
22
24
|
const valid = validate(data);
|
|
23
25
|
if (valid) {
|
|
@@ -27,7 +29,7 @@ function validatePageDataBeforeInsert(data) {
|
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
async function updatePageData(uuid, data, connection) {
|
|
32
|
+
async function updatePageData(uuid, data, connection): Promise<CmsPageRow & CmsPageDescriptionRow> {
|
|
31
33
|
const query = select().from('cms_page');
|
|
32
34
|
query
|
|
33
35
|
.leftJoin('cms_page_description')
|
|
@@ -71,13 +73,17 @@ async function updatePageData(uuid, data, connection) {
|
|
|
71
73
|
* @param {Object} data
|
|
72
74
|
* @param {Object} context
|
|
73
75
|
*/
|
|
74
|
-
async function updatePage(uuid, data, context) {
|
|
76
|
+
async function updatePage(uuid, data, context): Promise<CmsPageRow & CmsPageDescriptionRow> {
|
|
75
77
|
const connection = await getConnection();
|
|
76
78
|
await startTransaction(connection);
|
|
77
79
|
try {
|
|
78
80
|
const pageData = await getValue('pageDataBeforeUpdate', data);
|
|
79
81
|
// Validate page data
|
|
80
82
|
validatePageDataBeforeInsert(pageData);
|
|
83
|
+
// Sanitize raw HTML blocks in EditorJS content
|
|
84
|
+
if (pageData.content) {
|
|
85
|
+
sanitizeRawHtml(pageData.content);
|
|
86
|
+
}
|
|
81
87
|
|
|
82
88
|
// Insert page data
|
|
83
89
|
const page = await hookable(updatePageData, { ...context, connection })(
|
|
@@ -94,7 +100,7 @@ async function updatePage(uuid, data, context) {
|
|
|
94
100
|
}
|
|
95
101
|
}
|
|
96
102
|
|
|
97
|
-
export default async (uuid, data, context) => {
|
|
103
|
+
export default async (uuid, data, context): Promise<CmsPageRow & CmsPageDescriptionRow> => {
|
|
98
104
|
// Make sure the context is either not provided or is an object
|
|
99
105
|
if (context && typeof context !== 'object') {
|
|
100
106
|
throw new Error('Context must be an object');
|
|
@@ -102,3 +108,59 @@ export default async (uuid, data, context) => {
|
|
|
102
108
|
const page = await hookable(updatePage, context)(uuid, data, context);
|
|
103
109
|
return page;
|
|
104
110
|
};
|
|
111
|
+
|
|
112
|
+
export function hookBeforeUpdatePageData(
|
|
113
|
+
callback: (
|
|
114
|
+
this: Record<string, any>,
|
|
115
|
+
...args: [
|
|
116
|
+
uuid: any,
|
|
117
|
+
data: any,
|
|
118
|
+
connection: any
|
|
119
|
+
]
|
|
120
|
+
) => void | Promise<void>,
|
|
121
|
+
priority: number = 10
|
|
122
|
+
): void {
|
|
123
|
+
hookBefore('updatePageData', callback, priority);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export function hookAfterUpdatePageData(
|
|
127
|
+
callback: (
|
|
128
|
+
this: Record<string, any>,
|
|
129
|
+
...args: [
|
|
130
|
+
uuid: any,
|
|
131
|
+
data: any,
|
|
132
|
+
connection: any
|
|
133
|
+
]
|
|
134
|
+
) => void | Promise<void>,
|
|
135
|
+
priority: number = 10
|
|
136
|
+
): void {
|
|
137
|
+
hookAfter('updatePageData', callback, priority);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export function hookBeforeUpdatePage(
|
|
141
|
+
callback: (
|
|
142
|
+
this: Record<string, any>,
|
|
143
|
+
...args: [
|
|
144
|
+
uuid: any,
|
|
145
|
+
data: any,
|
|
146
|
+
context: any
|
|
147
|
+
]
|
|
148
|
+
) => void | Promise<void>,
|
|
149
|
+
priority: number = 10
|
|
150
|
+
): void {
|
|
151
|
+
hookBefore('updatePage', callback, priority);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export function hookAfterUpdatePage(
|
|
155
|
+
callback: (
|
|
156
|
+
this: Record<string, any>,
|
|
157
|
+
...args: [
|
|
158
|
+
uuid: any,
|
|
159
|
+
data: any,
|
|
160
|
+
context: any
|
|
161
|
+
]
|
|
162
|
+
) => void | Promise<void>,
|
|
163
|
+
priority: number = 10
|
|
164
|
+
): void {
|
|
165
|
+
hookAfter('updatePage', callback, priority);
|
|
166
|
+
}
|