@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.
Files changed (695) hide show
  1. package/dist/components/common/Area.js +199 -12
  2. package/dist/components/common/Area.js.map +1 -1
  3. package/dist/components/common/Editor.js +2 -1
  4. package/dist/components/common/Editor.js.map +1 -1
  5. package/dist/components/common/ExtendableTable.js +1 -1
  6. package/dist/components/common/ExtendableTable.js.map +1 -1
  7. package/dist/components/common/StaticImage.js +2 -2
  8. package/dist/components/common/StaticImage.js.map +1 -1
  9. package/dist/components/common/form/Editor.scss +3 -1
  10. package/dist/components/common/form/ReactSelectCreatableField.d.ts +1 -1
  11. package/dist/components/common/form/SelectField.js +3 -3
  12. package/dist/components/common/form/SelectField.js.map +1 -1
  13. package/dist/components/common/ui/Badge.d.ts +1 -1
  14. package/dist/components/common/ui/Item.js +1 -1
  15. package/dist/components/common/ui/Item.js.map +1 -1
  16. package/dist/components/common/ui/Sonner.d.ts +5 -0
  17. package/dist/components/common/ui/Sonner.js +24 -0
  18. package/dist/components/common/ui/Sonner.js.map +1 -0
  19. package/dist/components/common/ui/Tabs.d.ts +1 -1
  20. package/dist/components/frontStore/Footer.js +3 -1
  21. package/dist/components/frontStore/Footer.js.map +1 -1
  22. package/dist/components/frontStore/Pagination.js +1 -1
  23. package/dist/components/frontStore/Pagination.js.map +1 -1
  24. package/dist/components/frontStore/cart/CartContext.d.ts +2 -2
  25. package/dist/components/frontStore/cart/DefaultCartItemList.js +5 -5
  26. package/dist/components/frontStore/cart/DefaultCartItemList.js.map +1 -1
  27. package/dist/components/frontStore/cart/DefaultMiniCartDropdown.js +2 -19
  28. package/dist/components/frontStore/cart/DefaultMiniCartDropdown.js.map +1 -1
  29. package/dist/components/frontStore/cart/DefaultMinicartDropdownSummary.d.ts +7 -0
  30. package/dist/components/frontStore/cart/DefaultMinicartDropdownSummary.js +29 -0
  31. package/dist/components/frontStore/cart/DefaultMinicartDropdownSummary.js.map +1 -0
  32. package/dist/components/frontStore/catalog/CategoryInfo.js +2 -2
  33. package/dist/components/frontStore/catalog/CategoryInfo.js.map +1 -1
  34. package/dist/components/frontStore/catalog/DefaultCategoryFilterRender.js +1 -1
  35. package/dist/components/frontStore/catalog/DefaultCategoryFilterRender.js.map +1 -1
  36. package/dist/components/frontStore/catalog/DefaultProductFilterRender.js +3 -3
  37. package/dist/components/frontStore/catalog/DefaultProductFilterRender.js.map +1 -1
  38. package/dist/components/frontStore/catalog/ProductSorting.d.ts +2 -1
  39. package/dist/components/frontStore/catalog/ProductSorting.js +7 -3
  40. package/dist/components/frontStore/catalog/ProductSorting.js.map +1 -1
  41. package/dist/components/frontStore/catalog/SearchBox.d.ts +1 -1
  42. package/dist/components/frontStore/checkout/CheckoutButton.js +19 -12
  43. package/dist/components/frontStore/checkout/CheckoutButton.js.map +1 -1
  44. package/dist/components/frontStore/checkout/CheckoutContext.d.ts +10 -9
  45. package/dist/components/frontStore/checkout/CheckoutContext.js +39 -25
  46. package/dist/components/frontStore/checkout/CheckoutContext.js.map +1 -1
  47. package/dist/components/frontStore/checkout/ContactInformation.js +12 -8
  48. package/dist/components/frontStore/checkout/ContactInformation.js.map +1 -1
  49. package/dist/components/frontStore/checkout/Payment.js +19 -12
  50. package/dist/components/frontStore/checkout/Payment.js.map +1 -1
  51. package/dist/components/frontStore/checkout/Shipment.js +19 -13
  52. package/dist/components/frontStore/checkout/Shipment.js.map +1 -1
  53. package/dist/components/frontStore/checkout/payment/PaymentMethods.js +1 -1
  54. package/dist/components/frontStore/checkout/payment/PaymentMethods.js.map +1 -1
  55. package/dist/components/frontStore/checkout/shipment/ShippingMethods.js +2 -2
  56. package/dist/components/frontStore/checkout/shipment/ShippingMethods.js.map +1 -1
  57. package/dist/components/frontStore/customer/CustomerContext.d.ts +3 -3
  58. package/dist/components/frontStore/customer/RegistrationForm.js +1 -1
  59. package/dist/components/frontStore/customer/address/addressForm/AddressForm.js +1 -1
  60. package/dist/components/frontStore/customer/address/addressForm/AddressForm.js.map +1 -1
  61. package/dist/lib/componee/scanForComponents.js.map +1 -1
  62. package/dist/lib/event/EventProcessor.d.ts +17 -0
  63. package/dist/lib/event/EventProcessor.js +63 -0
  64. package/dist/lib/event/EventProcessor.js.map +1 -0
  65. package/dist/lib/event/EventStorage.d.ts +36 -0
  66. package/dist/lib/event/EventStorage.js +49 -0
  67. package/dist/lib/event/EventStorage.js.map +1 -0
  68. package/dist/lib/event/callSubscibers.d.ts +1 -1
  69. package/dist/lib/event/callSubscibers.js +7 -11
  70. package/dist/lib/event/callSubscibers.js.map +1 -1
  71. package/dist/lib/event/event-manager.js +38 -71
  72. package/dist/lib/event/event-manager.js.map +1 -1
  73. package/dist/lib/event/loadSubscribers.d.ts +10 -1
  74. package/dist/lib/event/loadSubscribers.js +2 -4
  75. package/dist/lib/event/loadSubscribers.js.map +1 -1
  76. package/dist/lib/event/tests/unit/EventProcessor.test.d.ts +1 -0
  77. package/dist/lib/event/tests/unit/EventProcessor.test.js +196 -0
  78. package/dist/lib/event/tests/unit/EventProcessor.test.js.map +1 -0
  79. package/dist/lib/event/tests/unit/callSubscribers.test.d.ts +1 -0
  80. package/dist/lib/event/tests/unit/callSubscribers.test.js +57 -0
  81. package/dist/lib/event/tests/unit/callSubscribers.test.js.map +1 -0
  82. package/dist/lib/mail/emailHelper.d.ts +2 -2
  83. package/dist/lib/postgres/connection.d.ts +3 -1
  84. package/dist/lib/postgres/connection.js +10 -6
  85. package/dist/lib/postgres/connection.js.map +1 -1
  86. package/dist/lib/postgres/query.d.ts +296 -0
  87. package/dist/lib/postgres/query.js +42 -0
  88. package/dist/lib/postgres/query.js.map +1 -0
  89. package/dist/lib/util/getConfig.d.ts +6 -6
  90. package/dist/lib/util/registry.d.ts +17 -2
  91. package/dist/lib/util/registry.js.map +1 -1
  92. package/dist/lib/util/sanitizeHtml.d.ts +16 -0
  93. package/dist/lib/util/sanitizeHtml.js +45 -0
  94. package/dist/lib/util/sanitizeHtml.js.map +1 -0
  95. package/dist/lib/webpack/loaders/AreaLoader.js +0 -1
  96. package/dist/lib/webpack/loaders/AreaLoader.js.map +1 -1
  97. package/dist/lib/webpack/util/getTailwindSources.js +1 -1
  98. package/dist/lib/webpack/util/getTailwindSources.js.map +1 -1
  99. package/dist/modules/auth/api/refreshUserToken/refreshToken.js +4 -6
  100. package/dist/modules/auth/api/refreshUserToken/refreshToken.js.map +1 -1
  101. package/dist/modules/auth/bootstrap.d.ts +1 -1
  102. package/dist/modules/auth/bootstrap.js +16 -14
  103. package/dist/modules/auth/bootstrap.js.map +1 -1
  104. package/dist/modules/auth/services/buildAdminUserPayload.d.ts +10 -0
  105. package/dist/modules/auth/services/buildAdminUserPayload.js +19 -0
  106. package/dist/modules/auth/services/buildAdminUserPayload.js.map +1 -0
  107. package/dist/modules/auth/services/loginUserWithEmail.d.ts +3 -7
  108. package/dist/modules/auth/services/loginUserWithEmail.js +15 -6
  109. package/dist/modules/auth/services/loginUserWithEmail.js.map +1 -1
  110. package/dist/modules/auth/services/logoutUser.d.ts +3 -4
  111. package/dist/modules/auth/services/logoutUser.js +12 -1
  112. package/dist/modules/auth/services/logoutUser.js.map +1 -1
  113. package/dist/modules/base/api/global/[apiResponse]apiErrorHandler.d.ts +3 -1
  114. package/dist/modules/base/api/global/[apiResponse]apiErrorHandler.js.map +1 -1
  115. package/dist/modules/base/api/global/[auth]apiResponse[apiErrorHandler].d.ts +3 -1
  116. package/dist/modules/base/api/global/[auth]apiResponse[apiErrorHandler].js.map +1 -1
  117. package/dist/modules/base/api/global/[auth]payloadValidate.d.ts +3 -1
  118. package/dist/modules/base/api/global/[auth]payloadValidate.js +3 -2
  119. package/dist/modules/base/api/global/[auth]payloadValidate.js.map +1 -1
  120. package/dist/modules/base/api/global/[payloadValidate]escapeHtml.d.ts +3 -1
  121. package/dist/modules/base/api/global/[payloadValidate]escapeHtml.js +0 -2
  122. package/dist/modules/base/api/global/[payloadValidate]escapeHtml.js.map +1 -1
  123. package/dist/modules/base/migration/Version-1.0.2.d.ts +2 -0
  124. package/dist/modules/base/migration/Version-1.0.2.js +22 -0
  125. package/dist/modules/base/migration/Version-1.0.2.js.map +1 -0
  126. package/dist/modules/base/pages/admin/all/global.scss +1 -1
  127. package/dist/modules/base/services/escapePayload.js +20 -13
  128. package/dist/modules/base/services/escapePayload.js.map +1 -1
  129. package/dist/modules/base/services/markSkipEscape.d.ts +5 -0
  130. package/dist/modules/base/services/markSkipEscape.js +25 -20
  131. package/dist/modules/base/services/markSkipEscape.js.map +1 -1
  132. package/dist/modules/catalog/api/createAttribute/createAttribute[finish].d.ts +3 -1
  133. package/dist/modules/catalog/api/createCategory/[context]bodyParser[auth].d.ts +1 -1
  134. package/dist/modules/catalog/api/createCategory/[context]bodyParser[auth].js.map +1 -1
  135. package/dist/modules/catalog/api/createCategory/createCategory[finish].d.ts +5 -1
  136. package/dist/modules/catalog/api/createCategory/createCategory[finish].js.map +1 -1
  137. package/dist/modules/catalog/api/createCategory/finish[apiResponse].d.ts +3 -1
  138. package/dist/modules/catalog/api/createCategory/finish[apiResponse].js +2 -2
  139. package/dist/modules/catalog/api/createCategory/finish[apiResponse].js.map +1 -1
  140. package/dist/modules/catalog/api/createCategory/payloadSchema.json +76 -0
  141. package/dist/modules/catalog/api/createCollection/[context]bodyParser[auth].d.ts +1 -1
  142. package/dist/modules/catalog/api/createCollection/[context]bodyParser[auth].js.map +1 -1
  143. package/dist/modules/catalog/api/createCollection/createCollection[finish].d.ts +4 -1
  144. package/dist/modules/catalog/api/createCollection/createCollection[finish].js.map +1 -1
  145. package/dist/modules/catalog/api/createCollection/finish[apiResponse].d.ts +3 -1
  146. package/dist/modules/catalog/api/createCollection/finish[apiResponse].js +1 -1
  147. package/dist/modules/catalog/api/createCollection/finish[apiResponse].js.map +1 -1
  148. package/dist/modules/catalog/{services/collection/collectionDataSchema.json → api/createCollection/payloadSchema.json} +1 -0
  149. package/dist/modules/catalog/api/createProduct/[context]bodyParser[auth].d.ts +1 -1
  150. package/dist/modules/catalog/api/createProduct/[context]bodyParser[auth].js.map +1 -1
  151. package/dist/modules/catalog/api/createProduct/createProduct[finish].d.ts +5 -1
  152. package/dist/modules/catalog/api/createProduct/createProduct[finish].js.map +1 -1
  153. package/dist/modules/catalog/api/createProduct/finish[apiResponse].d.ts +3 -1
  154. package/dist/modules/catalog/api/createProduct/finish[apiResponse].js +2 -2
  155. package/dist/modules/catalog/api/createProduct/finish[apiResponse].js.map +1 -1
  156. package/dist/modules/catalog/api/createProduct/payloadSchema.json +76 -0
  157. package/dist/modules/catalog/api/updateAttribute/updateAttribute[finish].d.ts +3 -1
  158. package/dist/modules/catalog/api/updateCategory/[context]bodyParser[auth].d.ts +1 -1
  159. package/dist/modules/catalog/api/updateCategory/[context]bodyParser[auth].js.map +1 -1
  160. package/dist/modules/catalog/api/updateCategory/finish[apiResponse].d.ts +3 -1
  161. package/dist/modules/catalog/api/updateCategory/finish[apiResponse].js +2 -2
  162. package/dist/modules/catalog/api/updateCategory/finish[apiResponse].js.map +1 -1
  163. package/dist/modules/catalog/api/updateCategory/payloadSchema.json +76 -0
  164. package/dist/modules/catalog/api/updateCategory/updateCategory[finish].d.ts +5 -1
  165. package/dist/modules/catalog/api/updateCategory/updateCategory[finish].js +1 -1
  166. package/dist/modules/catalog/api/updateCategory/updateCategory[finish].js.map +1 -1
  167. package/dist/modules/catalog/api/updateCollection/[context]bodyParser[auth].d.ts +1 -1
  168. package/dist/modules/catalog/api/updateCollection/[context]bodyParser[auth].js.map +1 -1
  169. package/dist/modules/catalog/api/updateCollection/finish[apiResponse].d.ts +3 -1
  170. package/dist/modules/catalog/api/updateCollection/finish[apiResponse].js +1 -1
  171. package/dist/modules/catalog/api/updateCollection/finish[apiResponse].js.map +1 -1
  172. package/{src/modules/catalog/services/collection/collectionDataSchema.json → dist/modules/catalog/api/updateCollection/payloadSchema.json} +1 -0
  173. package/dist/modules/catalog/api/updateCollection/updateCollection[finish].d.ts +5 -1
  174. package/dist/modules/catalog/api/updateCollection/updateCollection[finish].js +1 -1
  175. package/dist/modules/catalog/api/updateCollection/updateCollection[finish].js.map +1 -1
  176. package/dist/modules/catalog/api/updateProduct/[context]bodyParser[auth].d.ts +1 -1
  177. package/dist/modules/catalog/api/updateProduct/[context]bodyParser[auth].js.map +1 -1
  178. package/dist/modules/catalog/api/updateProduct/finish[apiResponse].d.ts +3 -1
  179. package/dist/modules/catalog/api/updateProduct/finish[apiResponse].js +2 -2
  180. package/dist/modules/catalog/api/updateProduct/finish[apiResponse].js.map +1 -1
  181. package/dist/modules/catalog/api/updateProduct/payloadSchema.json +76 -0
  182. package/dist/modules/catalog/api/updateProduct/updateProduct[finish].d.ts +5 -1
  183. package/dist/modules/catalog/api/updateProduct/updateProduct[finish].js +1 -1
  184. package/dist/modules/catalog/api/updateProduct/updateProduct[finish].js.map +1 -1
  185. package/dist/modules/catalog/graphql/types/Category/Category.resolvers.d.ts +36 -37
  186. package/dist/modules/catalog/graphql/types/Category/Category.resolvers.js +0 -18
  187. package/dist/modules/catalog/graphql/types/Category/Category.resolvers.js.map +1 -1
  188. package/dist/modules/catalog/graphql/types/Collection/Collection.resolvers.js +1 -8
  189. package/dist/modules/catalog/graphql/types/Collection/Collection.resolvers.js.map +1 -1
  190. package/dist/modules/catalog/graphql/types/Product/Product.resolvers.js +0 -18
  191. package/dist/modules/catalog/graphql/types/Product/Product.resolvers.js.map +1 -1
  192. package/dist/modules/catalog/pages/admin/productEdit/variants/CreateVariant.js +4 -3
  193. package/dist/modules/catalog/pages/admin/productEdit/variants/CreateVariant.js.map +1 -1
  194. package/dist/modules/catalog/pages/admin/productEdit/variants/CreateVariantGroup.d.ts +1 -0
  195. package/dist/modules/catalog/pages/admin/productEdit/variants/CreateVariantGroup.js +12 -6
  196. package/dist/modules/catalog/pages/admin/productEdit/variants/CreateVariantGroup.js.map +1 -1
  197. package/dist/modules/catalog/pages/admin/productEdit/variants/EditVariant.js +4 -3
  198. package/dist/modules/catalog/pages/admin/productEdit/variants/EditVariant.js.map +1 -1
  199. package/dist/modules/catalog/pages/admin/productEdit/variants/New.js +6 -10
  200. package/dist/modules/catalog/pages/admin/productEdit/variants/New.js.map +1 -1
  201. package/dist/modules/catalog/pages/admin/productEdit/variants/VariantModal.d.ts +2 -0
  202. package/dist/modules/catalog/pages/admin/productEdit/variants/VariantModal.js +8 -2
  203. package/dist/modules/catalog/pages/admin/productEdit/variants/VariantModal.js.map +1 -1
  204. package/dist/modules/catalog/pages/admin/productEdit+productNew/General.js +4 -1
  205. package/dist/modules/catalog/pages/admin/productEdit+productNew/General.js.map +1 -1
  206. package/dist/modules/catalog/pages/frontStore/categoryView/CategoryView.js +1 -6
  207. package/dist/modules/catalog/pages/frontStore/categoryView/CategoryView.js.map +1 -1
  208. package/dist/modules/catalog/pages/frontStore/productView/ProductView.js +7 -1
  209. package/dist/modules/catalog/pages/frontStore/productView/ProductView.js.map +1 -1
  210. package/dist/modules/catalog/services/attribute/createProductAttribute.d.ts +78 -2
  211. package/dist/modules/catalog/services/attribute/createProductAttribute.js +25 -1
  212. package/dist/modules/catalog/services/attribute/createProductAttribute.js.map +1 -1
  213. package/dist/modules/catalog/services/attribute/deleteProductAttribute.d.ts +7 -1
  214. package/dist/modules/catalog/services/attribute/deleteProductAttribute.js +13 -1
  215. package/dist/modules/catalog/services/attribute/deleteProductAttribute.js.map +1 -1
  216. package/dist/modules/catalog/services/attribute/updateProductAttribute.d.ts +56 -2
  217. package/dist/modules/catalog/services/attribute/updateProductAttribute.js +28 -6
  218. package/dist/modules/catalog/services/attribute/updateProductAttribute.js.map +1 -1
  219. package/dist/modules/catalog/services/category/createCategory.d.ts +28 -2
  220. package/dist/modules/catalog/services/category/createCategory.js +18 -1
  221. package/dist/modules/catalog/services/category/createCategory.js.map +1 -1
  222. package/dist/modules/catalog/services/category/deleteCategory.d.ts +7 -1
  223. package/dist/modules/catalog/services/category/deleteCategory.js +13 -1
  224. package/dist/modules/catalog/services/category/deleteCategory.js.map +1 -1
  225. package/dist/modules/catalog/services/category/updateCategory.d.ts +25 -1
  226. package/dist/modules/catalog/services/category/updateCategory.js +26 -4
  227. package/dist/modules/catalog/services/category/updateCategory.js.map +1 -1
  228. package/dist/modules/catalog/services/collection/createCollection.d.ts +12 -3
  229. package/dist/modules/catalog/services/collection/createCollection.js +20 -20
  230. package/dist/modules/catalog/services/collection/createCollection.js.map +1 -1
  231. package/dist/modules/catalog/services/collection/deleteCollection.d.ts +7 -1
  232. package/dist/modules/catalog/services/collection/deleteCollection.js +13 -1
  233. package/dist/modules/catalog/services/collection/deleteCollection.js.map +1 -1
  234. package/dist/modules/catalog/services/collection/updateCollection.d.ts +9 -1
  235. package/dist/modules/catalog/services/collection/updateCollection.js +22 -24
  236. package/dist/modules/catalog/services/collection/updateCollection.js.map +1 -1
  237. package/dist/modules/catalog/services/index.d.ts +29 -18
  238. package/dist/modules/catalog/services/index.js +35 -18
  239. package/dist/modules/catalog/services/index.js.map +1 -1
  240. package/dist/modules/catalog/services/product/createProduct.d.ts +56 -4
  241. package/dist/modules/catalog/services/product/createProduct.js +36 -1
  242. package/dist/modules/catalog/services/product/createProduct.js.map +1 -1
  243. package/dist/modules/catalog/services/product/deleteProduct.d.ts +7 -2
  244. package/dist/modules/catalog/services/product/deleteProduct.js +13 -1
  245. package/dist/modules/catalog/services/product/deleteProduct.js.map +1 -1
  246. package/dist/modules/catalog/services/product/updateProduct.d.ts +58 -2
  247. package/dist/modules/catalog/services/product/updateProduct.js +43 -4
  248. package/dist/modules/catalog/services/product/updateProduct.js.map +1 -1
  249. package/dist/modules/checkout/pages/frontStore/cart/ShoppingCart.js +1 -3
  250. package/dist/modules/checkout/pages/frontStore/cart/ShoppingCart.js.map +1 -1
  251. package/dist/modules/checkout/pages/frontStore/checkout/Checkout.js +3 -1
  252. package/dist/modules/checkout/pages/frontStore/checkout/Checkout.js.map +1 -1
  253. package/dist/modules/checkout/services/addBillingAddress.d.ts +15 -0
  254. package/dist/modules/checkout/services/addBillingAddress.js +24 -6
  255. package/dist/modules/checkout/services/addBillingAddress.js.map +1 -1
  256. package/dist/modules/checkout/services/addCartItem.d.ts +12 -0
  257. package/dist/modules/checkout/services/addCartItem.js +7 -1
  258. package/dist/modules/checkout/services/addCartItem.js.map +1 -1
  259. package/dist/modules/checkout/services/addShippingAddress.d.ts +13 -0
  260. package/dist/modules/checkout/services/addShippingAddress.js +18 -6
  261. package/dist/modules/checkout/services/addShippingAddress.js.map +1 -1
  262. package/dist/modules/checkout/services/checkout.d.ts +19 -1
  263. package/dist/modules/checkout/services/checkout.js +12 -6
  264. package/dist/modules/checkout/services/checkout.js.map +1 -1
  265. package/dist/modules/checkout/services/index.d.ts +5 -3
  266. package/dist/modules/checkout/services/index.js +5 -3
  267. package/dist/modules/checkout/services/index.js.map +1 -1
  268. package/dist/modules/checkout/services/orderCreator.d.ts +48 -0
  269. package/dist/modules/checkout/services/orderCreator.js +25 -1
  270. package/dist/modules/checkout/services/orderCreator.js.map +1 -1
  271. package/dist/modules/checkout/services/removeCartItem.d.ts +8 -0
  272. package/dist/modules/checkout/services/removeCartItem.js +7 -1
  273. package/dist/modules/checkout/services/removeCartItem.js.map +1 -1
  274. package/dist/modules/checkout/services/updateCartItemQty.d.ts +14 -0
  275. package/dist/modules/checkout/services/updateCartItemQty.js +7 -1
  276. package/dist/modules/checkout/services/updateCartItemQty.js.map +1 -1
  277. package/dist/modules/cms/api/createCmsPage/[context]bodyParser[auth].d.ts +1 -1
  278. package/dist/modules/cms/api/createCmsPage/[context]bodyParser[auth].js.map +1 -1
  279. package/dist/modules/cms/api/createCmsPage/createPage[finish].d.ts +3 -1
  280. package/dist/modules/cms/api/createCmsPage/createPage[finish].js +1 -1
  281. package/dist/modules/cms/api/createCmsPage/createPage[finish].js.map +1 -1
  282. package/dist/modules/cms/api/createCmsPage/finish[apiResponse].d.ts +3 -1
  283. package/dist/modules/cms/api/createCmsPage/finish[apiResponse].js +2 -2
  284. package/dist/modules/cms/api/createCmsPage/finish[apiResponse].js.map +1 -1
  285. package/dist/modules/cms/api/createCmsPage/payloadSchema.json +76 -0
  286. package/dist/modules/cms/api/deleteCmsPage/deleteCmsPage.d.ts +3 -1
  287. package/dist/modules/cms/api/deleteCmsPage/deleteCmsPage.js +1 -1
  288. package/dist/modules/cms/api/deleteCmsPage/deleteCmsPage.js.map +1 -1
  289. package/dist/modules/cms/api/updateCmsPage/[context]bodyParser[auth].d.ts +1 -1
  290. package/dist/modules/cms/api/updateCmsPage/[context]bodyParser[auth].js.map +1 -1
  291. package/dist/modules/cms/api/updateCmsPage/finish[apiResponse].d.ts +3 -1
  292. package/dist/modules/cms/api/updateCmsPage/finish[apiResponse].js +2 -2
  293. package/dist/modules/cms/api/updateCmsPage/finish[apiResponse].js.map +1 -1
  294. package/dist/modules/cms/api/updateCmsPage/payloadSchema.json +76 -0
  295. package/dist/modules/cms/api/updateCmsPage/updatePage[finish].d.ts +2 -1
  296. package/dist/modules/cms/api/updateCmsPage/updatePage[finish].js.map +1 -1
  297. package/dist/modules/cms/bootstrap.d.ts +1 -1
  298. package/dist/modules/cms/bootstrap.js +18 -0
  299. package/dist/modules/cms/bootstrap.js.map +1 -1
  300. package/dist/modules/cms/components/BasicMenu.js +1 -1
  301. package/dist/modules/cms/components/BasicMenu.js.map +1 -1
  302. package/dist/modules/cms/graphql/types/CmsPage/CmsPage.resolvers.js +0 -18
  303. package/dist/modules/cms/graphql/types/CmsPage/CmsPage.resolvers.js.map +1 -1
  304. package/dist/modules/cms/graphql/types/Widget/Widget.resolvers.js +0 -17
  305. package/dist/modules/cms/graphql/types/Widget/Widget.resolvers.js.map +1 -1
  306. package/dist/modules/cms/services/index.d.ts +3 -0
  307. package/dist/modules/cms/services/index.js +3 -0
  308. package/dist/modules/cms/services/index.js.map +1 -1
  309. package/dist/modules/cms/services/page/createPage.d.ts +18 -2
  310. package/dist/modules/cms/services/page/createPage.js +25 -7
  311. package/dist/modules/cms/services/page/createPage.js.map +1 -1
  312. package/dist/modules/cms/services/page/deletePage.d.ts +6 -2
  313. package/dist/modules/cms/services/page/deletePage.js +18 -6
  314. package/dist/modules/cms/services/page/deletePage.js.map +1 -1
  315. package/dist/modules/cms/services/page/pageDataSchema.json +9 -1
  316. package/dist/modules/cms/services/page/updatePage.d.ts +22 -1
  317. package/dist/modules/cms/services/page/updatePage.js +19 -2
  318. package/dist/modules/cms/services/page/updatePage.js.map +1 -1
  319. package/dist/modules/cms/services/widget/createWidget.d.ts +12 -1
  320. package/dist/modules/cms/services/widget/createWidget.js +14 -2
  321. package/dist/modules/cms/services/widget/createWidget.js.map +1 -1
  322. package/dist/modules/cms/services/widget/deleteWidget.d.ts +7 -1
  323. package/dist/modules/cms/services/widget/deleteWidget.js +13 -1
  324. package/dist/modules/cms/services/widget/deleteWidget.js.map +1 -1
  325. package/dist/modules/cms/services/widget/updateWidget.d.ts +7 -1
  326. package/dist/modules/cms/services/widget/updateWidget.js +15 -3
  327. package/dist/modules/cms/services/widget/updateWidget.js.map +1 -1
  328. package/dist/modules/cod/pages/frontStore/checkout/CashOnDelivery.js +2 -2
  329. package/dist/modules/cod/pages/frontStore/checkout/CashOnDelivery.js.map +1 -1
  330. package/dist/modules/customer/api/refreshCustomerToken/refreshToken.js +4 -6
  331. package/dist/modules/customer/api/refreshCustomerToken/refreshToken.js.map +1 -1
  332. package/dist/modules/customer/pages/frontStore/login/LoginPage.js +10 -9
  333. package/dist/modules/customer/pages/frontStore/login/LoginPage.js.map +1 -1
  334. package/dist/modules/customer/pages/frontStore/register/RegisterPage.js +14 -13
  335. package/dist/modules/customer/pages/frontStore/register/RegisterPage.js.map +1 -1
  336. package/dist/modules/customer/services/customer/address/createCustomerAddress.d.ts +13 -0
  337. package/dist/modules/customer/services/customer/address/createCustomerAddress.js +13 -1
  338. package/dist/modules/customer/services/customer/address/createCustomerAddress.js.map +1 -1
  339. package/dist/modules/customer/services/customer/address/deleteCustomerAddress.d.ts +5 -0
  340. package/dist/modules/customer/services/customer/address/deleteCustomerAddress.js +13 -1
  341. package/dist/modules/customer/services/customer/address/deleteCustomerAddress.js.map +1 -1
  342. package/dist/modules/customer/services/customer/address/updateCustomerAddress.d.ts +13 -0
  343. package/dist/modules/customer/services/customer/address/updateCustomerAddress.js +13 -1
  344. package/dist/modules/customer/services/customer/address/updateCustomerAddress.js.map +1 -1
  345. package/dist/modules/customer/services/customer/buildCustomerPayload.d.ts +8 -0
  346. package/dist/modules/customer/services/customer/buildCustomerPayload.js +19 -0
  347. package/dist/modules/customer/services/customer/buildCustomerPayload.js.map +1 -0
  348. package/dist/modules/customer/services/customer/createCustomer.d.ts +19 -1
  349. package/dist/modules/customer/services/customer/createCustomer.js +17 -4
  350. package/dist/modules/customer/services/customer/createCustomer.js.map +1 -1
  351. package/dist/modules/customer/services/customer/deleteCustomer.d.ts +7 -2
  352. package/dist/modules/customer/services/customer/deleteCustomer.js +13 -1
  353. package/dist/modules/customer/services/customer/deleteCustomer.js.map +1 -1
  354. package/dist/modules/customer/services/customer/loginCustomerWithEmail.js +3 -4
  355. package/dist/modules/customer/services/customer/loginCustomerWithEmail.js.map +1 -1
  356. package/dist/modules/customer/services/customer/updateCustomer.d.ts +23 -1
  357. package/dist/modules/customer/services/customer/updateCustomer.js +13 -1
  358. package/dist/modules/customer/services/customer/updateCustomer.js.map +1 -1
  359. package/dist/modules/customer/services/customer/updatePassword.d.ts +13 -0
  360. package/dist/modules/customer/services/customer/updatePassword.js +13 -1
  361. package/dist/modules/customer/services/customer/updatePassword.js.map +1 -1
  362. package/dist/modules/customer/services/index.d.ts +17 -11
  363. package/dist/modules/customer/services/index.js +26 -11
  364. package/dist/modules/customer/services/index.js.map +1 -1
  365. package/dist/modules/oms/bootstrap.js +8 -8
  366. package/dist/modules/oms/bootstrap.js.map +1 -1
  367. package/dist/modules/oms/services/addOrderActivityLog.d.ts +20 -0
  368. package/dist/modules/oms/services/addOrderActivityLog.js +7 -1
  369. package/dist/modules/oms/services/addOrderActivityLog.js.map +1 -1
  370. package/dist/modules/oms/services/addPaymentTransaction.d.ts +3 -0
  371. package/dist/modules/oms/services/addPaymentTransaction.js +16 -0
  372. package/dist/modules/oms/services/addPaymentTransaction.js.map +1 -0
  373. package/dist/modules/oms/services/cancelOrder.d.ts +61 -0
  374. package/dist/modules/oms/services/cancelOrder.js +31 -1
  375. package/dist/modules/oms/services/cancelOrder.js.map +1 -1
  376. package/dist/modules/oms/services/createShipment.d.ts +20 -0
  377. package/dist/modules/oms/services/createShipment.js +7 -1
  378. package/dist/modules/oms/services/createShipment.js.map +1 -1
  379. package/dist/modules/oms/services/index.d.ts +4 -0
  380. package/dist/modules/oms/services/index.js +4 -0
  381. package/dist/modules/oms/services/index.js.map +1 -1
  382. package/dist/modules/oms/services/orderLoader.d.ts +8 -0
  383. package/dist/modules/oms/services/orderLoader.js +57 -0
  384. package/dist/modules/oms/services/orderLoader.js.map +1 -0
  385. package/dist/modules/oms/services/statusManager.d.ts +54 -0
  386. package/dist/modules/oms/services/statusManager.js +101 -0
  387. package/dist/modules/oms/services/statusManager.js.map +1 -0
  388. package/dist/modules/oms/services/updateOrderStatus.d.ts +37 -0
  389. package/dist/modules/oms/services/updateOrderStatus.js +34 -9
  390. package/dist/modules/oms/services/updateOrderStatus.js.map +1 -1
  391. package/dist/modules/oms/services/updatePaymentStatus.d.ts +26 -0
  392. package/dist/modules/oms/services/updatePaymentStatus.js +13 -1
  393. package/dist/modules/oms/services/updatePaymentStatus.js.map +1 -1
  394. package/dist/modules/oms/services/updateShipmentStatus.d.ts +26 -0
  395. package/dist/modules/oms/services/updateShipmentStatus.js +13 -1
  396. package/dist/modules/oms/services/updateShipmentStatus.js.map +1 -1
  397. package/dist/modules/paypal/api/paypalAuthorizePayment/[bodyParser]authorize.js +1 -1
  398. package/dist/modules/paypal/api/paypalAuthorizePayment/[bodyParser]authorize.js.map +1 -1
  399. package/dist/modules/paypal/api/paypalCaptureAuthorizedPayment/[bodyParser]capture.js +2 -2
  400. package/dist/modules/paypal/api/paypalCaptureAuthorizedPayment/[bodyParser]capture.js.map +1 -1
  401. package/dist/modules/paypal/api/paypalCapturePayment/[bodyParser]capture.js +1 -1
  402. package/dist/modules/paypal/api/paypalCapturePayment/[bodyParser]capture.js.map +1 -1
  403. package/dist/modules/paypal/bootstrap.d.ts +1 -1
  404. package/dist/modules/paypal/bootstrap.js +22 -2
  405. package/dist/modules/paypal/bootstrap.js.map +1 -1
  406. package/dist/modules/paypal/graphql/types/PaypalSetting/PaypalSetting.admin.resolvers.d.ts +1 -1
  407. package/dist/modules/paypal/migration/Version-1.0.0.d.ts +3 -0
  408. package/dist/modules/paypal/migration/Version-1.0.0.js +19 -0
  409. package/dist/modules/paypal/migration/Version-1.0.0.js.map +1 -0
  410. package/dist/modules/paypal/pages/admin/orderEdit/PaypalCaptureButton.js +1 -1
  411. package/dist/modules/paypal/pages/admin/orderEdit/PaypalCaptureButton.js.map +1 -1
  412. package/dist/modules/paypal/pages/frontStore/checkout/Paypal.js +8 -3
  413. package/dist/modules/paypal/pages/frontStore/checkout/Paypal.js.map +1 -1
  414. package/dist/modules/promotion/api/createCoupon/createCoupon[finish].d.ts +1 -1
  415. package/dist/modules/promotion/api/updateCoupon/updateCoupon[finish].d.ts +1 -1
  416. package/dist/modules/promotion/services/coupon/createCoupon.d.ts +45 -1
  417. package/dist/modules/promotion/services/coupon/createCoupon.js +17 -5
  418. package/dist/modules/promotion/services/coupon/createCoupon.js.map +1 -1
  419. package/dist/modules/promotion/services/coupon/deleteCoupon.d.ts +8 -1
  420. package/dist/modules/promotion/services/coupon/deleteCoupon.js +16 -4
  421. package/dist/modules/promotion/services/coupon/deleteCoupon.js.map +1 -1
  422. package/dist/modules/promotion/services/coupon/updateCoupon.d.ts +8 -1
  423. package/dist/modules/promotion/services/coupon/updateCoupon.js +27 -13
  424. package/dist/modules/promotion/services/coupon/updateCoupon.js.map +1 -1
  425. package/dist/modules/promotion/services/index.d.ts +6 -0
  426. package/dist/modules/promotion/services/index.js +10 -0
  427. package/dist/modules/promotion/services/index.js.map +1 -0
  428. package/dist/modules/setting/services/setting.d.ts +10 -1
  429. package/dist/modules/setting/services/setting.js +27 -0
  430. package/dist/modules/setting/services/setting.js.map +1 -1
  431. package/dist/modules/stripe/api/capturePaymentIntent/[context]bodyParser[auth].d.ts +1 -1
  432. package/dist/modules/stripe/api/capturePaymentIntent/[context]bodyParser[auth].js.map +1 -1
  433. package/dist/modules/stripe/api/capturePaymentIntent/capturePaymentIntent.d.ts +4 -1
  434. package/dist/modules/stripe/api/capturePaymentIntent/capturePaymentIntent.js +6 -4
  435. package/dist/modules/stripe/api/capturePaymentIntent/capturePaymentIntent.js.map +1 -1
  436. package/dist/modules/stripe/api/createPaymentIntent/[context]bodyParser[auth].d.ts +1 -1
  437. package/dist/modules/stripe/api/createPaymentIntent/[context]bodyParser[auth].js.map +1 -1
  438. package/dist/modules/stripe/api/createPaymentIntent/createPaymentIntent.d.ts +3 -1
  439. package/dist/modules/stripe/api/createPaymentIntent/createPaymentIntent.js +4 -4
  440. package/dist/modules/stripe/api/createPaymentIntent/createPaymentIntent.js.map +1 -1
  441. package/dist/modules/stripe/api/refundPaymentIntent/[context]bodyParser[auth].d.ts +1 -1
  442. package/dist/modules/stripe/api/refundPaymentIntent/[context]bodyParser[auth].js.map +1 -1
  443. package/dist/modules/stripe/api/refundPaymentIntent/refundPaymentIntent.d.ts +1 -1
  444. package/dist/modules/stripe/api/refundPaymentIntent/refundPaymentIntent.js +11 -7
  445. package/dist/modules/stripe/api/refundPaymentIntent/refundPaymentIntent.js.map +1 -1
  446. package/dist/modules/stripe/api/stripeWebHook/[bodyJson]webhook.d.ts +3 -1
  447. package/dist/modules/stripe/api/stripeWebHook/[bodyJson]webhook.js +6 -6
  448. package/dist/modules/stripe/api/stripeWebHook/[bodyJson]webhook.js.map +1 -1
  449. package/dist/modules/stripe/api/stripeWebHook/bodyJson.d.ts +1 -1
  450. package/dist/modules/stripe/api/stripeWebHook/bodyJson.js.map +1 -1
  451. package/dist/modules/stripe/bootstrap.d.ts +1 -1
  452. package/dist/modules/stripe/bootstrap.js +31 -15
  453. package/dist/modules/stripe/bootstrap.js.map +1 -1
  454. package/dist/modules/stripe/graphql/types/StripeSetting/StripeSetting.resolvers.d.ts +1 -1
  455. package/dist/modules/stripe/migration/Version-1.0.0.d.ts +3 -0
  456. package/dist/modules/stripe/migration/Version-1.0.0.js +19 -0
  457. package/dist/modules/stripe/migration/Version-1.0.0.js.map +1 -0
  458. package/dist/modules/stripe/pages/admin/orderEdit/StripeCaptureButton.js +1 -1
  459. package/dist/modules/stripe/pages/admin/orderEdit/StripeCaptureButton.js.map +1 -1
  460. package/dist/modules/stripe/pages/admin/orderEdit/StripeRefundButton.js +7 -3
  461. package/dist/modules/stripe/pages/admin/orderEdit/StripeRefundButton.js.map +1 -1
  462. package/dist/modules/stripe/pages/frontStore/checkout/Stripe.js +16 -7
  463. package/dist/modules/stripe/pages/frontStore/checkout/Stripe.js.map +1 -1
  464. package/dist/modules/stripe/pages/frontStore/stripeReturn/index.d.ts +3 -1
  465. package/dist/modules/stripe/pages/frontStore/stripeReturn/index.js +8 -4
  466. package/dist/modules/stripe/pages/frontStore/stripeReturn/index.js.map +1 -1
  467. package/dist/modules/stripe/services/cancelPayment.d.ts +1 -1
  468. package/dist/modules/stripe/services/cancelPayment.js +3 -3
  469. package/dist/modules/stripe/services/cancelPayment.js.map +1 -1
  470. package/dist/types/apiResponse.d.ts +1 -1
  471. package/dist/types/appContext.d.ts +7 -4
  472. package/dist/types/customerAddress.d.ts +1 -1
  473. package/dist/types/db/index.d.ts +61 -61
  474. package/dist/types/event.d.ts +27 -14
  475. package/dist/types/registry.d.ts +119 -0
  476. package/dist/types/registry.js +2 -0
  477. package/dist/types/registry.js.map +1 -0
  478. package/dist/types/widget.d.ts +3 -0
  479. package/package.json +21 -12
  480. package/src/components/common/Area.tsx +256 -40
  481. package/src/components/common/Editor.tsx +6 -3
  482. package/src/components/common/ExtendableTable.tsx +1 -1
  483. package/src/components/common/StaticImage.tsx +2 -2
  484. package/src/components/common/form/Editor.scss +3 -1
  485. package/src/components/common/form/ReactSelectCreatableField.tsx +1 -1
  486. package/src/components/common/form/SelectField.tsx +1 -1
  487. package/src/components/common/ui/Item.tsx +1 -1
  488. package/src/components/common/ui/Sonner.tsx +43 -0
  489. package/src/components/frontStore/Footer.tsx +2 -0
  490. package/src/components/frontStore/Pagination.tsx +1 -1
  491. package/src/components/frontStore/cart/CartContext.tsx +2 -2
  492. package/src/components/frontStore/cart/DefaultCartItemList.tsx +5 -5
  493. package/src/components/frontStore/cart/DefaultMiniCartDropdown.tsx +7 -37
  494. package/src/components/frontStore/cart/DefaultMinicartDropdownSummary.tsx +57 -0
  495. package/src/components/frontStore/catalog/CategoryInfo.tsx +2 -2
  496. package/src/components/frontStore/catalog/DefaultCategoryFilterRender.tsx +1 -1
  497. package/src/components/frontStore/catalog/DefaultProductFilterRender.tsx +3 -3
  498. package/src/components/frontStore/catalog/ProductSorting.tsx +13 -4
  499. package/src/components/frontStore/catalog/SearchBox.tsx +1 -1
  500. package/src/components/frontStore/checkout/CheckoutButton.tsx +40 -31
  501. package/src/components/frontStore/checkout/CheckoutContext.tsx +55 -36
  502. package/src/components/frontStore/checkout/ContactInformation.tsx +28 -23
  503. package/src/components/frontStore/checkout/Payment.tsx +36 -27
  504. package/src/components/frontStore/checkout/Shipment.tsx +35 -28
  505. package/src/components/frontStore/checkout/payment/PaymentMethods.tsx +1 -1
  506. package/src/components/frontStore/checkout/shipment/ShippingMethods.tsx +6 -2
  507. package/src/components/frontStore/customer/CustomerContext.tsx +5 -5
  508. package/src/components/frontStore/customer/RegistrationForm.tsx +1 -1
  509. package/src/components/frontStore/customer/address/addressForm/AddressForm.tsx +1 -0
  510. package/src/lib/componee/scanForComponents.ts +0 -1
  511. package/src/lib/event/EventProcessor.ts +78 -0
  512. package/src/lib/event/EventStorage.ts +74 -0
  513. package/src/lib/event/callSubscibers.ts +13 -0
  514. package/src/lib/event/event-manager.ts +96 -0
  515. package/src/lib/event/{loadSubscribers.js → loadSubscribers.ts} +20 -8
  516. package/src/lib/event/tests/unit/EventProcessor.test.js +262 -0
  517. package/src/lib/event/tests/unit/callSubscribers.test.js +77 -0
  518. package/src/lib/mail/emailHelper.ts +2 -2
  519. package/src/lib/postgres/connection.ts +11 -7
  520. package/src/lib/postgres/query.ts +582 -0
  521. package/src/lib/util/getConfig.ts +6 -6
  522. package/src/lib/util/registry.ts +31 -0
  523. package/src/lib/util/sanitizeHtml.ts +59 -0
  524. package/src/lib/webpack/loaders/AreaLoader.js +0 -1
  525. package/src/lib/webpack/util/getTailwindSources.ts +1 -1
  526. package/src/modules/auth/api/refreshUserToken/refreshToken.ts +4 -6
  527. package/src/modules/auth/bootstrap.ts +33 -0
  528. package/src/modules/auth/services/buildAdminUserPayload.ts +22 -0
  529. package/src/modules/auth/services/loginUserWithEmail.ts +36 -6
  530. package/src/modules/auth/services/logoutUser.ts +22 -1
  531. package/src/modules/base/api/global/{[apiResponse]apiErrorHandler.js → [apiResponse]apiErrorHandler.ts} +8 -1
  532. package/src/modules/base/api/global/{[auth]apiResponse[apiErrorHandler].js → [auth]apiResponse[apiErrorHandler].ts} +7 -1
  533. package/src/modules/base/api/global/{[auth]payloadValidate.js → [auth]payloadValidate.ts} +10 -3
  534. package/src/modules/base/api/global/[payloadValidate]escapeHtml.ts +12 -0
  535. package/src/modules/base/migration/Version-1.0.2.js +37 -0
  536. package/src/modules/base/pages/admin/all/global.scss +1 -1
  537. package/src/modules/base/services/{escapePayload.js → escapePayload.ts} +17 -11
  538. package/src/modules/base/services/markSkipEscape.ts +43 -0
  539. package/src/modules/catalog/api/createCategory/createCategory[finish].ts +10 -0
  540. package/src/modules/catalog/api/createCategory/{finish[apiResponse].js → finish[apiResponse].ts} +13 -4
  541. package/src/modules/catalog/api/createCategory/payloadSchema.json +76 -0
  542. package/src/modules/catalog/api/createCollection/{createCollection[finish].js → createCollection[finish].ts} +2 -1
  543. package/src/modules/catalog/api/{updateCollection/finish[apiResponse].js → createCollection/finish[apiResponse].ts} +12 -3
  544. package/src/modules/catalog/api/createCollection/payloadSchema.json +94 -0
  545. package/src/modules/catalog/api/createProduct/createProduct[finish].ts +10 -0
  546. package/src/modules/catalog/api/createProduct/{finish[apiResponse].js → finish[apiResponse].ts} +13 -4
  547. package/src/modules/catalog/api/createProduct/payloadSchema.json +76 -0
  548. package/src/modules/catalog/api/updateCategory/{finish[apiResponse].js → finish[apiResponse].ts} +13 -4
  549. package/src/modules/catalog/api/updateCategory/payloadSchema.json +76 -0
  550. package/src/modules/catalog/api/updateCategory/updateCategory[finish].ts +14 -0
  551. package/src/modules/catalog/api/{createCollection/finish[apiResponse].js → updateCollection/finish[apiResponse].ts} +12 -3
  552. package/src/modules/catalog/api/updateCollection/payloadSchema.json +94 -0
  553. package/src/modules/catalog/api/updateCollection/updateCollection[finish].ts +14 -0
  554. package/src/modules/catalog/api/updateProduct/{finish[apiResponse].js → finish[apiResponse].ts} +13 -4
  555. package/src/modules/catalog/api/updateProduct/payloadSchema.json +76 -0
  556. package/src/modules/catalog/api/updateProduct/updateProduct[finish].ts +14 -0
  557. package/src/modules/catalog/graphql/types/Category/{Category.resolvers.js → Category.resolvers.ts} +0 -21
  558. package/src/modules/catalog/graphql/types/Collection/Collection.resolvers.js +1 -8
  559. package/src/modules/catalog/graphql/types/Product/Product.resolvers.ts +0 -20
  560. package/src/modules/catalog/pages/admin/productEdit/variants/CreateVariant.tsx +6 -2
  561. package/src/modules/catalog/pages/admin/productEdit/variants/CreateVariantGroup.tsx +22 -11
  562. package/src/modules/catalog/pages/admin/productEdit/variants/EditVariant.tsx +10 -3
  563. package/src/modules/catalog/pages/admin/productEdit/variants/New.tsx +8 -23
  564. package/src/modules/catalog/pages/admin/productEdit/variants/VariantModal.tsx +10 -2
  565. package/src/modules/catalog/pages/admin/productEdit+productNew/General.tsx +5 -2
  566. package/src/modules/catalog/pages/frontStore/categoryView/CategoryView.tsx +4 -8
  567. package/src/modules/catalog/pages/frontStore/productView/ProductView.tsx +10 -1
  568. package/src/modules/catalog/services/attribute/createProductAttribute.ts +146 -8
  569. package/src/modules/catalog/services/attribute/deleteProductAttribute.ts +58 -4
  570. package/src/modules/catalog/services/attribute/updateProductAttribute.ts +128 -12
  571. package/src/modules/catalog/services/category/createCategory.ts +66 -6
  572. package/src/modules/catalog/services/category/deleteCategory.ts +61 -4
  573. package/src/modules/catalog/services/category/updateCategory.ts +75 -10
  574. package/src/modules/catalog/services/collection/createCollection.ts +71 -30
  575. package/src/modules/catalog/services/collection/deleteCollection.ts +58 -4
  576. package/src/modules/catalog/services/collection/updateCollection.ts +70 -35
  577. package/src/modules/catalog/services/index.ts +46 -35
  578. package/src/modules/catalog/services/product/createProduct.ts +155 -11
  579. package/src/modules/catalog/services/product/deleteProduct.ts +58 -4
  580. package/src/modules/catalog/services/product/updateProduct.ts +168 -17
  581. package/src/modules/checkout/pages/frontStore/cart/ShoppingCart.tsx +0 -2
  582. package/src/modules/checkout/pages/frontStore/checkout/Checkout.tsx +2 -0
  583. package/src/modules/checkout/services/addBillingAddress.ts +74 -6
  584. package/src/modules/checkout/services/addCartItem.ts +31 -1
  585. package/src/modules/checkout/services/addShippingAddress.ts +54 -6
  586. package/src/modules/checkout/services/checkout.ts +35 -7
  587. package/src/modules/checkout/services/index.ts +17 -3
  588. package/src/modules/checkout/services/orderCreator.ts +105 -1
  589. package/src/modules/checkout/services/removeCartItem.ts +27 -1
  590. package/src/modules/checkout/services/updateCartItemQty.ts +33 -1
  591. package/src/modules/cms/api/createCmsPage/createPage[finish].ts +12 -0
  592. package/src/modules/cms/api/createCmsPage/{finish[apiResponse].js → finish[apiResponse].ts} +10 -4
  593. package/src/modules/cms/api/createCmsPage/payloadSchema.json +76 -0
  594. package/src/modules/cms/api/deleteCmsPage/{deleteCmsPage.js → deleteCmsPage.ts} +8 -2
  595. package/src/modules/cms/api/updateCmsPage/{finish[apiResponse].js → finish[apiResponse].ts} +10 -4
  596. package/src/modules/cms/api/updateCmsPage/payloadSchema.json +76 -0
  597. package/src/modules/cms/api/updateCmsPage/{updatePage[finish].js → updatePage[finish].ts} +2 -1
  598. package/src/modules/cms/{bootstrap.js → bootstrap.ts} +24 -3
  599. package/src/modules/cms/components/BasicMenu.tsx +1 -1
  600. package/src/modules/cms/graphql/types/CmsPage/CmsPage.resolvers.ts +0 -21
  601. package/src/modules/cms/graphql/types/Widget/Widget.resolvers.js +0 -20
  602. package/src/modules/cms/services/index.ts +3 -0
  603. package/src/modules/cms/services/page/{createPage.js → createPage.ts} +65 -8
  604. package/src/modules/cms/services/page/deletePage.ts +109 -0
  605. package/src/modules/cms/services/page/pageDataSchema.json +9 -1
  606. package/src/modules/cms/services/page/{updatePage.js → updatePage.ts} +68 -6
  607. package/src/modules/cms/services/widget/createWidget.ts +120 -0
  608. package/src/modules/cms/services/widget/deleteWidget.ts +97 -0
  609. package/src/modules/cms/services/widget/updateWidget.js +17 -1
  610. package/src/modules/cms/services/widget/updateWidget.ts +139 -0
  611. package/src/modules/cod/pages/frontStore/checkout/CashOnDelivery.tsx +4 -2
  612. package/src/modules/customer/api/refreshCustomerToken/refreshToken.ts +4 -6
  613. package/src/modules/customer/pages/frontStore/login/LoginPage.tsx +26 -24
  614. package/src/modules/customer/pages/frontStore/register/RegisterPage.tsx +24 -22
  615. package/src/modules/customer/services/customer/address/createCustomerAddress.ts +54 -2
  616. package/src/modules/customer/services/customer/address/deleteCustomerAddress.ts +49 -2
  617. package/src/modules/customer/services/customer/address/updateCustomerAddress.ts +55 -3
  618. package/src/modules/customer/services/customer/buildCustomerPayload.ts +20 -0
  619. package/src/modules/customer/services/customer/createCustomer.ts +60 -7
  620. package/src/modules/customer/services/customer/deleteCustomer.ts +55 -5
  621. package/src/modules/customer/services/customer/loginCustomerWithEmail.ts +3 -4
  622. package/src/modules/customer/services/customer/updateCustomer.ts +62 -5
  623. package/src/modules/customer/services/customer/updatePassword.ts +56 -3
  624. package/src/modules/customer/services/index.ts +34 -27
  625. package/src/modules/oms/bootstrap.ts +9 -8
  626. package/src/modules/oms/services/addOrderActivityLog.ts +31 -1
  627. package/src/modules/oms/services/addPaymentTransaction.ts +26 -0
  628. package/src/modules/oms/services/cancelOrder.ts +131 -1
  629. package/src/modules/oms/services/createShipment.ts +31 -1
  630. package/src/modules/oms/services/index.ts +4 -0
  631. package/src/modules/oms/services/orderLoader.ts +73 -0
  632. package/src/modules/oms/services/statusManager.ts +159 -0
  633. package/src/modules/oms/services/updateOrderStatus.ts +101 -9
  634. package/src/modules/oms/services/updatePaymentStatus.ts +53 -1
  635. package/src/modules/oms/services/updateShipmentStatus.ts +53 -1
  636. package/src/modules/paypal/api/paypalAuthorizePayment/[bodyParser]authorize.ts +1 -1
  637. package/src/modules/paypal/api/paypalCaptureAuthorizedPayment/[bodyParser]capture.ts +10 -2
  638. package/src/modules/paypal/api/paypalCapturePayment/[bodyParser]capture.ts +5 -1
  639. package/src/modules/paypal/{bootstrap.js → bootstrap.ts} +23 -2
  640. package/src/modules/paypal/migration/Version-1.0.0.ts +24 -0
  641. package/src/modules/paypal/pages/admin/orderEdit/PaypalCaptureButton.tsx +1 -1
  642. package/src/modules/paypal/pages/frontStore/checkout/Paypal.tsx +9 -3
  643. package/src/modules/promotion/services/coupon/createCoupon.ts +147 -0
  644. package/src/modules/promotion/services/coupon/deleteCoupon.ts +100 -0
  645. package/src/modules/promotion/services/coupon/updateCoupon.ts +130 -0
  646. package/src/modules/promotion/services/index.ts +11 -0
  647. package/src/modules/setting/services/setting.ts +40 -2
  648. package/src/modules/stripe/api/capturePaymentIntent/{capturePaymentIntent.js → capturePaymentIntent.ts} +14 -5
  649. package/src/modules/stripe/api/createPaymentIntent/{createPaymentIntent.js → createPaymentIntent.ts} +11 -5
  650. package/src/modules/stripe/api/refundPaymentIntent/{refundPaymentIntent.js → refundPaymentIntent.ts} +11 -7
  651. package/src/modules/stripe/api/stripeWebHook/{[bodyJson]webhook.js → [bodyJson]webhook.ts} +30 -10
  652. package/src/modules/stripe/{bootstrap.js → bootstrap.ts} +40 -15
  653. package/src/modules/stripe/migration/Version-1.0.0.ts +24 -0
  654. package/src/modules/stripe/pages/admin/orderEdit/StripeCaptureButton.jsx +1 -1
  655. package/src/modules/stripe/pages/admin/orderEdit/StripeRefundButton.tsx +9 -3
  656. package/src/modules/stripe/pages/frontStore/checkout/Stripe.tsx +16 -7
  657. package/src/modules/stripe/pages/frontStore/stripeReturn/{index.js → index.ts} +15 -5
  658. package/src/modules/stripe/services/{cancelPayment.js → cancelPayment.ts} +4 -4
  659. package/src/types/apiResponse.ts +1 -1
  660. package/src/types/appContext.tsx +9 -4
  661. package/src/types/customerAddress.ts +1 -1
  662. package/src/types/db/index.ts +61 -61
  663. package/src/types/event.ts +29 -15
  664. package/src/types/registry.ts +160 -0
  665. package/src/types/widget.ts +3 -0
  666. package/src/lib/event/callSubscibers.js +0 -19
  667. package/src/lib/event/event-manager.js +0 -134
  668. package/src/modules/auth/bootstrap.js +0 -28
  669. package/src/modules/base/api/global/[payloadValidate]escapeHtml.js +0 -12
  670. package/src/modules/base/services/markSkipEscape.js +0 -30
  671. package/src/modules/catalog/api/createCategory/createCategory[finish].js +0 -8
  672. package/src/modules/catalog/api/createProduct/createProduct[finish].js +0 -8
  673. package/src/modules/catalog/api/updateCategory/updateCategory[finish].js +0 -8
  674. package/src/modules/catalog/api/updateCollection/updateCollection[finish].js +0 -8
  675. package/src/modules/catalog/api/updateProduct/updateProduct[finish].js +0 -8
  676. package/src/modules/cms/api/createCmsPage/createPage[finish].js +0 -10
  677. package/src/modules/cms/services/page/deletePage.js +0 -55
  678. package/src/modules/cms/services/widget/createWidget.js +0 -71
  679. package/src/modules/cms/services/widget/deleteWidget.js +0 -47
  680. package/src/modules/promotion/services/coupon/createCoupon.js +0 -75
  681. package/src/modules/promotion/services/coupon/deleteCoupon.js +0 -49
  682. package/src/modules/promotion/services/coupon/updateCoupon.js +0 -94
  683. package/src/types/request.d.ts +0 -7
  684. /package/src/modules/catalog/api/createCategory/{[context]bodyParser[auth].js → [context]bodyParser[auth].ts} +0 -0
  685. /package/src/modules/catalog/api/createCollection/{[context]bodyParser[auth].js → [context]bodyParser[auth].ts} +0 -0
  686. /package/src/modules/catalog/api/createProduct/{[context]bodyParser[auth].js → [context]bodyParser[auth].ts} +0 -0
  687. /package/src/modules/catalog/api/updateCategory/{[context]bodyParser[auth].js → [context]bodyParser[auth].ts} +0 -0
  688. /package/src/modules/catalog/api/updateCollection/{[context]bodyParser[auth].js → [context]bodyParser[auth].ts} +0 -0
  689. /package/src/modules/catalog/api/updateProduct/{[context]bodyParser[auth].js → [context]bodyParser[auth].ts} +0 -0
  690. /package/src/modules/cms/api/createCmsPage/{[context]bodyParser[auth].js → [context]bodyParser[auth].ts} +0 -0
  691. /package/src/modules/cms/api/updateCmsPage/{[context]bodyParser[auth].js → [context]bodyParser[auth].ts} +0 -0
  692. /package/src/modules/stripe/api/capturePaymentIntent/{[context]bodyParser[auth].js → [context]bodyParser[auth].ts} +0 -0
  693. /package/src/modules/stripe/api/createPaymentIntent/{[context]bodyParser[auth].js → [context]bodyParser[auth].ts} +0 -0
  694. /package/src/modules/stripe/api/refundPaymentIntent/{[context]bodyParser[auth].js → [context]bodyParser[auth].ts} +0 -0
  695. /package/src/modules/stripe/api/stripeWebHook/{bodyJson.js → bodyJson.ts} +0 -0
@@ -0,0 +1,120 @@
1
+ import {
2
+ commit,
3
+ insert,
4
+ PoolClient,
5
+ rollback,
6
+ startTransaction
7
+ } from '@evershop/postgres-query-builder';
8
+ import { getConnection } from '../../../../lib/postgres/connection.js';
9
+ import { hookable, hookBefore, hookAfter } from '../../../../lib/util/hookable.js';
10
+ import {
11
+ getValue,
12
+ getValueSync
13
+ } from '../../../../lib/util/registry.js';
14
+ import { getAjv } from '../../../base/services/getAjv.js';
15
+ import widgetDataSchema from './widgetDataSchema.json' with { type: 'json' };
16
+
17
+ export type WidgetData = {
18
+ name: string;
19
+ status: number;
20
+ sort_order: number;
21
+ [key: string]: unknown;
22
+ };
23
+
24
+ function validateWidgetDataBeforeInsert(data: WidgetData): WidgetData {
25
+ const ajv = getAjv();
26
+ (widgetDataSchema as any).required = ['status', 'name', 'sort_order'];
27
+ const jsonSchema = getValueSync(
28
+ 'createWidgetDataJsonSchema',
29
+ widgetDataSchema,
30
+ {}
31
+ );
32
+ const validate = ajv.compile(jsonSchema);
33
+ const valid = validate(data);
34
+ if (valid) {
35
+ return data;
36
+ } else {
37
+ throw new Error(validate.errors[0].message);
38
+ }
39
+ }
40
+
41
+ async function insertWidgetData(data: WidgetData, connection: PoolClient) {
42
+ const widget = await insert('widget').given(data).execute(connection);
43
+ return widget;
44
+ }
45
+
46
+ /**
47
+ * Create widget service. This service will create a widget with all related data
48
+ * @param {Object} data
49
+ * @param {Object} context
50
+ */
51
+ async function createWidget(data: WidgetData, context: Record<string, any>) {
52
+ const connection = await getConnection();
53
+ await startTransaction(connection);
54
+ try {
55
+ const widgetData = await getValue('widgetDataBeforeCreate', data);
56
+ // Validate widget data
57
+ validateWidgetDataBeforeInsert(widgetData);
58
+
59
+ // Insert widget data
60
+ const widget = await hookable(insertWidgetData, { ...context, connection })(
61
+ widgetData,
62
+ connection
63
+ );
64
+
65
+ await commit(connection);
66
+ return widget;
67
+ } catch (e) {
68
+ await rollback(connection);
69
+ throw e;
70
+ }
71
+ }
72
+
73
+ export default async (data: WidgetData, context: Record<string, any>) => {
74
+ // Make sure the context is either not provided or is an object
75
+ if (context && typeof context !== 'object') {
76
+ throw new Error('Context must be an object');
77
+ }
78
+ const widget = await hookable(createWidget, context)(data, context);
79
+ return widget;
80
+ };
81
+
82
+ export function hookBeforeInsertWidgetData(
83
+ callback: (
84
+ this: Record<string, any>,
85
+ ...args: [data: WidgetData, connection: PoolClient]
86
+ ) => void | Promise<void>,
87
+ priority: number = 10
88
+ ): void {
89
+ hookBefore('insertWidgetData', callback, priority);
90
+ }
91
+
92
+ export function hookAfterInsertWidgetData(
93
+ callback: (
94
+ this: Record<string, any>,
95
+ ...args: [data: WidgetData, connection: PoolClient]
96
+ ) => void | Promise<void>,
97
+ priority: number = 10
98
+ ): void {
99
+ hookAfter('insertWidgetData', callback, priority);
100
+ }
101
+
102
+ export function hookBeforeCreateWidget(
103
+ callback: (
104
+ this: Record<string, any>,
105
+ ...args: [data: WidgetData, context: Record<string, any>]
106
+ ) => void | Promise<void>,
107
+ priority: number = 10
108
+ ): void {
109
+ hookBefore('createWidget', callback, priority);
110
+ }
111
+
112
+ export function hookAfterCreateWidget(
113
+ callback: (
114
+ this: Record<string, any>,
115
+ ...args: [data: WidgetData, context: Record<string, any>]
116
+ ) => void | Promise<void>,
117
+ priority: number = 10
118
+ ): void {
119
+ hookAfter('createWidget', callback, priority);
120
+ }
@@ -0,0 +1,97 @@
1
+ import {
2
+ commit,
3
+ del,
4
+ PoolClient,
5
+ rollback,
6
+ select,
7
+ startTransaction
8
+ } from '@evershop/postgres-query-builder';
9
+ import { getConnection } from '../../../../lib/postgres/connection.js';
10
+ import {
11
+ hookable,
12
+ hookBefore,
13
+ hookAfter
14
+ } from '../../../../lib/util/hookable.js';
15
+ import { WidgetData } from './createWidget.js';
16
+
17
+ async function deleteWidgetData(uuid: string, connection: PoolClient) {
18
+ await del('widget').where('uuid', '=', uuid).execute(connection);
19
+ }
20
+
21
+ /**
22
+ * Delete widget service. This service will delete a widget with all related data
23
+ * @param {String} uuid
24
+ * @param {Object} context
25
+ */
26
+ async function deleteWidget(uuid: string, context: Record<string, any>) {
27
+ const connection = await getConnection();
28
+ await startTransaction(connection);
29
+ try {
30
+ const query = select().from('widget');
31
+ const widget = await query.where('uuid', '=', uuid).load(connection);
32
+ if (!widget) {
33
+ throw new Error('Invalid widget id');
34
+ }
35
+ await hookable(deleteWidgetData, { ...context, widget, connection })(
36
+ uuid,
37
+ connection
38
+ );
39
+ await commit(connection);
40
+ return widget;
41
+ } catch (e) {
42
+ await rollback(connection);
43
+ throw e;
44
+ }
45
+ }
46
+
47
+ export default async (
48
+ uuid: string,
49
+ context: Record<string, any>
50
+ ): Promise<WidgetData> => {
51
+ // Make sure the context is either not provided or is an object
52
+ if (context && typeof context !== 'object') {
53
+ throw new Error('Context must be an object');
54
+ }
55
+ const widget = await hookable(deleteWidget, context)(uuid, context);
56
+ return widget;
57
+ };
58
+
59
+ export function hookBeforeDeleteWidgetData(
60
+ callback: (
61
+ this: Record<string, any>,
62
+ ...args: [uuid: string, connection: PoolClient]
63
+ ) => void | Promise<void>,
64
+ priority: number = 10
65
+ ): void {
66
+ hookBefore('deleteWidgetData', callback, priority);
67
+ }
68
+
69
+ export function hookAfterDeleteWidgetData(
70
+ callback: (
71
+ this: Record<string, any>,
72
+ ...args: [uuid: string, connection: PoolClient]
73
+ ) => void | Promise<void>,
74
+ priority: number = 10
75
+ ): void {
76
+ hookAfter('deleteWidgetData', callback, priority);
77
+ }
78
+
79
+ export function hookBeforeDeleteWidget(
80
+ callback: (
81
+ this: Record<string, any>,
82
+ ...args: [uuid: string, context: Record<string, any>]
83
+ ) => void | Promise<void>,
84
+ priority: number = 10
85
+ ): void {
86
+ hookBefore('deleteWidget', callback, priority);
87
+ }
88
+
89
+ export function hookAfterDeleteWidget(
90
+ callback: (
91
+ this: Record<string, any>,
92
+ ...args: [uuid: string, context: Record<string, any>]
93
+ ) => void | Promise<void>,
94
+ priority: number = 10
95
+ ): void {
96
+ hookAfter('deleteWidget', callback, priority);
97
+ }
@@ -6,7 +6,7 @@ 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
@@ -82,3 +82,19 @@ export default async (uuid, data, context) => {
82
82
  const widget = await hookable(updateWidget, context)(uuid, data, context);
83
83
  return widget;
84
84
  };
85
+
86
+ export function hookBeforeUpdateWidgetData(callback, priority = 10) {
87
+ hookBefore('updateWidgetData', callback, priority);
88
+ }
89
+
90
+ export function hookAfterUpdateWidgetData(callback, priority = 10) {
91
+ hookAfter('updateWidgetData', callback, priority);
92
+ }
93
+
94
+ export function hookBeforeUpdateWidget(callback, priority = 10) {
95
+ hookBefore('updateWidget', callback, priority);
96
+ }
97
+
98
+ export function hookAfterUpdateWidget(callback, priority = 10) {
99
+ hookAfter('updateWidget', callback, priority);
100
+ }
@@ -0,0 +1,139 @@
1
+ import {
2
+ commit,
3
+ PoolClient,
4
+ rollback,
5
+ select,
6
+ startTransaction,
7
+ update
8
+ } from '@evershop/postgres-query-builder';
9
+ import { getConnection } from '../../../../lib/postgres/connection.js';
10
+ import { hookable, hookBefore, hookAfter } from '../../../../lib/util/hookable.js';
11
+ import {
12
+ getValue,
13
+ getValueSync
14
+ } from '../../../../lib/util/registry.js';
15
+ import { getAjv } from '../../../base/services/getAjv.js';
16
+ import { WidgetData } from './createWidget.js';
17
+ import widgetDataSchema from './widgetDataSchema.json' with { type: 'json' };
18
+
19
+ function validateWidgetDataBeforeInsert(data: Partial<WidgetData>): Partial<WidgetData> {
20
+ const ajv = getAjv();
21
+ (widgetDataSchema as any).required = ['status'];
22
+ const jsonSchema = getValueSync(
23
+ 'updateWidgetDataJsonSchema',
24
+ widgetDataSchema,
25
+ {}
26
+ );
27
+ const validate = ajv.compile(jsonSchema);
28
+ const valid = validate(data);
29
+ if (valid) {
30
+ return data;
31
+ } else {
32
+ throw new Error(validate.errors[0].message);
33
+ }
34
+ }
35
+
36
+ async function updateWidgetData(
37
+ uuid: string,
38
+ data: Partial<WidgetData>,
39
+ connection: PoolClient
40
+ ) {
41
+ const query = select().from('widget');
42
+ const widget = await query.where('uuid', '=', uuid).load(connection);
43
+
44
+ if (!widget) {
45
+ throw new Error('Requested widget not found');
46
+ }
47
+ const newWidget = await update('widget')
48
+ .given(data)
49
+ .where('uuid', '=', uuid)
50
+ .execute(connection);
51
+
52
+ return newWidget;
53
+ }
54
+
55
+ /**
56
+ * Update widget service. This service will update a widget with all related data
57
+ * @param {String} uuid
58
+ * @param {Object} data
59
+ * @param {Object} context
60
+ */
61
+ async function updateWidget(
62
+ uuid: string,
63
+ data: Partial<WidgetData>,
64
+ context: Record<string, any>
65
+ ) {
66
+ const connection = await getConnection();
67
+ await startTransaction(connection);
68
+ try {
69
+ const widgetData = await getValue('widgetDataBeforeUpdate', data);
70
+ // Validate widget data
71
+ validateWidgetDataBeforeInsert(widgetData);
72
+
73
+ // Update widget data
74
+ const widget = await hookable(updateWidgetData, { ...context, connection })(
75
+ uuid,
76
+ widgetData,
77
+ connection
78
+ );
79
+
80
+ await commit(connection);
81
+ return widget;
82
+ } catch (e) {
83
+ await rollback(connection);
84
+ throw e;
85
+ }
86
+ }
87
+
88
+ export default async (
89
+ uuid: string,
90
+ data: Partial<WidgetData>,
91
+ context: Record<string, any>
92
+ ) => {
93
+ // Make sure the context is either not provided or is an object
94
+ if (context && typeof context !== 'object') {
95
+ throw new Error('Context must be an object');
96
+ }
97
+ const widget = await hookable(updateWidget, context)(uuid, data, context);
98
+ return widget;
99
+ };
100
+
101
+ export function hookBeforeUpdateWidgetData(
102
+ callback: (
103
+ this: Record<string, any>,
104
+ ...args: [uuid: string, data: Partial<WidgetData>, connection: PoolClient]
105
+ ) => void | Promise<void>,
106
+ priority: number = 10
107
+ ): void {
108
+ hookBefore('updateWidgetData', callback, priority);
109
+ }
110
+
111
+ export function hookAfterUpdateWidgetData(
112
+ callback: (
113
+ this: Record<string, any>,
114
+ ...args: [uuid: string, data: Partial<WidgetData>, connection: PoolClient]
115
+ ) => void | Promise<void>,
116
+ priority: number = 10
117
+ ): void {
118
+ hookAfter('updateWidgetData', callback, priority);
119
+ }
120
+
121
+ export function hookBeforeUpdateWidget(
122
+ callback: (
123
+ this: Record<string, any>,
124
+ ...args: [uuid: string, data: Partial<WidgetData>, context: Record<string, any>]
125
+ ) => void | Promise<void>,
126
+ priority: number = 10
127
+ ): void {
128
+ hookBefore('updateWidget', callback, priority);
129
+ }
130
+
131
+ export function hookAfterUpdateWidget(
132
+ callback: (
133
+ this: Record<string, any>,
134
+ ...args: [uuid: string, data: Partial<WidgetData>, context: Record<string, any>]
135
+ ) => void | Promise<void>,
136
+ priority: number = 10
137
+ ): void {
138
+ hookAfter('updateWidget', callback, priority);
139
+ }
@@ -69,7 +69,9 @@ export default function CashOnDeliveryMethod({
69
69
  try {
70
70
  await checkout();
71
71
  } catch (error) {
72
- toast.error(_('Failed to place order. Please try again.'));
72
+ toast.error(
73
+ error.message || _('Failed to place order. Please try again.')
74
+ );
73
75
  }
74
76
  };
75
77
 
@@ -143,7 +145,7 @@ export default function CashOnDeliveryMethod({
143
145
  }
144
146
 
145
147
  export const layout = {
146
- areaId: 'checkoutForm',
148
+ areaId: 'checkoutFormAfter',
147
149
  sortOrder: 10
148
150
  };
149
151
 
@@ -9,6 +9,7 @@ import {
9
9
  TOKEN_TYPES,
10
10
  verifyRefreshToken
11
11
  } from '../../../../lib/util/jwt.js';
12
+ import { buildCustomerPayload } from '../../services/customer/buildCustomerPayload.js';
12
13
 
13
14
  export default async (request, response, next) => {
14
15
  const { refreshToken } = request.body;
@@ -41,16 +42,13 @@ export default async (request, response, next) => {
41
42
  });
42
43
  }
43
44
 
44
- // Generate new access token
45
- const payload = decoded.customer;
45
+ // Generate new access token using fresh customer data
46
+ const customerPayload = buildCustomerPayload(customer);
46
47
  const newAccessToken = generateToken(
47
- {
48
- customer: payload
49
- },
48
+ { customer: customerPayload },
50
49
  TOKEN_TYPES.CUSTOMER
51
50
  );
52
51
  return response.json({
53
- success: true,
54
52
  data: {
55
53
  accessToken: newAccessToken
56
54
  }
@@ -16,30 +16,32 @@ export default function LoginPage({
16
16
  forgotPasswordUrl
17
17
  }: LoginPageProps) {
18
18
  return (
19
- <div className="login__page flex flex-col justify-center items-center">
20
- <Card className="flex justify-center items-center max-w-max md:max-w-[80%]">
21
- <CardContent>
22
- <CustomerLoginForm
23
- title={_('Welcome Back!')}
24
- subtitle={_('Please sign in to your account')}
25
- redirectUrl={homeUrl}
26
- onError={(error) => {
27
- toast.error(error.message);
28
- }}
29
- className="w-120"
30
- />
31
- </CardContent>
32
- </Card>
33
- <div className="login__page__options text-center mt-2 gap-5 flex justify-center">
34
- <a className="text-interactive hover:underline" href={registerUrl}>
35
- {_('Create an account')}
36
- </a>
37
- <a
38
- className="text-destructive hover:underline"
39
- href={forgotPasswordUrl}
40
- >
41
- {_('Forgot your password?')}
42
- </a>
19
+ <div className="login__page flex flex-col items-center py-10 px-4">
20
+ <div className="w-full max-w-md">
21
+ <Card>
22
+ <CardContent>
23
+ <CustomerLoginForm
24
+ title={_('Welcome Back!')}
25
+ subtitle={_('Please sign in to your account')}
26
+ redirectUrl={homeUrl}
27
+ onError={(error) => {
28
+ toast.error(error.message);
29
+ }}
30
+ className="w-full"
31
+ />
32
+ </CardContent>
33
+ </Card>
34
+ <div className="login__page__options text-center mt-4 gap-5 flex justify-center">
35
+ <a className="text-interactive hover:underline" href={registerUrl}>
36
+ {_('Create an account')}
37
+ </a>
38
+ <a
39
+ className="text-destructive hover:underline"
40
+ href={forgotPasswordUrl}
41
+ >
42
+ {_('Forgot your password?')}
43
+ </a>
44
+ </div>
43
45
  </div>
44
46
  </div>
45
47
  );
@@ -10,29 +10,31 @@ interface RegisterPageProps {
10
10
  }
11
11
  export default function RegisterPage({ homeUrl, loginUrl }: RegisterPageProps) {
12
12
  return (
13
- <div className="flex justify-center items-center flex-col gap-3">
14
- <Card className="flex justify-center items-center max-w-max md:max-w-[80%]">
15
- <CardContent>
16
- <CustomerRegistrationForm
17
- title={_('Create an account')}
18
- subtitle={_('Join us for exclusive offers and order tracking')}
19
- redirectUrl={homeUrl}
20
- onError={(error) => {
21
- toast.error(error);
22
- }}
23
- className="w-120"
24
- />
25
- </CardContent>
26
- </Card>
13
+ <div className="flex flex-col items-center py-10 px-4">
14
+ <div className="w-full max-w-md">
15
+ <Card>
16
+ <CardContent>
17
+ <CustomerRegistrationForm
18
+ title={_('Create an account')}
19
+ subtitle={_('Join us for exclusive offers and order tracking')}
20
+ redirectUrl={homeUrl}
21
+ onError={(error) => {
22
+ toast.error(error);
23
+ }}
24
+ className="w-full"
25
+ />
26
+ </CardContent>
27
+ </Card>
27
28
 
28
- <div className="text-center">
29
- <span>
30
- {_('Already have an account?')}
31
- <a className="text-primary hover:underline" href={loginUrl}>
32
- {' '}
33
- {_('Login')}{' '}
34
- </a>
35
- </span>
29
+ <div className="text-center mt-4">
30
+ <span>
31
+ {_('Already have an account?')}
32
+ <a className="text-primary hover:underline" href={loginUrl}>
33
+ {' '}
34
+ {_('Login')}{' '}
35
+ </a>
36
+ </span>
37
+ </div>
36
38
  </div>
37
39
  </div>
38
40
  );
@@ -8,7 +8,11 @@ import {
8
8
  update
9
9
  } from '@evershop/postgres-query-builder';
10
10
  import { getConnection, pool } from '../../../../../lib/postgres/connection.js';
11
- import { hookable } from '../../../../../lib/util/hookable.js';
11
+ import {
12
+ hookable,
13
+ hookBefore,
14
+ hookAfter
15
+ } from '../../../../../lib/util/hookable.js';
12
16
  import { getValue } from '../../../../../lib/util/registry.js';
13
17
  import { Address } from '../../../../../types/customerAddress.js';
14
18
  import { validateAddress } from './addressValidators.js';
@@ -91,7 +95,7 @@ export default async (
91
95
  customerUUID: string,
92
96
  addressData: Address,
93
97
  context: Record<string, unknown>
94
- ) => {
98
+ ): Promise<Address> => {
95
99
  // Make sure the context is either not provided or is an object
96
100
  if (context && typeof context !== 'object') {
97
101
  throw new Error('Context must be an object');
@@ -103,3 +107,51 @@ export default async (
103
107
  );
104
108
  return address;
105
109
  };
110
+
111
+ export function hookBeforeInsertCustomerAddressData(
112
+ callback: (
113
+ this: Record<string, unknown>,
114
+ ...args: [data: Address, connection: PoolClient]
115
+ ) => void | Promise<void>,
116
+ priority: number = 10
117
+ ): void {
118
+ hookBefore('insertCustomerAddressData', callback, priority);
119
+ }
120
+
121
+ export function hookAfterInsertCustomerAddressData(
122
+ callback: (
123
+ this: Record<string, unknown>,
124
+ ...args: [data: Address, connection: PoolClient]
125
+ ) => void | Promise<void>,
126
+ priority: number = 10
127
+ ): void {
128
+ hookAfter('insertCustomerAddressData', callback, priority);
129
+ }
130
+
131
+ export function hookBeforeCreateCustomerAddress(
132
+ callback: (
133
+ this: Record<string, unknown>,
134
+ ...args: [
135
+ customerUUID: string,
136
+ address: Address,
137
+ context: Record<string, unknown>
138
+ ]
139
+ ) => void | Promise<void>,
140
+ priority: number = 10
141
+ ): void {
142
+ hookBefore('createCustomerAddress', callback, priority);
143
+ }
144
+
145
+ export function hookAfterCreateCustomerAddress(
146
+ callback: (
147
+ this: Record<string, unknown>,
148
+ ...args: [
149
+ customerUUID: string,
150
+ address: Address,
151
+ context: Record<string, unknown>
152
+ ]
153
+ ) => void | Promise<void>,
154
+ priority: number = 10
155
+ ): void {
156
+ hookAfter('createCustomerAddress', callback, priority);
157
+ }
@@ -7,10 +7,17 @@ import {
7
7
  startTransaction
8
8
  } from '@evershop/postgres-query-builder';
9
9
  import { getConnection } from '../../../../../lib/postgres/connection.js';
10
- import { hookable } from '../../../../../lib/util/hookable.js';
10
+ import {
11
+ hookable,
12
+ hookBefore,
13
+ hookAfter
14
+ } from '../../../../../lib/util/hookable.js';
11
15
  import { Address } from '../../../../../types/customerAddress.js';
12
16
 
13
- async function deleteCustomerAddressData(uuid: string, connection: PoolClient) {
17
+ async function deleteCustomerAddressData(
18
+ uuid: string,
19
+ connection: PoolClient
20
+ ): Promise<void> {
14
21
  await del('customer_address').where('uuid', '=', uuid).execute(connection);
15
22
  }
16
23
  /**
@@ -68,3 +75,43 @@ export default async (
68
75
  );
69
76
  return customerAddress;
70
77
  };
78
+
79
+ export function hookBeforeDeleteCustomerAddressData(
80
+ callback: (
81
+ this: Record<string, unknown>,
82
+ ...args: [uuid: string, connection: PoolClient]
83
+ ) => void | Promise<void>,
84
+ priority: number = 10
85
+ ): void {
86
+ hookBefore('deleteCustomerAddressData', callback, priority);
87
+ }
88
+
89
+ export function hookAfterDeleteCustomerAddressData(
90
+ callback: (
91
+ this: Record<string, unknown>,
92
+ ...args: [uuid: string, connection: PoolClient]
93
+ ) => void | Promise<void>,
94
+ priority: number = 10
95
+ ): void {
96
+ hookAfter('deleteCustomerAddressData', callback, priority);
97
+ }
98
+
99
+ export function hookBeforeDeleteCustomerAddress(
100
+ callback: (
101
+ this: Record<string, unknown>,
102
+ ...args: [uuid: string, context: Record<string, unknown>]
103
+ ) => void | Promise<void>,
104
+ priority: number = 10
105
+ ): void {
106
+ hookBefore('deleteCustomerAddress', callback, priority);
107
+ }
108
+
109
+ export function hookAfterDeleteCustomerAddress(
110
+ callback: (
111
+ this: Record<string, unknown>,
112
+ ...args: [uuid: string, context: Record<string, unknown>]
113
+ ) => void | Promise<void>,
114
+ priority: number = 10
115
+ ): void {
116
+ hookAfter('deleteCustomerAddress', callback, priority);
117
+ }