@sixtyninecommerce/client 0.23.1 → 0.25.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 (299) hide show
  1. package/README.md +25 -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/index.d.ts +17 -1
  41. package/dist/commerce/index.d.ts.map +1 -1
  42. package/dist/commerce/pickup-location-parser.d.ts +18 -0
  43. package/dist/commerce/pickup-location-parser.d.ts.map +1 -1
  44. package/dist/commerce/pickup-location-parser.js +28 -0
  45. package/dist/commerce/pickup-location-parser.js.map +1 -1
  46. package/dist/commerce/placement-error.d.ts +52 -0
  47. package/dist/commerce/placement-error.d.ts.map +1 -1
  48. package/dist/commerce/placement-error.js +87 -0
  49. package/dist/commerce/placement-error.js.map +1 -1
  50. package/dist/commerce/products.d.ts +48 -0
  51. package/dist/commerce/products.d.ts.map +1 -1
  52. package/dist/commerce/products.js +95 -2
  53. package/dist/commerce/products.js.map +1 -1
  54. package/dist/commerce/queries.d.ts +114 -27
  55. package/dist/commerce/queries.d.ts.map +1 -1
  56. package/dist/commerce/queries.js +219 -1
  57. package/dist/commerce/queries.js.map +1 -1
  58. package/dist/commerce/quotes.js +33 -0
  59. package/dist/commerce/quotes.js.map +1 -1
  60. package/dist/commerce/saved-lists.d.ts +7 -7
  61. package/dist/commerce/saved-lists.d.ts.map +1 -1
  62. package/dist/commerce/saved-lists.js +1 -1
  63. package/dist/commerce/search.js +3 -0
  64. package/dist/commerce/search.js.map +1 -1
  65. package/dist/commerce/shipping.js +3 -3
  66. package/dist/commerce/shipping.js.map +1 -1
  67. package/dist/commerce/stock-notifications.d.ts +11 -0
  68. package/dist/commerce/stock-notifications.d.ts.map +1 -1
  69. package/dist/commerce/stock-notifications.js +11 -0
  70. package/dist/commerce/stock-notifications.js.map +1 -1
  71. package/dist/commerce/subscriptions.d.ts +32 -8
  72. package/dist/commerce/subscriptions.d.ts.map +1 -1
  73. package/dist/commerce/subscriptions.js +90 -2
  74. package/dist/commerce/subscriptions.js.map +1 -1
  75. package/dist/commerce/vat-validation.js +4 -4
  76. package/dist/commerce/vat-validation.js.map +1 -1
  77. package/dist/constants.d.ts +31 -0
  78. package/dist/constants.d.ts.map +1 -1
  79. package/dist/constants.js +32 -0
  80. package/dist/constants.js.map +1 -1
  81. package/dist/content/asset-urls.d.ts +50 -0
  82. package/dist/content/asset-urls.d.ts.map +1 -1
  83. package/dist/content/asset-urls.js +92 -0
  84. package/dist/content/asset-urls.js.map +1 -1
  85. package/dist/content/assets.d.ts +15 -0
  86. package/dist/content/assets.d.ts.map +1 -1
  87. package/dist/content/assets.js +15 -0
  88. package/dist/content/assets.js.map +1 -1
  89. package/dist/content/collection-pages.d.ts +5 -0
  90. package/dist/content/collection-pages.d.ts.map +1 -1
  91. package/dist/content/collection-pages.js +8 -0
  92. package/dist/content/collection-pages.js.map +1 -1
  93. package/dist/content/collections.d.ts +14 -0
  94. package/dist/content/collections.d.ts.map +1 -1
  95. package/dist/content/collections.js +16 -0
  96. package/dist/content/collections.js.map +1 -1
  97. package/dist/content/filtered-products.d.ts +18 -0
  98. package/dist/content/filtered-products.d.ts.map +1 -1
  99. package/dist/content/filtered-products.js +16 -0
  100. package/dist/content/filtered-products.js.map +1 -1
  101. package/dist/content/form-field-types.d.ts +6 -0
  102. package/dist/content/form-field-types.d.ts.map +1 -1
  103. package/dist/content/form-field-types.js +12 -0
  104. package/dist/content/form-field-types.js.map +1 -1
  105. package/dist/content/forms.d.ts +16 -0
  106. package/dist/content/forms.d.ts.map +1 -1
  107. package/dist/content/forms.js +23 -0
  108. package/dist/content/forms.js.map +1 -1
  109. package/dist/content/items.d.ts +26 -0
  110. package/dist/content/items.d.ts.map +1 -1
  111. package/dist/content/items.js +33 -0
  112. package/dist/content/items.js.map +1 -1
  113. package/dist/content/resolve.js +6 -0
  114. package/dist/content/resolve.js.map +1 -1
  115. package/dist/content/sitemap.d.ts +5 -0
  116. package/dist/content/sitemap.d.ts.map +1 -1
  117. package/dist/content/sitemap.js +5 -0
  118. package/dist/content/sitemap.js.map +1 -1
  119. package/dist/core/context.js +6 -0
  120. package/dist/core/context.js.map +1 -1
  121. package/dist/core/headers.js +2 -0
  122. package/dist/core/headers.js.map +1 -1
  123. package/dist/core/http.d.ts +8 -0
  124. package/dist/core/http.d.ts.map +1 -1
  125. package/dist/core/http.js +89 -1
  126. package/dist/core/http.js.map +1 -1
  127. package/dist/credit/credit-status.js +2 -2
  128. package/dist/credit/credit-status.js.map +1 -1
  129. package/dist/credit/payment-terms.js +2 -2
  130. package/dist/credit/payment-terms.js.map +1 -1
  131. package/dist/currency/exchange.d.ts +11 -0
  132. package/dist/currency/exchange.d.ts.map +1 -1
  133. package/dist/currency/exchange.js +11 -0
  134. package/dist/currency/exchange.js.map +1 -1
  135. package/dist/errors.d.ts +50 -2
  136. package/dist/errors.d.ts.map +1 -1
  137. package/dist/errors.js +50 -3
  138. package/dist/errors.js.map +1 -1
  139. package/dist/events/envelope.d.ts +36 -0
  140. package/dist/events/envelope.d.ts.map +1 -1
  141. package/dist/events/envelope.js +12 -0
  142. package/dist/events/envelope.js.map +1 -1
  143. package/dist/events/index.d.ts +13 -0
  144. package/dist/events/index.d.ts.map +1 -1
  145. package/dist/events/index.js +13 -0
  146. package/dist/events/index.js.map +1 -1
  147. package/dist/events/payloads.d.ts +19 -0
  148. package/dist/events/payloads.d.ts.map +1 -1
  149. package/dist/events/payloads.js +12 -0
  150. package/dist/events/payloads.js.map +1 -1
  151. package/dist/index.d.ts +8 -1
  152. package/dist/index.d.ts.map +1 -1
  153. package/dist/index.js +7 -0
  154. package/dist/index.js.map +1 -1
  155. package/dist/media/index.js +2 -0
  156. package/dist/media/index.js.map +1 -1
  157. package/dist/media/urls.d.ts +52 -0
  158. package/dist/media/urls.d.ts.map +1 -1
  159. package/dist/media/urls.js +38 -0
  160. package/dist/media/urls.js.map +1 -1
  161. package/dist/media/video.d.ts +16 -0
  162. package/dist/media/video.d.ts.map +1 -1
  163. package/dist/media/video.js +16 -0
  164. package/dist/media/video.js.map +1 -1
  165. package/dist/next/artifact-handler.d.ts +22 -0
  166. package/dist/next/artifact-handler.d.ts.map +1 -1
  167. package/dist/next/artifact-handler.js +22 -0
  168. package/dist/next/artifact-handler.js.map +1 -1
  169. package/dist/next/event-revalidate-handler.d.ts +67 -0
  170. package/dist/next/event-revalidate-handler.d.ts.map +1 -1
  171. package/dist/next/event-revalidate-handler.js +48 -0
  172. package/dist/next/event-revalidate-handler.js.map +1 -1
  173. package/dist/next/index.d.ts +6 -0
  174. package/dist/next/index.d.ts.map +1 -1
  175. package/dist/next/index.js +6 -0
  176. package/dist/next/index.js.map +1 -1
  177. package/dist/next/json-ld.d.ts +9 -0
  178. package/dist/next/json-ld.d.ts.map +1 -1
  179. package/dist/next/json-ld.js +9 -0
  180. package/dist/next/json-ld.js.map +1 -1
  181. package/dist/next/metadata.d.ts +18 -0
  182. package/dist/next/metadata.d.ts.map +1 -1
  183. package/dist/next/metadata.js +21 -0
  184. package/dist/next/metadata.js.map +1 -1
  185. package/dist/next/redirect-middleware.d.ts +39 -0
  186. package/dist/next/redirect-middleware.d.ts.map +1 -1
  187. package/dist/next/redirect-middleware.js +32 -0
  188. package/dist/next/redirect-middleware.js.map +1 -1
  189. package/dist/next/revalidate-handler.d.ts +30 -0
  190. package/dist/next/revalidate-handler.d.ts.map +1 -1
  191. package/dist/next/revalidate-handler.js +22 -0
  192. package/dist/next/revalidate-handler.js.map +1 -1
  193. package/dist/order-scope.d.ts +27 -0
  194. package/dist/order-scope.d.ts.map +1 -1
  195. package/dist/order-scope.js +29 -0
  196. package/dist/order-scope.js.map +1 -1
  197. package/dist/pricing/format.d.ts +17 -0
  198. package/dist/pricing/format.d.ts.map +1 -1
  199. package/dist/pricing/format.js +19 -0
  200. package/dist/pricing/format.js.map +1 -1
  201. package/dist/pricing/index.d.ts +8 -1
  202. package/dist/pricing/index.d.ts.map +1 -1
  203. package/dist/pricing/index.js +18 -2
  204. package/dist/pricing/index.js.map +1 -1
  205. package/dist/pricing/tax-display.d.ts +77 -0
  206. package/dist/pricing/tax-display.d.ts.map +1 -1
  207. package/dist/pricing/tax-display.js +85 -0
  208. package/dist/pricing/tax-display.js.map +1 -1
  209. package/dist/pricing/tiers.d.ts +9 -0
  210. package/dist/pricing/tiers.d.ts.map +1 -1
  211. package/dist/pricing/tiers.js +9 -0
  212. package/dist/pricing/tiers.js.map +1 -1
  213. package/dist/pricing/validation.d.ts +56 -1
  214. package/dist/pricing/validation.d.ts.map +1 -1
  215. package/dist/pricing/validation.js +61 -0
  216. package/dist/pricing/validation.js.map +1 -1
  217. package/dist/redirects/index.d.ts +1 -0
  218. package/dist/redirects/index.d.ts.map +1 -1
  219. package/dist/redirects/index.js +1 -0
  220. package/dist/redirects/index.js.map +1 -1
  221. package/dist/redirects/store.d.ts +20 -0
  222. package/dist/redirects/store.d.ts.map +1 -1
  223. package/dist/redirects/store.js +57 -0
  224. package/dist/redirects/store.js.map +1 -1
  225. package/dist/redirects/types.d.ts +24 -0
  226. package/dist/redirects/types.d.ts.map +1 -1
  227. package/dist/redirects/types.js +1 -0
  228. package/dist/redirects/types.js.map +1 -1
  229. package/dist/revalidation/event-plan.d.ts +48 -0
  230. package/dist/revalidation/event-plan.d.ts.map +1 -1
  231. package/dist/revalidation/event-plan.js +61 -0
  232. package/dist/revalidation/event-plan.js.map +1 -1
  233. package/dist/revalidation/event-verify.d.ts +25 -0
  234. package/dist/revalidation/event-verify.d.ts.map +1 -1
  235. package/dist/revalidation/event-verify.js +27 -0
  236. package/dist/revalidation/event-verify.js.map +1 -1
  237. package/dist/revalidation/types.d.ts +20 -0
  238. package/dist/revalidation/types.d.ts.map +1 -1
  239. package/dist/revalidation/types.js +10 -0
  240. package/dist/revalidation/types.js.map +1 -1
  241. package/dist/revalidation/url-context.d.ts +25 -0
  242. package/dist/revalidation/url-context.d.ts.map +1 -1
  243. package/dist/revalidation/url-context.js +17 -0
  244. package/dist/revalidation/url-context.js.map +1 -1
  245. package/dist/revalidation/verify.d.ts +8 -0
  246. package/dist/revalidation/verify.d.ts.map +1 -1
  247. package/dist/revalidation/verify.js +8 -0
  248. package/dist/revalidation/verify.js.map +1 -1
  249. package/dist/seo/ai.d.ts +17 -0
  250. package/dist/seo/ai.d.ts.map +1 -1
  251. package/dist/seo/ai.js +12 -0
  252. package/dist/seo/ai.js.map +1 -1
  253. package/dist/seo/alternates.js +13 -0
  254. package/dist/seo/alternates.js.map +1 -1
  255. package/dist/seo/artifacts.d.ts +13 -0
  256. package/dist/seo/artifacts.d.ts.map +1 -1
  257. package/dist/seo/artifacts.js +19 -0
  258. package/dist/seo/artifacts.js.map +1 -1
  259. package/dist/seo/canonical.d.ts +15 -0
  260. package/dist/seo/canonical.d.ts.map +1 -1
  261. package/dist/seo/canonical.js +24 -0
  262. package/dist/seo/canonical.js.map +1 -1
  263. package/dist/seo/index.js +6 -0
  264. package/dist/seo/index.js.map +1 -1
  265. package/dist/seo/json-ld.d.ts +13 -0
  266. package/dist/seo/json-ld.d.ts.map +1 -1
  267. package/dist/seo/json-ld.js +32 -0
  268. package/dist/seo/json-ld.js.map +1 -1
  269. package/dist/seo/locale-tag.d.ts +31 -0
  270. package/dist/seo/locale-tag.d.ts.map +1 -1
  271. package/dist/seo/locale-tag.js +31 -0
  272. package/dist/seo/locale-tag.js.map +1 -1
  273. package/dist/seo/meta-tags.d.ts +29 -0
  274. package/dist/seo/meta-tags.d.ts.map +1 -1
  275. package/dist/seo/meta-tags.js +28 -0
  276. package/dist/seo/meta-tags.js.map +1 -1
  277. package/dist/seo/metadata-parser.d.ts +24 -0
  278. package/dist/seo/metadata-parser.d.ts.map +1 -1
  279. package/dist/seo/metadata-parser.js +38 -0
  280. package/dist/seo/metadata-parser.js.map +1 -1
  281. package/dist/seo/metadata-types.d.ts +16 -0
  282. package/dist/seo/metadata-types.d.ts.map +1 -1
  283. package/dist/seo/product-path.d.ts +96 -0
  284. package/dist/seo/product-path.d.ts.map +1 -1
  285. package/dist/seo/product-path.js +96 -0
  286. package/dist/seo/product-path.js.map +1 -1
  287. package/dist/seo/robots.d.ts +17 -0
  288. package/dist/seo/robots.d.ts.map +1 -1
  289. package/dist/seo/robots.js +12 -0
  290. package/dist/seo/robots.js.map +1 -1
  291. package/dist/seo/types.d.ts +39 -0
  292. package/dist/seo/types.d.ts.map +1 -1
  293. package/dist/seo/url-builder.d.ts +31 -0
  294. package/dist/seo/url-builder.d.ts.map +1 -1
  295. package/dist/seo/url-builder.js +36 -0
  296. package/dist/seo/url-builder.js.map +1 -1
  297. package/dist/types.d.ts +1283 -2
  298. package/dist/types.d.ts.map +1 -1
  299. package/package.json +1 -1
@@ -9,6 +9,8 @@ export function createSearchMethods(http) {
9
9
  vars.collectionSlug = input.collectionSlug;
10
10
  if (input.collectionId)
11
11
  vars.collectionId = input.collectionId;
12
+ // Plural collection filters combine with AND server-side — a product must
13
+ // belong to every listed collection (the storefront's cross-group filter).
12
14
  if (input.collectionSlugs?.length)
13
15
  vars.collectionSlugs = input.collectionSlugs;
14
16
  if (input.collectionIds?.length)
@@ -23,6 +25,7 @@ export function createSearchMethods(http) {
23
25
  vars.skip = input.skip;
24
26
  if (input.sort)
25
27
  vars.sort = input.sort;
28
+ // Only ids are taggable up front; slug filters resolve server-side.
26
29
  const collectionIds = [
27
30
  ...(input.collectionId ? [input.collectionId] : []),
28
31
  ...(input.collectionIds ?? []),
@@ -1 +1 @@
1
- {"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/commerce/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAmB,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,UAAU,mBAAmB,CAAC,IAAgB;IAClD,OAAO;QACL,KAAK,CAAC,cAAc,CAAC,KAAkB,EAAE,OAAwB;YAC/D,MAAM,IAAI,GAA4B,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;YAC3D,IAAI,KAAK,CAAC,cAAc;gBAAE,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;YACrE,IAAI,KAAK,CAAC,YAAY;gBAAE,IAAI,CAAC,YAAY,GAA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I,CAAC;YAEvC,oEAAoE;YACpE,MAAM,aAAa,GAAG;gBACpB,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBACnD,GAAG,CAAC,KAAK,CAAC,aAAa,IAAI,EAAE,CAAC;aAC/B,CAAC;YACF,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAC7B,eAAe,EACf,EAAE,KAAK,EAAE,IAAI,EAAE,EACf,UAAU,CAAC,OAAO,EAAE,gBAAgB,EAAE,aAAa,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAC7E,CAAC;YACF,OAAO,IAAI,CAAC,MAAM,CAAC;QACrB,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,4 +1,4 @@
1
- export const DROP_OFF_POINTS = `
1
+ export const DROP_OFF_POINTS = /* GraphQL */ `
2
2
  query MyparcelDropOffPoints($input: MyparcelDropOffPointInput!) {
3
3
  myparcelDropOffPoints(input: $input) {
4
4
  location_code
@@ -20,7 +20,7 @@ export const DROP_OFF_POINTS = `
20
20
  }
21
21
  }
22
22
  `;
23
- export const DELIVERY_OPTIONS = `
23
+ export const DELIVERY_OPTIONS = /* GraphQL */ `
24
24
  query MyparcelDeliveryOptions($input: MyparcelDeliveryOptionsInput!) {
25
25
  myparcelDeliveryOptions(input: $input) {
26
26
  date
@@ -34,7 +34,7 @@ export const DELIVERY_OPTIONS = `
34
34
  }
35
35
  }
36
36
  `;
37
- export const TRACK_SHIPMENT = `
37
+ export const TRACK_SHIPMENT = /* GraphQL */ `
38
38
  query MyparcelTrackShipment($barcode: String!, $postalCode: String!) {
39
39
  myparcelTrackShipment(barcode: $barcode, postalCode: $postalCode) {
40
40
  shipment_id
@@ -1 +1 @@
1
- {"version":3,"file":"shipping.js","sourceRoot":"","sources":["../../src/commerce/shipping.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,MAAM,eAAe,GAAi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C;IACtB,OAAO;QACL,UAAU,EAAE,GAAG,CAAC,WAAW;QAC3B,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,kBAAkB,EAAE,GAAG,CAAC,oBAAoB;KAC7C,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAgB;IACpD,OAAO;QACL,KAAK,CAAC,gBAAgB,CAAC,KAAwB;YAC7C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAC7B,eAAe,EACf,EAAE,KAAK,EAAE,CACV,CAAC;YACF,OAAO,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QACzD,CAAC;QAED,KAAK,CAAC,kBAAkB,CAAC,KAA2B;YAClD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAC7B,gBAAgB,EAChB,EAAE,KAAK,EAAE,CACV,CAAC;YACF,OAAO,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC7D,CAAC;QAED,KAAK,CAAC,aAAa,CAAC,OAAe,EAAE,UAAkB;YACrD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAC7B,cAAc,EACd,EAAE,OAAO,EAAE,UAAU,EAAE,CACxB,CAAC;YACF,OAAO,WAAW,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QACjD,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,7 +1,18 @@
1
1
  import type { HttpClient } from '../core/http.js';
2
2
  import type { StockNotificationSubscriptionResult } from '../types.js';
3
3
  export declare function createStockNotificationsMethods(http: HttpClient): {
4
+ /**
5
+ * Subscribe to a "back in stock" email for a variant. Logged-in customers
6
+ * may omit `emailAddress` — their account email is used. Guests must supply it.
7
+ *
8
+ * Throws `MutationError` for guest validation errors so callers can
9
+ * branch on `errorCode`. Returns the new subscription on success.
10
+ */
4
11
  subscribeToStockNotification(productVariantId: string, emailAddress?: string): Promise<StockNotificationSubscriptionResult>;
12
+ /**
13
+ * Unsubscribe from a stock notification using the token embedded in the
14
+ * email link. Always resolves to true (idempotent).
15
+ */
5
16
  unsubscribeFromStockNotification(token: string): Promise<boolean>;
6
17
  };
7
18
  //# sourceMappingURL=stock-notifications.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stock-notifications.d.ts","sourceRoot":"","sources":["../../src/commerce/stock-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,aAAa,CAAC;AA2CvE,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,UAAU;mDAUxC,MAAM,iBACT,MAAM,GACpB,OAAO,CAAC,mCAAmC,CAAC;4CAwBD,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;EAQ1E"}
1
+ {"version":3,"file":"stock-notifications.d.ts","sourceRoot":"","sources":["../../src/commerce/stock-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,aAAa,CAAC;AA2CvE,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,UAAU;IAE5D;;;;;;OAMG;mDAEiB,MAAM,iBACT,MAAM,GACpB,OAAO,CAAC,mCAAmC,CAAC;IAoB/C;;;OAGG;4CAC2C,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;EAQ1E"}
@@ -26,6 +26,13 @@ const UNSUBSCRIBE_FROM_STOCK_NOTIFICATION = `
26
26
  `;
27
27
  export function createStockNotificationsMethods(http) {
28
28
  return {
29
+ /**
30
+ * Subscribe to a "back in stock" email for a variant. Logged-in customers
31
+ * may omit `emailAddress` — their account email is used. Guests must supply it.
32
+ *
33
+ * Throws `MutationError` for guest validation errors so callers can
34
+ * branch on `errorCode`. Returns the new subscription on success.
35
+ */
29
36
  async subscribeToStockNotification(productVariantId, emailAddress) {
30
37
  const data = await http.graphql(SUBSCRIBE_TO_STOCK_NOTIFICATION, { productVariantId, emailAddress });
31
38
  const result = data.subscribeToStockNotification;
@@ -39,6 +46,10 @@ export function createStockNotificationsMethods(http) {
39
46
  }
40
47
  throw new MutationError(result.errorCode ?? 'STOCK_NOTIFICATION_ERROR', result.message ?? 'Stock notification subscription failed');
41
48
  },
49
+ /**
50
+ * Unsubscribe from a stock notification using the token embedded in the
51
+ * email link. Always resolves to true (idempotent).
52
+ */
42
53
  async unsubscribeFromStockNotification(token) {
43
54
  const data = await http.graphql(UNSUBSCRIBE_FROM_STOCK_NOTIFICATION, { token });
44
55
  return data.unsubscribeFromStockNotification;
@@ -1 +1 @@
1
- {"version":3,"file":"stock-notifications.js","sourceRoot":"","sources":["../../src/commerce/stock-notifications.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,MAAM,+BAA+B,GAAG;;;;;;;;;;;;;;;;;;;CAmBvC,CAAC;AAEF,MAAM,mCAAmC,GAAG;;;;CAI3C,CAAC;AAgBF,MAAM,UAAU,+BAA+B,CAAC,IAAgB;IAC9D,OAAO;QAQL,KAAK,CAAC,4BAA4B,CAChC,gBAAwB,EACxB,YAAqB;YAErB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAC7B,+BAA+B,EAC/B,EAAE,gBAAgB,EAAE,YAAY,EAAE,CACnC,CAAC;YACF,MAAM,MAAM,GAAG,IAAI,CAAC,4BAA4B,CAAC;YACjD,IAAI,MAAM,CAAC,UAAU,KAAK,+BAA+B,EAAE,CAAC;gBAC1D,OAAO;oBACL,EAAE,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE;oBACnB,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,IAAI,EAAE;oBAC/C,YAAY,EAAE,MAAM,CAAC,YAAY,IAAI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J,CAAC;YACD,MAAM,IAAI,aAAa,CACrB,MAAM,CAAC,SAAS,IAAI,0BAA0B,EAC9C,MAAM,CAAC,OAAO,IAAI,wCAAwC,CAC3D,CAAC;QACJ,CAAC;QAED;;;WAGG;QACH,KAAK,CAAC,gCAAgC,CAAC,KAAa;YAClD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAC7B,mCAAmC,EACnC,EAAE,KAAK,EAAE,CACV,CAAC;YACF,OAAO,IAAI,CAAC,gCAAgC,CAAC;QAC/C,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,14 +1,38 @@
1
1
  import type { HttpClient } from '../core/http.js';
2
- import type { CustomerSubscription, MyPaymentMandate, SetupPaymentMandateResult, SubscriptionPlanPublic } from '../types.js';
3
- export declare const SUBSCRIPTION_PLANS = "\n query SubscriptionPlans {\n subscriptionPlans { \n id\n name\n description\n currencyCode\n price\n billingInterval\n billingIntervalCount\n trialDays\n minCycles\n maxCycles\n }\n }\n";
2
+ import type { CustomerSubscription, MyPaymentMandate, SetupPaymentMandateResult, SubscriptionChangePreview, SubscriptionLifecycleCommand, SubscriptionPaymentActionInput, SubscriptionPlanPublic, SubscriptionPurchaseInput, SubscriptionPurchasePreview, SubscriptionPurchaseResult } from '../types.js';
3
+ export declare const SUBSCRIPTION_PLANS = "\n query SubscriptionPlans {\n subscriptionPlans { \n firstChargeTiming customerChangeCutoffHours\n id\n name\n description\n currencyCode\n price\n billingInterval\n billingIntervalCount\n trialDays\n minCycles\n maxCycles\n }\n }\n";
4
4
  export declare const MY_PAYMENT_MANDATES = "\n query MyPaymentMandates {\n myPaymentMandates { \n id\n provider\n mandateMethod\n mandateStatus\n isDefault\n createdAt\n }\n }\n";
5
5
  export declare const SETUP_PAYMENT_MANDATE = "\n mutation SetupPaymentMandate($input: SetupPaymentMandateInput!) {\n setupPaymentMandate(input: $input) {\n mandate { \n id\n provider\n mandateMethod\n mandateStatus\n isDefault\n createdAt\n }\n checkoutUrl\n clientSecret\n }\n }\n";
6
- export declare const CREATE_MY_SUBSCRIPTION = "\n mutation CreateMySubscription($input: CreateMySubscriptionInput!) {\n createMySubscription(input: $input) { \n id\n planName\n currencyCode\n recurringPrice\n billingInterval\n currentStatus\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n cancelAtPeriodEnd\n createdAt\n }\n }\n";
7
- export declare const MY_SUBSCRIPTIONS = "\n query MySubscriptions {\n mySubscriptions { \n id\n planName\n currencyCode\n recurringPrice\n billingInterval\n currentStatus\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n cancelAtPeriodEnd\n createdAt\n }\n }\n";
8
- export declare const PAUSE_MY_SUBSCRIPTION = "\n mutation PauseMySubscription($id: ID!, $reason: String) {\n pauseMySubscription(id: $id, reason: $reason) { \n id\n planName\n currencyCode\n recurringPrice\n billingInterval\n currentStatus\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n cancelAtPeriodEnd\n createdAt\n }\n }\n";
9
- export declare const RESUME_MY_SUBSCRIPTION = "\n mutation ResumeMySubscription($id: ID!) {\n resumeMySubscription(id: $id) { \n id\n planName\n currencyCode\n recurringPrice\n billingInterval\n currentStatus\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n cancelAtPeriodEnd\n createdAt\n }\n }\n";
10
- export declare const CANCEL_MY_SUBSCRIPTION = "\n mutation CancelMySubscription($id: ID!, $reason: String, $immediate: Boolean) {\n cancelMySubscription(id: $id, reason: $reason, immediate: $immediate) { \n id\n planName\n currencyCode\n recurringPrice\n billingInterval\n currentStatus\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n cancelAtPeriodEnd\n createdAt\n }\n }\n";
6
+ export declare const CREATE_MY_SUBSCRIPTION = "\n mutation CreateMySubscription($input: CreateMySubscriptionInput!) {\n createMySubscription(input: $input) { \n billingIntervalCount trialEndsAt minCycles maxCycles paidCycleCount\n firstChargeTiming customerChangeCutoffHours cutoffAt cancellationRequested\n cancellationEffectiveAt earliestCancellationAt remainingPaidCycles committedPayment\n resumeAt retainedResumeAt earliestResumeAt paymentActionRequired\n allowedActions { action allowed reason }\n products { variantId quantity name sku }\n upcomingPayment { dueAt amount currencyCode state nextRetryAt checkoutUrl }\n\n id\n planName\n currencyCode\n recurringPrice\n billingInterval\n currentStatus\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n cancelAtPeriodEnd\n createdAt\n }\n }\n";
7
+ export declare const MY_SUBSCRIPTIONS = "\n query MySubscriptions {\n mySubscriptions { \n billingIntervalCount trialEndsAt minCycles maxCycles paidCycleCount\n firstChargeTiming customerChangeCutoffHours cutoffAt cancellationRequested\n cancellationEffectiveAt earliestCancellationAt remainingPaidCycles committedPayment\n resumeAt retainedResumeAt earliestResumeAt paymentActionRequired\n allowedActions { action allowed reason }\n products { variantId quantity name sku }\n upcomingPayment { dueAt amount currencyCode state nextRetryAt checkoutUrl }\n\n id\n planName\n currencyCode\n recurringPrice\n billingInterval\n currentStatus\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n cancelAtPeriodEnd\n createdAt\n }\n }\n";
8
+ export declare const PAUSE_MY_SUBSCRIPTION = "\n mutation PauseMySubscription($id: ID!, $reason: String) {\n pauseMySubscription(id: $id, reason: $reason) { \n billingIntervalCount trialEndsAt minCycles maxCycles paidCycleCount\n firstChargeTiming customerChangeCutoffHours cutoffAt cancellationRequested\n cancellationEffectiveAt earliestCancellationAt remainingPaidCycles committedPayment\n resumeAt retainedResumeAt earliestResumeAt paymentActionRequired\n allowedActions { action allowed reason }\n products { variantId quantity name sku }\n upcomingPayment { dueAt amount currencyCode state nextRetryAt checkoutUrl }\n\n id\n planName\n currencyCode\n recurringPrice\n billingInterval\n currentStatus\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n cancelAtPeriodEnd\n createdAt\n }\n }\n";
9
+ export declare const RESUME_MY_SUBSCRIPTION = "\n mutation ResumeMySubscription($id: ID!) {\n resumeMySubscription(id: $id) { \n billingIntervalCount trialEndsAt minCycles maxCycles paidCycleCount\n firstChargeTiming customerChangeCutoffHours cutoffAt cancellationRequested\n cancellationEffectiveAt earliestCancellationAt remainingPaidCycles committedPayment\n resumeAt retainedResumeAt earliestResumeAt paymentActionRequired\n allowedActions { action allowed reason }\n products { variantId quantity name sku }\n upcomingPayment { dueAt amount currencyCode state nextRetryAt checkoutUrl }\n\n id\n planName\n currencyCode\n recurringPrice\n billingInterval\n currentStatus\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n cancelAtPeriodEnd\n createdAt\n }\n }\n";
10
+ export declare const CANCEL_MY_SUBSCRIPTION = "\n mutation CancelMySubscription($id: ID!, $reason: String, $immediate: Boolean) {\n cancelMySubscription(id: $id, reason: $reason, immediate: $immediate) { \n billingIntervalCount trialEndsAt minCycles maxCycles paidCycleCount\n firstChargeTiming customerChangeCutoffHours cutoffAt cancellationRequested\n cancellationEffectiveAt earliestCancellationAt remainingPaidCycles committedPayment\n resumeAt retainedResumeAt earliestResumeAt paymentActionRequired\n allowedActions { action allowed reason }\n products { variantId quantity name sku }\n upcomingPayment { dueAt amount currencyCode state nextRetryAt checkoutUrl }\n\n id\n planName\n currencyCode\n recurringPrice\n billingInterval\n currentStatus\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n cancelAtPeriodEnd\n createdAt\n }\n }\n";
11
+ export declare const MY_SUBSCRIPTION = "\n query MySubscription($id: ID!) { mySubscription(id: $id) { \n billingIntervalCount trialEndsAt minCycles maxCycles paidCycleCount\n firstChargeTiming customerChangeCutoffHours cutoffAt cancellationRequested\n cancellationEffectiveAt earliestCancellationAt remainingPaidCycles committedPayment\n resumeAt retainedResumeAt earliestResumeAt paymentActionRequired\n allowedActions { action allowed reason }\n products { variantId quantity name sku }\n upcomingPayment { dueAt amount currencyCode state nextRetryAt checkoutUrl }\n\n id\n planName\n currencyCode\n recurringPrice\n billingInterval\n currentStatus\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n cancelAtPeriodEnd\n createdAt\n } }\n";
12
+ export declare const SUBSCRIPTION_PURCHASE_PREVIEW = "\n query SubscriptionPurchasePreview($planId: ID!, $provider: String, $mandateId: ID) {\n subscriptionPurchasePreview(planId: $planId, provider: $provider, mandateId: $mandateId) {\n planId planName amount pricesIncludeTax netAmount taxAmount currencyCode firstPaymentAt firstChargeTiming\n billingInterval billingIntervalCount trialDays trialEndsAt minCycles maxCycles\n customerChangeCutoffHours cutoffAt mandateVerificationAmount products { variantId quantity name sku }\n }\n }\n";
13
+ export declare const START_MY_SUBSCRIPTION_PURCHASE = "\n mutation StartMySubscriptionPurchase($input: SubscriptionPurchaseInput!) {\n startMySubscriptionPurchase(input: $input) { \n id subscriptionId state checkoutUrl expiresAt currentStatus paymentActionRequired nextRenewalAt\n }\n }\n";
14
+ export declare const MY_SUBSCRIPTION_PURCHASE_STATUS = "\n query MySubscriptionPurchaseStatus($id: ID!) {\n mySubscriptionPurchaseStatus(id: $id) { \n id subscriptionId state checkoutUrl expiresAt currentStatus paymentActionRequired nextRenewalAt\n }\n }\n";
15
+ export declare const MANAGE_MY_SUBSCRIPTION = "\n mutation ManageMySubscription($id: ID!, $input: SubscriptionLifecycleCommand!) {\n manageMySubscription(id: $id, input: $input) { \n billingIntervalCount trialEndsAt minCycles maxCycles paidCycleCount\n firstChargeTiming customerChangeCutoffHours cutoffAt cancellationRequested\n cancellationEffectiveAt earliestCancellationAt remainingPaidCycles committedPayment\n resumeAt retainedResumeAt earliestResumeAt paymentActionRequired\n allowedActions { action allowed reason }\n products { variantId quantity name sku }\n upcomingPayment { dueAt amount currencyCode state nextRetryAt checkoutUrl }\n\n id\n planName\n currencyCode\n recurringPrice\n billingInterval\n currentStatus\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n cancelAtPeriodEnd\n createdAt\n }\n }\n";
16
+ export declare const REPLACE_MY_SUBSCRIPTION_MANDATE = "\n mutation ReplaceMySubscriptionMandate($id: ID!, $input: SubscriptionPaymentActionInput!) {\n replaceMySubscriptionMandate(id: $id, input: $input) { \n id subscriptionId state checkoutUrl expiresAt currentStatus paymentActionRequired nextRenewalAt\n }\n }\n";
17
+ export declare const RECOVER_MY_SUBSCRIPTION_PAYMENT = "\n mutation RecoverMySubscriptionPayment($id: ID!, $input: SubscriptionPaymentActionInput!) {\n recoverMySubscriptionPayment(id: $id, input: $input) { \n id subscriptionId state checkoutUrl expiresAt currentStatus paymentActionRequired nextRenewalAt\n }\n }\n";
18
+ export declare const PREVIEW_MY_SUBSCRIPTION_CHANGE = "query PreviewMySubscriptionChange($id: ID!, $input: SubscriptionLifecycleCommand!) {\n previewMySubscriptionChange(id: $id, input: $input) { allowed reason nextRenewalAt cancellationEffectiveAt committedPayment remainingPaidCycles }\n}";
11
19
  export declare function createSubscriptionsMethods(http: HttpClient): {
20
+ getMySubscription(id: string): Promise<CustomerSubscription | null>;
21
+ previewSubscriptionPurchase(planId: string, options?: {
22
+ provider?: "mollie" | "stripe";
23
+ mandateId?: string;
24
+ }): Promise<SubscriptionPurchasePreview>;
25
+ startSubscriptionPurchase(input: SubscriptionPurchaseInput): Promise<SubscriptionPurchaseResult>;
26
+ getSubscriptionPurchaseStatus(id: string): Promise<SubscriptionPurchaseResult>;
27
+ previewMySubscriptionChange(id: string, input: SubscriptionLifecycleCommand): Promise<SubscriptionChangePreview>;
28
+ manageMySubscription: (id: string, input: SubscriptionLifecycleCommand) => Promise<CustomerSubscription>;
29
+ skipMySubscription: (id: string, requestKey: string) => Promise<CustomerSubscription>;
30
+ rescheduleMySubscription: (id: string, date: string, requestKey: string) => Promise<CustomerSubscription>;
31
+ undoMySubscriptionCancellation: (id: string, requestKey: string) => Promise<CustomerSubscription>;
32
+ replaceMySubscriptionMandate(id: string, input: SubscriptionPaymentActionInput & {
33
+ provider: "mollie" | "stripe";
34
+ }): Promise<SubscriptionPurchaseResult>;
35
+ recoverMySubscriptionPayment(id: string, input: SubscriptionPaymentActionInput): Promise<SubscriptionPurchaseResult>;
12
36
  getMySubscriptions(): Promise<CustomerSubscription[]>;
13
37
  getSubscriptionPlans(): Promise<SubscriptionPlanPublic[]>;
14
38
  getMyPaymentMandates(): Promise<MyPaymentMandate[]>;
@@ -16,7 +40,7 @@ export declare function createSubscriptionsMethods(http: HttpClient): {
16
40
  provider: string;
17
41
  redirectUrl: string;
18
42
  }): Promise<SetupPaymentMandateResult>;
19
- createSubscription(planId: string, mandateId: string): Promise<CustomerSubscription>;
43
+ createSubscription(planId: string, mandateId: string, requestKey?: string): Promise<CustomerSubscription>;
20
44
  pauseMySubscription(id: string, reason?: string): Promise<CustomerSubscription>;
21
45
  resumeMySubscription(id: string): Promise<CustomerSubscription>;
22
46
  cancelMySubscription(id: string, options?: {
@@ -1 +1 @@
1
- {"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../src/commerce/subscriptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,oBAAoB,EACpB,gBAAgB,EAChB,yBAAyB,EACzB,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAsCrB,eAAO,MAAM,kBAAkB,+MAI9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,qJAI/B,CAAC;AAEF,eAAO,MAAM,qBAAqB,6QAQjC,CAAC;AAEF,eAAO,MAAM,sBAAsB,wTAIlC,CAAC;AAEF,eAAO,MAAM,gBAAgB,wPAI5B,CAAC;AAEF,eAAO,MAAM,qBAAqB,wTAIjC,CAAC;AAEF,eAAO,MAAM,sBAAsB,wRAIlC,CAAC;AAEF,eAAO,MAAM,sBAAsB,sWAIlC,CAAC;AAEF,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,UAAU;0BAE3B,OAAO,CAAC,oBAAoB,EAAE,CAAC;4BAO7B,OAAO,CAAC,sBAAsB,EAAE,CAAC;4BAOjC,OAAO,CAAC,gBAAgB,EAAE,CAAC;+BAOxB;QAC/B,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;KACrB,G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AC;6BAS/D,MAAM,YACA;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GACjD,OAAO,CAAC,oBAAoB,CAAC;EAQnC"}
@@ -1,4 +1,12 @@
1
1
  const SUBSCRIPTION_FIELDS = `
2
+ billingIntervalCount trialEndsAt minCycles maxCycles paidCycleCount
3
+ firstChargeTiming customerChangeCutoffHours cutoffAt cancellationRequested
4
+ cancellationEffectiveAt earliestCancellationAt remainingPaidCycles committedPayment
5
+ resumeAt retainedResumeAt earliestResumeAt paymentActionRequired
6
+ allowedActions { action allowed reason }
7
+ products { variantId quantity name sku }
8
+ upcomingPayment { dueAt amount currencyCode state nextRetryAt checkoutUrl }
9
+
2
10
  id
3
11
  planName
4
12
  currencyCode
@@ -12,6 +20,7 @@ const SUBSCRIPTION_FIELDS = `
12
20
  createdAt
13
21
  `;
14
22
  const SUBSCRIPTION_PLAN_PUBLIC_FIELDS = `
23
+ firstChargeTiming customerChangeCutoffHours
15
24
  id
16
25
  name
17
26
  description
@@ -75,8 +84,87 @@ export const CANCEL_MY_SUBSCRIPTION = `
75
84
  cancelMySubscription(id: $id, reason: $reason, immediate: $immediate) { ${SUBSCRIPTION_FIELDS} }
76
85
  }
77
86
  `;
87
+ const PURCHASE_RESULT_FIELDS = `
88
+ id subscriptionId state checkoutUrl expiresAt currentStatus paymentActionRequired nextRenewalAt
89
+ `;
90
+ export const MY_SUBSCRIPTION = `
91
+ query MySubscription($id: ID!) { mySubscription(id: $id) { ${SUBSCRIPTION_FIELDS} } }
92
+ `;
93
+ export const SUBSCRIPTION_PURCHASE_PREVIEW = `
94
+ query SubscriptionPurchasePreview($planId: ID!, $provider: String, $mandateId: ID) {
95
+ subscriptionPurchasePreview(planId: $planId, provider: $provider, mandateId: $mandateId) {
96
+ planId planName amount pricesIncludeTax netAmount taxAmount currencyCode firstPaymentAt firstChargeTiming
97
+ billingInterval billingIntervalCount trialDays trialEndsAt minCycles maxCycles
98
+ customerChangeCutoffHours cutoffAt mandateVerificationAmount products { variantId quantity name sku }
99
+ }
100
+ }
101
+ `;
102
+ export const START_MY_SUBSCRIPTION_PURCHASE = `
103
+ mutation StartMySubscriptionPurchase($input: SubscriptionPurchaseInput!) {
104
+ startMySubscriptionPurchase(input: $input) { ${PURCHASE_RESULT_FIELDS} }
105
+ }
106
+ `;
107
+ export const MY_SUBSCRIPTION_PURCHASE_STATUS = `
108
+ query MySubscriptionPurchaseStatus($id: ID!) {
109
+ mySubscriptionPurchaseStatus(id: $id) { ${PURCHASE_RESULT_FIELDS} }
110
+ }
111
+ `;
112
+ export const MANAGE_MY_SUBSCRIPTION = `
113
+ mutation ManageMySubscription($id: ID!, $input: SubscriptionLifecycleCommand!) {
114
+ manageMySubscription(id: $id, input: $input) { ${SUBSCRIPTION_FIELDS} }
115
+ }
116
+ `;
117
+ export const REPLACE_MY_SUBSCRIPTION_MANDATE = `
118
+ mutation ReplaceMySubscriptionMandate($id: ID!, $input: SubscriptionPaymentActionInput!) {
119
+ replaceMySubscriptionMandate(id: $id, input: $input) { ${PURCHASE_RESULT_FIELDS} }
120
+ }
121
+ `;
122
+ export const RECOVER_MY_SUBSCRIPTION_PAYMENT = `
123
+ mutation RecoverMySubscriptionPayment($id: ID!, $input: SubscriptionPaymentActionInput!) {
124
+ recoverMySubscriptionPayment(id: $id, input: $input) { ${PURCHASE_RESULT_FIELDS} }
125
+ }
126
+ `;
127
+ export const PREVIEW_MY_SUBSCRIPTION_CHANGE = `query PreviewMySubscriptionChange($id: ID!, $input: SubscriptionLifecycleCommand!) {
128
+ previewMySubscriptionChange(id: $id, input: $input) { allowed reason nextRenewalAt cancellationEffectiveAt committedPayment remainingPaidCycles }
129
+ }`;
78
130
  export function createSubscriptionsMethods(http) {
131
+ const manage = async (id, input) => {
132
+ const data = await http.graphql(MANAGE_MY_SUBSCRIPTION, { id, input });
133
+ return data.manageMySubscription;
134
+ };
79
135
  return {
136
+ async getMySubscription(id) {
137
+ const data = await http.graphql(MY_SUBSCRIPTION, { id });
138
+ return data.mySubscription;
139
+ },
140
+ async previewSubscriptionPurchase(planId, options) {
141
+ const data = await http.graphql(SUBSCRIPTION_PURCHASE_PREVIEW, { planId, ...options });
142
+ return data.subscriptionPurchasePreview;
143
+ },
144
+ async startSubscriptionPurchase(input) {
145
+ const data = await http.graphql(START_MY_SUBSCRIPTION_PURCHASE, { input });
146
+ return data.startMySubscriptionPurchase;
147
+ },
148
+ async getSubscriptionPurchaseStatus(id) {
149
+ const data = await http.graphql(MY_SUBSCRIPTION_PURCHASE_STATUS, { id });
150
+ return data.mySubscriptionPurchaseStatus;
151
+ },
152
+ async previewMySubscriptionChange(id, input) {
153
+ const data = await http.graphql(PREVIEW_MY_SUBSCRIPTION_CHANGE, { id, input });
154
+ return data.previewMySubscriptionChange;
155
+ },
156
+ manageMySubscription: manage,
157
+ skipMySubscription: (id, requestKey) => manage(id, { action: 'skip', requestKey }),
158
+ rescheduleMySubscription: (id, date, requestKey) => manage(id, { action: 'reschedule', date, requestKey }),
159
+ undoMySubscriptionCancellation: (id, requestKey) => manage(id, { action: 'undoCancellation', requestKey }),
160
+ async replaceMySubscriptionMandate(id, input) {
161
+ const data = await http.graphql(REPLACE_MY_SUBSCRIPTION_MANDATE, { id, input });
162
+ return data.replaceMySubscriptionMandate;
163
+ },
164
+ async recoverMySubscriptionPayment(id, input) {
165
+ const data = await http.graphql(RECOVER_MY_SUBSCRIPTION_PAYMENT, { id, input });
166
+ return data.recoverMySubscriptionPayment;
167
+ },
80
168
  async getMySubscriptions() {
81
169
  const data = await http.graphql(MY_SUBSCRIPTIONS);
82
170
  return data.mySubscriptions;
@@ -93,8 +181,8 @@ export function createSubscriptionsMethods(http) {
93
181
  const data = await http.graphql(SETUP_PAYMENT_MANDATE, { input });
94
182
  return data.setupPaymentMandate;
95
183
  },
96
- async createSubscription(planId, mandateId) {
97
- const data = await http.graphql(CREATE_MY_SUBSCRIPTION, { input: { planId, mandateId } });
184
+ async createSubscription(planId, mandateId, requestKey) {
185
+ const data = await http.graphql(CREATE_MY_SUBSCRIPTION, { input: { planId, mandateId, ...(requestKey ? { requestKey } : {}) } });
98
186
  return data.createMySubscription;
99
187
  },
100
188
  async pauseMySubscription(id, reason) {
@@ -1 +1 @@
1
- {"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../../src/commerce/subscriptions.ts"],"names":[],"mappings":"AAQA,MAAM,mBAAmB,GAAG;;;;;;;;;;;;CAY3B,CAAC;AAEF,MAAM,+BAA+B,GAAG;;;;;;;;;;;CAWvC,CAAC;AAEF,MAAM,sBAAsB,GAAG;;;;;;;CAO9B,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG;;0BAER,+BAA+B;;CAExD,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG;;0BAET,sBAAsB;;CAE/C,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;kBAGnB,sBAAsB;;;;;CAKvC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG;;4CAEM,mBAAmB;;CAE9D,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG;;wBAER,mBAAmB;;CAE1C,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG;;sDAEiB,mBAAmB;;CAExE,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG;;sCAEA,mBAAmB;;CAExD,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG;;8EAEwC,mBAAmB;;CAEhG,CAAC;AAEF,MAAM,UAAU,0BAA0B,CAAC,IAAgB;IACzD,OAAO;QACL,KAAK,CAAC,kBAAkB;YACtB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAC7B,gBAAgB,CACjB,CAAC;YACF,OAAO,IAAI,CAAC,eAAe,CAAC;QAC9B,CAAC;QAED,KAAK,CAAC,oBAAoB;YACxB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO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sB,EACtB,EAAE,EAAE,EAAE,CACP,CAAC;YACF,OAAO,IAAI,CAAC,oBAAoB,CAAC;QACnC,CAAC;QAED,KAAK,CAAC,oBAAoB,CACxB,EAAU,EACV,OAAkD;YAElD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAC7B,sBAAsB,EACtB,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,KAAK,EAAE,CACxE,CAAC;YACF,OAAO,IAAI,CAAC,oBAAoB,CAAC;QACnC,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,4 +1,4 @@
1
- const VAT_FIELDS = `
1
+ const VAT_FIELDS = /* GraphQL */ `
2
2
  status
3
3
  vatNumber
4
4
  countryCode
@@ -7,17 +7,17 @@ const VAT_FIELDS = `
7
7
  validatedAt
8
8
  error
9
9
  `;
10
- const MY_VAT_VALIDATION_STATUS = `
10
+ const MY_VAT_VALIDATION_STATUS = /* GraphQL */ `
11
11
  query MyVatValidationStatus {
12
12
  myVatValidationStatus { ${VAT_FIELDS} }
13
13
  }
14
14
  `;
15
- const SET_MY_VAT_NUMBER = `
15
+ const SET_MY_VAT_NUMBER = /* GraphQL */ `
16
16
  mutation SetMyVatNumber($vatNumber: String!) {
17
17
  setMyVatNumber(vatNumber: $vatNumber) { ${VAT_FIELDS} }
18
18
  }
19
19
  `;
20
- const CLEAR_MY_VAT_NUMBER = `
20
+ const CLEAR_MY_VAT_NUMBER = /* GraphQL */ `
21
21
  mutation ClearMyVatNumber {
22
22
  clearMyVatNumber
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"vat-validation.js","sourceRoot":"","sources":["../../src/commerce/vat-validation.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,GAAiB;;;;;;;;CAQhC,CAAC;AAEF,MAAM,wBAAwB,GAAiB;;8BAEjB,UAAU;;CAEvC,CAAC;AAEF,MAAM,iBAAiB,GAAiB;;8CAE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AI,CAAC,OAAO,CAA0C,iBAAiB,EAAE;gBAC1F,SAAS;aACV,CAAC,CAAC;YACH,OAAO,IAAI,CAAC,cAAc,CAAC;QAC7B,CAAC;QAED,KAAK,CAAC,gBAAgB;YACpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAgC,mBAAmB,CAAC,CAAC;YACpF,OAAO,IAAI,CAAC,gBAAgB,CAAC;QAC/B,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,10 +1,41 @@
1
+ /** Default Vendure Shop API base URL. Append `/shop-api` for GraphQL endpoint. */
1
2
  export declare const DEFAULT_VENDURE_URL = "https://engine.sixtyninecommerce.com";
3
+ /** Default CMS REST API base URL. */
2
4
  export declare const DEFAULT_CMS_URL = "https://cms.sixtyninecommerce.com";
5
+ /** Default Plugins REST API base URL. Used for routes manifest. */
3
6
  export declare const DEFAULT_PLUGINS_URL = "https://plugins.sixtyninecommerce.com";
7
+ /** Vendure Shop API GraphQL path. */
4
8
  export declare const SHOP_API_PATH = "/shop-api";
9
+ /** Request timeout in milliseconds for all API calls. */
5
10
  export declare const REQUEST_TIMEOUT_MS = 15000;
11
+ /** Request timeout in milliseconds for initialization (channel resolution). */
6
12
  export declare const INIT_TIMEOUT_MS = 10000;
13
+ /**
14
+ * URL path segments that storefronts own and must never collide with
15
+ * CMS-routed root-level content. The platform validates root content slugs
16
+ * against this list and rejects collisions.
17
+ *
18
+ * Add a new entry only when introducing a new platform-reserved storefront
19
+ * route. Sub-paths (e.g. `/blog/cart`) are not reserved — only root.
20
+ *
21
+ * Mirrored in `services/cms/src/collections/reserved-slugs.ts`; both files
22
+ * must be kept in sync.
23
+ */
7
24
  export declare const RESERVED_STOREFRONT_PATHS: readonly ["cart", "checkout", "account", "sign-in", "register", "forgot-password", "reset-password", "verify", "verify-pending", "api", "sitemaps"];
8
25
  export type ReservedStorefrontPath = (typeof RESERVED_STOREFRONT_PATHS)[number];
26
+ /**
27
+ * Request header carrying the order scope — WHICH storefront a cart belongs to.
28
+ *
29
+ * A tenant can run a consumer shop and a trade (B2B/dealer) shop off ONE
30
+ * channel. Vendure's active-order lookup falls back to "the one active order
31
+ * for this customer in this channel", so separate cookies are not enough: a
32
+ * dealer logged into both shops otherwise shares a single cart. The engine's
33
+ * scoped active-order strategy reads this header on every Shop API request
34
+ * (including uploads) and keeps the two carts apart.
35
+ *
36
+ * Omitting the header is NOT the same as sending `CONSUMER` — the engine then
37
+ * behaves exactly as stock Vendure does, so a storefront that has never heard
38
+ * of scopes is unaffected.
39
+ */
9
40
  export declare const ORDER_SCOPE_HEADER = "x-order-scope";
10
41
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,mBAAmB,yCAAyC,CAAC;AAG1E,eAAO,MAAM,eAAe,sCAAsC,CAAC;AAGnE,eAAO,MAAM,mBAAmB,0CAA0C,CAAC;AAG3E,eAAO,MAAM,aAAa,cAAc,CAAC;AAGzC,eAAO,MAAM,kBAAkB,QAAS,CAAC;AAGzC,eAAO,MAAM,eAAe,QAAS,CAAC;AAatC,eAAO,MAAM,yBAAyB,qJAa5B,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAgBhF,eAAO,MAAM,kBAAkB,kBAAkB,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,eAAO,MAAM,mBAAmB,yCAAyC,CAAC;AAE1E,qCAAqC;AACrC,eAAO,MAAM,eAAe,sCAAsC,CAAC;AAEnE,mEAAmE;AACnE,eAAO,MAAM,mBAAmB,0CAA0C,CAAC;AAE3E,qCAAqC;AACrC,eAAO,MAAM,aAAa,cAAc,CAAC;AAEzC,yDAAyD;AACzD,eAAO,MAAM,kBAAkB,QAAS,CAAC;AAEzC,+EAA+E;AAC/E,eAAO,MAAM,eAAe,QAAS,CAAC;AAEtC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,qJAa5B,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kBAAkB,kBAAkB,CAAC"}
package/dist/constants.js CHANGED
@@ -1,9 +1,26 @@
1
+ /** Default Vendure Shop API base URL. Append `/shop-api` for GraphQL endpoint. */
1
2
  export const DEFAULT_VENDURE_URL = 'https://engine.sixtyninecommerce.com';
3
+ /** Default CMS REST API base URL. */
2
4
  export const DEFAULT_CMS_URL = 'https://cms.sixtyninecommerce.com';
5
+ /** Default Plugins REST API base URL. Used for routes manifest. */
3
6
  export const DEFAULT_PLUGINS_URL = 'https://plugins.sixtyninecommerce.com';
7
+ /** Vendure Shop API GraphQL path. */
4
8
  export const SHOP_API_PATH = '/shop-api';
9
+ /** Request timeout in milliseconds for all API calls. */
5
10
  export const REQUEST_TIMEOUT_MS = 15_000;
11
+ /** Request timeout in milliseconds for initialization (channel resolution). */
6
12
  export const INIT_TIMEOUT_MS = 10_000;
13
+ /**
14
+ * URL path segments that storefronts own and must never collide with
15
+ * CMS-routed root-level content. The platform validates root content slugs
16
+ * against this list and rejects collisions.
17
+ *
18
+ * Add a new entry only when introducing a new platform-reserved storefront
19
+ * route. Sub-paths (e.g. `/blog/cart`) are not reserved — only root.
20
+ *
21
+ * Mirrored in `services/cms/src/collections/reserved-slugs.ts`; both files
22
+ * must be kept in sync.
23
+ */
7
24
  export const RESERVED_STOREFRONT_PATHS = [
8
25
  'cart',
9
26
  'checkout',
@@ -15,7 +32,22 @@ export const RESERVED_STOREFRONT_PATHS = [
15
32
  'verify',
16
33
  'verify-pending',
17
34
  'api',
35
+ // Child-sitemap proxy path (/sitemaps/:file) — CMS content must not collide.
18
36
  'sitemaps',
19
37
  ];
38
+ /**
39
+ * Request header carrying the order scope — WHICH storefront a cart belongs to.
40
+ *
41
+ * A tenant can run a consumer shop and a trade (B2B/dealer) shop off ONE
42
+ * channel. Vendure's active-order lookup falls back to "the one active order
43
+ * for this customer in this channel", so separate cookies are not enough: a
44
+ * dealer logged into both shops otherwise shares a single cart. The engine's
45
+ * scoped active-order strategy reads this header on every Shop API request
46
+ * (including uploads) and keeps the two carts apart.
47
+ *
48
+ * Omitting the header is NOT the same as sending `CONSUMER` — the engine then
49
+ * behaves exactly as stock Vendure does, so a storefront that has never heard
50
+ * of scopes is unaffected.
51
+ */
20
52
  export const ORDER_SCOPE_HEADER = 'x-order-scope';
21
53
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,mBAAmB,GAAG,sCAAsC,CAAC;AAG1E,MAAM,CAAC,MAAM,eAAe,GAAG,mCAAmC,CAAC;AAGnE,MAAM,CAAC,MAAM,mBAAmB,GAAG,uCAAuC,CAAC;AAG3E,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC;AAGzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAGzC,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AAatC,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,MAAM;IACN,UAAU;IACV,SAAS;IACT,SAAS;IACT,UAAU;IACV,iBAAiB;IACjB,gBAAgB;IAChB,QAAQ;IACR,gBAAgB;IAChB,KAAK;IAEL,UAAU;CACF,CAAC;AAkBX,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,MAAM,CAAC,MAAM,mBAAmB,GAAG,sCAAsC,CAAC;AAE1E,qCAAqC;AACrC,MAAM,CAAC,MAAM,eAAe,GAAG,mCAAmC,CAAC;AAEnE,mEAAmE;AACnE,MAAM,CAAC,MAAM,mBAAmB,GAAG,uCAAuC,CAAC;AAE3E,qCAAqC;AACrC,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC;AAEzC,yDAAyD;AACzD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAEzC,+EAA+E;AAC/E,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AAEtC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,MAAM;IACN,UAAU;IACV,SAAS;IACT,SAAS;IACT,UAAU;IACV,iBAAiB;IACjB,gBAAgB;IAChB,QAAQ;IACR,gBAAgB;IAChB,KAAK;IACL,6EAA6E;IAC7E,UAAU;CACF,CAAC;AAIX;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC"}
@@ -1,7 +1,57 @@
1
+ /**
2
+ * Resolve asset references inside CMS content values.
3
+ *
4
+ * CMS field values used to be written as ABSOLUTE CDN URLs — both bare picker
5
+ * values and `<img src>` inside rich text. That baked the CDN origin and the
6
+ * channel's code into the content itself, so a channel rename or a change of
7
+ * CDN domain silently broke every image (1,915 such references existed in
8
+ * production across two tenants). Values are now stored as storage KEYS and
9
+ * resolved here, at render time.
10
+ *
11
+ * Both forms are handled on purpose: an absolute URL passes through the
12
+ * resolver unchanged, so old and new content coexist and no backfill has to
13
+ * land before this ships.
14
+ */
1
15
  import type { AssetUrlResolver } from '../media/urls.js';
16
+ /** True when a bare string is an asset reference rather than merchant prose. */
2
17
  export declare function isAssetReference(value: string): boolean;
18
+ /**
19
+ * Resolve every asset reference in one stored value.
20
+ *
21
+ * - Rich text: rewrites each `src` attribute.
22
+ * - A bare storage key: resolves the whole value.
23
+ * - Anything else (prose, numbers, JSON): returned untouched.
24
+ */
3
25
  export declare function resolveContentAssetUrls(value: string, resolve: AssetUrlResolver): string;
26
+ /**
27
+ * Apply {@link resolveContentAssetUrls} across a field-value bag.
28
+ *
29
+ * Walks NESTED values, not just top-level strings. A `video` field is stored as
30
+ * `{ source, url }` and a `group` field as an object (or an array of them) with
31
+ * asset, multi-asset and rich-text members — the dashboard writes storage keys
32
+ * inside all of those, so stopping at the first level would hand the storefront
33
+ * a raw key and render a broken video or image.
34
+ *
35
+ * Non-string leaves (numbers, booleans, null) are returned untouched, and the
36
+ * walk is depth-capped: field values are merchant JSON, and a render must not
37
+ * be able to blow the stack.
38
+ */
4
39
  export declare function resolveContentFieldValues(fields: Record<string, unknown> | null | undefined, resolve: AssetUrlResolver): Record<string, unknown>;
40
+ /**
41
+ * Resolve the field values flattened onto one search hit.
42
+ *
43
+ * Search results come from Meilisearch, which stores `value_json` verbatim —
44
+ * so a hit carries exactly the same stored form as a direct read and needs
45
+ * exactly the same resolution. Missing it means a storefront search bar renders
46
+ * raw storage keys while the pages themselves are fine, and only for items
47
+ * re-saved since the migration, which makes it look intermittent.
48
+ */
5
49
  export declare function resolveSearchHitValues<T extends Record<string, unknown>>(hit: T, resolve: AssetUrlResolver): T;
50
+ /**
51
+ * Resolve the hits inside a raw search envelope (`{ data: { hits: [...] } }`).
52
+ *
53
+ * Used by the untyped `getContent` passthrough, which hands the caller whatever
54
+ * the endpoint returned — including, before this, unresolved storage keys.
55
+ */
6
56
  export declare function resolveSearchEnvelope(envelope: Record<string, unknown>, resolve: AssetUrlResolver): Record<string, unknown>;
7
57
  //# sourceMappingURL=asset-urls.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"asset-urls.d.ts","sourceRoot":"","sources":["../../src/content/asset-urls.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAmDzD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAIvD;AASD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,gB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