@aglyn/plugins-commerce 1.0.0-beta.143

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 (417) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +10 -0
  3. package/package.json +57 -0
  4. package/src/index.d.ts +38 -0
  5. package/src/index.js +38 -0
  6. package/src/index.js.map +1 -0
  7. package/src/lib/components/account.d.ts +31 -0
  8. package/src/lib/components/account.js +645 -0
  9. package/src/lib/components/account.js.map +1 -0
  10. package/src/lib/components/cart.d.ts +38 -0
  11. package/src/lib/components/cart.js +851 -0
  12. package/src/lib/components/cart.js.map +1 -0
  13. package/src/lib/components/commerce-console-page.d.ts +32 -0
  14. package/src/lib/components/commerce-console-page.js +296 -0
  15. package/src/lib/components/commerce-console-page.js.map +1 -0
  16. package/src/lib/components/commerce-console-sections.d.ts +34 -0
  17. package/src/lib/components/commerce-console-sections.js +62 -0
  18. package/src/lib/components/commerce-console-sections.js.map +1 -0
  19. package/src/lib/components/console/catalog-organization-card.component.d.ts +14 -0
  20. package/src/lib/components/console/catalog-organization-card.component.js +1087 -0
  21. package/src/lib/components/console/catalog-organization-card.component.js.map +1 -0
  22. package/src/lib/components/console/commerce-analytics-card.component.d.ts +27 -0
  23. package/src/lib/components/console/commerce-analytics-card.component.js +310 -0
  24. package/src/lib/components/console/commerce-analytics-card.component.js.map +1 -0
  25. package/src/lib/components/console/commerce-glance-card.component.d.ts +20 -0
  26. package/src/lib/components/console/commerce-glance-card.component.js +340 -0
  27. package/src/lib/components/console/commerce-glance-card.component.js.map +1 -0
  28. package/src/lib/components/console/commerce-stat-tile.component.d.ts +37 -0
  29. package/src/lib/components/console/commerce-stat-tile.component.js +72 -0
  30. package/src/lib/components/console/commerce-stat-tile.component.js.map +1 -0
  31. package/src/lib/components/console/discounts-card.component.d.ts +14 -0
  32. package/src/lib/components/console/discounts-card.component.js +443 -0
  33. package/src/lib/components/console/discounts-card.component.js.map +1 -0
  34. package/src/lib/components/console/entitlement-gate.component.d.ts +76 -0
  35. package/src/lib/components/console/entitlement-gate.component.js +115 -0
  36. package/src/lib/components/console/entitlement-gate.component.js.map +1 -0
  37. package/src/lib/components/console/gift-cards-card.component.d.ts +29 -0
  38. package/src/lib/components/console/gift-cards-card.component.js +379 -0
  39. package/src/lib/components/console/gift-cards-card.component.js.map +1 -0
  40. package/src/lib/components/console/host-coupons-card.component.d.ts +14 -0
  41. package/src/lib/components/console/host-coupons-card.component.js +252 -0
  42. package/src/lib/components/console/host-coupons-card.component.js.map +1 -0
  43. package/src/lib/components/console/host-orders-card.component.d.ts +13 -0
  44. package/src/lib/components/console/host-orders-card.component.js +861 -0
  45. package/src/lib/components/console/host-orders-card.component.js.map +1 -0
  46. package/src/lib/components/console/locations-card.component.d.ts +14 -0
  47. package/src/lib/components/console/locations-card.component.js +256 -0
  48. package/src/lib/components/console/locations-card.component.js.map +1 -0
  49. package/src/lib/components/console/member-posts-card.component.d.ts +8 -0
  50. package/src/lib/components/console/member-posts-card.component.js +283 -0
  51. package/src/lib/components/console/member-posts-card.component.js.map +1 -0
  52. package/src/lib/components/console/newest-site-users-card.component.d.ts +36 -0
  53. package/src/lib/components/console/newest-site-users-card.component.js +126 -0
  54. package/src/lib/components/console/newest-site-users-card.component.js.map +1 -0
  55. package/src/lib/components/console/order-detail-dialog.component.d.ts +28 -0
  56. package/src/lib/components/console/order-detail-dialog.component.js +976 -0
  57. package/src/lib/components/console/order-detail-dialog.component.js.map +1 -0
  58. package/src/lib/components/console/paid-media.d.ts +127 -0
  59. package/src/lib/components/console/paid-media.js +397 -0
  60. package/src/lib/components/console/paid-media.js.map +1 -0
  61. package/src/lib/components/console/payments-settings-card.component.d.ts +13 -0
  62. package/src/lib/components/console/payments-settings-card.component.js +295 -0
  63. package/src/lib/components/console/payments-settings-card.component.js.map +1 -0
  64. package/src/lib/components/console/pos-page.component.d.ts +13 -0
  65. package/src/lib/components/console/pos-page.component.js +916 -0
  66. package/src/lib/components/console/pos-page.component.js.map +1 -0
  67. package/src/lib/components/console/product-editor-dialog.component.d.ts +32 -0
  68. package/src/lib/components/console/product-editor-dialog.component.js +1374 -0
  69. package/src/lib/components/console/product-editor-dialog.component.js.map +1 -0
  70. package/src/lib/components/console/products-hub-card.component.d.ts +16 -0
  71. package/src/lib/components/console/products-hub-card.component.js +1280 -0
  72. package/src/lib/components/console/products-hub-card.component.js.map +1 -0
  73. package/src/lib/components/console/products-hub-zone.component.d.ts +50 -0
  74. package/src/lib/components/console/products-hub-zone.component.js +200 -0
  75. package/src/lib/components/console/products-hub-zone.component.js.map +1 -0
  76. package/src/lib/components/console/recovery-queue-card.component.d.ts +39 -0
  77. package/src/lib/components/console/recovery-queue-card.component.js +262 -0
  78. package/src/lib/components/console/recovery-queue-card.component.js.map +1 -0
  79. package/src/lib/components/console/registers-card.component.d.ts +21 -0
  80. package/src/lib/components/console/registers-card.component.js +296 -0
  81. package/src/lib/components/console/registers-card.component.js.map +1 -0
  82. package/src/lib/components/console/reservations-card.component.d.ts +14 -0
  83. package/src/lib/components/console/reservations-card.component.js +650 -0
  84. package/src/lib/components/console/reservations-card.component.js.map +1 -0
  85. package/src/lib/components/console/reviews-moderation-card.component.d.ts +8 -0
  86. package/src/lib/components/console/reviews-moderation-card.component.js +235 -0
  87. package/src/lib/components/console/reviews-moderation-card.component.js.map +1 -0
  88. package/src/lib/components/console/shipping-settings-card.component.d.ts +38 -0
  89. package/src/lib/components/console/shipping-settings-card.component.js +560 -0
  90. package/src/lib/components/console/shipping-settings-card.component.js.map +1 -0
  91. package/src/lib/components/console/stock-movements-card.component.d.ts +31 -0
  92. package/src/lib/components/console/stock-movements-card.component.js +333 -0
  93. package/src/lib/components/console/stock-movements-card.component.js.map +1 -0
  94. package/src/lib/components/console/store-settings-card.component.d.ts +14 -0
  95. package/src/lib/components/console/store-settings-card.component.js +300 -0
  96. package/src/lib/components/console/store-settings-card.component.js.map +1 -0
  97. package/src/lib/components/console/storefront-tax-summary-card.component.d.ts +73 -0
  98. package/src/lib/components/console/storefront-tax-summary-card.component.js +408 -0
  99. package/src/lib/components/console/storefront-tax-summary-card.component.js.map +1 -0
  100. package/src/lib/components/console/suppliers-card.component.d.ts +8 -0
  101. package/src/lib/components/console/suppliers-card.component.js +328 -0
  102. package/src/lib/components/console/suppliers-card.component.js.map +1 -0
  103. package/src/lib/components/console/tax-settings-card.component.d.ts +14 -0
  104. package/src/lib/components/console/tax-settings-card.component.js +473 -0
  105. package/src/lib/components/console/tax-settings-card.component.js.map +1 -0
  106. package/src/lib/components/gate.d.ts +39 -0
  107. package/src/lib/components/gate.js +202 -0
  108. package/src/lib/components/gate.js.map +1 -0
  109. package/src/lib/components/gated-video.d.ts +40 -0
  110. package/src/lib/components/gated-video.js +366 -0
  111. package/src/lib/components/gated-video.js.map +1 -0
  112. package/src/lib/components/member-feed.d.ts +32 -0
  113. package/src/lib/components/member-feed.js +198 -0
  114. package/src/lib/components/member-feed.js.map +1 -0
  115. package/src/lib/components/member-recovery.d.ts +35 -0
  116. package/src/lib/components/member-recovery.js +313 -0
  117. package/src/lib/components/member-recovery.js.map +1 -0
  118. package/src/lib/components/member-signin.d.ts +35 -0
  119. package/src/lib/components/member-signin.js +257 -0
  120. package/src/lib/components/member-signin.js.map +1 -0
  121. package/src/lib/components/member-signup.d.ts +34 -0
  122. package/src/lib/components/member-signup.js +287 -0
  123. package/src/lib/components/member-signup.js.map +1 -0
  124. package/src/lib/components/newsletter-signup.d.ts +39 -0
  125. package/src/lib/components/newsletter-signup.js +229 -0
  126. package/src/lib/components/newsletter-signup.js.map +1 -0
  127. package/src/lib/components/product-detail.d.ts +38 -0
  128. package/src/lib/components/product-detail.js +1022 -0
  129. package/src/lib/components/product-detail.js.map +1 -0
  130. package/src/lib/components/product-grid.d.ts +67 -0
  131. package/src/lib/components/product-grid.js +909 -0
  132. package/src/lib/components/product-grid.js.map +1 -0
  133. package/src/lib/components/product-reviews.d.ts +32 -0
  134. package/src/lib/components/product-reviews.js +349 -0
  135. package/src/lib/components/product-reviews.js.map +1 -0
  136. package/src/lib/components/related-products.d.ts +33 -0
  137. package/src/lib/components/related-products.js +232 -0
  138. package/src/lib/components/related-products.js.map +1 -0
  139. package/src/lib/components/reservation-widget.d.ts +33 -0
  140. package/src/lib/components/reservation-widget.js +418 -0
  141. package/src/lib/components/reservation-widget.js.map +1 -0
  142. package/src/lib/components/storefront-payment-element-fallback.d.ts +18 -0
  143. package/src/lib/components/storefront-payment-element-fallback.js +51 -0
  144. package/src/lib/components/storefront-payment-element-fallback.js.map +1 -0
  145. package/src/lib/components/storefront-payment-element.d.ts +78 -0
  146. package/src/lib/components/storefront-payment-element.js +156 -0
  147. package/src/lib/components/storefront-payment-element.js.map +1 -0
  148. package/src/lib/components/wishlist.d.ts +46 -0
  149. package/src/lib/components/wishlist.js +304 -0
  150. package/src/lib/components/wishlist.js.map +1 -0
  151. package/src/lib/constants/bundle-common.d.ts +18 -0
  152. package/src/lib/constants/bundle-common.js +18 -0
  153. package/src/lib/constants/bundle-common.js.map +1 -0
  154. package/src/lib/constants/product-filters.d.ts +35 -0
  155. package/src/lib/constants/product-filters.js +109 -0
  156. package/src/lib/constants/product-filters.js.map +1 -0
  157. package/src/lib/model/commerce-cart.d.ts +52 -0
  158. package/src/lib/model/commerce-cart.js +102 -0
  159. package/src/lib/model/commerce-cart.js.map +1 -0
  160. package/src/lib/model/commerce-connect-transfer.d.ts +243 -0
  161. package/src/lib/model/commerce-connect-transfer.js +231 -0
  162. package/src/lib/model/commerce-connect-transfer.js.map +1 -0
  163. package/src/lib/model/commerce-discounts.d.ts +164 -0
  164. package/src/lib/model/commerce-discounts.js +231 -0
  165. package/src/lib/model/commerce-discounts.js.map +1 -0
  166. package/src/lib/model/commerce-dispute.d.ts +124 -0
  167. package/src/lib/model/commerce-dispute.js +225 -0
  168. package/src/lib/model/commerce-dispute.js.map +1 -0
  169. package/src/lib/model/commerce-gift-cards.d.ts +107 -0
  170. package/src/lib/model/commerce-gift-cards.js +121 -0
  171. package/src/lib/model/commerce-gift-cards.js.map +1 -0
  172. package/src/lib/model/commerce-io.d.ts +36 -0
  173. package/src/lib/model/commerce-io.js +245 -0
  174. package/src/lib/model/commerce-io.js.map +1 -0
  175. package/src/lib/model/commerce-orders.d.ts +1040 -0
  176. package/src/lib/model/commerce-orders.js +1022 -0
  177. package/src/lib/model/commerce-orders.js.map +1 -0
  178. package/src/lib/model/commerce-promotions.d.ts +188 -0
  179. package/src/lib/model/commerce-promotions.js +199 -0
  180. package/src/lib/model/commerce-promotions.js.map +1 -0
  181. package/src/lib/model/commerce-reservations.d.ts +175 -0
  182. package/src/lib/model/commerce-reservations.js +157 -0
  183. package/src/lib/model/commerce-reservations.js.map +1 -0
  184. package/src/lib/model/commerce-shipping.d.ts +316 -0
  185. package/src/lib/model/commerce-shipping.js +484 -0
  186. package/src/lib/model/commerce-shipping.js.map +1 -0
  187. package/src/lib/model/commerce-stock-holds.d.ts +199 -0
  188. package/src/lib/model/commerce-stock-holds.js +190 -0
  189. package/src/lib/model/commerce-stock-holds.js.map +1 -0
  190. package/src/lib/model/commerce-subscription-status.d.ts +67 -0
  191. package/src/lib/model/commerce-subscription-status.js +76 -0
  192. package/src/lib/model/commerce-subscription-status.js.map +1 -0
  193. package/src/lib/model/commerce-tax-decision.d.ts +222 -0
  194. package/src/lib/model/commerce-tax-decision.js +165 -0
  195. package/src/lib/model/commerce-tax-decision.js.map +1 -0
  196. package/src/lib/model/commerce-tax.d.ts +176 -0
  197. package/src/lib/model/commerce-tax.js +92 -0
  198. package/src/lib/model/commerce-tax.js.map +1 -0
  199. package/src/lib/model/commerce.d.ts +551 -0
  200. package/src/lib/model/commerce.js +739 -0
  201. package/src/lib/model/commerce.js.map +1 -0
  202. package/src/lib/model/index.d.ts +40 -0
  203. package/src/lib/model/index.js +40 -0
  204. package/src/lib/model/index.js.map +1 -0
  205. package/src/lib/model/order-figures.d.ts +48 -0
  206. package/src/lib/model/order-figures.js +74 -0
  207. package/src/lib/model/order-figures.js.map +1 -0
  208. package/src/lib/model/plugin-permissions.d.ts +23 -0
  209. package/src/lib/model/plugin-permissions.js +34 -0
  210. package/src/lib/model/plugin-permissions.js.map +1 -0
  211. package/src/lib/model/purchase-analytics.d.ts +186 -0
  212. package/src/lib/model/purchase-analytics.js +216 -0
  213. package/src/lib/model/purchase-analytics.js.map +1 -0
  214. package/src/lib/plugin-config.d.ts +62 -0
  215. package/src/lib/plugin-config.js +78 -0
  216. package/src/lib/plugin-config.js.map +1 -0
  217. package/src/lib/plugin.d.ts +28 -0
  218. package/src/lib/plugin.js +147 -0
  219. package/src/lib/plugin.js.map +1 -0
  220. package/src/lib/server/billing-webhook.d.ts +26 -0
  221. package/src/lib/server/billing-webhook.js +4011 -0
  222. package/src/lib/server/billing-webhook.js.map +1 -0
  223. package/src/lib/server/cancel-order.d.ts +87 -0
  224. package/src/lib/server/cancel-order.js +368 -0
  225. package/src/lib/server/cancel-order.js.map +1 -0
  226. package/src/lib/server/cart-checkout.d.ts +25 -0
  227. package/src/lib/server/cart-checkout.js +976 -0
  228. package/src/lib/server/cart-checkout.js.map +1 -0
  229. package/src/lib/server/cart-cookie.d.ts +32 -0
  230. package/src/lib/server/cart-cookie.js +77 -0
  231. package/src/lib/server/cart-cookie.js.map +1 -0
  232. package/src/lib/server/cart.d.ts +34 -0
  233. package/src/lib/server/cart.js +181 -0
  234. package/src/lib/server/cart.js.map +1 -0
  235. package/src/lib/server/catalog.d.ts +127 -0
  236. package/src/lib/server/catalog.js +277 -0
  237. package/src/lib/server/catalog.js.map +1 -0
  238. package/src/lib/server/checkout.d.ts +36 -0
  239. package/src/lib/server/checkout.js +915 -0
  240. package/src/lib/server/checkout.js.map +1 -0
  241. package/src/lib/server/connect.d.ts +26 -0
  242. package/src/lib/server/connect.js +238 -0
  243. package/src/lib/server/connect.js.map +1 -0
  244. package/src/lib/server/contact-refund.d.ts +117 -0
  245. package/src/lib/server/contact-refund.js +196 -0
  246. package/src/lib/server/contact-refund.js.map +1 -0
  247. package/src/lib/server/download.d.ts +39 -0
  248. package/src/lib/server/download.js +206 -0
  249. package/src/lib/server/download.js.map +1 -0
  250. package/src/lib/server/draft-order.d.ts +26 -0
  251. package/src/lib/server/draft-order.js +706 -0
  252. package/src/lib/server/draft-order.js.map +1 -0
  253. package/src/lib/server/feed.d.ts +24 -0
  254. package/src/lib/server/feed.js +59 -0
  255. package/src/lib/server/feed.js.map +1 -0
  256. package/src/lib/server/fulfill-order.d.ts +97 -0
  257. package/src/lib/server/fulfill-order.js +235 -0
  258. package/src/lib/server/fulfill-order.js.map +1 -0
  259. package/src/lib/server/gate.d.ts +36 -0
  260. package/src/lib/server/gate.js +112 -0
  261. package/src/lib/server/gate.js.map +1 -0
  262. package/src/lib/server/gift-cards.d.ts +42 -0
  263. package/src/lib/server/gift-cards.js +219 -0
  264. package/src/lib/server/gift-cards.js.map +1 -0
  265. package/src/lib/server/low-stock.d.ts +49 -0
  266. package/src/lib/server/low-stock.js +60 -0
  267. package/src/lib/server/low-stock.js.map +1 -0
  268. package/src/lib/server/manual-tax-rate.d.ts +82 -0
  269. package/src/lib/server/manual-tax-rate.js +113 -0
  270. package/src/lib/server/manual-tax-rate.js.map +1 -0
  271. package/src/lib/server/member-feed.d.ts +24 -0
  272. package/src/lib/server/member-feed.js +72 -0
  273. package/src/lib/server/member-feed.js.map +1 -0
  274. package/src/lib/server/member-name-search.d.ts +37 -0
  275. package/src/lib/server/member-name-search.js +42 -0
  276. package/src/lib/server/member-name-search.js.map +1 -0
  277. package/src/lib/server/member-post.d.ts +23 -0
  278. package/src/lib/server/member-post.js +166 -0
  279. package/src/lib/server/member-post.js.map +1 -0
  280. package/src/lib/server/membership-account.d.ts +37 -0
  281. package/src/lib/server/membership-account.js +148 -0
  282. package/src/lib/server/membership-account.js.map +1 -0
  283. package/src/lib/server/membership-admin-password.d.ts +33 -0
  284. package/src/lib/server/membership-admin-password.js +202 -0
  285. package/src/lib/server/membership-admin-password.js.map +1 -0
  286. package/src/lib/server/membership-content.d.ts +23 -0
  287. package/src/lib/server/membership-content.js +105 -0
  288. package/src/lib/server/membership-content.js.map +1 -0
  289. package/src/lib/server/membership-login.d.ts +19 -0
  290. package/src/lib/server/membership-login.js +137 -0
  291. package/src/lib/server/membership-login.js.map +1 -0
  292. package/src/lib/server/membership-logout.d.ts +19 -0
  293. package/src/lib/server/membership-logout.js +35 -0
  294. package/src/lib/server/membership-logout.js.map +1 -0
  295. package/src/lib/server/membership-recover.d.ts +60 -0
  296. package/src/lib/server/membership-recover.js +244 -0
  297. package/src/lib/server/membership-recover.js.map +1 -0
  298. package/src/lib/server/membership-register.d.ts +22 -0
  299. package/src/lib/server/membership-register.js +241 -0
  300. package/src/lib/server/membership-register.js.map +1 -0
  301. package/src/lib/server/membership-reset.d.ts +26 -0
  302. package/src/lib/server/membership-reset.js +88 -0
  303. package/src/lib/server/membership-reset.js.map +1 -0
  304. package/src/lib/server/membership-wishlist.d.ts +23 -0
  305. package/src/lib/server/membership-wishlist.js +89 -0
  306. package/src/lib/server/membership-wishlist.js.map +1 -0
  307. package/src/lib/server/membership.d.ts +96 -0
  308. package/src/lib/server/membership.js +222 -0
  309. package/src/lib/server/membership.js.map +1 -0
  310. package/src/lib/server/native-checkout.d.ts +170 -0
  311. package/src/lib/server/native-checkout.js +193 -0
  312. package/src/lib/server/native-checkout.js.map +1 -0
  313. package/src/lib/server/newsletter.d.ts +23 -0
  314. package/src/lib/server/newsletter.js +323 -0
  315. package/src/lib/server/newsletter.js.map +1 -0
  316. package/src/lib/server/notify-restock.d.ts +22 -0
  317. package/src/lib/server/notify-restock.js +84 -0
  318. package/src/lib/server/notify-restock.js.map +1 -0
  319. package/src/lib/server/order-analytics.d.ts +134 -0
  320. package/src/lib/server/order-analytics.js +263 -0
  321. package/src/lib/server/order-analytics.js.map +1 -0
  322. package/src/lib/server/order-figures.d.ts +33 -0
  323. package/src/lib/server/order-figures.js +220 -0
  324. package/src/lib/server/order-figures.js.map +1 -0
  325. package/src/lib/server/paid-media-delivery.d.ts +173 -0
  326. package/src/lib/server/paid-media-delivery.js +212 -0
  327. package/src/lib/server/paid-media-delivery.js.map +1 -0
  328. package/src/lib/server/pos-order.d.ts +54 -0
  329. package/src/lib/server/pos-order.js +1137 -0
  330. package/src/lib/server/pos-order.js.map +1 -0
  331. package/src/lib/server/process-abandoned.d.ts +54 -0
  332. package/src/lib/server/process-abandoned.js +222 -0
  333. package/src/lib/server/process-abandoned.js.map +1 -0
  334. package/src/lib/server/process-restock.d.ts +42 -0
  335. package/src/lib/server/process-restock.js +219 -0
  336. package/src/lib/server/process-restock.js.map +1 -0
  337. package/src/lib/server/product-card.d.ts +29 -0
  338. package/src/lib/server/product-card.js +54 -0
  339. package/src/lib/server/product-card.js.map +1 -0
  340. package/src/lib/server/product.d.ts +70 -0
  341. package/src/lib/server/product.js +105 -0
  342. package/src/lib/server/product.js.map +1 -0
  343. package/src/lib/server/promotion-hold.d.ts +144 -0
  344. package/src/lib/server/promotion-hold.js +174 -0
  345. package/src/lib/server/promotion-hold.js.map +1 -0
  346. package/src/lib/server/reconcile-stock.d.ts +106 -0
  347. package/src/lib/server/reconcile-stock.js +349 -0
  348. package/src/lib/server/reconcile-stock.js.map +1 -0
  349. package/src/lib/server/refund.d.ts +45 -0
  350. package/src/lib/server/refund.js +607 -0
  351. package/src/lib/server/refund.js.map +1 -0
  352. package/src/lib/server/related.d.ts +24 -0
  353. package/src/lib/server/related.js +104 -0
  354. package/src/lib/server/related.js.map +1 -0
  355. package/src/lib/server/reservation-availability.d.ts +23 -0
  356. package/src/lib/server/reservation-availability.js +111 -0
  357. package/src/lib/server/reservation-availability.js.map +1 -0
  358. package/src/lib/server/reserve-stock.d.ts +156 -0
  359. package/src/lib/server/reserve-stock.js +146 -0
  360. package/src/lib/server/reserve-stock.js.map +1 -0
  361. package/src/lib/server/reserve.d.ts +25 -0
  362. package/src/lib/server/reserve.js +426 -0
  363. package/src/lib/server/reserve.js.map +1 -0
  364. package/src/lib/server/restock-flag.d.ts +202 -0
  365. package/src/lib/server/restock-flag.js +449 -0
  366. package/src/lib/server/restock-flag.js.map +1 -0
  367. package/src/lib/server/reviews.d.ts +51 -0
  368. package/src/lib/server/reviews.js +132 -0
  369. package/src/lib/server/reviews.js.map +1 -0
  370. package/src/lib/server/site-page-enricher.d.ts +42 -0
  371. package/src/lib/server/site-page-enricher.js +149 -0
  372. package/src/lib/server/site-page-enricher.js.map +1 -0
  373. package/src/lib/server/site-page-resolver.d.ts +26 -0
  374. package/src/lib/server/site-page-resolver.js +223 -0
  375. package/src/lib/server/site-page-resolver.js.map +1 -0
  376. package/src/lib/server/stock-hold.d.ts +127 -0
  377. package/src/lib/server/stock-hold.js +258 -0
  378. package/src/lib/server/stock-hold.js.map +1 -0
  379. package/src/lib/server/storefront-tax-record.d.ts +22 -0
  380. package/src/lib/server/storefront-tax-record.js +218 -0
  381. package/src/lib/server/storefront-tax-record.js.map +1 -0
  382. package/src/lib/server/storefront-tax.d.ts +197 -0
  383. package/src/lib/server/storefront-tax.js +245 -0
  384. package/src/lib/server/storefront-tax.js.map +1 -0
  385. package/src/lib/server/stream.d.ts +25 -0
  386. package/src/lib/server/stream.js +191 -0
  387. package/src/lib/server/stream.js.map +1 -0
  388. package/src/lib/server/subscription-portal.d.ts +24 -0
  389. package/src/lib/server/subscription-portal.js +91 -0
  390. package/src/lib/server/subscription-portal.js.map +1 -0
  391. package/src/lib/server/supplier-outbox.d.ts +190 -0
  392. package/src/lib/server/supplier-outbox.js +342 -0
  393. package/src/lib/server/supplier-outbox.js.map +1 -0
  394. package/src/lib/server/supplier-update.d.ts +23 -0
  395. package/src/lib/server/supplier-update.js +289 -0
  396. package/src/lib/server/supplier-update.js.map +1 -0
  397. package/src/lib/server/tax-profile.d.ts +29 -0
  398. package/src/lib/server/tax-profile.js +40 -0
  399. package/src/lib/server/tax-profile.js.map +1 -0
  400. package/src/lib/server.d.ts +32 -0
  401. package/src/lib/server.js +311 -0
  402. package/src/lib/server.js.map +1 -0
  403. package/src/lib/site.d.ts +27 -0
  404. package/src/lib/site.js +134 -0
  405. package/src/lib/site.js.map +1 -0
  406. package/src/lib/utils/escape-html.d.ts +41 -0
  407. package/src/lib/utils/escape-html.js +41 -0
  408. package/src/lib/utils/escape-html.js.map +1 -0
  409. package/src/lib/utils/generate-preset-id.d.ts +19 -0
  410. package/src/lib/utils/generate-preset-id.js +25 -0
  411. package/src/lib/utils/generate-preset-id.js.map +1 -0
  412. package/src/lib/utils/member-continue.d.ts +45 -0
  413. package/src/lib/utils/member-continue.js +49 -0
  414. package/src/lib/utils/member-continue.js.map +1 -0
  415. package/src/lib/utils/use-storefront-purchase-event.d.ts +60 -0
  416. package/src/lib/utils/use-storefront-purchase-event.js +142 -0
  417. package/src/lib/utils/use-storefront-purchase-event.js.map +1 -0
@@ -0,0 +1,311 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ /**
17
+ * Server half of the commerce plugin (AGL-396): the site-facing storefront
18
+ * API handlers, registered with the plugin API registry and served by the
19
+ * tenant dispatcher at their unchanged `/api/commerce/*` URLs. This module
20
+ * pulls in firebase-admin + Stripe, so it is NOT re-exported from the client
21
+ * barrel — apps import `@aglyn/plugins-commerce/server` only from their
22
+ * (server-only) API dispatcher registration.
23
+ */ import { registerBillingWebhookHandler, registerOrderFulfilmentService, registerPluginApiRoute, registerPluginJob, registerSitePageEnricher, registerSitePageResolver, registerPluginPermissions, registerPluginConfigSchema } from "@aglyn/aglyn/server";
24
+ import { isEmailConfigured } from "@aglyn/shared-util-email";
25
+ import { firebaseAdmin } from "@aglyn/tenant-data-admin";
26
+ import { BUNDLE_ID } from "./constants/bundle-common.js";
27
+ import { registerProductCardReader } from "./server/product-card.js";
28
+ import { registerCommerceTaxProfile } from "./server/tax-profile.js";
29
+ import { commerceBillingWebhookHandler } from "./server/billing-webhook.js";
30
+ import { registerOrderFigureReaders } from "./server/order-figures.js";
31
+ import { COMMERCE_PERMISSIONS } from "./model/plugin-permissions.js";
32
+ import { COMMERCE_CONFIG_SCHEMA } from "./plugin-config.js";
33
+ import { commerceSitePageEnricher } from "./server/site-page-enricher.js";
34
+ import { commerceSitePageResolver } from "./server/site-page-resolver.js";
35
+ import { cartCheckoutHandler } from "./server/cart-checkout.js";
36
+ import { cartHandler } from "./server/cart.js";
37
+ import { catalogHandler } from "./server/catalog.js";
38
+ import { checkoutHandler } from "./server/checkout.js";
39
+ import { downloadHandler } from "./server/download.js";
40
+ import { feedHandler } from "./server/feed.js";
41
+ import { newsletterHandler } from "./server/newsletter.js";
42
+ import { notifyRestockHandler } from "./server/notify-restock.js";
43
+ import { productHandler } from "./server/product.js";
44
+ import { relatedHandler } from "./server/related.js";
45
+ import { reservationAvailabilityHandler } from "./server/reservation-availability.js";
46
+ import { gateHandler } from "./server/gate.js";
47
+ import { memberFeedHandler } from "./server/member-feed.js";
48
+ import { membershipAccountHandler } from "./server/membership-account.js";
49
+ import { membershipAdminPasswordHandler } from "./server/membership-admin-password.js";
50
+ import { membershipContentHandler } from "./server/membership-content.js";
51
+ import { membershipLoginHandler } from "./server/membership-login.js";
52
+ import { membershipLogoutHandler } from "./server/membership-logout.js";
53
+ import { membershipRecoverHandler } from "./server/membership-recover.js";
54
+ import { membershipRegisterHandler } from "./server/membership-register.js";
55
+ import { membershipResetHandler } from "./server/membership-reset.js";
56
+ import { membershipWishlistHandler } from "./server/membership-wishlist.js";
57
+ import { reserveHandler } from "./server/reserve.js";
58
+ import { streamHandler } from "./server/stream.js";
59
+ import { subscriptionPortalHandler } from "./server/subscription-portal.js";
60
+ import { reviewsHandler } from "./server/reviews.js";
61
+ import { connectHandler } from "./server/connect.js";
62
+ import { cancelOrderHandler } from "./server/cancel-order.js";
63
+ import { draftOrderHandler } from "./server/draft-order.js";
64
+ import { fulfillOrderHandler, recordOrderShipment } from "./server/fulfill-order.js";
65
+ import { giftCardsHandler } from "./server/gift-cards.js";
66
+ import { memberPostHandler } from "./server/member-post.js";
67
+ import { orderAnalyticsHandler } from "./server/order-analytics.js";
68
+ import { posOrderHandler } from "./server/pos-order.js";
69
+ import { processAbandonedHandler, scanAbandonedCheckouts } from "./server/process-abandoned.js";
70
+ import { processRestockHandler, scanRestockAlerts } from "./server/process-restock.js";
71
+ import { scanStockDecrements } from "./server/reconcile-stock.js";
72
+ import { refundHandler } from "./server/refund.js";
73
+ import { scanSupplierDeliveries } from "./server/supplier-outbox.js";
74
+ import { supplierUpdateHandler } from "./server/supplier-update.js";
75
+ /**
76
+ * The two commerce beats (AGL-2227).
77
+ *
78
+ * `commerce/process-abandoned` and `commerce/process-restock` have existed
79
+ * since AGL-323/326 as `x-cron-secret` HTTP doors, and `registerCommerceConsoleApi`
80
+ * below has called them "the scheduler-driven jobs" in a comment that whole
81
+ * time. **Nothing scheduled them.** Not `scheduled-crons.yml` (its table names
82
+ * 11 paths; neither of these), not `vercel.json` (no `crons` key at all), not
83
+ * `registerPluginJob` — the only two registrations in the repo were scheduled
84
+ * publishing and the bookings hold-expiry.
85
+ *
86
+ * The cost was a Pro-tier entitlement (`abandonedCart`) that had never sent an
87
+ * email, and a storefront "notify me when it's back" form writing into a queue
88
+ * with no drain. AGL-1793 had already added the collection-group indexes these
89
+ * two scans need, which is the clearest evidence they were always meant to run.
90
+ *
91
+ * Module scope, like the bookings job beside it: the runner route reaches jobs
92
+ * through `ensureAll(['tenantApi'])`, and a registration inside a `register*`
93
+ * function would depend on which entry point happened to be loaded.
94
+ *
95
+ * 15 minutes, not 1: `process-abandoned` will not remind a checkout younger
96
+ * than an hour and `process-restock` only mails alerts whose product already
97
+ * has stock, so a tighter beat buys nothing and costs two collection-group
98
+ * scans a minute. Both are bounded (200 docs) and idempotent — each pass
99
+ * stamps what it sent — so an overlapping or repeated beat cannot double-send.
100
+ */ const RECOVERY_JOB_INTERVAL_MINUTES = 15;
101
+ registerPluginJob({
102
+ pluginId: BUNDLE_ID,
103
+ name: 'abandoned-checkout-recovery',
104
+ intervalMinutes: RECOVERY_JOB_INTERVAL_MINUTES,
105
+ description: 'Email one recovery reminder per stalled checkout (abandonedCart plans).',
106
+ lockdown: {
107
+ scope: 'per-host'
108
+ },
109
+ handler: async (gate)=>{
110
+ // Quietly, not as an error: email is optional per deployment, and a beat
111
+ // that logs every minute on a self-host without Resend buries everything
112
+ // else in the log.
113
+ if (!isEmailConfigured()) return;
114
+ const { sent } = await scanAbandonedCheckouts(gate);
115
+ if (sent) console.info(`commerce: sent ${sent} abandoned-cart reminders`);
116
+ }
117
+ });
118
+ registerPluginJob({
119
+ pluginId: BUNDLE_ID,
120
+ name: 'back-in-stock-alerts',
121
+ intervalMinutes: RECOVERY_JOB_INTERVAL_MINUTES,
122
+ description: 'Email shoppers whose requested product is in stock again.',
123
+ lockdown: {
124
+ scope: 'per-host'
125
+ },
126
+ handler: async (gate)=>{
127
+ if (!isEmailConfigured()) return;
128
+ const { sent } = await scanRestockAlerts(gate);
129
+ if (sent) console.info(`commerce: sent ${sent} back-in-stock alerts`);
130
+ }
131
+ });
132
+ /**
133
+ * The missing-decrement detector (AGL-2358).
134
+ *
135
+ * HOURLY, not on the 15-minute recovery beat: it is a detector for a rare
136
+ * process death, not a queue drain, and nothing it finds gets less true for
137
+ * waiting an hour. The cost of the beat is what sets the interval — one
138
+ * collection-group read of the platform's most recent orders, plus two
139
+ * queries per host that has any — and an hour keeps that off the same tick as
140
+ * the two scans above.
141
+ *
142
+ * NOT gated on `isEmailConfigured()`, unlike its two neighbours. Those send
143
+ * mail; this writes a console notification and a log line, both of which work
144
+ * on a self-host with no mail provider at all — and a stock count that is
145
+ * silently wrong is exactly what a self-hoster least wants suppressed by a
146
+ * setting about email.
147
+ */ registerPluginJob({
148
+ pluginId: BUNDLE_ID,
149
+ name: 'stock-decrement-reconciliation',
150
+ intervalMinutes: 60,
151
+ description: 'Report paid orders whose stock decrement never landed (AGL-2358).',
152
+ lockdown: {
153
+ scope: 'per-host'
154
+ },
155
+ handler: async (gate)=>{
156
+ const scan = await scanStockDecrements(gate);
157
+ if (scan.missingLines || scan.truncatedHosts) {
158
+ console.warn(`commerce: ${scan.missingLines} order lines across ${scan.hosts} ` + `sites have no sale ledger row (${scan.reportedOrders} newly ` + `reported, ${scan.truncatedHosts} sites' ledger window truncated)`);
159
+ }
160
+ }
161
+ });
162
+ /**
163
+ * The dropship supplier outbox drain (AGL-2473).
164
+ *
165
+ * EVERY MINUTE, unlike the three above, and the interval is the point rather
166
+ * than an oversight. This is the only one of the four that a BUYER is waiting
167
+ * on: the row it drains is a paid order that has not been routed to whoever
168
+ * ships it, and every minute it sits is a minute the parcel is not moving. The
169
+ * first backoff step is also 60s, so a supplier that blipped is retried on the
170
+ * next tick.
171
+ *
172
+ * The cost that set fifteen minutes for the recovery pair does not apply. Those
173
+ * are collection-GROUP scans across every site on the platform; this is one
174
+ * ordinary equality query against a top-level collection that is EMPTY in the
175
+ * ordinary case — an empty result bills a single read, so the whole beat is
176
+ * ~1,440 reads a day whether or not anyone is dropshipping.
177
+ *
178
+ * Not gated on `isEmailConfigured()`. The supplier notification is an HTTP POST
179
+ * to the merchant's own supplier, and a self-host with no mail provider still
180
+ * has dropship orders to route.
181
+ */ registerPluginJob({
182
+ pluginId: BUNDLE_ID,
183
+ name: 'supplier-webhook-delivery',
184
+ intervalMinutes: 1,
185
+ description: 'Deliver queued dropship supplier notifications, with backoff and a ' + 'dead letter that tells the merchant (AGL-2473).',
186
+ lockdown: {
187
+ scope: 'per-host'
188
+ },
189
+ handler: async (gate)=>{
190
+ const scan = await scanSupplierDeliveries(gate);
191
+ if (scan.deadLettered) {
192
+ console.warn(`commerce: ${scan.deadLettered} dropship orders could not be routed ` + `to their supplier and have been reported on the order`);
193
+ }
194
+ }
195
+ });
196
+ /** Registers the commerce plugin's storefront API routes. */ export function registerCommerceApi() {
197
+ registerProductCardReader();
198
+ // The merchant's tax rule, for every plugin that prices a charge here.
199
+ registerCommerceTaxProfile();
200
+ registerPluginPermissions(COMMERCE_PERMISSIONS);
201
+ // Merchant-settable register discount ceiling (AGL-2161). Registered on
202
+ // BOTH surfaces, like the permissions above: the POS route reads it
203
+ // server-side, and the settings card renders it from the same schema.
204
+ registerPluginConfigSchema(COMMERCE_CONFIG_SCHEMA);
205
+ // PDP/PLP template pages (AGL-418): /products/* + /collections/*.
206
+ registerSitePageResolver(commerceSitePageResolver);
207
+ // Seeds product grids on ordinary screens (AGL-659) — the resolver above
208
+ // only covers /products/* and /collections/*, so /products itself, and any
209
+ // designed page with a grid on it, needed this to render server-side.
210
+ registerSitePageEnricher(commerceSitePageEnricher);
211
+ registerPluginApiRoute('commerce/cart-checkout', cartCheckoutHandler);
212
+ registerPluginApiRoute('commerce/cart', cartHandler);
213
+ registerPluginApiRoute('commerce/catalog', catalogHandler);
214
+ registerPluginApiRoute('commerce/checkout', checkoutHandler);
215
+ registerPluginApiRoute('commerce/download', downloadHandler);
216
+ registerPluginApiRoute('commerce/feed', feedHandler);
217
+ registerPluginApiRoute('commerce/newsletter', newsletterHandler);
218
+ registerPluginApiRoute('commerce/notify-restock', notifyRestockHandler);
219
+ // GA-safe order projection for the storefront `purchase` (AGL-1641).
220
+ registerPluginApiRoute('commerce/order-analytics', orderAnalyticsHandler);
221
+ registerPluginApiRoute('commerce/product', productHandler);
222
+ registerPluginApiRoute('commerce/related', relatedHandler);
223
+ registerPluginApiRoute('commerce/reservation-availability', reservationAvailabilityHandler);
224
+ registerPluginApiRoute('commerce/reserve', reserveHandler);
225
+ registerPluginApiRoute('commerce/gate', gateHandler);
226
+ registerPluginApiRoute('commerce/member-feed', memberFeedHandler);
227
+ registerPluginApiRoute('commerce/stream', streamHandler);
228
+ registerPluginApiRoute('commerce/subscription-portal', subscriptionPortalHandler);
229
+ registerPluginApiRoute('commerce/reviews', reviewsHandler);
230
+ registerPluginApiRoute('membership/account', membershipAccountHandler);
231
+ // Console-driven password help for a member (AGL-914). Console-auth, not
232
+ // the visitor cookie the neighbouring routes take.
233
+ registerPluginApiRoute('membership/admin-password', membershipAdminPasswordHandler);
234
+ registerPluginApiRoute('membership/content', membershipContentHandler);
235
+ registerPluginApiRoute('membership/login', membershipLoginHandler);
236
+ registerPluginApiRoute('membership/logout', membershipLogoutHandler);
237
+ // Password recovery pair (AGL-552): request + complete.
238
+ registerPluginApiRoute('membership/recover', membershipRecoverHandler);
239
+ registerPluginApiRoute('membership/register', membershipRegisterHandler);
240
+ registerPluginApiRoute('membership/reset', membershipResetHandler);
241
+ registerPluginApiRoute('membership/wishlist', membershipWishlistHandler);
242
+ }
243
+ /**
244
+ * Registers the commerce plugin's console-side API routes (AGL-396):
245
+ * merchant/staff operations (Connect onboarding, refunds, draft & POS
246
+ * orders, member posts), the supplier tracking callback, and the HTTP doors
247
+ * for the abandoned-cart / restock passes.
248
+ *
249
+ * Those last two are NOT what schedules them — the `registerPluginJob` calls
250
+ * above are (AGL-2227). This comment used to call them "the scheduler-driven
251
+ * jobs", which is how they stayed dark for months: it asserted the wiring
252
+ * instead of having it.
253
+ */ export function registerCommerceConsoleApi() {
254
+ // What a product looks like to a surface that is not this plugin's — a
255
+ // campaign email that features one asks here rather than importing the model.
256
+ registerProductCardReader();
257
+ // …and the tax rule, for the webhook that confirms what they charged.
258
+ registerCommerceTaxProfile();
259
+ // Stripe webhook sections (AGL-418): orders/carts/drafts/reservations/
260
+ // subscriptions ride the platform webhook via the hook registry.
261
+ registerBillingWebhookHandler(commerceBillingWebhookHandler);
262
+ // Cancel + stock release in one transaction (AGL-1808). Server-side because
263
+ // the release depends on the transition rule, and a client write could not
264
+ // re-ask it under the same lock that flips the status.
265
+ registerPluginApiRoute('commerce/cancel-order', cancelOrderHandler);
266
+ registerPluginApiRoute('commerce/connect', connectHandler);
267
+ registerPluginApiRoute('commerce/draft-order', draftOrderHandler);
268
+ // Fulfil + mark-delivered with the transition re-asked under the write
269
+ // (AGL-1819) — the same stale-dialog hole cancel-order closes, minus the
270
+ // stock release those two transitions never had.
271
+ registerPluginApiRoute('commerce/fulfill-order', fulfillOrderHandler);
272
+ // The same transaction, offered to the HOST APP as a capability (AGL-2461)
273
+ // so `/v1` can record a shipment without importing this library — which
274
+ // `eslint.config.mjs`'s `scope:app` boundary forbids, and which is why the
275
+ // public REST API could take an order and never ship it.
276
+ //
277
+ // Registered HERE, in the consoleApi surface, beside the route it shares an
278
+ // implementation with: `/v1` reaches it through the console's server plugin
279
+ // loader, the same `ensureAll(['consoleApi'])` batch the plugin API
280
+ // dispatcher runs. A registration at module scope would instead depend on
281
+ // which entry point a process happened to import.
282
+ //
283
+ // NOTHING ABOUT AUTHORIZATION CROSSES THIS LINE. The capability is a
284
+ // pre-authorized domain operation and `/v1` does its own gating (key scope,
285
+ // plan entitlement, org-owns-host, plugin-enabled-for-site) before it calls.
286
+ registerOrderFulfilmentService({
287
+ pluginId: BUNDLE_ID,
288
+ recordShipment: recordOrderShipment
289
+ });
290
+ // Issue / void store credit (AGL-2226). Server-side because the host
291
+ // catch-all in the Firestore rules would otherwise let a client write
292
+ // its own `balanceCents`, which checkout applies as amount-off.
293
+ registerPluginApiRoute('commerce/gift-cards', giftCardsHandler);
294
+ registerPluginApiRoute('commerce/member-post', memberPostHandler);
295
+ registerPluginApiRoute('commerce/pos-order', posOrderHandler);
296
+ registerPluginApiRoute('commerce/process-abandoned', processAbandonedHandler);
297
+ registerPluginApiRoute('commerce/process-restock', processRestockHandler);
298
+ registerPluginApiRoute('commerce/refund', refundHandler);
299
+ registerPluginApiRoute('commerce/supplier-update', supplierUpdateHandler);
300
+ // The store's sales as figure tables (AGL-2915), for the AI plugin's
301
+ // insights to read by id rather than by reading orders. The console runs
302
+ // insight jobs, so the console surface registers them.
303
+ registerOrderFigureReaders(()=>firebaseAdmin.app().firestore());
304
+ }
305
+ // Shared with the (still app-side) membership/account route.
306
+ export { mintDownloadToken } from "./server/download.js";
307
+ // Site-member session primitives, shared with the (still app-side)
308
+ // membership/* routes until those migrate too (AGL-396).
309
+ export * from "./server/membership.js";
310
+
311
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../libs/plugins/commerce/src/lib/server.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * Server half of the commerce plugin (AGL-396): the site-facing storefront\n * API handlers, registered with the plugin API registry and served by the\n * tenant dispatcher at their unchanged `/api/commerce/*` URLs. This module\n * pulls in firebase-admin + Stripe, so it is NOT re-exported from the client\n * barrel — apps import `@aglyn/plugins-commerce/server` only from their\n * (server-only) API dispatcher registration.\n */\n\nimport {\n registerBillingWebhookHandler,\n registerOrderFulfilmentService,\n registerPluginApiRoute,\n registerPluginJob,\n registerSitePageEnricher,\n registerSitePageResolver,\n registerPluginPermissions,\n registerPluginConfigSchema,\n} from '@aglyn/aglyn/server'\nimport { isEmailConfigured } from '@aglyn/shared-util-email'\nimport { firebaseAdmin } from '@aglyn/tenant-data-admin'\nimport { BUNDLE_ID } from './constants/bundle-common'\nimport { registerProductCardReader } from './server/product-card'\nimport { registerCommerceTaxProfile } from './server/tax-profile'\nimport { commerceBillingWebhookHandler } from './server/billing-webhook'\nimport { registerOrderFigureReaders } from './server/order-figures'\nimport { COMMERCE_PERMISSIONS } from './model/plugin-permissions'\nimport { COMMERCE_CONFIG_SCHEMA } from './plugin-config'\nimport { commerceSitePageEnricher } from './server/site-page-enricher'\nimport { commerceSitePageResolver } from './server/site-page-resolver'\nimport { cartCheckoutHandler } from './server/cart-checkout'\nimport { cartHandler } from './server/cart'\nimport { catalogHandler } from './server/catalog'\nimport { checkoutHandler } from './server/checkout'\nimport { downloadHandler } from './server/download'\nimport { feedHandler } from './server/feed'\nimport { newsletterHandler } from './server/newsletter'\nimport { notifyRestockHandler } from './server/notify-restock'\nimport { productHandler } from './server/product'\nimport { relatedHandler } from './server/related'\nimport { reservationAvailabilityHandler } from './server/reservation-availability'\nimport { gateHandler } from './server/gate'\nimport { memberFeedHandler } from './server/member-feed'\nimport { membershipAccountHandler } from './server/membership-account'\nimport { membershipAdminPasswordHandler } from './server/membership-admin-password'\nimport { membershipContentHandler } from './server/membership-content'\nimport { membershipLoginHandler } from './server/membership-login'\nimport { membershipLogoutHandler } from './server/membership-logout'\nimport { membershipRecoverHandler } from './server/membership-recover'\nimport { membershipRegisterHandler } from './server/membership-register'\nimport { membershipResetHandler } from './server/membership-reset'\nimport { membershipWishlistHandler } from './server/membership-wishlist'\nimport { reserveHandler } from './server/reserve'\nimport { streamHandler } from './server/stream'\nimport { subscriptionPortalHandler } from './server/subscription-portal'\nimport { reviewsHandler } from './server/reviews'\nimport { connectHandler } from './server/connect'\nimport { cancelOrderHandler } from './server/cancel-order'\nimport { draftOrderHandler } from './server/draft-order'\nimport {\n fulfillOrderHandler,\n recordOrderShipment,\n} from './server/fulfill-order'\nimport { giftCardsHandler } from './server/gift-cards'\nimport { memberPostHandler } from './server/member-post'\nimport { orderAnalyticsHandler } from './server/order-analytics'\nimport { posOrderHandler } from './server/pos-order'\nimport {\n processAbandonedHandler,\n scanAbandonedCheckouts,\n} from './server/process-abandoned'\nimport { processRestockHandler, scanRestockAlerts } from './server/process-restock'\nimport { scanStockDecrements } from './server/reconcile-stock'\nimport { refundHandler } from './server/refund'\nimport { scanSupplierDeliveries } from './server/supplier-outbox'\nimport { supplierUpdateHandler } from './server/supplier-update'\n\n/**\n * The two commerce beats (AGL-2227).\n *\n * `commerce/process-abandoned` and `commerce/process-restock` have existed\n * since AGL-323/326 as `x-cron-secret` HTTP doors, and `registerCommerceConsoleApi`\n * below has called them \"the scheduler-driven jobs\" in a comment that whole\n * time. **Nothing scheduled them.** Not `scheduled-crons.yml` (its table names\n * 11 paths; neither of these), not `vercel.json` (no `crons` key at all), not\n * `registerPluginJob` — the only two registrations in the repo were scheduled\n * publishing and the bookings hold-expiry.\n *\n * The cost was a Pro-tier entitlement (`abandonedCart`) that had never sent an\n * email, and a storefront \"notify me when it's back\" form writing into a queue\n * with no drain. AGL-1793 had already added the collection-group indexes these\n * two scans need, which is the clearest evidence they were always meant to run.\n *\n * Module scope, like the bookings job beside it: the runner route reaches jobs\n * through `ensureAll(['tenantApi'])`, and a registration inside a `register*`\n * function would depend on which entry point happened to be loaded.\n *\n * 15 minutes, not 1: `process-abandoned` will not remind a checkout younger\n * than an hour and `process-restock` only mails alerts whose product already\n * has stock, so a tighter beat buys nothing and costs two collection-group\n * scans a minute. Both are bounded (200 docs) and idempotent — each pass\n * stamps what it sent — so an overlapping or repeated beat cannot double-send.\n */\nconst RECOVERY_JOB_INTERVAL_MINUTES = 15\n\nregisterPluginJob({\n pluginId: BUNDLE_ID,\n name: 'abandoned-checkout-recovery',\n intervalMinutes: RECOVERY_JOB_INTERVAL_MINUTES,\n description:\n 'Email one recovery reminder per stalled checkout (abandonedCart plans).',\n lockdown: { scope: 'per-host' },\n handler: async (gate) => {\n // Quietly, not as an error: email is optional per deployment, and a beat\n // that logs every minute on a self-host without Resend buries everything\n // else in the log.\n if (!isEmailConfigured()) return\n const { sent } = await scanAbandonedCheckouts(gate)\n if (sent) console.info(`commerce: sent ${sent} abandoned-cart reminders`)\n },\n})\n\nregisterPluginJob({\n pluginId: BUNDLE_ID,\n name: 'back-in-stock-alerts',\n intervalMinutes: RECOVERY_JOB_INTERVAL_MINUTES,\n description: 'Email shoppers whose requested product is in stock again.',\n lockdown: { scope: 'per-host' },\n handler: async (gate) => {\n if (!isEmailConfigured()) return\n const { sent } = await scanRestockAlerts(gate)\n if (sent) console.info(`commerce: sent ${sent} back-in-stock alerts`)\n },\n})\n\n/**\n * The missing-decrement detector (AGL-2358).\n *\n * HOURLY, not on the 15-minute recovery beat: it is a detector for a rare\n * process death, not a queue drain, and nothing it finds gets less true for\n * waiting an hour. The cost of the beat is what sets the interval — one\n * collection-group read of the platform's most recent orders, plus two\n * queries per host that has any — and an hour keeps that off the same tick as\n * the two scans above.\n *\n * NOT gated on `isEmailConfigured()`, unlike its two neighbours. Those send\n * mail; this writes a console notification and a log line, both of which work\n * on a self-host with no mail provider at all — and a stock count that is\n * silently wrong is exactly what a self-hoster least wants suppressed by a\n * setting about email.\n */\nregisterPluginJob({\n pluginId: BUNDLE_ID,\n name: 'stock-decrement-reconciliation',\n intervalMinutes: 60,\n description:\n 'Report paid orders whose stock decrement never landed (AGL-2358).',\n lockdown: { scope: 'per-host' },\n handler: async (gate) => {\n const scan = await scanStockDecrements(gate)\n if (scan.missingLines || scan.truncatedHosts) {\n console.warn(\n `commerce: ${scan.missingLines} order lines across ${scan.hosts} ` +\n `sites have no sale ledger row (${scan.reportedOrders} newly ` +\n `reported, ${scan.truncatedHosts} sites' ledger window truncated)`,\n )\n }\n },\n})\n\n/**\n * The dropship supplier outbox drain (AGL-2473).\n *\n * EVERY MINUTE, unlike the three above, and the interval is the point rather\n * than an oversight. This is the only one of the four that a BUYER is waiting\n * on: the row it drains is a paid order that has not been routed to whoever\n * ships it, and every minute it sits is a minute the parcel is not moving. The\n * first backoff step is also 60s, so a supplier that blipped is retried on the\n * next tick.\n *\n * The cost that set fifteen minutes for the recovery pair does not apply. Those\n * are collection-GROUP scans across every site on the platform; this is one\n * ordinary equality query against a top-level collection that is EMPTY in the\n * ordinary case — an empty result bills a single read, so the whole beat is\n * ~1,440 reads a day whether or not anyone is dropshipping.\n *\n * Not gated on `isEmailConfigured()`. The supplier notification is an HTTP POST\n * to the merchant's own supplier, and a self-host with no mail provider still\n * has dropship orders to route.\n */\nregisterPluginJob({\n pluginId: BUNDLE_ID,\n name: 'supplier-webhook-delivery',\n intervalMinutes: 1,\n description:\n 'Deliver queued dropship supplier notifications, with backoff and a ' +\n 'dead letter that tells the merchant (AGL-2473).',\n lockdown: { scope: 'per-host' },\n handler: async (gate) => {\n const scan = await scanSupplierDeliveries(gate)\n if (scan.deadLettered) {\n console.warn(\n `commerce: ${scan.deadLettered} dropship orders could not be routed ` +\n `to their supplier and have been reported on the order`,\n )\n }\n },\n})\n\n/** Registers the commerce plugin's storefront API routes. */\nexport function registerCommerceApi(): void {\n registerProductCardReader()\n // The merchant's tax rule, for every plugin that prices a charge here.\n registerCommerceTaxProfile()\n registerPluginPermissions(COMMERCE_PERMISSIONS)\n // Merchant-settable register discount ceiling (AGL-2161). Registered on\n // BOTH surfaces, like the permissions above: the POS route reads it\n // server-side, and the settings card renders it from the same schema.\n registerPluginConfigSchema(COMMERCE_CONFIG_SCHEMA)\n // PDP/PLP template pages (AGL-418): /products/* + /collections/*.\n registerSitePageResolver(commerceSitePageResolver)\n // Seeds product grids on ordinary screens (AGL-659) — the resolver above\n // only covers /products/* and /collections/*, so /products itself, and any\n // designed page with a grid on it, needed this to render server-side.\n registerSitePageEnricher(commerceSitePageEnricher)\n registerPluginApiRoute('commerce/cart-checkout', cartCheckoutHandler)\n registerPluginApiRoute('commerce/cart', cartHandler)\n registerPluginApiRoute('commerce/catalog', catalogHandler)\n registerPluginApiRoute('commerce/checkout', checkoutHandler)\n registerPluginApiRoute('commerce/download', downloadHandler)\n registerPluginApiRoute('commerce/feed', feedHandler)\n registerPluginApiRoute('commerce/newsletter', newsletterHandler)\n registerPluginApiRoute('commerce/notify-restock', notifyRestockHandler)\n // GA-safe order projection for the storefront `purchase` (AGL-1641).\n registerPluginApiRoute('commerce/order-analytics', orderAnalyticsHandler)\n registerPluginApiRoute('commerce/product', productHandler)\n registerPluginApiRoute('commerce/related', relatedHandler)\n registerPluginApiRoute('commerce/reservation-availability', reservationAvailabilityHandler)\n registerPluginApiRoute('commerce/reserve', reserveHandler)\n registerPluginApiRoute('commerce/gate', gateHandler)\n registerPluginApiRoute('commerce/member-feed', memberFeedHandler)\n registerPluginApiRoute('commerce/stream', streamHandler)\n registerPluginApiRoute('commerce/subscription-portal', subscriptionPortalHandler)\n registerPluginApiRoute('commerce/reviews', reviewsHandler)\n registerPluginApiRoute('membership/account', membershipAccountHandler)\n // Console-driven password help for a member (AGL-914). Console-auth, not\n // the visitor cookie the neighbouring routes take.\n registerPluginApiRoute(\n 'membership/admin-password',\n membershipAdminPasswordHandler,\n )\n registerPluginApiRoute('membership/content', membershipContentHandler)\n registerPluginApiRoute('membership/login', membershipLoginHandler)\n registerPluginApiRoute('membership/logout', membershipLogoutHandler)\n // Password recovery pair (AGL-552): request + complete.\n registerPluginApiRoute('membership/recover', membershipRecoverHandler)\n registerPluginApiRoute('membership/register', membershipRegisterHandler)\n registerPluginApiRoute('membership/reset', membershipResetHandler)\n registerPluginApiRoute('membership/wishlist', membershipWishlistHandler)\n}\n\n/**\n * Registers the commerce plugin's console-side API routes (AGL-396):\n * merchant/staff operations (Connect onboarding, refunds, draft & POS\n * orders, member posts), the supplier tracking callback, and the HTTP doors\n * for the abandoned-cart / restock passes.\n *\n * Those last two are NOT what schedules them — the `registerPluginJob` calls\n * above are (AGL-2227). This comment used to call them \"the scheduler-driven\n * jobs\", which is how they stayed dark for months: it asserted the wiring\n * instead of having it.\n */\nexport function registerCommerceConsoleApi(): void {\n // What a product looks like to a surface that is not this plugin's — a\n // campaign email that features one asks here rather than importing the model.\n registerProductCardReader()\n // …and the tax rule, for the webhook that confirms what they charged.\n registerCommerceTaxProfile()\n // Stripe webhook sections (AGL-418): orders/carts/drafts/reservations/\n // subscriptions ride the platform webhook via the hook registry.\n registerBillingWebhookHandler(commerceBillingWebhookHandler)\n // Cancel + stock release in one transaction (AGL-1808). Server-side because\n // the release depends on the transition rule, and a client write could not\n // re-ask it under the same lock that flips the status.\n registerPluginApiRoute('commerce/cancel-order', cancelOrderHandler)\n registerPluginApiRoute('commerce/connect', connectHandler)\n registerPluginApiRoute('commerce/draft-order', draftOrderHandler)\n // Fulfil + mark-delivered with the transition re-asked under the write\n // (AGL-1819) — the same stale-dialog hole cancel-order closes, minus the\n // stock release those two transitions never had.\n registerPluginApiRoute('commerce/fulfill-order', fulfillOrderHandler)\n // The same transaction, offered to the HOST APP as a capability (AGL-2461)\n // so `/v1` can record a shipment without importing this library — which\n // `eslint.config.mjs`'s `scope:app` boundary forbids, and which is why the\n // public REST API could take an order and never ship it.\n //\n // Registered HERE, in the consoleApi surface, beside the route it shares an\n // implementation with: `/v1` reaches it through the console's server plugin\n // loader, the same `ensureAll(['consoleApi'])` batch the plugin API\n // dispatcher runs. A registration at module scope would instead depend on\n // which entry point a process happened to import.\n //\n // NOTHING ABOUT AUTHORIZATION CROSSES THIS LINE. The capability is a\n // pre-authorized domain operation and `/v1` does its own gating (key scope,\n // plan entitlement, org-owns-host, plugin-enabled-for-site) before it calls.\n registerOrderFulfilmentService({\n pluginId: BUNDLE_ID,\n recordShipment: recordOrderShipment,\n })\n // Issue / void store credit (AGL-2226). Server-side because the host\n // catch-all in the Firestore rules would otherwise let a client write\n // its own `balanceCents`, which checkout applies as amount-off.\n registerPluginApiRoute('commerce/gift-cards', giftCardsHandler)\n registerPluginApiRoute('commerce/member-post', memberPostHandler)\n registerPluginApiRoute('commerce/pos-order', posOrderHandler)\n registerPluginApiRoute('commerce/process-abandoned', processAbandonedHandler)\n registerPluginApiRoute('commerce/process-restock', processRestockHandler)\n registerPluginApiRoute('commerce/refund', refundHandler)\n registerPluginApiRoute('commerce/supplier-update', supplierUpdateHandler)\n // The store's sales as figure tables (AGL-2915), for the AI plugin's\n // insights to read by id rather than by reading orders. The console runs\n // insight jobs, so the console surface registers them.\n registerOrderFigureReaders(() => firebaseAdmin.app().firestore())\n}\n\n// Shared with the (still app-side) membership/account route.\nexport { mintDownloadToken } from './server/download'\n\n// Site-member session primitives, shared with the (still app-side)\n// membership/* routes until those migrate too (AGL-396).\nexport * from './server/membership'\n"],"names":["registerBillingWebhookHandler","registerOrderFulfilmentService","registerPluginApiRoute","registerPluginJob","registerSitePageEnricher","registerSitePageResolver","registerPluginPermissions","registerPluginConfigSchema","isEmailConfigured","firebaseAdmin","BUNDLE_ID","registerProductCardReader","registerCommerceTaxProfile","commerceBillingWebhookHandler","registerOrderFigureReaders","COMMERCE_PERMISSIONS","COMMERCE_CONFIG_SCHEMA","commerceSitePageEnricher","commerceSitePageResolver","cartCheckoutHandler","cartHandler","catalogHandler","checkoutHandler","downloadHandler","feedHandler","newsletterHandler","notifyRestockHandler","productHandler","relatedHandler","reservationAvailabilityHandler","gateHandler","memberFeedHandler","membershipAccountHandler","membershipAdminPasswordHandler","membershipContentHandler","membershipLoginHandler","membershipLogoutHandler","membershipRecoverHandler","membershipRegisterHandler","membershipResetHandler","membershipWishlistHandler","reserveHandler","streamHandler","subscriptionPortalHandler","reviewsHandler","connectHandler","cancelOrderHandler","draftOrderHandler","fulfillOrderHandler","recordOrderShipment","giftCardsHandler","memberPostHandler","orderAnalyticsHandler","posOrderHandler","processAbandonedHandler","scanAbandonedCheckouts","processRestockHandler","scanRestockAlerts","scanStockDecrements","refundHandler","scanSupplierDeliveries","supplierUpdateHandler","RECOVERY_JOB_INTERVAL_MINUTES","pluginId","name","intervalMinutes","description","lockdown","scope","handler","gate","sent","console","info","scan","missingLines","truncatedHosts","warn","hosts","reportedOrders","deadLettered","registerCommerceApi","registerCommerceConsoleApi","recordShipment","app","firestore","mintDownloadToken"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAGD;;;;;;;CAOC,GAED,SACEA,6BAA6B,EAC7BC,8BAA8B,EAC9BC,sBAAsB,EACtBC,iBAAiB,EACjBC,wBAAwB,EACxBC,wBAAwB,EACxBC,yBAAyB,EACzBC,0BAA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,4EAA4E;IAC5E,oEAAoE;IACpE,0EAA0E;IAC1E,kDAAkD;IAClD,EAAE;IACF,qEAAqE;IACrE,4EAA4E;IAC5E,6EAA6E;IAC7E/C,+BAA+B;QAC7B8D,UAAUrD;QACVyE,gBAAgBlC;IAClB;IACA,qEAAqE;IACrE,sEAAsE;IACtE,gEAAgE;IAChE/C,uBAAuB,uBAAuBgD;IAC9ChD,uBAAuB,wBAAwBiD;IAC/CjD,uBAAuB,sBAAsBmD;IAC7CnD,uBAAuB,8BAA8BoD;IACrDpD,uBAAuB,4BAA4BsD;IACnDtD,uBAAuB,mBAAmByD;IAC1CzD,uBAAuB,4BAA4B2D;IACnD,qEAAqE;IACrE,yEAAyE;IACzE,uDAAuD;IACvD/C,2BAA2B,IAAML,cAAc2E,GAAG,GAAGC,SAAS;AAChE;AAEA,6DAA6D;AAC7D,SAASC,iBAAiB,QAAQ,uBAAmB;AAErD,mEAAmE;AACnE,yDAAyD;AACzD,cAAc,yBAAqB"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import * as Aglyn from '@aglyn/aglyn';
18
+ /**
19
+ * Commerce UI feature plugin (AGL-290): the storefront component set,
20
+ * built on the feature-plugin pattern (AGL-277) — depends on the mui
21
+ * bundle for primitives/theming and registers alongside it in the
22
+ * besigner and the tenant renderer. Components join `COMMERCE_BUNDLE`
23
+ * as they land (PLP AGL-291, PDP AGL-292, cart AGL-293, …); ids are
24
+ * persisted in screen docs and never renamed.
25
+ */
26
+ export declare const COMMERCE_BUNDLE: Aglyn.FeatureBundleEntry[];
27
+ export declare function registerCommercePlugin(): void;
@@ -0,0 +1,134 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ import * as Aglyn from "@aglyn/aglyn";
17
+ import { mdiStorefrontOutline } from "@aglyn/shared-data-mdi";
18
+ import * as Account from "./components/account.js";
19
+ import * as Cart from "./components/cart.js";
20
+ import * as Gate from "./components/gate.js";
21
+ import * as GatedVideo from "./components/gated-video.js";
22
+ import * as MemberFeed from "./components/member-feed.js";
23
+ import * as MemberRecovery from "./components/member-recovery.js";
24
+ import * as MemberSignin from "./components/member-signin.js";
25
+ import * as MemberSignup from "./components/member-signup.js";
26
+ import * as NewsletterSignup from "./components/newsletter-signup.js";
27
+ import * as ProductDetail from "./components/product-detail.js";
28
+ import * as ReservationWidget from "./components/reservation-widget.js";
29
+ import * as ProductGrid from "./components/product-grid.js";
30
+ import * as ProductReviews from "./components/product-reviews.js";
31
+ import * as RelatedProducts from "./components/related-products.js";
32
+ import * as Wishlist from "./components/wishlist.js";
33
+ import { BUNDLE_ID } from "./constants/bundle-common.js";
34
+ /**
35
+ * Commerce UI feature plugin (AGL-290): the storefront component set,
36
+ * built on the feature-plugin pattern (AGL-277) — depends on the mui
37
+ * bundle for primitives/theming and registers alongside it in the
38
+ * besigner and the tenant renderer. Components join `COMMERCE_BUNDLE`
39
+ * as they land (PLP AGL-291, PDP AGL-292, cart AGL-293, …); ids are
40
+ * persisted in screen docs and never renamed.
41
+ */ export const COMMERCE_BUNDLE = [
42
+ {
43
+ component: ProductGrid.default,
44
+ schema: ProductGrid.schema,
45
+ presets: ProductGrid.presets
46
+ },
47
+ {
48
+ component: ProductDetail.default,
49
+ schema: ProductDetail.schema,
50
+ presets: ProductDetail.presets
51
+ },
52
+ {
53
+ component: Cart.default,
54
+ schema: Cart.schema,
55
+ presets: Cart.presets
56
+ },
57
+ {
58
+ component: Account.default,
59
+ schema: Account.schema,
60
+ presets: Account.presets
61
+ },
62
+ {
63
+ component: Wishlist.default,
64
+ schema: Wishlist.schema,
65
+ presets: Wishlist.presets
66
+ },
67
+ {
68
+ component: NewsletterSignup.default,
69
+ schema: NewsletterSignup.schema,
70
+ presets: NewsletterSignup.presets
71
+ },
72
+ {
73
+ component: Gate.default,
74
+ schema: Gate.schema,
75
+ presets: Gate.presets
76
+ },
77
+ {
78
+ component: GatedVideo.default,
79
+ schema: GatedVideo.schema,
80
+ presets: GatedVideo.presets
81
+ },
82
+ {
83
+ component: MemberFeed.default,
84
+ schema: MemberFeed.schema,
85
+ presets: MemberFeed.presets
86
+ },
87
+ {
88
+ component: MemberRecovery.default,
89
+ schema: MemberRecovery.schema,
90
+ presets: MemberRecovery.presets
91
+ },
92
+ {
93
+ component: MemberSignin.default,
94
+ schema: MemberSignin.schema,
95
+ presets: MemberSignin.presets
96
+ },
97
+ {
98
+ component: MemberSignup.default,
99
+ schema: MemberSignup.schema,
100
+ presets: MemberSignup.presets
101
+ },
102
+ {
103
+ component: ReservationWidget.default,
104
+ schema: ReservationWidget.schema,
105
+ presets: ReservationWidget.presets
106
+ },
107
+ {
108
+ component: ProductReviews.default,
109
+ schema: ProductReviews.schema,
110
+ presets: ProductReviews.presets
111
+ },
112
+ {
113
+ component: RelatedProducts.default,
114
+ schema: RelatedProducts.schema,
115
+ presets: RelatedProducts.presets
116
+ }
117
+ ];
118
+ export function registerCommercePlugin() {
119
+ // The canvas half only. The console registers the console half through its
120
+ // own `console` surface, and a published page must never load console code
121
+ // (AGL-3116): this runs on every page that places one of these elements.
122
+ if (Aglyn.plugins.getDependency(BUNDLE_ID)) return;
123
+ Aglyn.plugins.addDependency(Aglyn.defineUiFeatureBundle({
124
+ bundleId: BUNDLE_ID,
125
+ displayName: 'Commerce',
126
+ description: 'Storefront blocks: product grids, detail, cart',
127
+ icon: {
128
+ path: mdiStorefrontOutline.path
129
+ },
130
+ components: COMMERCE_BUNDLE
131
+ }, Aglyn.components));
132
+ }
133
+
134
+ //# sourceMappingURL=site.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../libs/plugins/commerce/src/lib/site.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as Aglyn from '@aglyn/aglyn'\nimport { mdiStorefrontOutline } from '@aglyn/shared-data-mdi'\nimport * as Account from './components/account'\nimport * as Cart from './components/cart'\nimport * as Gate from './components/gate'\nimport * as GatedVideo from './components/gated-video'\nimport * as MemberFeed from './components/member-feed'\nimport * as MemberRecovery from './components/member-recovery'\nimport * as MemberSignin from './components/member-signin'\nimport * as MemberSignup from './components/member-signup'\nimport * as NewsletterSignup from './components/newsletter-signup'\nimport * as ProductDetail from './components/product-detail'\nimport * as ReservationWidget from './components/reservation-widget'\nimport * as ProductGrid from './components/product-grid'\nimport * as ProductReviews from './components/product-reviews'\nimport * as RelatedProducts from './components/related-products'\nimport * as Wishlist from './components/wishlist'\nimport { BUNDLE_ID } from './constants/bundle-common'\n\n/**\n * Commerce UI feature plugin (AGL-290): the storefront component set,\n * built on the feature-plugin pattern (AGL-277) — depends on the mui\n * bundle for primitives/theming and registers alongside it in the\n * besigner and the tenant renderer. Components join `COMMERCE_BUNDLE`\n * as they land (PLP AGL-291, PDP AGL-292, cart AGL-293, …); ids are\n * persisted in screen docs and never renamed.\n */\nexport const COMMERCE_BUNDLE: Aglyn.FeatureBundleEntry[] = [\n {\n component: ProductGrid.default,\n schema: ProductGrid.schema,\n presets: ProductGrid.presets,\n },\n {\n component: ProductDetail.default,\n schema: ProductDetail.schema,\n presets: ProductDetail.presets,\n },\n {\n component: Cart.default,\n schema: Cart.schema,\n presets: Cart.presets,\n },\n {\n component: Account.default,\n schema: Account.schema,\n presets: Account.presets,\n },\n {\n component: Wishlist.default,\n schema: Wishlist.schema,\n presets: Wishlist.presets,\n },\n {\n component: NewsletterSignup.default,\n schema: NewsletterSignup.schema,\n presets: NewsletterSignup.presets,\n },\n {\n component: Gate.default,\n schema: Gate.schema,\n presets: Gate.presets,\n },\n {\n component: GatedVideo.default,\n schema: GatedVideo.schema,\n presets: GatedVideo.presets,\n },\n {\n component: MemberFeed.default,\n schema: MemberFeed.schema,\n presets: MemberFeed.presets,\n },\n {\n component: MemberRecovery.default,\n schema: MemberRecovery.schema,\n presets: MemberRecovery.presets,\n },\n {\n component: MemberSignin.default,\n schema: MemberSignin.schema,\n presets: MemberSignin.presets,\n },\n {\n component: MemberSignup.default,\n schema: MemberSignup.schema,\n presets: MemberSignup.presets,\n },\n {\n component: ReservationWidget.default,\n schema: ReservationWidget.schema,\n presets: ReservationWidget.presets,\n },\n {\n component: ProductReviews.default,\n schema: ProductReviews.schema,\n presets: ProductReviews.presets,\n },\n {\n component: RelatedProducts.default,\n schema: RelatedProducts.schema,\n presets: RelatedProducts.presets,\n },\n]\n\nexport function registerCommercePlugin(): void {\n // The canvas half only. The console registers the console half through its\n // own `console` surface, and a published page must never load console code\n // (AGL-3116): this runs on every page that places one of these elements.\n if (Aglyn.plugins.getDependency(BUNDLE_ID)) return\n Aglyn.plugins.addDependency(\n Aglyn.defineUiFeatureBundle(\n {\n bundleId: BUNDLE_ID,\n displayName: 'Commerce',\n description: 'Storefront blocks: product grids, detail, cart',\n icon: { path: mdiStorefrontOutline.path },\n components: COMMERCE_BUNDLE,\n },\n Aglyn.components,\n ),\n )\n}\n"],"names":["Aglyn","mdiStorefrontOutline","Account","Cart","Gate","GatedVideo","MemberFeed","MemberRecovery","MemberSignin","MemberSignup","NewsletterSignup","ProductDetail","ReservationWidget","ProductGrid","ProductReviews","RelatedProducts","Wishlist","BUNDLE_ID","COMMERCE_BUNDLE","component","default","schema","presets","registerCommercePlugin","plugins","getDependency","addDependency","defineUiFeatureBundle","bundleId","displayName","description","icon","path","components"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,WAAW,eAAc;AACrC,SAASC,oBAAoB,QAAQ,yBAAwB;AAC7D,YAAYC,aAAa,0BAAsB;AAC/C,YAAYC,UAAU,uBAAmB;AACzC,YAAYC,UAAU,uBAAmB;AACzC,YAAYC,gBAAgB,8BAA0B;AACtD,YAAYC,gBAAgB,8BAA0B;AACtD,YAAYC,oBAAoB,kCAA8B;AAC9D,YAAYC,kBAAkB,gCAA4B;AAC1D,YAAYC,kBAAkB,gCAA4B;AAC1D,YAAYC,sBAAsB,oCAAgC;AAClE,YAAYC,mBAAmB,iCAA6B;AAC5D,YAAYC,uBAAuB,qCAAiC;AACpE,YAAYC,iBAAiB,+BAA2B;AACxD,YAAYC,oBAAoB,kCAA8B;AAC9D,YAAYC,qBAAqB,mCAA+B;AAChE,YAAYC,cAAc,2BAAuB;AACjD,SAASC,SAAS,QAAQ,+BAA2B;AAErD;;;;;;;CAOC,GACD,OAAO,MAAMC,kBAA8C;IACzD;QACEC,WAAWN,YAAYO,OAAO;QAC9BC,QAAQR,YAAYQ,MAAM;QAC1BC,SAAST,YAAYS,OAAO;IAC9B;IACA;QACEH,WAAWR,cAAcS,OAAO;QAChCC,QAAQV,cAAcU,MAAM;QAC5BC,SAASX,cAAcW,OAA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AC9BC,SAASP,gBAAgBO,OAAO;IAClC;CACD,CAAA;AAED,OAAO,SAASC;IACd,2EAA2E;IAC3E,2EAA2E;IAC3E,yEAAyE;IACzE,IAAIvB,MAAMwB,OAAO,CAACC,aAAa,CAACR,YAAY;IAC5CjB,MAAMwB,OAAO,CAACE,aAAa,CACzB1B,MAAM2B,qBAAqB,CACzB;QACEC,UAAUX;QACVY,aAAa;QACbC,aAAa;QACbC,MAAM;YAAEC,MAAM/B,qBAAqB+B,IAAI;QAAC;QACxCC,YAAYf;IACd,GACAlB,MAAMiC,UAAU;AAGtB"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * HTML-escape a text value for interpolation into markup this plugin builds by
19
+ * hand (AGL-2283).
20
+ *
21
+ * Commerce has three such places and React guards none of them, because none
22
+ * of them is React: the packing slip and the POS receipt are written into a
23
+ * `window.open('')` popup with `document.write`, and the supplier confirmation
24
+ * page is a string a server route sends. All three interpolated values
25
+ * straight in.
26
+ *
27
+ * The packing slip is the one that matters. `order.shippingAddress` is copied
28
+ * verbatim from Stripe's `shipping_details` — a SHOPPER types it — and the
29
+ * popup is an `about:blank` document that inherits the CONSOLE's origin, so a
30
+ * name of `<img src=x onerror=…>` runs script against the merchant's own
31
+ * authenticated session. The receipt and the slip's line names are merchant-
32
+ * authored and lower severity, but they are the same construction and are
33
+ * escaped the same way rather than reasoned about one at a time.
34
+ *
35
+ * The escaping itself is `@aglyn/shared-util-tools/escape-html`, which this
36
+ * module's implementation became when the same function turned up in four
37
+ * other places (AGL-2706) — two of them missing `'`. What stays here is the
38
+ * paragraph above, which is about commerce's call sites and belongs with
39
+ * them.
40
+ */
41
+ export { escapeHtml } from '@aglyn/shared-util-tools/escape-html';
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ /**
17
+ * HTML-escape a text value for interpolation into markup this plugin builds by
18
+ * hand (AGL-2283).
19
+ *
20
+ * Commerce has three such places and React guards none of them, because none
21
+ * of them is React: the packing slip and the POS receipt are written into a
22
+ * `window.open('')` popup with `document.write`, and the supplier confirmation
23
+ * page is a string a server route sends. All three interpolated values
24
+ * straight in.
25
+ *
26
+ * The packing slip is the one that matters. `order.shippingAddress` is copied
27
+ * verbatim from Stripe's `shipping_details` — a SHOPPER types it — and the
28
+ * popup is an `about:blank` document that inherits the CONSOLE's origin, so a
29
+ * name of `<img src=x onerror=…>` runs script against the merchant's own
30
+ * authenticated session. The receipt and the slip's line names are merchant-
31
+ * authored and lower severity, but they are the same construction and are
32
+ * escaped the same way rather than reasoned about one at a time.
33
+ *
34
+ * The escaping itself is `@aglyn/shared-util-tools/escape-html`, which this
35
+ * module's implementation became when the same function turned up in four
36
+ * other places (AGL-2706) — two of them missing `'`. What stays here is the
37
+ * paragraph above, which is about commerce's call sites and belongs with
38
+ * them.
39
+ */ export { escapeHtml } from "@aglyn/shared-util-tools/escape-html";
40
+
41
+ //# sourceMappingURL=escape-html.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/utils/escape-html.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * HTML-escape a text value for interpolation into markup this plugin builds by\n * hand (AGL-2283).\n *\n * Commerce has three such places and React guards none of them, because none\n * of them is React: the packing slip and the POS receipt are written into a\n * `window.open('')` popup with `document.write`, and the supplier confirmation\n * page is a string a server route sends. All three interpolated values\n * straight in.\n *\n * The packing slip is the one that matters. `order.shippingAddress` is copied\n * verbatim from Stripe's `shipping_details` — a SHOPPER types it — and the\n * popup is an `about:blank` document that inherits the CONSOLE's origin, so a\n * name of `<img src=x onerror=…>` runs script against the merchant's own\n * authenticated session. The receipt and the slip's line names are merchant-\n * authored and lower severity, but they are the same construction and are\n * escaped the same way rather than reasoned about one at a time.\n *\n * The escaping itself is `@aglyn/shared-util-tools/escape-html`, which this\n * module's implementation became when the same function turned up in four\n * other places (AGL-2706) — two of them missing `'`. What stays here is the\n * paragraph above, which is about commerce's call sites and belongs with\n * them.\n */\nexport { escapeHtml } from '@aglyn/shared-util-tools/escape-html'\n"],"names":["escapeHtml"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;;;;;;;;CAuBC,GACD,SAASA,UAAU,QAAQ,uCAAsC"}