@sixtyninecommerce/client 0.2.2 → 0.4.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 (200) hide show
  1. package/README.md +141 -1
  2. package/dist/client.d.ts.map +1 -1
  3. package/dist/client.js +6 -1
  4. package/dist/client.js.map +1 -1
  5. package/dist/commerce/age-verification.d.ts +8 -0
  6. package/dist/commerce/age-verification.d.ts.map +1 -0
  7. package/dist/commerce/age-verification.js +47 -0
  8. package/dist/commerce/age-verification.js.map +1 -0
  9. package/dist/commerce/branding.d.ts +6 -0
  10. package/dist/commerce/branding.d.ts.map +1 -0
  11. package/dist/commerce/branding.js +138 -0
  12. package/dist/commerce/branding.js.map +1 -0
  13. package/dist/commerce/checkout.d.ts.map +1 -1
  14. package/dist/commerce/checkout.js +5 -1
  15. package/dist/commerce/checkout.js.map +1 -1
  16. package/dist/commerce/customer.d.ts +26 -1
  17. package/dist/commerce/customer.d.ts.map +1 -1
  18. package/dist/commerce/customer.js +122 -15
  19. package/dist/commerce/customer.js.map +1 -1
  20. package/dist/commerce/favorites.d.ts +12 -0
  21. package/dist/commerce/favorites.d.ts.map +1 -0
  22. package/dist/commerce/favorites.js +30 -0
  23. package/dist/commerce/favorites.js.map +1 -0
  24. package/dist/commerce/index.d.ts +2 -2
  25. package/dist/commerce/index.d.ts.map +1 -1
  26. package/dist/commerce/index.js +34 -1
  27. package/dist/commerce/index.js.map +1 -1
  28. package/dist/commerce/payments.d.ts +8 -0
  29. package/dist/commerce/payments.d.ts.map +1 -0
  30. package/dist/commerce/payments.js +30 -0
  31. package/dist/commerce/payments.js.map +1 -0
  32. package/dist/commerce/products.d.ts +9 -7
  33. package/dist/commerce/products.d.ts.map +1 -1
  34. package/dist/commerce/products.js +93 -26
  35. package/dist/commerce/products.js.map +1 -1
  36. package/dist/commerce/queries.d.ts +41 -11
  37. package/dist/commerce/queries.d.ts.map +1 -1
  38. package/dist/commerce/queries.js +443 -81
  39. package/dist/commerce/queries.js.map +1 -1
  40. package/dist/commerce/quotes.d.ts +10 -0
  41. package/dist/commerce/quotes.d.ts.map +1 -0
  42. package/dist/commerce/quotes.js +33 -0
  43. package/dist/commerce/quotes.js.map +1 -0
  44. package/dist/commerce/recommendations.d.ts +6 -0
  45. package/dist/commerce/recommendations.d.ts.map +1 -0
  46. package/dist/commerce/recommendations.js +10 -0
  47. package/dist/commerce/recommendations.js.map +1 -0
  48. package/dist/commerce/reviews.d.ts +22 -0
  49. package/dist/commerce/reviews.d.ts.map +1 -0
  50. package/dist/commerce/reviews.js +168 -0
  51. package/dist/commerce/reviews.js.map +1 -0
  52. package/dist/commerce/search.d.ts +2 -2
  53. package/dist/commerce/search.d.ts.map +1 -1
  54. package/dist/commerce/search.js +6 -4
  55. package/dist/commerce/search.js.map +1 -1
  56. package/dist/commerce/shipping.d.ts +8 -0
  57. package/dist/commerce/shipping.d.ts.map +1 -0
  58. package/dist/commerce/shipping.js +109 -0
  59. package/dist/commerce/shipping.js.map +1 -0
  60. package/dist/commerce/stock-notifications.d.ts +7 -0
  61. package/dist/commerce/stock-notifications.d.ts.map +1 -0
  62. package/dist/commerce/stock-notifications.js +48 -0
  63. package/dist/commerce/stock-notifications.js.map +1 -0
  64. package/dist/commerce/subscriptions.d.ts +12 -0
  65. package/dist/commerce/subscriptions.d.ts.map +1 -0
  66. package/dist/commerce/subscriptions.js +54 -0
  67. package/dist/commerce/subscriptions.js.map +1 -0
  68. package/dist/commerce/vat-validation.d.ts +8 -0
  69. package/dist/commerce/vat-validation.d.ts.map +1 -0
  70. package/dist/commerce/vat-validation.js +43 -0
  71. package/dist/commerce/vat-validation.js.map +1 -0
  72. package/dist/constants.d.ts +2 -0
  73. package/dist/constants.d.ts.map +1 -1
  74. package/dist/constants.js +12 -0
  75. package/dist/constants.js.map +1 -1
  76. package/dist/content/assets.d.ts +4 -2
  77. package/dist/content/assets.d.ts.map +1 -1
  78. package/dist/content/assets.js +15 -11
  79. package/dist/content/assets.js.map +1 -1
  80. package/dist/content/collection-pages.d.ts +6 -0
  81. package/dist/content/collection-pages.d.ts.map +1 -0
  82. package/dist/content/collection-pages.js +12 -0
  83. package/dist/content/collection-pages.js.map +1 -0
  84. package/dist/content/filtered-products.d.ts +19 -0
  85. package/dist/content/filtered-products.d.ts.map +1 -0
  86. package/dist/content/filtered-products.js +18 -0
  87. package/dist/content/filtered-products.js.map +1 -0
  88. package/dist/content/forms.d.ts +2 -2
  89. package/dist/content/forms.d.ts.map +1 -1
  90. package/dist/content/forms.js +2 -2
  91. package/dist/content/forms.js.map +1 -1
  92. package/dist/content/index.d.ts.map +1 -1
  93. package/dist/content/index.js +4 -0
  94. package/dist/content/index.js.map +1 -1
  95. package/dist/content/items.d.ts +5 -2
  96. package/dist/content/items.d.ts.map +1 -1
  97. package/dist/content/items.js +51 -16
  98. package/dist/content/items.js.map +1 -1
  99. package/dist/content/menus.d.ts +3 -3
  100. package/dist/content/menus.d.ts.map +1 -1
  101. package/dist/content/menus.js +29 -11
  102. package/dist/content/menus.js.map +1 -1
  103. package/dist/content/resolve.d.ts +2 -2
  104. package/dist/content/resolve.d.ts.map +1 -1
  105. package/dist/content/resolve.js +2 -2
  106. package/dist/content/resolve.js.map +1 -1
  107. package/dist/content/sitemap.d.ts +6 -0
  108. package/dist/content/sitemap.d.ts.map +1 -0
  109. package/dist/content/sitemap.js +12 -0
  110. package/dist/content/sitemap.js.map +1 -0
  111. package/dist/content/strings.d.ts +2 -2
  112. package/dist/content/strings.d.ts.map +1 -1
  113. package/dist/content/strings.js +3 -3
  114. package/dist/content/strings.js.map +1 -1
  115. package/dist/core/context.d.ts.map +1 -1
  116. package/dist/core/context.js +12 -33
  117. package/dist/core/context.js.map +1 -1
  118. package/dist/core/http.d.ts +8 -4
  119. package/dist/core/http.d.ts.map +1 -1
  120. package/dist/core/http.js +259 -104
  121. package/dist/core/http.js.map +1 -1
  122. package/dist/credit/credit-status.d.ts +6 -0
  123. package/dist/credit/credit-status.d.ts.map +1 -0
  124. package/dist/credit/credit-status.js +26 -0
  125. package/dist/credit/credit-status.js.map +1 -0
  126. package/dist/credit/index.d.ts +4 -0
  127. package/dist/credit/index.d.ts.map +1 -0
  128. package/dist/credit/index.js +5 -0
  129. package/dist/credit/index.js.map +1 -0
  130. package/dist/index.d.ts +4 -2
  131. package/dist/index.d.ts.map +1 -1
  132. package/dist/index.js +2 -1
  133. package/dist/index.js.map +1 -1
  134. package/dist/media/index.d.ts +2 -1
  135. package/dist/media/index.d.ts.map +1 -1
  136. package/dist/media/index.js +35 -5
  137. package/dist/media/index.js.map +1 -1
  138. package/dist/media/urls.d.ts +3 -0
  139. package/dist/media/urls.d.ts.map +1 -1
  140. package/dist/media/urls.js +15 -1
  141. package/dist/media/urls.js.map +1 -1
  142. package/dist/media/video.d.ts +25 -0
  143. package/dist/media/video.d.ts.map +1 -0
  144. package/dist/media/video.js +109 -0
  145. package/dist/media/video.js.map +1 -0
  146. package/dist/navigation/routes.d.ts +4 -4
  147. package/dist/navigation/routes.d.ts.map +1 -1
  148. package/dist/navigation/routes.js +8 -8
  149. package/dist/navigation/routes.js.map +1 -1
  150. package/dist/pricing/validation.d.ts +0 -2
  151. package/dist/pricing/validation.d.ts.map +1 -1
  152. package/dist/pricing/validation.js +0 -10
  153. package/dist/pricing/validation.js.map +1 -1
  154. package/dist/seo/ai.d.ts +17 -0
  155. package/dist/seo/ai.d.ts.map +1 -0
  156. package/dist/seo/ai.js +32 -0
  157. package/dist/seo/ai.js.map +1 -0
  158. package/dist/seo/alternates.d.ts +4 -0
  159. package/dist/seo/alternates.d.ts.map +1 -0
  160. package/dist/seo/alternates.js +29 -0
  161. package/dist/seo/alternates.js.map +1 -0
  162. package/dist/seo/canonical.d.ts +4 -0
  163. package/dist/seo/canonical.d.ts.map +1 -0
  164. package/dist/seo/canonical.js +49 -0
  165. package/dist/seo/canonical.js.map +1 -0
  166. package/dist/seo/index.d.ts +9 -0
  167. package/dist/seo/index.d.ts.map +1 -0
  168. package/dist/seo/index.js +54 -0
  169. package/dist/seo/index.js.map +1 -0
  170. package/dist/seo/json-ld.d.ts +25 -0
  171. package/dist/seo/json-ld.d.ts.map +1 -0
  172. package/dist/seo/json-ld.js +113 -0
  173. package/dist/seo/json-ld.js.map +1 -0
  174. package/dist/seo/meta-tags.d.ts +58 -0
  175. package/dist/seo/meta-tags.d.ts.map +1 -0
  176. package/dist/seo/meta-tags.js +194 -0
  177. package/dist/seo/meta-tags.js.map +1 -0
  178. package/dist/seo/metadata-parser.d.ts +31 -0
  179. package/dist/seo/metadata-parser.d.ts.map +1 -0
  180. package/dist/seo/metadata-parser.js +180 -0
  181. package/dist/seo/metadata-parser.js.map +1 -0
  182. package/dist/seo/metadata-types.d.ts +63 -0
  183. package/dist/seo/metadata-types.d.ts.map +1 -0
  184. package/dist/seo/metadata-types.js +2 -0
  185. package/dist/seo/metadata-types.js.map +1 -0
  186. package/dist/seo/robots.d.ts +21 -0
  187. package/dist/seo/robots.d.ts.map +1 -0
  188. package/dist/seo/robots.js +39 -0
  189. package/dist/seo/robots.js.map +1 -0
  190. package/dist/seo/types.d.ts +54 -0
  191. package/dist/seo/types.d.ts.map +1 -0
  192. package/dist/seo/types.js +2 -0
  193. package/dist/seo/types.js.map +1 -0
  194. package/dist/seo/url-builder.d.ts +11 -0
  195. package/dist/seo/url-builder.d.ts.map +1 -0
  196. package/dist/seo/url-builder.js +40 -0
  197. package/dist/seo/url-builder.js.map +1 -0
  198. package/dist/types.d.ts +843 -32
  199. package/dist/types.d.ts.map +1 -1
  200. package/package.json +4 -3
@@ -1,3 +1,30 @@
1
+ const PRODUCT_METADATA_FRAGMENT = `
2
+ metadata {
3
+ seoTitle seoDescription canonicalUrl
4
+ socialTitle socialDescription socialImageAlt socialOgType
5
+ socialImage {
6
+ source name
7
+ customFields { altText }
8
+ presets {
9
+ xs { url webpUrl } m { url webpUrl }
10
+ l { url webpUrl } xl { url webpUrl }
11
+ }
12
+ }
13
+ twitterCardType twitterTitleOverride twitterDescriptionOverride
14
+ twitterImageOverride {
15
+ source name
16
+ customFields { altText }
17
+ presets {
18
+ xs { url webpUrl } m { url webpUrl }
19
+ l { url webpUrl } xl { url webpUrl }
20
+ }
21
+ }
22
+ aiSummary qaPairs qaEmitFaqpageJsonld
23
+ breadcrumbOverride hreflangOverrides
24
+ metaRobots resolvedBotDirectives
25
+ includeReviewsInJsonld
26
+ }
27
+ `;
1
28
  export const GET_PRODUCT = `
2
29
  query GetProduct($slug: String!) {
3
30
  product(slug: $slug) {
@@ -24,7 +51,14 @@ export const GET_PRODUCT = `
24
51
  price priceWithTax currencyCode stockLevel
25
52
  priceListName retailPrice retailPriceWithTax
26
53
  priceTiers { minQuantity price priceWithTax discountLabel }
54
+ availabilityByLocation { locationId locationName inStock }
27
55
  options { id code name group { id name code } }
56
+ customFields { minOrderQuantity salesUnit position }
57
+ featuredAsset {
58
+ source name
59
+ customFields { altText }
60
+ presets { xs { url webpUrl } m { url webpUrl } }
61
+ }
28
62
  assets {
29
63
  source name
30
64
  customFields { altText }
@@ -33,7 +67,17 @@ export const GET_PRODUCT = `
33
67
  }
34
68
  optionGroups { id name code options { id name code } }
35
69
  facetValues { id name code facet { id name code } }
36
- collections { id name slug }
70
+ translations { languageCode name slug description }
71
+ collections {
72
+ id name slug position
73
+ parent { id }
74
+ translations { languageCode name slug }
75
+ customFields { isRoutable isCanonical }
76
+ }
77
+ documents {
78
+ id position title description fileUrl fileMimeType fileSize fileName requiresAuth
79
+ }
80
+ ${PRODUCT_METADATA_FRAGMENT}
37
81
  }
38
82
  }
39
83
  `;
@@ -63,7 +107,14 @@ export const GET_PRODUCT_BY_ID = `
63
107
  price priceWithTax currencyCode stockLevel
64
108
  priceListName retailPrice retailPriceWithTax
65
109
  priceTiers { minQuantity price priceWithTax discountLabel }
110
+ availabilityByLocation { locationId locationName inStock }
66
111
  options { id code name group { id name code } }
112
+ customFields { minOrderQuantity salesUnit position }
113
+ featuredAsset {
114
+ source name
115
+ customFields { altText }
116
+ presets { xs { url webpUrl } m { url webpUrl } }
117
+ }
67
118
  assets {
68
119
  source name
69
120
  customFields { altText }
@@ -72,7 +123,17 @@ export const GET_PRODUCT_BY_ID = `
72
123
  }
73
124
  optionGroups { id name code options { id name code } }
74
125
  facetValues { id name code facet { id name code } }
75
- collections { id name slug }
126
+ translations { languageCode name slug description }
127
+ collections {
128
+ id name slug position
129
+ parent { id }
130
+ translations { languageCode name slug }
131
+ customFields { isRoutable isCanonical }
132
+ }
133
+ documents {
134
+ id position title description fileUrl fileMimeType fileSize fileName requiresAuth
135
+ }
136
+ ${PRODUCT_METADATA_FRAGMENT}
76
137
  }
77
138
  }
78
139
  `;
@@ -91,9 +152,17 @@ export const LIST_PRODUCTS = `
91
152
  price priceWithTax currencyCode stockLevel
92
153
  priceListName retailPrice retailPriceWithTax
93
154
  priceTiers { minQuantity price priceWithTax discountLabel }
155
+ availabilityByLocation { locationId locationName inStock }
156
+ customFields { minOrderQuantity salesUnit position }
94
157
  }
95
158
  facetValues { id name code facet { id name code } }
96
- collections { id name slug }
159
+ translations { languageCode name slug description }
160
+ collections {
161
+ id name slug position
162
+ parent { id }
163
+ translations { languageCode name slug }
164
+ customFields { isRoutable isCanonical }
165
+ }
97
166
  }
98
167
  totalItems
99
168
  }
@@ -146,6 +215,9 @@ export const GET_COLLECTION = `
146
215
  }
147
216
  price priceWithTax currencyCode stockLevel
148
217
  priceListName retailPrice retailPriceWithTax
218
+ priceTiers { minQuantity price priceWithTax discountLabel }
219
+ availabilityByLocation { locationId locationName inStock }
220
+ customFields { minOrderQuantity salesUnit position }
149
221
  }
150
222
  totalItems
151
223
  }
@@ -162,53 +234,49 @@ export const SEARCH_PRODUCTS = `
162
234
  currencyCode
163
235
  productAsset { preview focalPoint { x y } }
164
236
  collectionIds
237
+ inStock
165
238
  }
166
239
  totalItems
167
240
  facetValues { facetValue { id name code facet { id name code } } count }
168
241
  }
169
242
  }
170
243
  `;
244
+ const ORDER_FIELDS = `
245
+ id code state active
246
+ totalQuantity
247
+ subTotal subTotalWithTax
248
+ shipping shippingWithTax
249
+ total totalWithTax
250
+ currencyCode
251
+ lines {
252
+ id quantity
253
+ unitPrice unitPriceWithTax
254
+ linePrice linePriceWithTax
255
+ discountedLinePrice discountedLinePriceWithTax
256
+ discounts { adjustmentSource type description amount amountWithTax }
257
+ productVariant {
258
+ id name sku
259
+ product { id name slug }
260
+ options { id name group { name } }
261
+ }
262
+ featuredAsset { source presets { xs { url webpUrl } } }
263
+ }
264
+ discounts { adjustmentSource type description amount amountWithTax }
265
+ taxSummary { description taxRate taxBase taxTotal }
266
+ promotions { id name couponCode description }
267
+ shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }
268
+ customer { id firstName lastName emailAddress }
269
+ couponCodes
270
+ `;
171
271
  export const ACTIVE_ORDER = `
172
272
  query ActiveOrder {
173
- activeOrder {
174
- id code state active
175
- totalQuantity
176
- subTotal subTotalWithTax
177
- shipping shippingWithTax
178
- total totalWithTax
179
- currencyCode
180
- lines {
181
- id quantity
182
- unitPrice unitPriceWithTax
183
- linePrice linePriceWithTax
184
- productVariant {
185
- id name sku
186
- product { id name slug }
187
- options { id name group { name } }
188
- }
189
- featuredAsset { source presets { xs { url webpUrl } } }
190
- }
191
- shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }
192
- customer { id firstName lastName emailAddress }
193
- couponCodes
194
- }
273
+ activeOrder { ${ORDER_FIELDS} }
195
274
  }
196
275
  `;
197
276
  export const ADD_TO_CART = `
198
277
  mutation AddToCart($variantId: ID!, $quantity: Int!) {
199
278
  addItemToOrder(productVariantId: $variantId, quantity: $quantity) {
200
- ... on Order {
201
- id code state active totalQuantity
202
- subTotal subTotalWithTax shipping shippingWithTax total totalWithTax currencyCode
203
- lines {
204
- id quantity unitPrice unitPriceWithTax linePrice linePriceWithTax
205
- productVariant { id name sku product { id name slug } options { id name group { name } } }
206
- featuredAsset { source presets { xs { url webpUrl } } }
207
- }
208
- shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }
209
- customer { id firstName lastName emailAddress }
210
- couponCodes
211
- }
279
+ ... on Order { ${ORDER_FIELDS} }
212
280
  ... on OrderModificationError { errorCode message }
213
281
  ... on OrderLimitError { errorCode message maxItems }
214
282
  ... on NegativeQuantityError { errorCode message }
@@ -219,18 +287,7 @@ export const ADD_TO_CART = `
219
287
  export const ADJUST_ORDER_LINE = `
220
288
  mutation AdjustOrderLine($lineId: ID!, $quantity: Int!) {
221
289
  adjustOrderLine(orderLineId: $lineId, quantity: $quantity) {
222
- ... on Order {
223
- id code state active totalQuantity
224
- subTotal subTotalWithTax shipping shippingWithTax total totalWithTax currencyCode
225
- lines {
226
- id quantity unitPrice unitPriceWithTax linePrice linePriceWithTax
227
- productVariant { id name sku product { id name slug } options { id name group { name } } }
228
- featuredAsset { source presets { xs { url webpUrl } } }
229
- }
230
- shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }
231
- customer { id firstName lastName emailAddress }
232
- couponCodes
233
- }
290
+ ... on Order { ${ORDER_FIELDS} }
234
291
  ... on OrderModificationError { errorCode message }
235
292
  ... on OrderLimitError { errorCode message maxItems }
236
293
  ... on NegativeQuantityError { errorCode message }
@@ -241,18 +298,7 @@ export const ADJUST_ORDER_LINE = `
241
298
  export const REMOVE_ORDER_LINE = `
242
299
  mutation RemoveOrderLine($lineId: ID!) {
243
300
  removeOrderLine(orderLineId: $lineId) {
244
- ... on Order {
245
- id code state active totalQuantity
246
- subTotal subTotalWithTax shipping shippingWithTax total totalWithTax currencyCode
247
- lines {
248
- id quantity unitPrice unitPriceWithTax linePrice linePriceWithTax
249
- productVariant { id name sku product { id name slug } options { id name group { name } } }
250
- featuredAsset { source presets { xs { url webpUrl } } }
251
- }
252
- shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }
253
- customer { id firstName lastName emailAddress }
254
- couponCodes
255
- }
301
+ ... on Order { ${ORDER_FIELDS} }
256
302
  ... on OrderModificationError { errorCode message }
257
303
  }
258
304
  }
@@ -260,16 +306,7 @@ export const REMOVE_ORDER_LINE = `
260
306
  export const APPLY_COUPON = `
261
307
  mutation ApplyCoupon($code: String!) {
262
308
  applyCouponCode(couponCode: $code) {
263
- ... on Order {
264
- id code state active totalQuantity
265
- subTotal subTotalWithTax shipping shippingWithTax total totalWithTax currencyCode
266
- lines {
267
- id quantity unitPrice unitPriceWithTax linePrice linePriceWithTax
268
- productVariant { id name sku product { id name slug } options { id name group { name } } }
269
- featuredAsset { source presets { xs { url webpUrl } } }
270
- }
271
- couponCodes
272
- }
309
+ ... on Order { ${ORDER_FIELDS} }
273
310
  ... on CouponCodeExpiredError { errorCode message couponCode }
274
311
  ... on CouponCodeInvalidError { errorCode message couponCode }
275
312
  ... on CouponCodeLimitError { errorCode message couponCode limit }
@@ -278,16 +315,7 @@ export const APPLY_COUPON = `
278
315
  `;
279
316
  export const REMOVE_COUPON = `
280
317
  mutation RemoveCoupon($code: String!) {
281
- removeCouponCode(couponCode: $code) {
282
- id code state active totalQuantity
283
- subTotal subTotalWithTax shipping shippingWithTax total totalWithTax currencyCode
284
- lines {
285
- id quantity unitPrice unitPriceWithTax linePrice linePriceWithTax
286
- productVariant { id name sku product { id name slug } options { id name group { name } } }
287
- featuredAsset { source presets { xs { url webpUrl } } }
288
- }
289
- couponCodes
290
- }
318
+ removeCouponCode(couponCode: $code) { ${ORDER_FIELDS} }
291
319
  }
292
320
  `;
293
321
  export const SET_CUSTOMER = `
@@ -370,6 +398,31 @@ export const ADD_PAYMENT = `
370
398
  }
371
399
  }
372
400
  `;
401
+ export const CREATE_STRIPE_PAYMENT_INTENT = `
402
+ mutation CreateStripePaymentIntent {
403
+ createStripePaymentIntent
404
+ }
405
+ `;
406
+ export const MOLLIE_PAYMENT_METHODS = `
407
+ query MolliePaymentMethods($input: MolliePaymentMethodsInput!) {
408
+ molliePaymentMethods(input: $input) {
409
+ id
410
+ code
411
+ description
412
+ minimumAmount { value currency }
413
+ maximumAmount { value currency }
414
+ image { size1x size2x svg }
415
+ }
416
+ }
417
+ `;
418
+ export const CREATE_MOLLIE_PAYMENT_INTENT = `
419
+ mutation CreateMolliePaymentIntent($input: MolliePaymentIntentInput!) {
420
+ createMolliePaymentIntent(input: $input) {
421
+ ... on MolliePaymentIntent { url }
422
+ ... on MolliePaymentIntentError { errorCode message }
423
+ }
424
+ }
425
+ `;
373
426
  export const LOGIN = `
374
427
  mutation Login($email: String!, $password: String!) {
375
428
  login(username: $email, password: $password) {
@@ -427,6 +480,249 @@ export const LOGOUT = `
427
480
  logout { success }
428
481
  }
429
482
  `;
483
+ export const UPDATE_CUSTOMER = `
484
+ mutation UpdateCustomer($input: UpdateCustomerInput!) {
485
+ updateCustomer(input: $input) {
486
+ id firstName lastName emailAddress phoneNumber
487
+ }
488
+ }
489
+ `;
490
+ export const UPDATE_PASSWORD = `
491
+ mutation UpdatePassword($currentPassword: String!, $newPassword: String!) {
492
+ updateCustomerPassword(currentPassword: $currentPassword, newPassword: $newPassword) {
493
+ ... on Success { success }
494
+ ... on InvalidCredentialsError { errorCode message }
495
+ ... on PasswordValidationError { errorCode message validationErrorMessage }
496
+ ... on NativeAuthStrategyError { errorCode message }
497
+ }
498
+ }
499
+ `;
500
+ export const REQUEST_PASSWORD_RESET = `
501
+ mutation RequestPasswordReset($emailAddress: String!) {
502
+ requestPasswordReset(emailAddress: $emailAddress) {
503
+ ... on Success { success }
504
+ ... on NativeAuthStrategyError { errorCode message }
505
+ }
506
+ }
507
+ `;
508
+ export const RESET_PASSWORD = `
509
+ mutation ResetPassword($token: String!, $password: String!) {
510
+ resetPassword(token: $token, password: $password) {
511
+ ... on CurrentUser { id identifier }
512
+ ... on PasswordResetTokenInvalidError { errorCode message }
513
+ ... on PasswordResetTokenExpiredError { errorCode message }
514
+ ... on PasswordValidationError { errorCode message validationErrorMessage }
515
+ ... on NativeAuthStrategyError { errorCode message }
516
+ ... on NotVerifiedError { errorCode message }
517
+ }
518
+ }
519
+ `;
520
+ export const REQUEST_EMAIL_UPDATE = `
521
+ mutation RequestEmailUpdate($password: String!, $newEmailAddress: String!) {
522
+ requestUpdateCustomerEmailAddress(password: $password, newEmailAddress: $newEmailAddress) {
523
+ ... on Success { success }
524
+ ... on InvalidCredentialsError { errorCode message }
525
+ ... on EmailAddressConflictError { errorCode message }
526
+ ... on NativeAuthStrategyError { errorCode message }
527
+ }
528
+ }
529
+ `;
530
+ export const UPDATE_EMAIL = `
531
+ mutation UpdateEmail($token: String!) {
532
+ updateCustomerEmailAddress(token: $token) {
533
+ ... on Success { success }
534
+ ... on IdentifierChangeTokenInvalidError { errorCode message }
535
+ ... on IdentifierChangeTokenExpiredError { errorCode message }
536
+ ... on NativeAuthStrategyError { errorCode message }
537
+ }
538
+ }
539
+ `;
540
+ export const VERIFY_ACCOUNT = `
541
+ mutation VerifyAccount($token: String!, $password: String) {
542
+ verifyCustomerAccount(token: $token, password: $password) {
543
+ ... on CurrentUser { id identifier }
544
+ ... on VerificationTokenInvalidError { errorCode message }
545
+ ... on VerificationTokenExpiredError { errorCode message }
546
+ ... on MissingPasswordError { errorCode message }
547
+ ... on PasswordAlreadySetError { errorCode message }
548
+ ... on PasswordValidationError { errorCode message validationErrorMessage }
549
+ ... on NativeAuthStrategyError { errorCode message }
550
+ }
551
+ }
552
+ `;
553
+ export const REFRESH_VERIFICATION = `
554
+ mutation RefreshVerification($emailAddress: String!) {
555
+ refreshCustomerVerification(emailAddress: $emailAddress) {
556
+ ... on Success { success }
557
+ ... on NativeAuthStrategyError { errorCode message }
558
+ }
559
+ }
560
+ `;
561
+ export const CREATE_ADDRESS = `
562
+ mutation CreateAddress($input: CreateAddressInput!) {
563
+ createCustomerAddress(input: $input) {
564
+ id fullName streetLine1 streetLine2 city province postalCode
565
+ country { code name }
566
+ defaultShippingAddress defaultBillingAddress
567
+ }
568
+ }
569
+ `;
570
+ export const UPDATE_ADDRESS = `
571
+ mutation UpdateAddress($input: UpdateAddressInput!) {
572
+ updateCustomerAddress(input: $input) {
573
+ id fullName streetLine1 streetLine2 city province postalCode
574
+ country { code name }
575
+ defaultShippingAddress defaultBillingAddress
576
+ }
577
+ }
578
+ `;
579
+ export const DELETE_ADDRESS = `
580
+ mutation DeleteAddress($id: ID!) {
581
+ deleteCustomerAddress(id: $id) {
582
+ success
583
+ }
584
+ }
585
+ `;
586
+ export const AVAILABLE_COUNTRIES = `
587
+ query AvailableCountries {
588
+ availableCountries {
589
+ id code name
590
+ }
591
+ }
592
+ `;
593
+ export const ORDER_BY_CODE = `
594
+ query OrderByCode($code: String!) {
595
+ orderByCode(code: $code) { ${ORDER_FIELDS} }
596
+ }
597
+ `;
598
+ export const FAVORITE_VARIANT_IDS = `
599
+ query FavoriteVariantIds {
600
+ favoriteProductVariantIds
601
+ }
602
+ `;
603
+ export const MY_FAVORITES = `
604
+ query MyFavorites($options: FavoriteListOptions) {
605
+ myFavorites(options: $options) {
606
+ items {
607
+ id
608
+ productVariantId
609
+ createdAt
610
+ productVariant {
611
+ id name sku
612
+ price priceWithTax currencyCode stockLevel
613
+ priceListName retailPrice retailPriceWithTax
614
+ priceTiers { minQuantity price priceWithTax discountLabel }
615
+ availabilityByLocation { locationId locationName inStock }
616
+ product {
617
+ id name slug
618
+ featuredAsset {
619
+ source
620
+ customFields { altText }
621
+ presets { xs { url webpUrl } m { url webpUrl } l { url webpUrl } }
622
+ }
623
+ }
624
+ options { id name group { name } }
625
+ customFields { minOrderQuantity salesUnit position }
626
+ }
627
+ }
628
+ totalItems
629
+ }
630
+ }
631
+ `;
632
+ export const TOGGLE_FAVORITE = `
633
+ mutation ToggleFavorite($productVariantId: ID!) {
634
+ toggleFavorite(productVariantId: $productVariantId)
635
+ }
636
+ `;
637
+ export const REMOVE_FAVORITE = `
638
+ mutation RemoveFavorite($productVariantId: ID!) {
639
+ removeFavorite(productVariantId: $productVariantId)
640
+ }
641
+ `;
642
+ const CHANNEL_CUSTOM_FIELDS_FRAGMENT = `
643
+ customFields {
644
+ businessName businessDescription
645
+ logoAssetId darkLogoAssetId coverAssetId faviconAssetId
646
+ websiteUrl primaryColor
647
+ contactEmail contactPhone
648
+ legalName vatNumber registrationNumber
649
+ addressLine1 addressLine2 city postalCode province country
650
+ socialLinks
651
+ commercePathPrefix commercePathPrefixTranslations
652
+ cdnDomain maintenanceMode
653
+ urlLocaleStrategy urlLocalePrefixDefault
654
+ twitterHandle defaultOgImageId llmsTxtEnabled
655
+ }
656
+ `;
657
+ export const GET_ACTIVE_CHANNEL = `
658
+ query ActiveChannel {
659
+ activeChannel {
660
+ id code
661
+ defaultLanguageCode
662
+ availableLanguageCodes
663
+ defaultCurrencyCode
664
+ availableCurrencyCodes
665
+ ${CHANNEL_CUSTOM_FIELDS_FRAGMENT}
666
+ }
667
+ }
668
+ `;
669
+ export const PROPERTY_GROUPS = `
670
+ query PropertyGroups {
671
+ productPropertyGroups {
672
+ id position
673
+ translations { id languageCode name }
674
+ properties {
675
+ id slug fieldType isFilterable isRequired position
676
+ config { options { value label } min max maxLength allowedCollectionIds filterableFieldSlugs }
677
+ facetId
678
+ fieldFacets { fieldSlug fieldType facetId }
679
+ translations { id languageCode name helpText }
680
+ }
681
+ }
682
+ }
683
+ `;
684
+ export const PRODUCT_PROPERTIES = `
685
+ query ProductProperties($productId: ID!) {
686
+ productPropertyValues(productId: $productId) {
687
+ group {
688
+ id position
689
+ translations { id languageCode name }
690
+ properties {
691
+ id slug fieldType isFilterable isRequired position
692
+ config { options { value label } min max maxLength }
693
+ facetId
694
+ fieldFacets { fieldSlug fieldType facetId }
695
+ translations { id languageCode name helpText }
696
+ }
697
+ }
698
+ values { id propertyId languageCode value }
699
+ }
700
+ }
701
+ `;
702
+ export const GET_PRODUCT_RECOMMENDATIONS = `
703
+ query ProductRecommendations($productId: ID!, $groupSlug: String) {
704
+ productRecommendations(productId: $productId, groupSlug: $groupSlug) {
705
+ groupName
706
+ groupSlug
707
+ products {
708
+ id name slug description
709
+ featuredAsset {
710
+ source name
711
+ customFields { altText }
712
+ presets { xs { url webpUrl } m { url webpUrl } l { url webpUrl } }
713
+ }
714
+ variants {
715
+ id name sku
716
+ price priceWithTax currencyCode stockLevel
717
+ priceListName retailPrice retailPriceWithTax
718
+ priceTiers { minQuantity price priceWithTax discountLabel }
719
+ availabilityByLocation { locationId locationName inStock }
720
+ customFields { minOrderQuantity salesUnit position }
721
+ }
722
+ }
723
+ }
724
+ }
725
+ `;
430
726
  export const GET_EXCHANGE_RATES = `
431
727
  query ExchangeRates {
432
728
  exchangeRates {
@@ -441,4 +737,70 @@ export const CONVERT_CURRENCY = `
441
737
  }
442
738
  }
443
739
  `;
740
+ const QUOTE_FIELDS = `
741
+ id code channelId customerId currencyCode status
742
+ expiresAt salesRepUserId customerNotes convertedOrderId
743
+ createdAt updatedAt
744
+ lines {
745
+ id productVariantId quantity unitPrice discountLabel position
746
+ createdAt updatedAt
747
+ }
748
+ `;
749
+ export const MY_QUOTES = `
750
+ query MyQuotes($options: QuoteListOptions) {
751
+ myQuotes(options: $options) {
752
+ items { ${QUOTE_FIELDS} }
753
+ totalItems
754
+ }
755
+ }
756
+ `;
757
+ export const MY_QUOTE = `
758
+ query MyQuote($id: ID!) {
759
+ myQuote(id: $id) { ${QUOTE_FIELDS} }
760
+ }
761
+ `;
762
+ export const CREATE_QUOTE_REQUEST = `
763
+ mutation CreateQuoteRequest($input: CreateQuoteRequestInput!) {
764
+ createQuoteRequest(input: $input) { ${QUOTE_FIELDS} }
765
+ }
766
+ `;
767
+ export const ACCEPT_QUOTE = `
768
+ mutation AcceptQuote($id: ID!) {
769
+ acceptQuote(id: $id) { ${ORDER_FIELDS} }
770
+ }
771
+ `;
772
+ export const CANCEL_MY_QUOTE = `
773
+ mutation CancelMyQuote($id: ID!, $reason: String) {
774
+ cancelMyQuote(id: $id, reason: $reason) { ${QUOTE_FIELDS} }
775
+ }
776
+ `;
777
+ export const GET_BRANDING = `
778
+ query GetBranding($ids: [ID!]!) {
779
+ activeChannel {
780
+ id
781
+ defaultLanguageCode
782
+ availableLanguageCodes
783
+ defaultCurrencyCode
784
+ }
785
+ fontResources {
786
+ id
787
+ identifier
788
+ kind
789
+ family
790
+ weights
791
+ files {
792
+ id
793
+ source
794
+ preview
795
+ mimeType
796
+ }
797
+ }
798
+ brandingAssets(ids: $ids) {
799
+ id
800
+ source
801
+ preview
802
+ mimeType
803
+ }
804
+ }
805
+ `;
444
806
  //# sourceMappingURL=queries.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"queries.js","sourceRoot":"","sources":["../../src/commerce/queries.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsC1B,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsChC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;CAsB5B,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;CAU1B,CAAC;AAIF,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;CAgB/B,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;CAwB7B,CAAC;AAIF,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;CAe9B,CAAC;AAIF,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;CAyB3B,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;CAqB1B,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;CAqBhC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;CAkBhC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;CAkB3B,CAAC;AAEF,MAAM,CAAC,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M,YAAY,GAAG;;6BAEC,YAAY;;CAExC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG;;gDAEiB,YAAY;;CAE3D,CAAC;AAOF,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4B3B,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { HttpClient } from '../core/http.js';
2
+ import type { CreateQuoteRequestInput, Order, Quote, QuoteList, QuoteListOptions } from '../types.js';
3
+ export declare function createQuotesMethods(http: HttpClient): {
4
+ getMyQuotes(options?: QuoteListOptions): Promise<QuoteList>;
5
+ getMyQuote(id: string): Promise<Quote | null>;
6
+ createQuoteRequest(input: CreateQuoteRequestInput): Promise<Quote>;
7
+ acceptQuote(id: string): Promise<Order>;
8
+ cancelMyQuote(id: string, reason?: string): Promise<Quote>;
9
+ };
10
+ //# sourceMappingURL=quotes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quotes.d.ts","sourceRoot":"","sources":["../../src/commerce/quotes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,uBAAuB,EACvB,KAAK,EACL,KAAK,EACL,SAAS,EACT,gBAAgB,EACjB,MAAM,aAAa,CAAC;AASrB,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU;0BAEpB,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;mBAO5C,MAAM,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;8BAKnB,uBAAuB,GAAG,OAAO,CAAC,KAAK,CAAC;oBAOlD,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;sBAKrB,MAAM,WAAW,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;EAQnE"}
@@ -0,0 +1,33 @@
1
+ import { ACCEPT_QUOTE, CANCEL_MY_QUOTE, CREATE_QUOTE_REQUEST, MY_QUOTE, MY_QUOTES, } from './queries.js';
2
+ export function createQuotesMethods(http) {
3
+ return {
4
+ async getMyQuotes(options) {
5
+ const data = await http.graphql(MY_QUOTES, {
6
+ options: options ?? null,
7
+ });
8
+ return data.myQuotes;
9
+ },
10
+ async getMyQuote(id) {
11
+ const data = await http.graphql(MY_QUOTE, { id });
12
+ return data.myQuote;
13
+ },
14
+ async createQuoteRequest(input) {
15
+ const data = await http.graphql(CREATE_QUOTE_REQUEST, {
16
+ input,
17
+ });
18
+ return data.createQuoteRequest;
19
+ },
20
+ async acceptQuote(id) {
21
+ const data = await http.graphql(ACCEPT_QUOTE, { id });
22
+ return data.acceptQuote;
23
+ },
24
+ async cancelMyQuote(id, reason) {
25
+ const data = await http.graphql(CANCEL_MY_QUOTE, {
26
+ id,
27
+ reason,
28
+ });
29
+ return data.cancelMyQuote;
30
+ },
31
+ };
32
+ }
33
+ //# sourceMappingURL=quotes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quotes.js","sourceRoot":"","sources":["../../src/commerce/quotes.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,QAAQ,EACR,SAAS,GACV,MAAM,cAAc,CAAC;AAEtB,MAAM,UAAU,mBAAmB,CAAC,IAAgB;IAClD,OAAO;QACL,KAAK,CAAC,WAAW,CAAC,OAA0B;YAC1C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAA0B,SAAS,EAAE;gBAClE,OAAO,EAAE,OAAO,IAAI,IAAI;aACzB,CAAC,CAAC;YACH,OAAO,IAAI,CAAC,QAAQ,CAAC;QACvB,CAAC;QAED,KAAK,CAAC,UAAU,CAAC,EAAU;YACzB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAA4B,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;YAC7E,OAAO,IAAI,CAAC,OAAO,CAAC;QACtB,CAAC;QAED,KAAK,CAAC,kBAAkB,CAAC,KAA8B;YACrD,MAAM,IAA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