@shop-on/theme-server 0.10.0 → 0.11.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 (168) hide show
  1. package/dist/account-state.js +1 -2
  2. package/dist/account.d.ts +1 -3
  3. package/dist/account.js +1 -3
  4. package/dist/activity.d.ts +1 -3
  5. package/dist/activity.js +1 -2
  6. package/dist/analytics-proxy.d.ts +8 -14
  7. package/dist/analytics-proxy.js +111 -28
  8. package/dist/analytics-script-proxy.d.ts +1 -5
  9. package/dist/analytics-script-proxy.js +4 -14
  10. package/dist/api-contract/src/addresses.js +32 -0
  11. package/dist/api-contract/src/areas.js +49 -0
  12. package/dist/api-contract/src/custom-data.d.ts +31 -0
  13. package/dist/api-contract/src/custom-data.js +303 -0
  14. package/dist/api-contract/src/ids.js +110 -0
  15. package/dist/api-contract/src/image.js +65 -0
  16. package/dist/api-contract/src/limits.js +44 -0
  17. package/dist/api-contract/src/media.js +13 -0
  18. package/dist/api-contract/src/pickup.js +11 -0
  19. package/dist/api-contract/src/recommendations.js +4 -0
  20. package/dist/api-contract/src/shops.js +27 -0
  21. package/dist/api-contract/src/storefront/analytics.d.ts +100 -0
  22. package/dist/api-contract/src/storefront/analytics.js +138 -0
  23. package/dist/api-contract/src/storefront/areas.d.ts +2 -0
  24. package/dist/api-contract/src/storefront/cart.d.ts +132 -0
  25. package/dist/api-contract/src/storefront/cart.js +248 -0
  26. package/dist/api-contract/src/storefront/catalog.d.ts +3 -0
  27. package/dist/api-contract/src/storefront/checkout-analytics.d.ts +2 -0
  28. package/dist/api-contract/src/storefront/checkout.d.ts +2 -0
  29. package/dist/api-contract/src/storefront/checkout.js +624 -0
  30. package/dist/api-contract/src/storefront/client.d.ts +3 -0
  31. package/dist/api-contract/src/storefront/client.js +6 -0
  32. package/dist/api-contract/src/storefront/content.d.ts +3 -0
  33. package/dist/api-contract/src/storefront/custom-data.d.ts +2 -0
  34. package/dist/api-contract/src/storefront/custom-data.js +27 -0
  35. package/dist/api-contract/src/storefront/customer.d.ts +2 -0
  36. package/dist/api-contract/src/storefront/customer.js +261 -0
  37. package/dist/api-contract/src/storefront/downloads.d.ts +2 -0
  38. package/dist/api-contract/src/storefront/draft-order-invoice.d.ts +2 -0
  39. package/dist/api-contract/src/storefront/forms.d.ts +2 -0
  40. package/dist/api-contract/src/storefront/forms.js +82 -0
  41. package/dist/api-contract/src/storefront/index.d.ts +20956 -0
  42. package/dist/api-contract/src/storefront/orders.d.ts +2 -0
  43. package/dist/api-contract/src/storefront/policies.d.ts +2 -0
  44. package/dist/api-contract/src/storefront/procedure.d.ts +2 -0
  45. package/dist/api-contract/src/storefront/procedure.js +29 -0
  46. package/dist/api-contract/src/storefront/reviews.d.ts +20 -0
  47. package/dist/api-contract/src/storefront/search.d.ts +3 -0
  48. package/dist/api-contract/src/storefront/seo.d.ts +2 -0
  49. package/dist/api-contract/src/storefront/seo.js +132 -0
  50. package/dist/api-contract/src/storefront/shop.d.ts +2 -0
  51. package/dist/api-contract/src/storefront/shop.js +101 -0
  52. package/dist/api-contract/src/taxonomy.js +5 -0
  53. package/dist/api-contract/src/text.js +15 -0
  54. package/dist/api-contract/src/theme-documents.js +13 -0
  55. package/dist/api-contract/src/theme-translations.d.ts +14 -0
  56. package/dist/api-contract/src/theme-translations.js +30 -0
  57. package/dist/api-contract/src/video.js +19 -0
  58. package/dist/availability.d.ts +6 -3
  59. package/dist/availability.js +11 -5
  60. package/dist/blog.d.ts +53 -59
  61. package/dist/blog.js +197 -497
  62. package/dist/cache.d.ts +5 -6
  63. package/dist/cache.js +1 -2
  64. package/dist/canonical-host.d.ts +4 -6
  65. package/dist/canonical-host.js +5 -6
  66. package/dist/card.js +159 -0
  67. package/dist/cart-customer.d.ts +1 -3
  68. package/dist/cart-customer.js +64 -105
  69. package/dist/cart-mutations.d.ts +43 -77
  70. package/dist/cart-mutations.js +106 -232
  71. package/dist/cart-recommendations.d.ts +1 -3
  72. package/dist/cart-recommendations.js +1 -2
  73. package/dist/cart-session.d.ts +1 -3
  74. package/dist/cart-session.js +1 -2
  75. package/dist/cart.d.ts +63 -224
  76. package/dist/cart.js +70 -197
  77. package/dist/checkout.d.ts +13 -17
  78. package/dist/checkout.js +75 -101
  79. package/dist/coalesce.js +57 -0
  80. package/dist/collection.d.ts +89 -298
  81. package/dist/collection.js +210 -656
  82. package/dist/contact.d.ts +20 -10
  83. package/dist/contact.js +36 -30
  84. package/dist/content-version.d.ts +37 -21
  85. package/dist/content-version.js +64 -42
  86. package/dist/contract-kit/src/client.d.ts +12 -0
  87. package/dist/contract-kit/src/client.js +156 -0
  88. package/dist/contract-kit/src/errors.d.ts +1 -0
  89. package/dist/contract-kit/src/errors.js +81 -0
  90. package/dist/contract-kit/src/ids.d.ts +1 -0
  91. package/dist/contract-kit/src/ids.js +118 -0
  92. package/dist/contract-kit/src/index.d.ts +7 -0
  93. package/dist/contract-kit/src/money.d.ts +1 -0
  94. package/dist/contract-kit/src/money.js +10 -0
  95. package/dist/contract-kit/src/pagination.d.ts +1 -0
  96. package/dist/contract-kit/src/procedure.d.ts +69 -0
  97. package/dist/contract-kit/src/procedure.js +16 -0
  98. package/dist/contract-kit/src/realtime.d.ts +1 -0
  99. package/dist/cookie-secret.js +1 -2
  100. package/dist/csrf.js +1 -2
  101. package/dist/customer-handoff.d.ts +1 -3
  102. package/dist/customer-handoff.js +10 -25
  103. package/dist/customer-session.d.ts +1 -3
  104. package/dist/customer-session.js +1 -2
  105. package/dist/customer.d.ts +2 -3
  106. package/dist/customer.js +27 -44
  107. package/dist/files.d.ts +49 -10
  108. package/dist/files.js +106 -89
  109. package/dist/fonts.d.ts +3 -5
  110. package/dist/fonts.js +16 -35
  111. package/dist/html.d.ts +1 -3
  112. package/dist/html.js +1 -2
  113. package/dist/liquid.d.ts +4 -10
  114. package/dist/liquid.js +25 -32
  115. package/dist/listing.js +79 -0
  116. package/dist/marketing-cookies.d.ts +1 -3
  117. package/dist/marketing-cookies.js +1 -2
  118. package/dist/menu.d.ts +46 -155
  119. package/dist/menu.js +51 -61
  120. package/dist/metafields.d.ts +9 -5
  121. package/dist/metafields.js +10 -38
  122. package/dist/metaobject.d.ts +10 -5
  123. package/dist/metaobject.js +43 -66
  124. package/dist/money.d.ts +7 -0
  125. package/dist/money.js +18 -0
  126. package/dist/newsletter.d.ts +19 -10
  127. package/dist/newsletter.js +31 -25
  128. package/dist/page.d.ts +13 -17
  129. package/dist/page.js +49 -105
  130. package/dist/password-session.d.ts +1 -3
  131. package/dist/password-session.js +1 -2
  132. package/dist/password.d.ts +25 -18
  133. package/dist/password.js +41 -59
  134. package/dist/policy.d.ts +7 -7
  135. package/dist/policy.js +19 -55
  136. package/dist/product.d.ts +42 -67
  137. package/dist/product.js +144 -644
  138. package/dist/read-ahead.d.ts +18 -0
  139. package/dist/read-ahead.js +32 -0
  140. package/dist/recommendations.d.ts +6 -12
  141. package/dist/recommendations.js +36 -60
  142. package/dist/review.d.ts +134 -94
  143. package/dist/review.js +257 -469
  144. package/dist/search.d.ts +59 -64
  145. package/dist/search.js +170 -469
  146. package/dist/seo-context.d.ts +1 -3
  147. package/dist/seo-context.js +4 -5
  148. package/dist/seo-documents.d.ts +50 -0
  149. package/dist/seo-documents.js +149 -0
  150. package/dist/shop-seo.d.ts +3 -5
  151. package/dist/shop-seo.js +7 -26
  152. package/dist/shop.d.ts +38 -42
  153. package/dist/shop.js +37 -51
  154. package/dist/store-availability.d.ts +12 -14
  155. package/dist/store-availability.js +18 -56
  156. package/dist/storefront.js +199 -0
  157. package/dist/structured-data.d.ts +3 -28
  158. package/dist/structured-data.js +19 -49
  159. package/dist/trace.js +1 -2
  160. package/dist/translations.d.ts +26 -31
  161. package/dist/translations.js +55 -28
  162. package/package.json +16 -14
  163. package/dist/graphql-env.d.ts +0 -22778
  164. package/dist/graphql.d.ts +0 -64
  165. package/dist/graphql.js +0 -344
  166. package/dist/schema.storefront.graphql +0 -10483
  167. package/dist/seo-proxy.d.ts +0 -11
  168. package/dist/seo-proxy.js +0 -26
@@ -1,273 +1,147 @@
1
- import { graphql, request } from "./graphql.js";
2
- import { CartFields, decodeCart, readCartFields } from "./cart.js";
3
- import { ClientError } from "graphql-request";
4
- //#region src/cart-mutations.ts
5
- const CartCreateMutation = graphql(`
6
- mutation CartCreate {
7
- cartCreate(input: {}) {
8
- cart {
9
- ...CartFields
10
- }
11
- cartToken
12
- userErrors {
13
- code
14
- field
15
- message
16
- }
17
- }
18
- }
19
- `, [CartFields]);
20
- const CartLinesAddMutation = graphql(`
21
- mutation CartLinesAdd($cartToken: String!, $lines: [CartLineInput!]!) {
22
- cartLinesAdd(input: { cartToken: $cartToken, lines: $lines }) {
23
- cart {
24
- ...CartFields
25
- }
26
- userErrors {
27
- code
28
- field
29
- message
30
- }
31
- }
32
- }
33
- `, [CartFields]);
34
- const CartLinesUpdateMutation = graphql(`
35
- mutation CartLinesUpdate($cartToken: String!, $lines: [CartLineUpdateInput!]!) {
36
- cartLinesUpdate(input: { cartToken: $cartToken, lines: $lines }) {
37
- cart {
38
- ...CartFields
39
- }
40
- userErrors {
41
- code
42
- field
43
- message
44
- }
45
- }
46
- }
47
- `, [CartFields]);
48
- const CartLinesRemoveMutation = graphql(`
49
- mutation CartLinesRemove($cartToken: String!, $lineIds: [ID!]!) {
50
- cartLinesRemove(input: { cartToken: $cartToken, lineIds: $lineIds }) {
51
- cart {
52
- ...CartFields
53
- }
54
- userErrors {
55
- code
56
- field
57
- message
58
- }
59
- }
60
- }
61
- `, [CartFields]);
62
- const CartNoteUpdateMutation = graphql(`
63
- mutation CartNoteUpdate($cartToken: String!, $note: String) {
64
- cartNoteUpdate(input: { cartToken: $cartToken, note: $note }) {
65
- cart {
66
- ...CartFields
67
- }
68
- userErrors {
69
- code
70
- field
71
- message
72
- }
73
- }
74
- }
75
- `, [CartFields]);
76
- function firstError(errors) {
77
- return errors[0] ?? {
78
- code: "UNKNOWN",
79
- field: null,
80
- message: "Cart action failed."
81
- };
82
- }
83
- function unwrapCartPayload(payload) {
84
- if (!payload) return {
1
+ import { liteId } from "./api-contract/src/ids.js";
2
+ import { isCartGone, toCart } from "./cart.js";
3
+ import { StorefrontConfigError, buyerStorefront, errorCode, storefront } from "./storefront.js";
4
+ // src/cart-mutations.ts
5
+ async function refused(error, session, op) {
6
+ if (error instanceof StorefrontConfigError) throw error;
7
+ const message = error instanceof Error ? error.message : "Cart action failed.";
8
+ if (isCartGone(error)) {
9
+ await session?.clear();
10
+ return {
11
+ ok: false,
12
+ code: "NOT_FOUND",
13
+ resource: "cart",
14
+ message
15
+ };
16
+ }
17
+ const code = errorCode(error);
18
+ const data = error.data;
19
+ if (code === "NOT_FOUND") return {
85
20
  ok: false,
86
- error: {
87
- code: "UNKNOWN",
88
- field: null,
89
- message: "Cart action failed."
90
- }
21
+ code,
22
+ resource: typeof data?.resource === "string" ? data.resource : null,
23
+ message
91
24
  };
92
- if (payload.userErrors.length > 0) return {
25
+ if (code === "PRECONDITION_FAILED" && data?.condition === "sales.cart_paying") return {
93
26
  ok: false,
94
- error: firstError(payload.userErrors)
27
+ code: "CART_PAYING",
28
+ resource: null,
29
+ message
95
30
  };
96
- if (!payload.cart) return {
31
+ if (code === "INSUFFICIENT_INVENTORY" || code === "LIMIT_EXCEEDED" || code === "VALIDATION_FAILED" || code === "RATE_LIMITED") return {
97
32
  ok: false,
98
- error: {
99
- code: "UNKNOWN",
100
- field: null,
101
- message: "Cart action failed."
102
- }
33
+ code,
34
+ resource: null,
35
+ message
103
36
  };
37
+ console.warn(`[cart] ${op} failed: ${code ?? String(error)}`);
104
38
  return {
105
- ok: true,
106
- cart: payload.cart
107
- };
108
- }
109
- function isCartTokenNotFound(error) {
110
- return error.code === "NOT_FOUND" && error.field === "cartToken";
111
- }
112
- function surfaceClientError(err, op) {
113
- console.warn(`[cart] ${op} failed:`, err);
114
- if (err instanceof ClientError) return {
115
39
  ok: false,
116
40
  code: "REQUEST_FAILED",
117
- field: null,
118
- message: err.response.errors?.[0]?.message ?? "Request failed."
119
- };
120
- return {
121
- ok: false,
122
- code: "UNKNOWN",
123
- field: null,
124
- message: "Cart action failed."
41
+ resource: null,
42
+ message
125
43
  };
126
44
  }
127
- /** Mint a fresh cart via `cartCreate`. When `customerToken` is present the
128
- * cart is born attached to that customer. Returns the plaintext token + the
129
- * server-authoritative `expiresAt` so the caller can write its cookie; never
130
- * touches the cookie itself. */
131
- async function mintCart(customerToken) {
45
+ async function write(session, op, call) {
132
46
  try {
133
- const payload = (await request(CartCreateMutation, {}, customerToken ? { customerSessionToken: customerToken } : void 0)).cartCreate;
134
- const unwrapped = unwrapCartPayload(payload);
135
- if (!unwrapped.ok || !payload?.cartToken) return {
136
- ok: false,
137
- ...!unwrapped.ok ? unwrapped.error : {
138
- code: "UNKNOWN",
139
- field: null,
140
- message: "Cart action failed."
141
- }
142
- };
143
47
  return {
144
48
  ok: true,
145
- token: payload.cartToken,
146
- expiresAt: readCartFields(unwrapped.cart).expiresAt
49
+ cart: toCart(await call(storefront().cart))
147
50
  };
148
- } catch (err) {
149
- return surfaceClientError(err, "cartCreate");
51
+ } catch (error) {
52
+ return refused(error, session, op);
150
53
  }
151
54
  }
152
- async function addLines(args) {
153
- const { session, token, customerToken, lines } = args;
154
- try {
155
- const unwrapped = unwrapCartPayload((await request(CartLinesAddMutation, {
156
- cartToken: token,
157
- lines
158
- }, customerToken ? { customerSessionToken: customerToken } : void 0)).cartLinesAdd);
159
- if (!unwrapped.ok) {
160
- if (isCartTokenNotFound(unwrapped.error)) await session.clear();
161
- return {
162
- ok: false,
163
- ...unwrapped.error
164
- };
165
- }
166
- return {
167
- ok: true,
168
- cart: decodeCart(unwrapped.cart)
169
- };
170
- } catch (err) {
171
- return surfaceClientError(err, "addToCart");
55
+ /** The ids a theme hands in, as the api's: one that is no id of its kind
56
+ * names nothing, so the call is refused as NOT_FOUND without being made. */
57
+ function ids(schema, refs) {
58
+ const parsed = [];
59
+ for (const ref of refs) {
60
+ const id = schema.safeParse(ref);
61
+ if (!id.success) return null;
62
+ parsed.push(id.data);
172
63
  }
64
+ return parsed;
173
65
  }
174
- async function updateLines(args) {
175
- const { session, token, customerToken, lines } = args;
176
- try {
177
- const unwrapped = unwrapCartPayload((await request(CartLinesUpdateMutation, {
178
- cartToken: token,
179
- lines
180
- }, customerToken ? { customerSessionToken: customerToken } : void 0)).cartLinesUpdate);
181
- if (!unwrapped.ok) {
182
- if (isCartTokenNotFound(unwrapped.error)) await session.clear();
183
- return {
184
- ok: false,
185
- ...unwrapped.error
186
- };
187
- }
188
- return {
189
- ok: true,
190
- cart: decodeCart(unwrapped.cart)
191
- };
192
- } catch (err) {
193
- return surfaceClientError(err, "updateCartLine");
194
- }
66
+ const VARIANT_ID = liteId("variant");
67
+ const LINE_ID = liteId("basket_line");
68
+ function unknown(resource) {
69
+ return {
70
+ ok: false,
71
+ code: "NOT_FOUND",
72
+ resource,
73
+ message: `No such ${resource}.`
74
+ };
195
75
  }
196
- async function removeLines(args) {
197
- const { session, token, customerToken, lineIds } = args;
76
+ /** Open a new, empty cart, the signed-in buyer's when `buyerSession` is
77
+ * given. Answers its token and when it expires (30 days, never extended) for
78
+ * the caller's cookie; never touches the cookie itself. */
79
+ async function mintCart(buyerSession) {
198
80
  try {
199
- const unwrapped = unwrapCartPayload((await request(CartLinesRemoveMutation, {
200
- cartToken: token,
201
- lineIds
202
- }, customerToken ? { customerSessionToken: customerToken } : void 0)).cartLinesRemove);
203
- if (!unwrapped.ok) {
204
- if (isCartTokenNotFound(unwrapped.error)) await session.clear();
205
- return {
206
- ok: false,
207
- ...unwrapped.error
208
- };
209
- }
81
+ const { token, cart } = await (buyerSession ? buyerStorefront(buyerSession) : storefront()).cart.create({});
210
82
  return {
211
83
  ok: true,
212
- cart: decodeCart(unwrapped.cart)
84
+ token,
85
+ expiresAt: cart.expiresAt
213
86
  };
214
- } catch (err) {
215
- return surfaceClientError(err, "removeCartLine");
87
+ } catch (error) {
88
+ return refused(error, null, "create");
216
89
  }
217
90
  }
91
+ /** Add lines, all or nothing. */
92
+ function addLines(args) {
93
+ const { session, token, lines } = args;
94
+ const variantIds = ids(VARIANT_ID, lines.map((l) => l.variantId));
95
+ if (!variantIds) return Promise.resolve(unknown("variant"));
96
+ return write(session, "add", (cart) => cart.lines.add({
97
+ token,
98
+ lines: lines.map((l, i) => ({
99
+ ...l,
100
+ variantId: variantIds[i]
101
+ }))
102
+ }));
103
+ }
104
+ function removeLines(args) {
105
+ const lineIds = ids(LINE_ID, args.lineIds);
106
+ if (!lineIds) return Promise.resolve(unknown("cart_line"));
107
+ const { session, token } = args;
108
+ return write(session, "remove", (cart) => cart.lines.remove({
109
+ token,
110
+ lineIds
111
+ }));
112
+ }
218
113
  /**
219
- * Set a single line's quantity. Owns the invariant that quantity ≤ 0 is a
220
- * REMOVE (the DB CHECK constraint rejects 0) so no caller has to re-remember
221
- * it — a qty stepper can drive this straight down to 0 without hitting a raw
222
- * constraint error. This is the op cart UIs should call for a quantity change;
223
- * `updateLines` (batch) stays internal.
114
+ * Set one line's quantity. A quantity of 0 or less removes the line (the api
115
+ * takes a quantity of at least 1), so a stepper can go straight down to 0.
116
+ * The op cart UIs call for a quantity change.
224
117
  */
225
- async function setLineQuantity(args) {
226
- const { session, token, customerToken, lineId, quantity } = args;
118
+ function setLineQuantity(args) {
119
+ const { session, token, lineId, quantity } = args;
227
120
  if (quantity <= 0) return removeLines({
228
121
  session,
229
122
  token,
230
- customerToken,
231
123
  lineIds: [lineId]
232
124
  });
233
- return updateLines({
234
- session,
125
+ const [id] = ids(LINE_ID, [lineId]) ?? [];
126
+ if (!id) return Promise.resolve(unknown("cart_line"));
127
+ return write(session, "update", (cart) => cart.lines.update({
235
128
  token,
236
- customerToken,
237
129
  lines: [{
238
- id: lineId,
130
+ lineId: id,
239
131
  quantity
240
132
  }]
241
- });
133
+ }));
242
134
  }
243
135
  /**
244
- * Set or clear the buyer's cart note. A blank note CLEARS it: the API treats
245
- * null and whitespace alike, and sending null keeps "no note" one state rather
246
- * than two. The server trims the text and caps it at 1000 characters
247
- * (`VALIDATION_ERROR`, `field: "note"`); a theme's field mirrors the cap as
248
- * `maxLength`.
136
+ * Set or clear the buyer's cart note. The api trims it, and a blank one clears
137
+ * it; it refuses one past `CART_NOTE_MAX_LENGTH` (`VALIDATION_FAILED`), which a
138
+ * theme's field mirrors as `maxLength`.
249
139
  */
250
- async function setNote(args) {
251
- const { session, token, customerToken, note } = args;
252
- try {
253
- const unwrapped = unwrapCartPayload((await request(CartNoteUpdateMutation, {
254
- cartToken: token,
255
- note: note.trim() || null
256
- }, customerToken ? { customerSessionToken: customerToken } : void 0)).cartNoteUpdate);
257
- if (!unwrapped.ok) {
258
- if (isCartTokenNotFound(unwrapped.error)) await session.clear();
259
- return {
260
- ok: false,
261
- ...unwrapped.error
262
- };
263
- }
264
- return {
265
- ok: true,
266
- cart: decodeCart(unwrapped.cart)
267
- };
268
- } catch (err) {
269
- return surfaceClientError(err, "setCartNote");
270
- }
140
+ function setNote(args) {
141
+ const { session, token, note } = args;
142
+ return write(session, "note", (cart) => cart.note.set({
143
+ token,
144
+ note
145
+ }));
271
146
  }
272
- //#endregion
273
- export { addLines, mintCart, removeLines, setLineQuantity, setNote, unwrapCartPayload };
147
+ export { addLines, mintCart, removeLines, setLineQuantity, setNote };
@@ -1,10 +1,8 @@
1
1
  import { CollectionProductData } from "./collection.js";
2
- //#region src/cart-recommendations.d.ts
3
2
  export declare const fetchCartRecommendations: ({ handles, locale, maxResults }: {
4
3
  /** Every line's product handle, in cart order. */
5
4
  handles: string[];
6
5
  locale?: string;
7
6
  /** How many products the theme's rail draws. */
8
7
  maxResults: number;
9
- }) => Promise<CollectionProductData[]>;
10
- //#endregion
8
+ }) => Promise<CollectionProductData[]>;
@@ -1,5 +1,5 @@
1
1
  import { fetchProductRecommendations } from "./recommendations.js";
2
- //#region src/cart-recommendations.ts
2
+ // src/cart-recommendations.ts
3
3
  const MAX_REFERENCES = 5;
4
4
  /** One deduped list in reference order, minus whatever is already in the cart. */
5
5
  function merge(results, inCart, maxResults) {
@@ -27,5 +27,4 @@ const fetchCartRecommendations = async ({ handles, locale, maxResults }) => {
27
27
  if (complementary.length > 0) return complementary;
28
28
  return merge(await fanOut("RELATED"), inCart, maxResults);
29
29
  };
30
- //#endregion
31
30
  export { fetchCartRecommendations };
@@ -1,8 +1,6 @@
1
1
  import { SealedSession } from "@shop-on/customer-runtime/sealed-session";
2
- //#region src/cart-session.d.ts
3
2
  export interface CartSessionData {
4
3
  token?: string;
5
4
  expiresAtMs?: number;
6
5
  }
7
- export declare const useCartSession: () => Promise<SealedSession<CartSessionData>>;
8
- //#endregion
6
+ export declare const useCartSession: () => Promise<SealedSession<CartSessionData>>;
@@ -1,7 +1,7 @@
1
1
  import { derivedCookieSecret } from "./cookie-secret.js";
2
2
  import { createServerOnlyFn } from "@tanstack/react-start";
3
3
  import { createShopBoundCookieConfig } from "@shop-on/customer-runtime/session-cookie";
4
- //#region src/cart-session.ts
4
+ // src/cart-session.ts
5
5
  const TTL_SECONDS = 2592e3;
6
6
  const DOMAIN_LABEL = "cart";
7
7
  const sessionConfig = createServerOnlyFn(async () => {
@@ -15,5 +15,4 @@ const useCartSession = createServerOnlyFn(async () => {
15
15
  const { openSession } = await import("@shop-on/customer-runtime/sealed-session");
16
16
  return openSession(await sessionConfig());
17
17
  });
18
- //#endregion
19
18
  export { useCartSession };