@sixtyninecommerce/client 0.24.0 → 0.26.0

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 (293) hide show
  1. package/README.md +21 -0
  2. package/dist/admin/forms.js +19 -0
  3. package/dist/admin/forms.js.map +1 -1
  4. package/dist/admin/http.d.ts +9 -0
  5. package/dist/admin/http.d.ts.map +1 -1
  6. package/dist/admin/http.js +3 -0
  7. package/dist/admin/http.js.map +1 -1
  8. package/dist/admin/index.d.ts +63 -0
  9. package/dist/admin/index.d.ts.map +1 -1
  10. package/dist/admin/index.js +67 -0
  11. package/dist/admin/index.js.map +1 -1
  12. package/dist/admin/redirects.d.ts +6 -0
  13. package/dist/admin/redirects.d.ts.map +1 -1
  14. package/dist/admin/redirects.js +12 -0
  15. package/dist/admin/redirects.js.map +1 -1
  16. package/dist/admin/types.d.ts +63 -0
  17. package/dist/admin/types.d.ts.map +1 -1
  18. package/dist/cache-tags.d.ts +19 -0
  19. package/dist/cache-tags.d.ts.map +1 -1
  20. package/dist/cache-tags.js +19 -0
  21. package/dist/cache-tags.js.map +1 -1
  22. package/dist/client.d.ts +17 -0
  23. package/dist/client.d.ts.map +1 -1
  24. package/dist/client.js +17 -0
  25. package/dist/client.js.map +1 -1
  26. package/dist/commerce/age-verification.js +3 -3
  27. package/dist/commerce/age-verification.js.map +1 -1
  28. package/dist/commerce/branding.js +7 -0
  29. package/dist/commerce/branding.js.map +1 -1
  30. package/dist/commerce/cart.js +25 -0
  31. package/dist/commerce/cart.js.map +1 -1
  32. package/dist/commerce/checkout.d.ts +68 -0
  33. package/dist/commerce/checkout.d.ts.map +1 -1
  34. package/dist/commerce/checkout.js +83 -0
  35. package/dist/commerce/checkout.js.map +1 -1
  36. package/dist/commerce/customer.d.ts +58 -0
  37. package/dist/commerce/customer.d.ts.map +1 -1
  38. package/dist/commerce/customer.js +65 -0
  39. package/dist/commerce/customer.js.map +1 -1
  40. package/dist/commerce/pickup-location-parser.d.ts +18 -0
  41. package/dist/commerce/pickup-location-parser.d.ts.map +1 -1
  42. package/dist/commerce/pickup-location-parser.js +28 -0
  43. package/dist/commerce/pickup-location-parser.js.map +1 -1
  44. package/dist/commerce/placement-error.d.ts +52 -0
  45. package/dist/commerce/placement-error.d.ts.map +1 -1
  46. package/dist/commerce/placement-error.js +87 -0
  47. package/dist/commerce/placement-error.js.map +1 -1
  48. package/dist/commerce/products.d.ts +48 -0
  49. package/dist/commerce/products.d.ts.map +1 -1
  50. package/dist/commerce/products.js +92 -0
  51. package/dist/commerce/products.js.map +1 -1
  52. package/dist/commerce/queries.d.ts +113 -27
  53. package/dist/commerce/queries.d.ts.map +1 -1
  54. package/dist/commerce/queries.js +188 -2
  55. package/dist/commerce/queries.js.map +1 -1
  56. package/dist/commerce/quotes.js +33 -0
  57. package/dist/commerce/quotes.js.map +1 -1
  58. package/dist/commerce/saved-lists.d.ts +7 -7
  59. package/dist/commerce/saved-lists.d.ts.map +1 -1
  60. package/dist/commerce/saved-lists.js +1 -1
  61. package/dist/commerce/search.js +3 -0
  62. package/dist/commerce/search.js.map +1 -1
  63. package/dist/commerce/shipping.js +3 -3
  64. package/dist/commerce/shipping.js.map +1 -1
  65. package/dist/commerce/stock-notifications.d.ts +11 -0
  66. package/dist/commerce/stock-notifications.d.ts.map +1 -1
  67. package/dist/commerce/stock-notifications.js +11 -0
  68. package/dist/commerce/stock-notifications.js.map +1 -1
  69. package/dist/commerce/vat-validation.js +4 -4
  70. package/dist/commerce/vat-validation.js.map +1 -1
  71. package/dist/constants.d.ts +31 -0
  72. package/dist/constants.d.ts.map +1 -1
  73. package/dist/constants.js +32 -0
  74. package/dist/constants.js.map +1 -1
  75. package/dist/content/asset-urls.d.ts +50 -0
  76. package/dist/content/asset-urls.d.ts.map +1 -1
  77. package/dist/content/asset-urls.js +92 -0
  78. package/dist/content/asset-urls.js.map +1 -1
  79. package/dist/content/assets.d.ts +15 -0
  80. package/dist/content/assets.d.ts.map +1 -1
  81. package/dist/content/assets.js +15 -0
  82. package/dist/content/assets.js.map +1 -1
  83. package/dist/content/collection-pages.d.ts +5 -0
  84. package/dist/content/collection-pages.d.ts.map +1 -1
  85. package/dist/content/collection-pages.js +8 -0
  86. package/dist/content/collection-pages.js.map +1 -1
  87. package/dist/content/collections.d.ts +14 -0
  88. package/dist/content/collections.d.ts.map +1 -1
  89. package/dist/content/collections.js +16 -0
  90. package/dist/content/collections.js.map +1 -1
  91. package/dist/content/filtered-products.d.ts +18 -0
  92. package/dist/content/filtered-products.d.ts.map +1 -1
  93. package/dist/content/filtered-products.js +16 -0
  94. package/dist/content/filtered-products.js.map +1 -1
  95. package/dist/content/form-field-types.d.ts +6 -0
  96. package/dist/content/form-field-types.d.ts.map +1 -1
  97. package/dist/content/form-field-types.js +12 -0
  98. package/dist/content/form-field-types.js.map +1 -1
  99. package/dist/content/forms.d.ts +16 -0
  100. package/dist/content/forms.d.ts.map +1 -1
  101. package/dist/content/forms.js +23 -0
  102. package/dist/content/forms.js.map +1 -1
  103. package/dist/content/items.d.ts +26 -0
  104. package/dist/content/items.d.ts.map +1 -1
  105. package/dist/content/items.js +33 -0
  106. package/dist/content/items.js.map +1 -1
  107. package/dist/content/resolve.js +6 -0
  108. package/dist/content/resolve.js.map +1 -1
  109. package/dist/content/sitemap.d.ts +5 -0
  110. package/dist/content/sitemap.d.ts.map +1 -1
  111. package/dist/content/sitemap.js +5 -0
  112. package/dist/content/sitemap.js.map +1 -1
  113. package/dist/core/context.js +6 -0
  114. package/dist/core/context.js.map +1 -1
  115. package/dist/core/headers.js +2 -0
  116. package/dist/core/headers.js.map +1 -1
  117. package/dist/core/http.d.ts +8 -0
  118. package/dist/core/http.d.ts.map +1 -1
  119. package/dist/core/http.js +89 -1
  120. package/dist/core/http.js.map +1 -1
  121. package/dist/credit/credit-status.js +2 -2
  122. package/dist/credit/credit-status.js.map +1 -1
  123. package/dist/credit/payment-terms.js +2 -2
  124. package/dist/credit/payment-terms.js.map +1 -1
  125. package/dist/currency/exchange.d.ts +11 -0
  126. package/dist/currency/exchange.d.ts.map +1 -1
  127. package/dist/currency/exchange.js +11 -0
  128. package/dist/currency/exchange.js.map +1 -1
  129. package/dist/errors.d.ts +50 -2
  130. package/dist/errors.d.ts.map +1 -1
  131. package/dist/errors.js +48 -2
  132. package/dist/errors.js.map +1 -1
  133. package/dist/events/envelope.d.ts +60 -0
  134. package/dist/events/envelope.d.ts.map +1 -1
  135. package/dist/events/envelope.js +12 -0
  136. package/dist/events/envelope.js.map +1 -1
  137. package/dist/events/index.d.ts +14 -1
  138. package/dist/events/index.d.ts.map +1 -1
  139. package/dist/events/index.js +13 -0
  140. package/dist/events/index.js.map +1 -1
  141. package/dist/events/payloads.d.ts +19 -0
  142. package/dist/events/payloads.d.ts.map +1 -1
  143. package/dist/events/payloads.js +12 -0
  144. package/dist/events/payloads.js.map +1 -1
  145. package/dist/index.d.ts +7 -0
  146. package/dist/index.d.ts.map +1 -1
  147. package/dist/index.js +7 -0
  148. package/dist/index.js.map +1 -1
  149. package/dist/media/index.js +2 -0
  150. package/dist/media/index.js.map +1 -1
  151. package/dist/media/urls.d.ts +52 -0
  152. package/dist/media/urls.d.ts.map +1 -1
  153. package/dist/media/urls.js +38 -0
  154. package/dist/media/urls.js.map +1 -1
  155. package/dist/media/video.d.ts +16 -0
  156. package/dist/media/video.d.ts.map +1 -1
  157. package/dist/media/video.js +16 -0
  158. package/dist/media/video.js.map +1 -1
  159. package/dist/next/artifact-handler.d.ts +22 -0
  160. package/dist/next/artifact-handler.d.ts.map +1 -1
  161. package/dist/next/artifact-handler.js +22 -0
  162. package/dist/next/artifact-handler.js.map +1 -1
  163. package/dist/next/event-revalidate-handler.d.ts +67 -0
  164. package/dist/next/event-revalidate-handler.d.ts.map +1 -1
  165. package/dist/next/event-revalidate-handler.js +48 -0
  166. package/dist/next/event-revalidate-handler.js.map +1 -1
  167. package/dist/next/index.d.ts +6 -0
  168. package/dist/next/index.d.ts.map +1 -1
  169. package/dist/next/index.js +6 -0
  170. package/dist/next/index.js.map +1 -1
  171. package/dist/next/json-ld.d.ts +9 -0
  172. package/dist/next/json-ld.d.ts.map +1 -1
  173. package/dist/next/json-ld.js +9 -0
  174. package/dist/next/json-ld.js.map +1 -1
  175. package/dist/next/metadata.d.ts +18 -0
  176. package/dist/next/metadata.d.ts.map +1 -1
  177. package/dist/next/metadata.js +21 -0
  178. package/dist/next/metadata.js.map +1 -1
  179. package/dist/next/redirect-middleware.d.ts +39 -0
  180. package/dist/next/redirect-middleware.d.ts.map +1 -1
  181. package/dist/next/redirect-middleware.js +32 -0
  182. package/dist/next/redirect-middleware.js.map +1 -1
  183. package/dist/next/revalidate-handler.d.ts +30 -0
  184. package/dist/next/revalidate-handler.d.ts.map +1 -1
  185. package/dist/next/revalidate-handler.js +22 -0
  186. package/dist/next/revalidate-handler.js.map +1 -1
  187. package/dist/order-scope.d.ts +27 -0
  188. package/dist/order-scope.d.ts.map +1 -1
  189. package/dist/order-scope.js +29 -0
  190. package/dist/order-scope.js.map +1 -1
  191. package/dist/pricing/format.d.ts +17 -0
  192. package/dist/pricing/format.d.ts.map +1 -1
  193. package/dist/pricing/format.js +19 -0
  194. package/dist/pricing/format.js.map +1 -1
  195. package/dist/pricing/index.d.ts +8 -1
  196. package/dist/pricing/index.d.ts.map +1 -1
  197. package/dist/pricing/index.js +18 -2
  198. package/dist/pricing/index.js.map +1 -1
  199. package/dist/pricing/tax-display.d.ts +77 -0
  200. package/dist/pricing/tax-display.d.ts.map +1 -1
  201. package/dist/pricing/tax-display.js +85 -0
  202. package/dist/pricing/tax-display.js.map +1 -1
  203. package/dist/pricing/tiers.d.ts +9 -0
  204. package/dist/pricing/tiers.d.ts.map +1 -1
  205. package/dist/pricing/tiers.js +9 -0
  206. package/dist/pricing/tiers.js.map +1 -1
  207. package/dist/pricing/validation.d.ts +56 -1
  208. package/dist/pricing/validation.d.ts.map +1 -1
  209. package/dist/pricing/validation.js +61 -0
  210. package/dist/pricing/validation.js.map +1 -1
  211. package/dist/redirects/index.d.ts +1 -0
  212. package/dist/redirects/index.d.ts.map +1 -1
  213. package/dist/redirects/index.js +1 -0
  214. package/dist/redirects/index.js.map +1 -1
  215. package/dist/redirects/store.d.ts +20 -0
  216. package/dist/redirects/store.d.ts.map +1 -1
  217. package/dist/redirects/store.js +57 -0
  218. package/dist/redirects/store.js.map +1 -1
  219. package/dist/redirects/types.d.ts +24 -0
  220. package/dist/redirects/types.d.ts.map +1 -1
  221. package/dist/redirects/types.js +1 -0
  222. package/dist/redirects/types.js.map +1 -1
  223. package/dist/revalidation/event-plan.d.ts +48 -0
  224. package/dist/revalidation/event-plan.d.ts.map +1 -1
  225. package/dist/revalidation/event-plan.js +61 -0
  226. package/dist/revalidation/event-plan.js.map +1 -1
  227. package/dist/revalidation/event-verify.d.ts +25 -0
  228. package/dist/revalidation/event-verify.d.ts.map +1 -1
  229. package/dist/revalidation/event-verify.js +27 -0
  230. package/dist/revalidation/event-verify.js.map +1 -1
  231. package/dist/revalidation/types.d.ts +20 -0
  232. package/dist/revalidation/types.d.ts.map +1 -1
  233. package/dist/revalidation/types.js +10 -0
  234. package/dist/revalidation/types.js.map +1 -1
  235. package/dist/revalidation/url-context.d.ts +25 -0
  236. package/dist/revalidation/url-context.d.ts.map +1 -1
  237. package/dist/revalidation/url-context.js +17 -0
  238. package/dist/revalidation/url-context.js.map +1 -1
  239. package/dist/revalidation/verify.d.ts +8 -0
  240. package/dist/revalidation/verify.d.ts.map +1 -1
  241. package/dist/revalidation/verify.js +8 -0
  242. package/dist/revalidation/verify.js.map +1 -1
  243. package/dist/seo/ai.d.ts +17 -0
  244. package/dist/seo/ai.d.ts.map +1 -1
  245. package/dist/seo/ai.js +12 -0
  246. package/dist/seo/ai.js.map +1 -1
  247. package/dist/seo/alternates.js +13 -0
  248. package/dist/seo/alternates.js.map +1 -1
  249. package/dist/seo/artifacts.d.ts +13 -0
  250. package/dist/seo/artifacts.d.ts.map +1 -1
  251. package/dist/seo/artifacts.js +19 -0
  252. package/dist/seo/artifacts.js.map +1 -1
  253. package/dist/seo/canonical.d.ts +15 -0
  254. package/dist/seo/canonical.d.ts.map +1 -1
  255. package/dist/seo/canonical.js +24 -0
  256. package/dist/seo/canonical.js.map +1 -1
  257. package/dist/seo/index.js +6 -0
  258. package/dist/seo/index.js.map +1 -1
  259. package/dist/seo/json-ld.d.ts +13 -0
  260. package/dist/seo/json-ld.d.ts.map +1 -1
  261. package/dist/seo/json-ld.js +32 -0
  262. package/dist/seo/json-ld.js.map +1 -1
  263. package/dist/seo/locale-tag.d.ts +31 -0
  264. package/dist/seo/locale-tag.d.ts.map +1 -1
  265. package/dist/seo/locale-tag.js +31 -0
  266. package/dist/seo/locale-tag.js.map +1 -1
  267. package/dist/seo/meta-tags.d.ts +29 -0
  268. package/dist/seo/meta-tags.d.ts.map +1 -1
  269. package/dist/seo/meta-tags.js +28 -0
  270. package/dist/seo/meta-tags.js.map +1 -1
  271. package/dist/seo/metadata-parser.d.ts +24 -0
  272. package/dist/seo/metadata-parser.d.ts.map +1 -1
  273. package/dist/seo/metadata-parser.js +38 -0
  274. package/dist/seo/metadata-parser.js.map +1 -1
  275. package/dist/seo/metadata-types.d.ts +16 -0
  276. package/dist/seo/metadata-types.d.ts.map +1 -1
  277. package/dist/seo/product-path.d.ts +96 -0
  278. package/dist/seo/product-path.d.ts.map +1 -1
  279. package/dist/seo/product-path.js +96 -0
  280. package/dist/seo/product-path.js.map +1 -1
  281. package/dist/seo/robots.d.ts +17 -0
  282. package/dist/seo/robots.d.ts.map +1 -1
  283. package/dist/seo/robots.js +12 -0
  284. package/dist/seo/robots.js.map +1 -1
  285. package/dist/seo/types.d.ts +39 -0
  286. package/dist/seo/types.d.ts.map +1 -1
  287. package/dist/seo/url-builder.d.ts +31 -0
  288. package/dist/seo/url-builder.d.ts.map +1 -1
  289. package/dist/seo/url-builder.js +36 -0
  290. package/dist/seo/url-builder.js.map +1 -1
  291. package/dist/types.d.ts +1163 -0
  292. package/dist/types.d.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;;;;;;;;;;GAaG;AACH,MAAM,UAAU,aAAa,CAAC,GAAmD;IAC/E,OAAO,GAAG,GAAG,CAAC,SAAS,IAAI,EAAE,IAAI,GAAG,CAAC,UAAU,IAAI,EAAE,EAAE,CAAC;AAC1D,CAAC;AAED,SAAS,WAAW,CAAmB,GAAY,EAAE,OAAqB,EAAE,QAAW;IACrF,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC7C,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACvC,OAAQ,OAA6B,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,KAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;AAClF,CAAC"}
@@ -1,4 +1,13 @@
1
1
  import type { PriceTier, TierTableEntry, VariantPriceData } from '../types.js';
2
+ /**
3
+ * Find the active price tier for a given quantity.
4
+ * Tiers are matched by the highest minQuantity that does not exceed the given quantity.
5
+ * Returns null if no tiers or quantity is below all thresholds.
6
+ */
2
7
  export declare function getTierForQuantity(tiers: PriceTier[], quantity: number): PriceTier | null;
8
+ /**
9
+ * Build a tier table with savings percentages relative to the retail price.
10
+ * If no retail price is available, savings are computed relative to the variant's base price.
11
+ */
3
12
  export declare function computeTierTable(variant: VariantPriceData): TierTableEntry[];
4
13
  //# sourceMappingURL=tiers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tiers.d.ts","sourceRoot":"","sources":["../../src/pricing/tiers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAO/E,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAYzF;AAMD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,GAAG,cAAc,EAAE,CAkB5E"}
1
+ {"version":3,"file":"tiers.d.ts","sourceRoot":"","sources":["../../src/pricing/tiers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/E;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAYzF;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,GAAG,cAAc,EAAE,CAkB5E"}
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Find the active price tier for a given quantity.
3
+ * Tiers are matched by the highest minQuantity that does not exceed the given quantity.
4
+ * Returns null if no tiers or quantity is below all thresholds.
5
+ */
1
6
  export function getTierForQuantity(tiers, quantity) {
2
7
  if (!tiers.length)
3
8
  return null;
@@ -11,6 +16,10 @@ export function getTierForQuantity(tiers, quantity) {
11
16
  }
12
17
  return matched;
13
18
  }
19
+ /**
20
+ * Build a tier table with savings percentages relative to the retail price.
21
+ * If no retail price is available, savings are computed relative to the variant's base price.
22
+ */
14
23
  export function computeTierTable(variant) {
15
24
  const tiers = variant.priceTiers;
16
25
  if (!tiers?.length)
@@ -1 +1 @@
1
- {"version":3,"file":"tiers.js","sourceRoot":"","sources":["../../src/pricing/tiers.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,kBAAkB,CAAC,KAAkB,EAAE,QAAgB;IACrE,IAAI,CAAC,KAAK,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAE/B,IAAI,OAAO,GAAqB,IAAI,CAAC;IACrC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACjC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;gBACvD,OAAO,GAAG,IAAI,CA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,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;gBACvD,OAAO,GAAG,IAAI,CAAC;YACjB,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAyB;IACxD,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC;IACjC,IAAI,CAAC,KAAK,EAAE,MAAM;QAAE,OAAO,EAAE,CAAC;IAE9B,MAAM,cAAc,GAAG,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,KAAK,CAAC;IAC5D,IAAI,cAAc,IAAI,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC1B,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,OAAO,EAAE,OAAO,CAAC,cAAc,EAAE,KAAK,IAAI,IAAI;QAC9C,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,iBAAiB,EACf,cAAc,GAAG,CAAC;YAChB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,cAAc,CAAC,GAAG,GAAG,CAAC;YACpE,CAAC,CAAC,IAAI;KACX,CAAC,CAAC,CAAC;AACN,CAAC"}
@@ -1,14 +1,69 @@
1
- import type { OrderValidationResult } from '../types.js';
1
+ import type { OrderableStockInput, OrderValidationResult } from '../types.js';
2
+ /**
3
+ * Validate an order against the channel's order minimums.
4
+ * Call before `transitionToArrangingPayment()` to provide early feedback.
5
+ *
6
+ * Pass the object from `getOrderConstraints()` straight through — its
7
+ * `minOrderAmountGross` / `minOrderQuantity` fields are read directly:
8
+ *
9
+ * ```ts
10
+ * const constraints = await client.checkout.getOrderConstraints();
11
+ * const result = client.pricing.validateOrderMinimums(order, constraints);
12
+ * ```
13
+ *
14
+ * The server enforces both minimums at the transition regardless, and its
15
+ * message may name the price list that binds ("Minimum order for Wholesale
16
+ * is …"), which the client cannot know. Display the server's message as-is on
17
+ * failure; these messages are for the pre-checkout shortfall hint.
18
+ */
2
19
  export declare function validateOrderMinimums(order: {
3
20
  totalWithTax: number;
4
21
  currencyCode: string;
5
22
  totalQuantity?: number;
23
+ /**
24
+ * Net (tax-exclusive) total, minor units. Only needed when the channel
25
+ * returns `minOrderAmountNet`; `subTotal` is preferred over `total` because
26
+ * the server compares line totals, which exclude shipping.
27
+ */
6
28
  subTotal?: number;
7
29
  total?: number;
8
30
  }, constraints: {
31
+ /** Minimum vs the GROSS order total, minor units. As returned by `getOrderConstraints()`. */
9
32
  minOrderAmountGross?: number | null;
33
+ /**
34
+ * Minimum vs the NET order total, minor units. Independent of the gross
35
+ * minimum — both bind. As returned by `getOrderConstraints()`.
36
+ */
10
37
  minOrderAmountNet?: number | null;
38
+ /** Minimum total item count. As returned by `getOrderConstraints()`. */
11
39
  minOrderQuantity?: number | null;
40
+ /** @deprecated Use `minOrderAmountGross` — the field `getOrderConstraints()` actually returns. */
12
41
  minOrderAmount?: number | null;
13
42
  }): OrderValidationResult;
43
+ export type { OrderableStockInput };
44
+ /**
45
+ * How many units of a variant the current shopper may put in the cart:
46
+ * `max(0, saleable) + backorderAllowance`.
47
+ *
48
+ * Returns `null` when the channel does not expose stock (`saleable == null`) —
49
+ * the storefront cannot know a ceiling then and should let the server decide,
50
+ * exactly as before backorders existed. A `null` allowance counts as 0, so a
51
+ * shopper the policy does not admit gets plain `saleable`.
52
+ */
53
+ export declare function maxOrderableQuantity(variant: OrderableStockInput): number | null;
54
+ /**
55
+ * Whether a variant is orderable only on backorder: nothing saleable, but an
56
+ * allowance. The signal to label "Backorder" instead of "Out of stock".
57
+ */
58
+ export declare function isBackorderOnly(variant: OrderableStockInput): boolean;
59
+ /**
60
+ * Units of a cart line physical stock will not cover — the "N on backorder"
61
+ * hint BEFORE placement, when `backorderedQuantity` is still 0 — computed the
62
+ * way the server stamps it at placement: `max(0, quantity − max(0, saleable))`.
63
+ *
64
+ * `null` when there is nothing to say: the channel hides stock
65
+ * (`saleable == null` — never read that as 0, or every in-stock line would
66
+ * be "on backorder"), or stock covers the line. Pass the line's variant.
67
+ */
68
+ export declare function backorderedQuantityForCart(variant: Pick<OrderableStockInput, 'saleable'>, quantity: number): number | null;
14
69
  //# sourceMappingURL=validation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/pricing/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAwB,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAoB/E,wBAAgB,qBAAqB,CACnC,KAAK,EAAE;IACL,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IAMvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,EACD,WAAW,EAAE;IAEX,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAKpC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAElC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEjC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,GACA,qBAAqB,CAgDvB"}
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/pricing/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAwB,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGpG;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE;IACL,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,EACD,WAAW,EAAE;IACX,6FAA6F;IAC7F,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,kGAAkG;IAClG,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,GACA,qBAAqB,CAgDvB;AAED,YAAY,EAAE,mBAAmB,EAAE,CAAC;AAEpC;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,GAAG,IAAI,CAGhF;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAErE;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,EAC9C,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,IAAI,CAIf"}
@@ -1,4 +1,21 @@
1
1
  import { formatPrice } from './format.js';
2
+ /**
3
+ * Validate an order against the channel's order minimums.
4
+ * Call before `transitionToArrangingPayment()` to provide early feedback.
5
+ *
6
+ * Pass the object from `getOrderConstraints()` straight through — its
7
+ * `minOrderAmountGross` / `minOrderQuantity` fields are read directly:
8
+ *
9
+ * ```ts
10
+ * const constraints = await client.checkout.getOrderConstraints();
11
+ * const result = client.pricing.validateOrderMinimums(order, constraints);
12
+ * ```
13
+ *
14
+ * The server enforces both minimums at the transition regardless, and its
15
+ * message may name the price list that binds ("Minimum order for Wholesale
16
+ * is …"), which the client cannot know. Display the server's message as-is on
17
+ * failure; these messages are for the pre-checkout shortfall hint.
18
+ */
2
19
  export function validateOrderMinimums(order, constraints) {
3
20
  const errors = [];
4
21
  const minAmount = constraints.minOrderAmountGross ?? constraints.minOrderAmount;
@@ -10,17 +27,25 @@ export function validateOrderMinimums(order, constraints) {
10
27
  actual: order.totalWithTax,
11
28
  });
12
29
  }
30
+ // A net minimum is checked separately, never folded into the gross one: the
31
+ // two are different bases and converting between them needs a tax rate the
32
+ // client does not have. Both can fail on the same cart.
13
33
  const minAmountNet = constraints.minOrderAmountNet;
14
34
  const netTotal = order.subTotal ?? order.total;
15
35
  if (minAmountNet != null && minAmountNet > 0 && netTotal != null && netTotal < minAmountNet) {
16
36
  errors.push({
17
37
  type: 'min_amount',
38
+ // Says "excl. tax" so the figure is not read against the gross total the
39
+ // buyer sees on screen, where it would look wrong.
18
40
  message: `Minimum order amount is ${formatPrice(minAmountNet, order.currencyCode)} excl. tax`,
19
41
  required: minAmountNet,
20
42
  actual: netTotal,
21
43
  });
22
44
  }
23
45
  const minQuantity = constraints.minOrderQuantity;
46
+ // `totalQuantity` is optional so a caller passing only totals still validates
47
+ // the amount. Skipping the quantity check when it is absent is correct;
48
+ // silently failing it against `undefined` would not be.
24
49
  if (minQuantity != null &&
25
50
  minQuantity > 0 &&
26
51
  order.totalQuantity != null &&
@@ -34,4 +59,40 @@ export function validateOrderMinimums(order, constraints) {
34
59
  }
35
60
  return { valid: errors.length === 0, errors };
36
61
  }
62
+ /**
63
+ * How many units of a variant the current shopper may put in the cart:
64
+ * `max(0, saleable) + backorderAllowance`.
65
+ *
66
+ * Returns `null` when the channel does not expose stock (`saleable == null`) —
67
+ * the storefront cannot know a ceiling then and should let the server decide,
68
+ * exactly as before backorders existed. A `null` allowance counts as 0, so a
69
+ * shopper the policy does not admit gets plain `saleable`.
70
+ */
71
+ export function maxOrderableQuantity(variant) {
72
+ if (variant.saleable == null)
73
+ return null;
74
+ return Math.max(0, variant.saleable) + Math.max(0, variant.backorderAllowance ?? 0);
75
+ }
76
+ /**
77
+ * Whether a variant is orderable only on backorder: nothing saleable, but an
78
+ * allowance. The signal to label "Backorder" instead of "Out of stock".
79
+ */
80
+ export function isBackorderOnly(variant) {
81
+ return (variant.saleable ?? 0) <= 0 && (variant.backorderAllowance ?? 0) > 0;
82
+ }
83
+ /**
84
+ * Units of a cart line physical stock will not cover — the "N on backorder"
85
+ * hint BEFORE placement, when `backorderedQuantity` is still 0 — computed the
86
+ * way the server stamps it at placement: `max(0, quantity − max(0, saleable))`.
87
+ *
88
+ * `null` when there is nothing to say: the channel hides stock
89
+ * (`saleable == null` — never read that as 0, or every in-stock line would
90
+ * be "on backorder"), or stock covers the line. Pass the line's variant.
91
+ */
92
+ export function backorderedQuantityForCart(variant, quantity) {
93
+ if (variant.saleable == null)
94
+ return null;
95
+ const units = Math.max(0, quantity - Math.max(0, variant.saleable));
96
+ return units > 0 ? units : null;
97
+ }
37
98
  //# sourceMappingURL=validation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/pricing/validation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAmB1C,MAAM,UAAU,qBAAqB,CACnC,KAWC,EACD,WAYC;IAED,MAAM,MAAM,GAA2B,EAAE,CAAC;IAE1C,MAAM,SAAS,GAAG,WAAW,CAAC,mBAAmB,IAAI,WAAW,CAAC,cAAc,CAAC;IAChF,IAAI,SAAS,IAAI,IAAI,IAAI,SAAS,GAAG,CAAC,IAAI,KAAK,CAAC,YAAY,GAAG,SAAS,EAAE,CAAC;QACzE,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,YAAY;YAClB,OAAO,EAAE,2BAA2B,WAAW,CAAC,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC,EAAE;YAChF,QAAQ,EAAE,SAAS;YACnB,MAAM,EAAE,KAAK,CAAC,YAAY;SAC3B,CAAC,CAAC;IACL,CAAC;IAKD,MAAM,YAAY,GAAG,WAAW,CAAC,iBAAiB,CAAC;IACnD,MAAM,Q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AAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;AAChD,CAAC;AAID;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAA4B;IAC/D,IAAI,OAAO,CAAC,QAAQ,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IAC1C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,kBAAkB,IAAI,CAAC,CAAC,CAAC;AACtF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,OAA4B;IAC1D,OAAO,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;AAC/E,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,0BAA0B,CACxC,OAA8C,EAC9C,QAAgB;IAEhB,IAAI,OAAO,CAAC,QAAQ,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpE,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AAClC,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { StoreContext } from '../types.js';
2
2
  import type { RedirectStore, RedirectStoreConfig } from './types.js';
3
+ /** Wire a redirect store from an initialized client's context. */
3
4
  export declare function createRedirectsModule(ctx: StoreContext, options?: Pick<RedirectStoreConfig, 'ttlMs' | 'timeoutMs' | 'onError'>): RedirectStore;
4
5
  export { createRedirectStore, normalizeLookupPath } from './store.js';
5
6
  export { REDIRECT_STATUS_CODES, type RedirectMatch, type RedirectRule, type RedirectSnapshot, type RedirectStatusCode, type RedirectStore, type RedirectStoreConfig, } from './types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/redirects/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGrE,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,YAAY,EACjB,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,WAAW,GAAG,SAAS,CAAC,GACrE,aAAa,CAOf;AAED,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EACL,qBAAqB,EACrB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,mBAAmB,GACzB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/redirects/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAErE,kEAAkE;AAClE,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,YAAY,EACjB,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,WAAW,GAAG,SAAS,CAAC,GACrE,aAAa,CAOf;AAED,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EACL,qBAAqB,EACrB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,mBAAmB,GACzB,MAAM,YAAY,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { createRedirectStore } from './store.js';
2
+ /** Wire a redirect store from an initialized client's context. */
2
3
  export function createRedirectsModule(ctx, options) {
3
4
  return createRedirectStore({
4
5
  storeCode: ctx.channel.code,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/redirects/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAIjD,MAAM,UAAU,qBAAqB,CACnC,GAAiB,EACjB,OAAsE;IAEtE,OAAO,mBAAmB,CAAC;QACzB,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC,IAAI;QAC3B,UAAU,EAAE,GAAG,CAAC,UAAU;QAC1B,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EACL,qBAAqB,GAOtB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/redirects/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGjD,kEAAkE;AAClE,MAAM,UAAU,qBAAqB,CACnC,GAAiB,EACjB,OAAsE;IAEtE,OAAO,mBAAmB,CAAC;QACzB,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC,IAAI;QAC3B,UAAU,EAAE,GAAG,CAAC,UAAU;QAC1B,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EACL,qBAAqB,GAOtB,MAAM,YAAY,CAAC"}
@@ -1,4 +1,24 @@
1
+ /**
2
+ * In-process redirect map for a storefront.
3
+ *
4
+ * Fetches the platform's public per-channel snapshot once per TTL and matches
5
+ * pathnames against it in memory, so a middleware costs a Map lookup rather
6
+ * than a network hop. Revalidation is ETag-conditional: an unchanged map comes
7
+ * back as a 304 with no body.
8
+ *
9
+ * Deliberately fail-open — a refresh failure keeps the last good map in service
10
+ * and reports through `onError` rather than throwing. A platform blip must not
11
+ * turn a tenant's working redirects into 404s.
12
+ *
13
+ * Only the FIRST load is awaited. Once a map exists, revalidation happens in the
14
+ * background and callers are served the current one: this runs in middleware
15
+ * ahead of every page render, so a slow platform must never become a slow store.
16
+ */
1
17
  import { type RedirectStore, type RedirectStoreConfig } from './types.js';
18
+ /**
19
+ * Match the platform's own source normalization: trailing slashes are stripped
20
+ * so `/a` and `/a/` are the same rule. The root path keeps its slash.
21
+ */
2
22
  export declare function normalizeLookupPath(pathname: string): string;
3
23
  export declare function createRedirectStore(config: RedirectStoreConfig): RedirectStore;
4
24
  //# sourceMappingURL=store.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/redirects/store.ts"],"names":[],"mappings":"AAkBA,OAAO,EAML,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACzB,MAAM,YAAY,CAAC;AA2BpB,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAe5D;AAsCD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG,aAAa,CA+J9E"}
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/redirects/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAML,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACzB,MAAM,YAAY,CAAC;AAuBpB;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAe5D;AAsCD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG,aAAa,CA+J9E"}
@@ -1,25 +1,57 @@
1
+ /**
2
+ * In-process redirect map for a storefront.
3
+ *
4
+ * Fetches the platform's public per-channel snapshot once per TTL and matches
5
+ * pathnames against it in memory, so a middleware costs a Map lookup rather
6
+ * than a network hop. Revalidation is ETag-conditional: an unchanged map comes
7
+ * back as a 304 with no body.
8
+ *
9
+ * Deliberately fail-open — a refresh failure keeps the last good map in service
10
+ * and reports through `onError` rather than throwing. A platform blip must not
11
+ * turn a tenant's working redirects into 404s.
12
+ *
13
+ * Only the FIRST load is awaited. Once a map exists, revalidation happens in the
14
+ * background and callers are served the current one: this runs in middleware
15
+ * ahead of every page render, so a slow platform must never become a slow store.
16
+ */
1
17
  import { DEFAULT_PLUGINS_URL } from '../constants.js';
2
18
  import { REDIRECT_STATUS_CODES, } from './types.js';
3
19
  const DEFAULT_TTL_MS = 60_000;
4
20
  const DEFAULT_TIMEOUT_MS = 5_000;
21
+ /**
22
+ * How long a FAILED load is remembered before the next attempt. Deliberately
23
+ * well above `DEFAULT_TIMEOUT_MS`: if the two were equal, an outage would spend
24
+ * half of every cycle inside a fetch that callers are waiting on.
25
+ */
5
26
  const FAILURE_BACKOFF_MS = 30_000;
27
+ /** Base for lookup-path canonicalization only — never requested. */
6
28
  const CANONICAL_BASE = 'https://redirect.invalid';
29
+ /**
30
+ * Match the platform's own source normalization: trailing slashes are stripped
31
+ * so `/a` and `/a/` are the same rule. The root path keeps its slash.
32
+ */
7
33
  export function normalizeLookupPath(pathname) {
8
34
  const trimmed = pathname.trim();
9
35
  if (trimmed === '' || trimmed === '/')
10
36
  return '/';
11
37
  const withLeadingSlash = trimmed.startsWith('/') ? trimmed : `/${trimmed}`;
38
+ // The platform stores the canonical percent-encoded form, which is also what
39
+ // a browser sends. Re-encoding here is idempotent and lets a caller pass the
40
+ // human-readable `/café` and still hit the `/caf%C3%A9` rule.
12
41
  let canonical = withLeadingSlash;
13
42
  try {
14
43
  canonical = new URL(withLeadingSlash, CANONICAL_BASE).pathname;
15
44
  }
16
45
  catch {
46
+ // Not URL-shaped — fall through with the raw value rather than throwing
47
+ // out of a middleware's hot path.
17
48
  }
18
49
  return canonical.replace(/\/+$/, '') || '/';
19
50
  }
20
51
  function isRedirectStatusCode(value) {
21
52
  return typeof value === 'number' && REDIRECT_STATUS_CODES.includes(value);
22
53
  }
54
+ /** Parse the wire payload defensively — the platform is an external boundary. */
23
55
  function parseSnapshot(raw) {
24
56
  if (typeof raw !== 'object' || raw === null) {
25
57
  throw new Error('Redirect snapshot is not an object');
@@ -63,6 +95,7 @@ export function createRedirectStore(config) {
63
95
  let etag = null;
64
96
  let freshUntil = 0;
65
97
  let inFlight = null;
98
+ /** Set once a load has failed; cleared by the next success. */
66
99
  let lastLoadFailed = false;
67
100
  function indexOf(snapshot) {
68
101
  const map = new Map();
@@ -100,12 +133,19 @@ export function createRedirectStore(config) {
100
133
  clearTimeout(timeoutId);
101
134
  }
102
135
  }
136
+ /** One refresh at a time; concurrent callers share the in-flight request. */
103
137
  function loadOnce() {
104
138
  inFlight ??= load().finally(() => {
105
139
  inFlight = null;
106
140
  });
107
141
  return inFlight;
108
142
  }
143
+ /**
144
+ * Load that is guaranteed to observe state as of NOW. An in-flight request
145
+ * may have been issued before the change we are being told about, so joining
146
+ * it would report success while leaving the stale map in place — chain a new
147
+ * load after it instead.
148
+ */
109
149
  function loadAfterInFlight() {
110
150
  const pending = inFlight;
111
151
  if (!pending)
@@ -115,8 +155,12 @@ export function createRedirectStore(config) {
115
155
  function reportFailure(error) {
116
156
  lastLoadFailed = true;
117
157
  config.onError?.(error instanceof Error ? error : new Error(String(error)));
158
+ // Back off whether or not there is a map to fall back on. With a warm cache
159
+ // that means serving the last good map for another TTL; with a COLD one it
160
+ // is what stops every request paying the full fetch timeout.
118
161
  freshUntil = Date.now() + (cached ? ttlMs : FAILURE_BACKOFF_MS);
119
162
  }
163
+ /** Warm the map without anyone waiting on it. Never rejects. */
120
164
  function refreshInBackground() {
121
165
  void loadOnce().then(() => {
122
166
  lastLoadFailed = false;
@@ -128,14 +172,25 @@ export function createRedirectStore(config) {
128
172
  if (Date.now() < freshUntil) {
129
173
  return cached;
130
174
  }
175
+ // Stale-while-revalidate: once there IS a map, no caller ever waits on the
176
+ // network again. Revalidating in the foreground put one request per TTL —
177
+ // and every request concurrent with it — behind a round-trip that can run to
178
+ // `timeoutMs`, in middleware, ahead of a page render. Serving a map up to
179
+ // one TTL stale is what this store already accepts on error, so accepting it
180
+ // on a slow platform too is the consistent choice.
131
181
  if (cached) {
132
182
  refreshInBackground();
133
183
  return cached;
134
184
  }
185
+ // Cold cache AND we already know loads are failing: do not make this caller
186
+ // wait to rediscover that. Retry in the background and let the request
187
+ // through unredirected.
135
188
  if (lastLoadFailed) {
136
189
  refreshInBackground();
137
190
  return null;
138
191
  }
192
+ // The very first load IS awaited, so a healthy cold start never misses a
193
+ // redirect it had the data to serve.
139
194
  try {
140
195
  const snapshot = await loadOnce();
141
196
  lastLoadFailed = false;
@@ -157,6 +212,8 @@ export function createRedirectStore(config) {
157
212
  const snapshot = await ensureFresh();
158
213
  if (snapshot)
159
214
  return snapshot;
215
+ // No cached map to fall back on — the caller asked for data we do not
216
+ // have, so surface the load error rather than inventing an empty map.
160
217
  return loadOnce();
161
218
  },
162
219
  async refresh() {
@@ -1 +1 @@
1
- {"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/redirects/store.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACL,qBAAqB,GAOtB,MAAM,YAAY,CAAC;AAEpB,MAAM,cAAc,GAAG,MAAM,CAAC;AAC9B,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAOjC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAGlC,MAAM,cAAc,GAAG,0BAA0B,CAAC;AAclD,MAAM,UAAU,mBAAmB,CAAC,QAAgB;IAClD,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;IAChC,IAAI,O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C9B,sEAAsE;YACtE,sEAAsE;YACtE,OAAO,QAAQ,EAAE,CAAC;QACpB,CAAC;QAED,KAAK,CAAC,OAAO;YACX,UAAU,GAAG,CAAC,CAAC;YACf,OAAO,iBAAiB,EAAE,CAAC;QAC7B,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,5 +1,7 @@
1
+ /** The redirect statuses the platform accepts. Mirrors the plugins service. */
1
2
  export declare const REDIRECT_STATUS_CODES: readonly [301, 302, 303, 307, 308];
2
3
  export type RedirectStatusCode = (typeof REDIRECT_STATUS_CODES)[number];
4
+ /** One stored rule. `from` is always a literal path; `to` is a path or an https URL. */
3
5
  export interface RedirectRule {
4
6
  from: string;
5
7
  to: string;
@@ -7,26 +9,48 @@ export interface RedirectRule {
7
9
  }
8
10
  export interface RedirectSnapshot {
9
11
  channelCode: string;
12
+ /** Content hash of the rule set — equal to the ETag the platform served. */
10
13
  version: string;
14
+ /** ISO instant the platform rendered this snapshot. */
11
15
  generatedAt: string;
12
16
  rules: RedirectRule[];
17
+ /**
18
+ * Stored rows the platform could not express as an exact-path rule (legacy
19
+ * wildcard/pattern rows). Non-zero means the merchant has rows to clean up.
20
+ */
13
21
  unservableCount: number;
14
22
  }
15
23
  export interface RedirectMatch {
24
+ /** Resolved target, exactly as stored. */
16
25
  to: string;
17
26
  status: RedirectStatusCode;
18
27
  }
19
28
  export interface RedirectStoreConfig {
29
+ /** Store channel code, e.g. `fashion-store`. */
20
30
  storeCode: string;
31
+ /** Plugins service origin. Defaults to the SDK's configured plugins URL. */
21
32
  pluginsUrl?: string;
33
+ /** How long a fetched snapshot is served before revalidating. Default 60s. */
22
34
  ttlMs?: number;
35
+ /** Upstream fetch timeout. Default 5s — a middleware must not hang a request. */
23
36
  timeoutMs?: number;
24
37
  fetch?: typeof globalThis.fetch;
38
+ /**
39
+ * Called when a refresh fails. The store keeps serving the last good snapshot
40
+ * (a platform blip must not break the storefront's URLs), so this callback is
41
+ * the only signal that revalidation is failing — wire it to your logger.
42
+ */
25
43
  onError?: (error: Error) => void;
26
44
  }
27
45
  export interface RedirectStore {
46
+ /**
47
+ * Look up one pathname. Returns null when nothing matches. Never throws:
48
+ * on a cold cache with an unreachable platform it resolves to null.
49
+ */
28
50
  match(pathname: string): Promise<RedirectMatch | null>;
51
+ /** The current snapshot, fetching or revalidating if the TTL has lapsed. */
29
52
  snapshot(): Promise<RedirectSnapshot>;
53
+ /** Force a revalidation regardless of TTL. */
30
54
  refresh(): Promise<RedirectSnapshot>;
31
55
  }
32
56
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/redirects/types.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,qBAAqB,oCAAqC,CAAC;AACxE,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAGxE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,kBAAkB,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;IAEpB,OAAO,EAAE,MAAM,CAAC;IAEhB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,YAAY,EAAE,CAAC;IAKtB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAE5B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,kBAAkB,CAAC;CAC5B;AAED,MAAM,WAAW,mBAAmB;IAElC,SAAS,EAAE,MAAM,CAAC;IAElB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IAMhC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,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OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IACvD,4EAA4E;IAC5E,QAAQ,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACtC,8CAA8C;IAC9C,OAAO,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACtC"}
@@ -1,2 +1,3 @@
1
+ /** The redirect statuses the platform accepts. Mirrors the plugins service. */
1
2
  export const REDIRECT_STATUS_CODES = [301, 302, 303, 307, 308];
2
3
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/redirects/types.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/redirects/types.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAC"}
@@ -1,23 +1,56 @@
1
+ /**
2
+ * Event → revalidation mapping. Pure: no `next`, no I/O, so a pull-feed
3
+ * consumer can reuse it exactly as the webhook handler does.
4
+ *
5
+ * Path rules the whole module keeps:
6
+ * - Event paths are channel-relative and locale-UNPREFIXED. Each is composed
7
+ * per locale with the channel's own URL rule (`buildUrl`) and then mapped to
8
+ * a route path (default: the URL's pathname).
9
+ * - A commerce path prefix is never prepended and never stripped: commerce
10
+ * paths on the bus already carry it, and CMS paths never do — a CMS page may
11
+ * legitimately live at `/store/about` beside `commercePathPrefix: '/store'`.
12
+ * - Whenever an event cannot say which URLs moved (a truncated list, a moved
13
+ * base path, a rule change), the plan is the WHOLE site. Never quieter.
14
+ */
1
15
  import type { PlatformEventEnvelope } from '../events/envelope.js';
2
16
  import type { ChannelUrlRuleSet, UrlContext } from './url-context.js';
17
+ /** Above this many route paths, one whole-site revalidation replaces them — as the legacy dispatcher does. */
3
18
  export declare const DEFAULT_MAX_REVALIDATE_PATHS = 500;
4
19
  export type RevalidationSkipReason = 'unknown_type' | 'unsupported_schema_version';
5
20
  export interface RevalidationPlan {
21
+ /** Route paths for `revalidatePath`, de-duplicated. Empty when `all`. */
6
22
  readonly paths: string[];
23
+ /** Tags for `revalidateTag`. */
7
24
  readonly tags: string[];
25
+ /** Revalidate the whole site — `revalidatePath('/', 'layout')`. */
8
26
  readonly all: boolean;
27
+ /** Set when the event is not one this SDK acts on; the plan is then empty. */
9
28
  readonly skipped?: RevalidationSkipReason;
29
+ /**
30
+ * Set by `createEventRevalidateHandler` when a path event's URLs could not be
31
+ * composed — the URL context could not be read or is unusable, or
32
+ * `toRoutePath` threw or returned a non-path — and it revalidated the whole
33
+ * site instead, answering 200. `planRevalidation` never sets it; it throws.
34
+ */
10
35
  readonly degraded?: RevalidationDegradedReason;
11
36
  }
12
37
  export type RevalidationDegradedReason = 'url_mapping_failed';
13
38
  export interface RevalidationPlanOptions {
39
+ /** Above this many route paths, plan a whole-site revalidation instead. Default 500. */
14
40
  maxPaths?: number;
41
+ /**
42
+ * Map a composed storefront URL to the route path to revalidate, or `null` to
43
+ * skip it. Default: `url.pathname`. Override when your routes differ from your
44
+ * public URLs — e.g. `subdomain` locales rewritten to `/[locale]/...` routes.
45
+ */
15
46
  toRoutePath?(url: URL, locale: string): string | null;
16
47
  }
48
+ /** A signed, known-type, version-1 event whose `data` does not match its contract. */
17
49
  export declare class EventPayloadError extends Error {
18
50
  constructor(message: string);
19
51
  }
20
52
  type PathPair = readonly [path: string, locale: string];
53
+ /** What an event asks for, before any URL is composed. Internal to the SDK. */
21
54
  export type RevalidationIntent = {
22
55
  readonly kind: 'skip';
23
56
  readonly reason: RevalidationSkipReason;
@@ -31,9 +64,24 @@ export type RevalidationIntent = {
31
64
  readonly kind: 'paths';
32
65
  expand(locales: readonly string[]): PathPair[];
33
66
  };
67
+ /**
68
+ * Classify an envelope. Unknown types and unsupported versions are skips, not
69
+ * errors — a subscriber on an older SDK must keep accepting newer events.
70
+ * Throws {@link EventPayloadError} for a known v1 type whose `data` is off-contract.
71
+ */
34
72
  export declare function classifyEvent(envelope: Pick<PlatformEventEnvelope, 'type' | 'schema_version' | 'data'>): RevalidationIntent;
35
73
  export declare function resolveMaxPaths(maxPaths: number | undefined): number;
74
+ /** Turn an intent into a plan, composing URLs only when the intent has paths. */
36
75
  export declare function planFromIntent(intent: RevalidationIntent, urls: UrlContext | null, options?: RevalidationPlanOptions): RevalidationPlan;
76
+ /**
77
+ * The revalidation a platform event calls for — the mapping
78
+ * `createEventRevalidateHandler` applies, for consumers of the pull feed or of
79
+ * their own webhook plumbing.
80
+ *
81
+ * Throws {@link EventPayloadError} when a known version-1 event's `data` does
82
+ * not match its contract, and `TypeError` when `urls` is unusable for an event
83
+ * that carries paths.
84
+ */
37
85
  export declare function planRevalidation(envelope: Pick<PlatformEventEnvelope, 'type' | 'schema_version' | 'data'>, urls: UrlContext, options?: RevalidationPlanOptions): RevalidationPlan;
38
86
  export {};
39
87
  //# sourceMappingURL=event-plan.d.ts.map