@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,5 +1,6 @@
|
|
|
1
1
|
import { select } from '@evershop/postgres-query-builder';
|
|
2
|
-
import
|
|
2
|
+
import { NextFunction } from 'express';
|
|
3
|
+
import Stripe from 'stripe';
|
|
3
4
|
import { error } from '../../../../lib/log/logger.js';
|
|
4
5
|
import { pool } from '../../../../lib/postgres/connection.js';
|
|
5
6
|
import { getConfig } from '../../../../lib/util/getConfig.js';
|
|
@@ -8,10 +9,16 @@ import {
|
|
|
8
9
|
INVALID_PAYLOAD,
|
|
9
10
|
INTERNAL_SERVER_ERROR
|
|
10
11
|
} from '../../../../lib/util/httpStatus.js';
|
|
12
|
+
import { EvershopRequest } from '../../../../types/request.js';
|
|
13
|
+
import { EvershopResponse } from '../../../../types/response.js';
|
|
11
14
|
import { updatePaymentStatus } from '../../../oms/services/updatePaymentStatus.js';
|
|
12
15
|
import { getSetting } from '../../../setting/services/setting.js';
|
|
13
16
|
|
|
14
|
-
export default async (
|
|
17
|
+
export default async (
|
|
18
|
+
request: EvershopRequest,
|
|
19
|
+
response: EvershopResponse,
|
|
20
|
+
next: NextFunction
|
|
21
|
+
) => {
|
|
15
22
|
try {
|
|
16
23
|
const { order_id } = request.body;
|
|
17
24
|
// Load the order
|
|
@@ -49,12 +56,12 @@ export default async (request, response, next) => {
|
|
|
49
56
|
const stripeConfig = getConfig('system.stripe', {});
|
|
50
57
|
let stripeSecretKey;
|
|
51
58
|
|
|
52
|
-
if (stripeConfig
|
|
59
|
+
if (stripeConfig?.secretKey) {
|
|
53
60
|
stripeSecretKey = stripeConfig.secretKey;
|
|
54
61
|
} else {
|
|
55
62
|
stripeSecretKey = await getSetting('stripeSecretKey', '');
|
|
56
63
|
}
|
|
57
|
-
const stripe =
|
|
64
|
+
const stripe = new Stripe(stripeSecretKey);
|
|
58
65
|
// Retrieve the PaymentIntent
|
|
59
66
|
const paymentIntent = await stripe.paymentIntents.retrieve(
|
|
60
67
|
paymentTransaction.transaction_id
|
|
@@ -67,6 +74,7 @@ export default async (request, response, next) => {
|
|
|
67
74
|
message: 'Invalid payment intent'
|
|
68
75
|
}
|
|
69
76
|
});
|
|
77
|
+
return;
|
|
70
78
|
}
|
|
71
79
|
if (paymentIntent.status !== 'requires_capture') {
|
|
72
80
|
response.status(INVALID_PAYLOAD);
|
|
@@ -77,11 +85,12 @@ export default async (request, response, next) => {
|
|
|
77
85
|
'Payment intent is not in the correct state (requires_capture)'
|
|
78
86
|
}
|
|
79
87
|
});
|
|
88
|
+
return;
|
|
80
89
|
}
|
|
81
90
|
// Capture the PaymentIntent
|
|
82
91
|
await stripe.paymentIntents.capture(paymentTransaction.transaction_id);
|
|
83
92
|
// Update the order status to paid
|
|
84
|
-
await updatePaymentStatus(order.order_id, '
|
|
93
|
+
await updatePaymentStatus(order.order_id, 'stripe_captured');
|
|
85
94
|
response.status(OK);
|
|
86
95
|
response.json({
|
|
87
96
|
data: {
|
package/src/modules/stripe/api/createPaymentIntent/{createPaymentIntent.js → createPaymentIntent.ts}
RENAMED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { select } from '@evershop/postgres-query-builder';
|
|
2
|
-
import
|
|
2
|
+
import Stripe from 'stripe';
|
|
3
3
|
import smallestUnit from 'zero-decimal-currencies';
|
|
4
4
|
import { pool } from '../../../../lib/postgres/connection.js';
|
|
5
5
|
import { getConfig } from '../../../../lib/util/getConfig.js';
|
|
6
6
|
import { OK, INVALID_PAYLOAD } from '../../../../lib/util/httpStatus.js';
|
|
7
|
+
import { EvershopRequest } from '../../../../types/request.js';
|
|
8
|
+
import { EvershopResponse } from '../../../../types/response.js';
|
|
7
9
|
import { getSetting } from '../../../setting/services/setting.js';
|
|
8
10
|
|
|
9
|
-
export default async (
|
|
11
|
+
export default async (
|
|
12
|
+
request: EvershopRequest,
|
|
13
|
+
response: EvershopResponse,
|
|
14
|
+
next
|
|
15
|
+
) => {
|
|
10
16
|
const { cart_id, order_id } = request.body;
|
|
11
17
|
// Check the cart
|
|
12
18
|
const cart = await select()
|
|
@@ -26,18 +32,18 @@ export default async (request, response, next) => {
|
|
|
26
32
|
const stripeConfig = getConfig('system.stripe', {});
|
|
27
33
|
let stripeSecretKey;
|
|
28
34
|
|
|
29
|
-
if (stripeConfig
|
|
35
|
+
if (stripeConfig?.secretKey) {
|
|
30
36
|
stripeSecretKey = stripeConfig.secretKey;
|
|
31
37
|
} else {
|
|
32
38
|
stripeSecretKey = await getSetting('stripeSecretKey', '');
|
|
33
39
|
}
|
|
34
40
|
const stripePaymentMode = await getSetting('stripePaymentMode', 'capture');
|
|
35
41
|
|
|
36
|
-
const stripe =
|
|
42
|
+
const stripe = new Stripe(stripeSecretKey);
|
|
37
43
|
|
|
38
44
|
// Create a PaymentIntent with the order amount and currency
|
|
39
45
|
const paymentIntent = await stripe.paymentIntents.create({
|
|
40
|
-
amount: smallestUnit
|
|
46
|
+
amount: parseInt(smallestUnit(cart.grand_total, cart.currency), 10),
|
|
41
47
|
currency: cart.currency,
|
|
42
48
|
metadata: {
|
|
43
49
|
cart_id,
|
package/src/modules/stripe/api/refundPaymentIntent/{refundPaymentIntent.js → refundPaymentIntent.ts}
RENAMED
|
@@ -2,11 +2,10 @@ import {
|
|
|
2
2
|
select,
|
|
3
3
|
getConnection,
|
|
4
4
|
startTransaction,
|
|
5
|
-
insert,
|
|
6
5
|
commit,
|
|
7
6
|
rollback
|
|
8
7
|
} from '@evershop/postgres-query-builder';
|
|
9
|
-
import
|
|
8
|
+
import Stripe from 'stripe';
|
|
10
9
|
import smallestUnit from 'zero-decimal-currencies';
|
|
11
10
|
import { error } from '../../../../lib/log/logger.js';
|
|
12
11
|
import { pool } from '../../../../lib/postgres/connection.js';
|
|
@@ -61,20 +60,25 @@ export default async (request, response, next) => {
|
|
|
61
60
|
const stripeConfig = getConfig('system.stripe', {});
|
|
62
61
|
let stripeSecretKey;
|
|
63
62
|
|
|
64
|
-
if (stripeConfig
|
|
63
|
+
if (stripeConfig?.secretKey) {
|
|
65
64
|
stripeSecretKey = stripeConfig.secretKey;
|
|
66
65
|
} else {
|
|
67
66
|
stripeSecretKey = await getSetting('stripeSecretKey', '');
|
|
68
67
|
}
|
|
69
|
-
const stripe =
|
|
68
|
+
const stripe = new Stripe(stripeSecretKey);
|
|
70
69
|
// Refund
|
|
71
70
|
const refund = await stripe.refunds.create({
|
|
72
71
|
payment_intent: paymentTransaction.transaction_id,
|
|
73
|
-
amount: smallestUnit
|
|
72
|
+
amount: parseInt(smallestUnit(amount, order.currency), 10)
|
|
74
73
|
});
|
|
75
|
-
const
|
|
74
|
+
const chargeId =
|
|
75
|
+
typeof refund.charge === 'string'
|
|
76
|
+
? refund.charge
|
|
77
|
+
: refund.charge?.id ?? '';
|
|
78
|
+
const charge = await stripe.charges.retrieve(chargeId);
|
|
76
79
|
// Update the order status
|
|
77
|
-
const status =
|
|
80
|
+
const status =
|
|
81
|
+
charge.refunded === true ? 'stripe_refunded' : 'stripe_partial_refunded';
|
|
78
82
|
await updatePaymentStatus(order.order_id, status, connection);
|
|
79
83
|
|
|
80
84
|
// Add order activity log
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
insert,
|
|
3
2
|
startTransaction,
|
|
4
3
|
commit,
|
|
5
4
|
rollback,
|
|
@@ -12,24 +11,33 @@ import { emit } from '../../../../lib/event/emitter.js';
|
|
|
12
11
|
import { debug, error } from '../../../../lib/log/logger.js';
|
|
13
12
|
import { getConnection } from '../../../../lib/postgres/connection.js';
|
|
14
13
|
import { getConfig } from '../../../../lib/util/getConfig.js';
|
|
14
|
+
import { EvershopRequest } from '../../../../types/request.js';
|
|
15
|
+
import { EvershopResponse } from '../../../../types/response.js';
|
|
15
16
|
import addOrderActivityLog from '../../../oms/services/addOrderActivityLog.js';
|
|
16
17
|
import { updatePaymentStatus } from '../../../oms/services/updatePaymentStatus.js';
|
|
17
18
|
import { getSetting } from '../../../setting/services/setting.js';
|
|
18
19
|
|
|
19
|
-
export default async (
|
|
20
|
+
export default async (
|
|
21
|
+
request: EvershopRequest,
|
|
22
|
+
response: EvershopResponse,
|
|
23
|
+
next
|
|
24
|
+
) => {
|
|
20
25
|
const sig = request.headers['stripe-signature'];
|
|
21
26
|
|
|
22
27
|
let event;
|
|
23
28
|
const connection = await getConnection();
|
|
24
29
|
try {
|
|
25
|
-
const stripeConfig = getConfig('system.stripe', {})
|
|
30
|
+
const stripeConfig = getConfig('system.stripe', {}) as {
|
|
31
|
+
secretKey?: string;
|
|
32
|
+
endpointSecret?: string;
|
|
33
|
+
};
|
|
26
34
|
let stripeSecretKey;
|
|
27
35
|
if (stripeConfig.secretKey) {
|
|
28
36
|
stripeSecretKey = stripeConfig.secretKey;
|
|
29
37
|
} else {
|
|
30
38
|
stripeSecretKey = await getSetting('stripeSecretKey', '');
|
|
31
39
|
}
|
|
32
|
-
const stripe = stripePgk(stripeSecretKey);
|
|
40
|
+
const stripe = new stripePgk(stripeSecretKey);
|
|
33
41
|
|
|
34
42
|
// Webhook enpoint secret
|
|
35
43
|
let endpointSecret;
|
|
@@ -39,9 +47,13 @@ export default async (request, response, next) => {
|
|
|
39
47
|
endpointSecret = await getSetting('stripeEndpointSecret', '');
|
|
40
48
|
}
|
|
41
49
|
|
|
42
|
-
event = stripe.webhooks.constructEvent(
|
|
50
|
+
event = stripe.webhooks.constructEvent(
|
|
51
|
+
request.body,
|
|
52
|
+
sig as string,
|
|
53
|
+
endpointSecret
|
|
54
|
+
);
|
|
43
55
|
await startTransaction(connection);
|
|
44
|
-
const paymentIntent = event.data.object;
|
|
56
|
+
const paymentIntent = event.data.object as stripePgk.PaymentIntent;
|
|
45
57
|
const { order_id } = paymentIntent.metadata;
|
|
46
58
|
const transaction = await select()
|
|
47
59
|
.from('payment_transaction')
|
|
@@ -78,12 +90,16 @@ export default async (request, response, next) => {
|
|
|
78
90
|
.execute(connection);
|
|
79
91
|
|
|
80
92
|
if (!transaction) {
|
|
81
|
-
await updatePaymentStatus(
|
|
93
|
+
await updatePaymentStatus(
|
|
94
|
+
order.order_id,
|
|
95
|
+
'stripe_captured',
|
|
96
|
+
connection
|
|
97
|
+
);
|
|
82
98
|
|
|
83
99
|
// Add an activity log
|
|
84
100
|
await addOrderActivityLog(
|
|
85
101
|
order.order_id,
|
|
86
|
-
`
|
|
102
|
+
`Payment captured by using Stripe. Transaction ID: ${paymentIntent.id}`,
|
|
87
103
|
false,
|
|
88
104
|
connection
|
|
89
105
|
);
|
|
@@ -115,11 +131,15 @@ export default async (request, response, next) => {
|
|
|
115
131
|
.execute(connection);
|
|
116
132
|
|
|
117
133
|
if (!transaction) {
|
|
118
|
-
await updatePaymentStatus(
|
|
134
|
+
await updatePaymentStatus(
|
|
135
|
+
order.order_id,
|
|
136
|
+
'stripe_authorized',
|
|
137
|
+
connection
|
|
138
|
+
);
|
|
119
139
|
// Add an activity log
|
|
120
140
|
await addOrderActivityLog(
|
|
121
141
|
order.order_id,
|
|
122
|
-
`
|
|
142
|
+
`Payment authorized by using Stripe. Transaction ID: ${paymentIntent.id}`,
|
|
123
143
|
false,
|
|
124
144
|
connection
|
|
125
145
|
);
|
|
@@ -1,42 +1,67 @@
|
|
|
1
1
|
import config from 'config';
|
|
2
2
|
import { getConfig } from '../../lib/util/getConfig.js';
|
|
3
3
|
import { hookAfter } from '../../lib/util/hookable.js';
|
|
4
|
-
import {
|
|
4
|
+
import { PaymentStatus } from '../../types/order.js';
|
|
5
5
|
import { registerPaymentMethod } from '../checkout/services/getAvailablePaymentMethods.js';
|
|
6
6
|
import { getSetting } from '../setting/services/setting.js';
|
|
7
7
|
import { cancelPaymentIntent } from './services/cancelPayment.js';
|
|
8
8
|
|
|
9
9
|
export default async () => {
|
|
10
|
-
const
|
|
10
|
+
const stripePaymentStatus = {
|
|
11
11
|
order: {
|
|
12
12
|
paymentStatus: {
|
|
13
|
-
|
|
13
|
+
stripe_authorized: {
|
|
14
14
|
name: 'Authorized',
|
|
15
|
+
isDefault: false,
|
|
16
|
+
isCancelable: true,
|
|
15
17
|
badge: 'warning'
|
|
16
18
|
},
|
|
17
|
-
|
|
19
|
+
stripe_captured: {
|
|
20
|
+
name: 'Captured',
|
|
21
|
+
isDefault: false,
|
|
22
|
+
isCancelable: false,
|
|
23
|
+
badge: 'success'
|
|
24
|
+
},
|
|
25
|
+
stripe_failed: {
|
|
18
26
|
name: 'Failed',
|
|
27
|
+
isDefault: false,
|
|
28
|
+
isCancelable: true,
|
|
19
29
|
badge: 'critical'
|
|
20
30
|
},
|
|
21
|
-
|
|
31
|
+
stripe_refunded: {
|
|
22
32
|
name: 'Refunded',
|
|
23
|
-
badge: '
|
|
33
|
+
badge: 'destructive',
|
|
34
|
+
isCancelable: false,
|
|
35
|
+
isDefault: false
|
|
24
36
|
},
|
|
25
|
-
|
|
37
|
+
stripe_partial_refunded: {
|
|
26
38
|
name: 'Partial Refunded',
|
|
27
|
-
badge: '
|
|
39
|
+
badge: 'destructive',
|
|
40
|
+
isCancelable: false,
|
|
41
|
+
isDefault: false
|
|
28
42
|
}
|
|
29
43
|
},
|
|
30
44
|
psoMapping: {
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
35
|
-
'
|
|
45
|
+
'stripe_authorized:*': 'processing',
|
|
46
|
+
'stripe_captured:*': 'processing',
|
|
47
|
+
'stripe_captured:delivered': 'completed',
|
|
48
|
+
'stripe_failed:*': 'new',
|
|
49
|
+
'stripe_refunded:*': 'closed',
|
|
50
|
+
'stripe_partial_refunded:*': 'processing',
|
|
51
|
+
'stripe_partial_refunded:delivered': 'completed'
|
|
36
52
|
}
|
|
37
53
|
}
|
|
54
|
+
} as {
|
|
55
|
+
order: {
|
|
56
|
+
paymentStatus: {
|
|
57
|
+
[key: string]: PaymentStatus;
|
|
58
|
+
};
|
|
59
|
+
psoMapping: {
|
|
60
|
+
[key: string]: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
38
63
|
};
|
|
39
|
-
config.util.setModuleDefaults('oms',
|
|
64
|
+
config.util.setModuleDefaults('oms', stripePaymentStatus);
|
|
40
65
|
|
|
41
66
|
hookAfter('changePaymentStatus', async (order, orderID, status) => {
|
|
42
67
|
if (status !== 'canceled') {
|
|
@@ -54,7 +79,7 @@ export default async () => {
|
|
|
54
79
|
name: await getSetting('stripeDisplayName', 'Stripe')
|
|
55
80
|
}),
|
|
56
81
|
validator: async () => {
|
|
57
|
-
const stripeConfig = getConfig('system.stripe', {});
|
|
82
|
+
const stripeConfig = getConfig('system.stripe', {}) ?? {};
|
|
58
83
|
let stripeStatus;
|
|
59
84
|
if (stripeConfig.status) {
|
|
60
85
|
stripeStatus = stripeConfig.status;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { execute } from '@evershop/postgres-query-builder';
|
|
2
|
+
import type { PoolClient } from '@evershop/postgres-query-builder';
|
|
3
|
+
|
|
4
|
+
export default async (connection: PoolClient) => {
|
|
5
|
+
// Migrate legacy Stripe payment statuses to the new prefixed values.
|
|
6
|
+
// Only orders placed with payment_method = 'stripe' are affected.
|
|
7
|
+
const statusMap: Record<string, string> = {
|
|
8
|
+
authorized: 'stripe_authorized',
|
|
9
|
+
failed: 'stripe_failed',
|
|
10
|
+
refunded: 'stripe_refunded',
|
|
11
|
+
paid: 'stripe_captured',
|
|
12
|
+
partial_refunded: 'stripe_partial_refunded'
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
for (const [oldStatus, newStatus] of Object.entries(statusMap)) {
|
|
16
|
+
await execute(
|
|
17
|
+
connection,
|
|
18
|
+
`UPDATE "order"
|
|
19
|
+
SET "payment_status" = '${newStatus}'
|
|
20
|
+
WHERE "payment_method" = 'stripe'
|
|
21
|
+
AND "payment_status" = '${oldStatus}'`
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
@@ -33,7 +33,7 @@ export default function StripeCaptureButton({
|
|
|
33
33
|
return (
|
|
34
34
|
<RenderIfTrue
|
|
35
35
|
condition={
|
|
36
|
-
paymentStatus.code === '
|
|
36
|
+
paymentStatus.code === 'stripe_authorized' && paymentMethod === 'stripe'
|
|
37
37
|
}
|
|
38
38
|
>
|
|
39
39
|
<CardContent>
|
|
@@ -27,11 +27,14 @@ export default function StripeRefundButton({
|
|
|
27
27
|
order: { paymentStatus, orderId, paymentMethod, grandTotal }
|
|
28
28
|
}: StripeRefundButtonProps) {
|
|
29
29
|
const { openAlert, closeAlert, dispatchAlert } = useAlertContext();
|
|
30
|
+
const [loading, setLoading] = React.useState(false);
|
|
30
31
|
return (
|
|
31
32
|
<RenderIfTrue
|
|
32
33
|
condition={
|
|
33
34
|
paymentMethod === 'stripe' &&
|
|
34
|
-
['
|
|
35
|
+
['stripe_captured', 'stripe_partial_refunded'].includes(
|
|
36
|
+
paymentStatus.code
|
|
37
|
+
)
|
|
35
38
|
}
|
|
36
39
|
>
|
|
37
40
|
<CardContent>
|
|
@@ -49,6 +52,7 @@ export default function StripeRefundButton({
|
|
|
49
52
|
action={refundAPI}
|
|
50
53
|
submitBtn={false}
|
|
51
54
|
onSuccess={(response) => {
|
|
55
|
+
setLoading(false);
|
|
52
56
|
if (response.error) {
|
|
53
57
|
toast.error(response.error.message);
|
|
54
58
|
dispatchAlert({
|
|
@@ -61,6 +65,7 @@ export default function StripeRefundButton({
|
|
|
61
65
|
}
|
|
62
66
|
}}
|
|
63
67
|
onInvalid={() => {
|
|
68
|
+
setLoading(false);
|
|
64
69
|
dispatchAlert({
|
|
65
70
|
type: 'update',
|
|
66
71
|
payload: { secondaryAction: { isLoading: false } }
|
|
@@ -93,7 +98,7 @@ export default function StripeRefundButton({
|
|
|
93
98
|
<InputField
|
|
94
99
|
type="hidden"
|
|
95
100
|
name="order_id"
|
|
96
|
-
|
|
101
|
+
defaultValue={orderId}
|
|
97
102
|
/>
|
|
98
103
|
</Form>
|
|
99
104
|
</div>
|
|
@@ -106,6 +111,7 @@ export default function StripeRefundButton({
|
|
|
106
111
|
secondaryAction: {
|
|
107
112
|
title: 'Refund',
|
|
108
113
|
onAction: () => {
|
|
114
|
+
setLoading(true);
|
|
109
115
|
dispatchAlert({
|
|
110
116
|
type: 'update',
|
|
111
117
|
payload: { secondaryAction: { isLoading: true } }
|
|
@@ -117,7 +123,7 @@ export default function StripeRefundButton({
|
|
|
117
123
|
);
|
|
118
124
|
},
|
|
119
125
|
variant: 'secondary',
|
|
120
|
-
isLoading:
|
|
126
|
+
isLoading: loading
|
|
121
127
|
}
|
|
122
128
|
});
|
|
123
129
|
}}
|
|
@@ -384,13 +384,22 @@ export default function StripeMethod({
|
|
|
384
384
|
const { checkout } = useCheckoutDispatch();
|
|
385
385
|
const { loadingStates, orderPlaced } = useCheckout();
|
|
386
386
|
const handleClick = async (e: React.MouseEvent) => {
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
387
|
+
try {
|
|
388
|
+
e.preventDefault();
|
|
389
|
+
const validateStripe = (window as any)?.validateStripePayment;
|
|
390
|
+
if (validateStripe) {
|
|
391
|
+
const isValid = await validateStripe();
|
|
392
|
+
if (!isValid) return;
|
|
393
|
+
}
|
|
394
|
+
// If validation passed, proceed with order placement
|
|
395
|
+
await checkout();
|
|
396
|
+
} catch (error) {
|
|
397
|
+
toast.error(
|
|
398
|
+
error instanceof Error
|
|
399
|
+
? error.message
|
|
400
|
+
: _('An unexpected error occurred. Please try again.')
|
|
401
|
+
);
|
|
391
402
|
}
|
|
392
|
-
// If validation passed, proceed with order placement
|
|
393
|
-
await checkout();
|
|
394
403
|
};
|
|
395
404
|
|
|
396
405
|
const isDisabled = loadingStates.placingOrder || orderPlaced;
|
|
@@ -463,7 +472,7 @@ export default function StripeMethod({
|
|
|
463
472
|
}
|
|
464
473
|
|
|
465
474
|
export const layout = {
|
|
466
|
-
areaId: '
|
|
475
|
+
areaId: 'checkoutFormAfter',
|
|
467
476
|
sortOrder: 10
|
|
468
477
|
};
|
|
469
478
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { select, update } from '@evershop/postgres-query-builder';
|
|
2
|
-
import
|
|
2
|
+
import Stripe from 'stripe';
|
|
3
3
|
import { error } from '../../../../../lib/log/logger.js';
|
|
4
4
|
import { pool } from '../../../../../lib/postgres/connection.js';
|
|
5
5
|
import { buildUrl } from '../../../../../lib/router/buildUrl.js';
|
|
@@ -7,10 +7,20 @@ import { getConfig } from '../../../../../lib/util/getConfig.js';
|
|
|
7
7
|
import { addNotification } from '../../../../../modules/base/services/notifications.js';
|
|
8
8
|
import { updatePaymentStatus } from '../../../../../modules/oms/services/updatePaymentStatus.js';
|
|
9
9
|
import { getSetting } from '../../../../../modules/setting/services/setting.js';
|
|
10
|
+
import { EvershopRequest } from '../../../../../types/request.js';
|
|
11
|
+
import { EvershopResponse } from '../../../../../types/response.js';
|
|
10
12
|
|
|
11
|
-
export default async (
|
|
13
|
+
export default async (
|
|
14
|
+
request: EvershopRequest,
|
|
15
|
+
response: EvershopResponse,
|
|
16
|
+
next
|
|
17
|
+
) => {
|
|
12
18
|
try {
|
|
13
19
|
const { order_id, payment_intent } = request.query;
|
|
20
|
+
if (typeof order_id !== 'string' || typeof payment_intent !== 'string') {
|
|
21
|
+
response.redirect(buildUrl('homepage'));
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
14
24
|
// Check if order exist
|
|
15
25
|
const order = await select()
|
|
16
26
|
.from('order')
|
|
@@ -25,13 +35,13 @@ export default async (request, response, next) => {
|
|
|
25
35
|
|
|
26
36
|
const stripeConfig = getConfig('system.stripe', {});
|
|
27
37
|
let stripeSecretKey;
|
|
28
|
-
if (stripeConfig
|
|
38
|
+
if (stripeConfig?.secretKey) {
|
|
29
39
|
stripeSecretKey = stripeConfig.secretKey;
|
|
30
40
|
} else {
|
|
31
41
|
stripeSecretKey = await getSetting('stripeSecretKey', '');
|
|
32
42
|
}
|
|
33
43
|
const stripePaymentMode = await getSetting('stripePaymentMode', 'capture');
|
|
34
|
-
const stripe =
|
|
44
|
+
const stripe = new Stripe(stripeSecretKey, {} as Stripe.StripeConfig);
|
|
35
45
|
const paymentIntent = await stripe.paymentIntents.retrieve(payment_intent);
|
|
36
46
|
// Check if the payment intent is succeeded
|
|
37
47
|
if (
|
|
@@ -50,7 +60,7 @@ export default async (request, response, next) => {
|
|
|
50
60
|
.given({ status: true })
|
|
51
61
|
.where('cart_id', '=', order.cart_id)
|
|
52
62
|
.execute(pool);
|
|
53
|
-
await updatePaymentStatus(order.order_id, '
|
|
63
|
+
await updatePaymentStatus(order.order_id, 'stripe_failed');
|
|
54
64
|
// Add a error notification
|
|
55
65
|
addNotification(request, 'Payment failed', 'error');
|
|
56
66
|
request.session.save(() => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { select } from '@evershop/postgres-query-builder';
|
|
2
|
-
import
|
|
2
|
+
import Stripe from 'stripe';
|
|
3
3
|
import { error } from '../../../lib/log/logger.js';
|
|
4
4
|
import { pool } from '../../../lib/postgres/connection.js';
|
|
5
5
|
import { getConfig } from '../../../lib/util/getConfig.js';
|
|
6
6
|
import { getSetting } from '../../setting/services/setting.js';
|
|
7
7
|
|
|
8
|
-
export async function cancelPaymentIntent(orderID) {
|
|
8
|
+
export async function cancelPaymentIntent(orderID: number) {
|
|
9
9
|
try {
|
|
10
10
|
const transaction = await select()
|
|
11
11
|
.from('payment_transaction')
|
|
@@ -17,12 +17,12 @@ export async function cancelPaymentIntent(orderID) {
|
|
|
17
17
|
const stripeConfig = getConfig('system.stripe', {});
|
|
18
18
|
let stripeSecretKey;
|
|
19
19
|
|
|
20
|
-
if (stripeConfig
|
|
20
|
+
if (stripeConfig?.secretKey) {
|
|
21
21
|
stripeSecretKey = stripeConfig.secretKey;
|
|
22
22
|
} else {
|
|
23
23
|
stripeSecretKey = await getSetting('stripeSecretKey', '');
|
|
24
24
|
}
|
|
25
|
-
const stripe =
|
|
25
|
+
const stripe = new Stripe(stripeSecretKey);
|
|
26
26
|
|
|
27
27
|
// Get the payment intent
|
|
28
28
|
const paymentIntent = await stripe.paymentIntents.retrieve(
|
package/src/types/apiResponse.ts
CHANGED
package/src/types/appContext.tsx
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
import { WidgetInstance } from '@evershop/evershop/types/widget';
|
|
1
2
|
import { PageMetaInfo } from './pageMeta.js';
|
|
2
3
|
|
|
4
|
+
type GraphqlScalar = string | number | boolean | null;
|
|
5
|
+
type GraphqlResponseValue =
|
|
6
|
+
| GraphqlScalar
|
|
7
|
+
| GraphqlResponseValue[]
|
|
8
|
+
| { [key: string]: GraphqlResponseValue };
|
|
9
|
+
|
|
3
10
|
interface Config {
|
|
4
11
|
pageMeta: PageMetaInfo;
|
|
5
12
|
tax: {
|
|
@@ -11,12 +18,10 @@ interface Config {
|
|
|
11
18
|
}
|
|
12
19
|
|
|
13
20
|
interface AppStateContextValue {
|
|
14
|
-
graphqlResponse:
|
|
15
|
-
[key: string]: any;
|
|
16
|
-
};
|
|
21
|
+
graphqlResponse: Record<string, GraphqlResponseValue>;
|
|
17
22
|
config: Config;
|
|
18
23
|
propsMap: Record<string, any[]>;
|
|
19
|
-
widgets?:
|
|
24
|
+
widgets?: WidgetInstance[];
|
|
20
25
|
fetching: boolean;
|
|
21
26
|
}
|
|
22
27
|
|