@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,316 @@
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
+ * Shipping v1 (AGL-288): zones own countries; rates belong to a zone and
19
+ * price as flat, free-over-threshold, or subtotal/weight tiers. Settings
20
+ * live on `hosts/{hostId}/settings/store` under `shipping`. Pure.
21
+ *
22
+ * `resolveShippingRates` is the per-destination resolver;
23
+ * `resolveCheckoutShippingOptions` is the Stripe Checkout adapter,
24
+ * `planCheckoutShipping` decides which destinations one session may serve,
25
+ * `appendCheckoutShippingParams` emits it onto a session, and
26
+ * `summarizeShippingCoverage` answers the same question for the console, so a
27
+ * merchant can see which destinations their zones refuse. AGL-288 shipped this
28
+ * model with no production call site at all — the doc comment here claimed the
29
+ * cart estimator, checkout and POS pickup used it, and none of them did, so
30
+ * nothing ever read the settings a merchant saved and no shipping was ever
31
+ * charged. Cart checkout calls it (AGL-1707), buy-now calls it for physical
32
+ * one-time products (AGL-1720), and a draft order's payment link calls it for
33
+ * physical products (AGL-1792).
34
+ *
35
+ * POS DOES NOT, AND SHOULD NOT (AGL-1792). A register has no destination
36
+ * anywhere in it — no address field, no delivery choice — and all three
37
+ * tenders settle at the counter: cash, a card QR the customer scans while
38
+ * standing there, and a room folio collected at check-out. There is nothing to
39
+ * price a parcel against, so the only rate POS could resolve is the free
40
+ * `Local pickup` one this module appends, which is 0¢ and would add a step to
41
+ * a register flow in exchange for nothing. A POS sale that must be shipped is
42
+ * a draft order.
43
+ */
44
+ export interface ShippingZone {
45
+ id: string;
46
+ name: string;
47
+ /** ISO-3166 alpha-2 codes; '*' = rest of world. */
48
+ countries: string[];
49
+ }
50
+ export interface ShippingTier {
51
+ /** Tier applies while subtotal (cents) or weight (grams) ≤ this. */
52
+ upTo: number;
53
+ amountCents: number;
54
+ }
55
+ export interface ShippingRate {
56
+ id: string;
57
+ zoneId: string;
58
+ name: string;
59
+ kind: 'flat' | 'free_over' | 'price_tiers' | 'weight_tiers';
60
+ /** flat + free_over base amount. */
61
+ amountCents?: number;
62
+ /** free_over: order subtotal (cents) at/above which shipping is free. */
63
+ freeOverCents?: number;
64
+ /** price_tiers (upTo = subtotal cents) / weight_tiers (upTo = grams). */
65
+ tiers?: ShippingTier[];
66
+ }
67
+ export interface ShippingSettings {
68
+ zones?: ShippingZone[];
69
+ rates?: ShippingRate[];
70
+ /**
71
+ * Offer free local pickup as a delivery choice. Does NOT widen where the
72
+ * store ships: a destination no rate reaches is still refused (AGL-2325).
73
+ */
74
+ localPickup?: boolean;
75
+ }
76
+ export interface ResolvedShippingRate {
77
+ rateId: string;
78
+ name: string;
79
+ amountCents: number;
80
+ }
81
+ /**
82
+ * The rate id appended for local pickup (AGL-2325).
83
+ *
84
+ * Exported because pickup is the one entry in a resolved list that is NOT a
85
+ * shipping promise: it is appended AFTER and INDEPENDENT of zone matching, so
86
+ * it resolves for every destination on earth. Anything asking "does this store
87
+ * ship there" — the checkout refusal, the console coverage card — has to be
88
+ * able to tell it apart from a rate, or it reads a merchant who offers
89
+ * collection as a merchant who delivers worldwide.
90
+ */
91
+ export declare const LOCAL_PICKUP_RATE_ID = "pickup";
92
+ /**
93
+ * Rates available for a destination + cart, cheapest first. Specific
94
+ * country zones beat '*' zones: when any specific zone matches, '*'
95
+ * zones are ignored (rest-of-world semantics).
96
+ *
97
+ * Local pickup is appended AFTER and INDEPENDENT of zone matching, so this
98
+ * list is never empty for a merchant who offers it, at any destination. That
99
+ * is correct for a resolver — a shopper anywhere may choose to come and
100
+ * collect — but it means A NON-EMPTY RESULT IS NOT A PROMISE TO SHIP THERE.
101
+ * Callers deciding whether a destination is served must filter pickup out
102
+ * first; `planCheckoutShipping` and `summarizeShippingCoverage` do (AGL-2325).
103
+ */
104
+ export declare function resolveShippingRates(settings: ShippingSettings | undefined, destinationCountry: string | undefined, cart: {
105
+ subtotalCents: number;
106
+ totalGrams?: number;
107
+ }): ResolvedShippingRate[];
108
+ /** Stripe Checkout accepts at most 5 `shipping_options` on one session. */
109
+ export declare const MAX_CHECKOUT_SHIPPING_OPTIONS = 5;
110
+ /**
111
+ * Destinations a storefront Checkout Session collects an address for, and
112
+ * therefore the destinations shipping rates are resolved against (AGL-1707).
113
+ *
114
+ * NOT narrowed to the zones the merchant configured: narrowing would block
115
+ * checkouts that complete today, turning a money fix into lost sales. The
116
+ * wider list only means a shopper outside the merchant's zones is offered some
117
+ * rate rather than none. Shared by cart checkout and buy-now (AGL-1720) so the
118
+ * two paths cannot drift into offering different destinations.
119
+ */
120
+ export declare const CHECKOUT_SHIPPING_COUNTRIES: readonly ["US", "CA", "GB", "AU", "DE", "FR"];
121
+ /**
122
+ * The rates to declare as `shipping_options` on a Stripe Checkout Session
123
+ * (AGL-1707), unioned over `destinationCountries`. Stripe charges shipping
124
+ * ONLY when the session declares them.
125
+ *
126
+ * A UNION IS ONLY HONEST OVER DESTINATIONS THE SESSION IS ALSO RESTRICTED TO.
127
+ * Called with every collectable country while the session accepted an address
128
+ * in any of them — which is what AGL-1707 shipped — it offers a shopper in one
129
+ * zone a rate belonging to another, and Stripe applies whichever the shopper
130
+ * picks (a `shipping_rate_data` carries no country of its own, so nothing
131
+ * downstream re-checks it against the address). That is AGL-1721. Callers now
132
+ * reach this through `planCheckoutShipping`, which pairs the country list it
133
+ * unions over with the country list the session allows, so the two cannot
134
+ * disagree. Do not call it directly from a handler.
135
+ *
136
+ * Returns `[]` for a merchant who has configured nothing, and the caller must
137
+ * then declare no `shipping_options` at all rather than an empty array — a
138
+ * merchant who never set shipping up keeps a session identical to today's.
139
+ */
140
+ export declare function resolveCheckoutShippingOptions(settings: ShippingSettings | undefined, destinationCountries: readonly string[], cart: {
141
+ subtotalCents: number;
142
+ totalGrams?: number;
143
+ }): ResolvedShippingRate[];
144
+ /** Shopper-facing names for the collectable destinations (AGL-1721). */
145
+ export declare const CHECKOUT_SHIPPING_COUNTRY_NAMES: Readonly<Record<string, string>>;
146
+ /**
147
+ * A destination a shopper declared, or `undefined` for anything this session
148
+ * could not collect an address for anyway. Never throws: an unknown code is
149
+ * an undeclared destination, not an error, so a stale storefront that posts
150
+ * one is answered by the plan below rather than by a 400 nobody can act on.
151
+ */
152
+ export declare function normalizeCheckoutShippingCountry(value: unknown): string | undefined;
153
+ export interface CheckoutShippingPlan {
154
+ /** `shipping_address_collection[allowed_countries]` for this session. */
155
+ countries: readonly string[];
156
+ /** `shipping_options` for this session — valid for EVERY `countries` entry. */
157
+ options: ResolvedShippingRate[];
158
+ /**
159
+ * Set when no session may be created at all:
160
+ *
161
+ * - `destination-required` — the merchant's rates differ by destination, so
162
+ * there is no set of options honest for every address Stripe would accept.
163
+ * Ask the shopper where they are shipping and plan again.
164
+ * - `destination-unserved` — the merchant ships somewhere, but not there.
165
+ * - `cart-unpriceable` — the merchant priced shipping, but no rate of theirs
166
+ * resolves for THIS cart at ANY destination (AGL-2232). A tier table that
167
+ * stops at 2 kg says nothing about a 3 kg parcel, and the honest answer is
168
+ * to refuse rather than to ship it for nothing.
169
+ */
170
+ refusal?: 'destination-required' | 'destination-unserved' | 'cart-unpriceable';
171
+ }
172
+ /**
173
+ * Whether this merchant prices shipping AT ALL (AGL-2232).
174
+ *
175
+ * A pure question about the SETTINGS, deliberately taking no cart, and that is
176
+ * the whole point of it existing. `planCheckoutShipping` used to ask "does any
177
+ * rate resolve for any destination?" and pass the live cart into the probe, so
178
+ * a cart that exhausted every tier made the probe empty too — and an empty
179
+ * probe reads as "this merchant never set shipping up", the one case that must
180
+ * complete with no `shipping_options` and nothing charged. A 3 kg order at a
181
+ * store whose weight tiers stop at 2 kg therefore shipped free, silently, on
182
+ * every one of the three doors.
183
+ *
184
+ * Answered from the stored zones and rates instead: a rate bound to a zone
185
+ * that exists, or local pickup, means the merchant made a shipping decision
186
+ * and a cart their table cannot price is a REFUSAL. A merchant with no zones,
187
+ * no rates and no pickup has made no such decision, and their session stays
188
+ * byte-identical to the one AGL-1707 shipped.
189
+ */
190
+ export declare function merchantPricesShipping(settings: ShippingSettings | undefined): boolean;
191
+ /**
192
+ * What a shopper is told when `cart-unpriceable` refuses (AGL-2232).
193
+ *
194
+ * One string, shared by all three doors, because the three used to phrase the
195
+ * two existing refusals identically and drifting here would make the same
196
+ * store say different things depending on which button was pressed. It names
197
+ * the cart rather than the destination on purpose — a `Ship to` select cannot
198
+ * fix a parcel no tier covers, so the refusal deliberately does NOT set
199
+ * `needsShippingCountry`.
200
+ */
201
+ export declare const CART_UNPRICEABLE_SHIPPING_MESSAGE: string;
202
+ /**
203
+ * The whole shipping half of a Checkout Session: which destinations it may
204
+ * accept an address for, and which rates it may charge (AGL-1721).
205
+ *
206
+ * THE INVARIANT IS THAT EVERY RETURNED OPTION IS VALID FOR EVERY RETURNED
207
+ * COUNTRY. Stripe offers a session's `shipping_options` to whoever reaches the
208
+ * page and charges whichever the shopper picks — it does not filter them by
209
+ * the address entered, and there is no field on a `shipping_rate_data` that
210
+ * would let it. So the ONLY place a zone can be enforced is here, by choosing
211
+ * the two lists together: narrowing the allowed countries to the declared
212
+ * destination is what makes the rates offered for it unpickable by anyone
213
+ * else. Filtering the rate list alone would leave a session that still accepts
214
+ * a French address against a US rate.
215
+ *
216
+ * Three shapes come out of it:
217
+ *
218
+ * 1. A merchant whose rates resolve the SAME for every collectable country —
219
+ * one zone, a single '*' zone, or none at all — needs no destination and
220
+ * keeps the session AGL-1707 shipped, byte for byte. The issue notes this
221
+ * is the common configuration, and it is the one that must not regress.
222
+ * 2. A declared destination resolves exactly, and the session is restricted
223
+ * to it. A caller may not skip the restriction: the country arrives in a
224
+ * request body a shopper can craft, so a session that took the country's
225
+ * cheap rate while still accepting any address would hand that shopper
226
+ * the defect on purpose.
227
+ * 3. Otherwise the caller must refuse — see `refusal`. Refusing is not lost
228
+ * revenue in either case: with rates that differ by zone there is no
229
+ * correct amount to charge without knowing where the parcel is going, and
230
+ * the union AGL-1707 shipped chose the wrong one silently.
231
+ *
232
+ * `cart.subtotalCents` is the PRE-discount items total, matching what the cart
233
+ * displays, so a free-over threshold means what the shopper saw it mean.
234
+ */
235
+ export declare function planCheckoutShipping(settings: ShippingSettings | undefined, cart: {
236
+ subtotalCents: number;
237
+ totalGrams?: number;
238
+ }, destinationCountry?: unknown): CheckoutShippingPlan;
239
+ /** What a merchant's saved zones and rates cost their shoppers (AGL-1791). */
240
+ export interface ShippingCoverage {
241
+ /** Collectable destinations at least one rate reaches. */
242
+ served: string[];
243
+ /**
244
+ * Collectable destinations CHECKOUT REFUSES — `destination-unserved`.
245
+ *
246
+ * EMPTY FOR A MERCHANT WHOSE RATES REACH NOWHERE, who is not misconfigured:
247
+ * `planCheckoutShipping` refuses nobody when no rate resolves anywhere, so
248
+ * that store charges no shipping and completes exactly as it always has.
249
+ * The rule lives here rather than in the caller because reading `served`
250
+ * against a bare partition is how a surface comes to warn every store that
251
+ * does not ship.
252
+ */
253
+ unserved: string[];
254
+ /** No rate reaches anywhere: no shipping is charged, and nobody refused. */
255
+ shipsNowhere: boolean;
256
+ /**
257
+ * Rates differ by destination, so the storefront asks the shopper where the
258
+ * parcel is going before it can price one — a checkout step the merchant
259
+ * added by saving these zones, and never chose.
260
+ */
261
+ asksDestination: boolean;
262
+ /** Some zone already claims rest of world, so `*` is not the missing piece. */
263
+ hasRestOfWorldZone: boolean;
264
+ /**
265
+ * The merchant offers local pickup, so checkout presents a free collection
266
+ * choice at every destination it does not refuse (AGL-2325).
267
+ *
268
+ * Deliberately NOT folded into `served`: pickup resolves for every country
269
+ * because it is appended independent of zone matching, so counting it as
270
+ * coverage told a US-only merchant who had switched it on that checkout
271
+ * "can price shipping to every destination", which is the sentence that
272
+ * hid the defect. It is reported alongside instead, so the card can say
273
+ * both true things: these destinations are refused, and pickup is offered
274
+ * to the ones that are not.
275
+ */
276
+ offersLocalPickup: boolean;
277
+ }
278
+ /**
279
+ * Which of the collectable destinations a merchant's settings actually cover
280
+ * (AGL-1791), for a console surface to show them.
281
+ *
282
+ * Measured against `CHECKOUT_SHIPPING_COUNTRIES` and nothing wider: those six
283
+ * are the only destinations a storefront session collects an address for, so
284
+ * they are the only ones a merchant can lose an order to. Counting coverage
285
+ * against every country on earth would report a gap for destinations no
286
+ * shopper can reach checkout from.
287
+ *
288
+ * Answered through `resolveCheckoutShippingOptions` — the same function the
289
+ * session is built from — so a row the console allows but Stripe would reject
290
+ * (blank id, blank name) counts as the nothing it resolves to, and a specific
291
+ * zone with no rates still hides a `*` zone here exactly as it does at
292
+ * checkout.
293
+ */
294
+ export declare function summarizeShippingCoverage(settings: ShippingSettings | undefined): ShippingCoverage;
295
+ /**
296
+ * Emit `shipping_address_collection[allowed_countries][n]` onto a session's
297
+ * form body. Stripe will not apply a `shipping_options` rate without an
298
+ * address to ship to, so the two always travel together — and the countries
299
+ * are the OTHER half of what makes a rate honest (AGL-1721), so pass the list
300
+ * `planCheckoutShipping` returned rather than defaulting it beside a rate list
301
+ * resolved for something narrower.
302
+ */
303
+ export declare function appendShippingAddressCollectionParams(params: URLSearchParams, countries?: readonly string[]): void;
304
+ /**
305
+ * Emit resolved rates as `shipping_options` on a Checkout Session's form body.
306
+ *
307
+ * THIS IS THE ONLY THING THAT MAKES STRIPE CHARGE SHIPPING. Without these keys
308
+ * Stripe presents no shipping choice and `total_details.amount_shipping` is 0
309
+ * however many zones and rates the merchant saved (AGL-1707).
310
+ *
311
+ * An empty list emits NOTHING — not an empty array — so a merchant who
312
+ * configured no shipping keeps a session byte-identical to the one built
313
+ * before shipping was wired at all. That guarantee lives here rather than in
314
+ * each caller, so neither checkout path can lose it independently (AGL-1720).
315
+ */
316
+ export declare function appendCheckoutShippingParams(params: URLSearchParams, options: readonly ResolvedShippingRate[]): void;