@sixtyninecommerce/client 0.3.0 → 0.4.1

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 (127) hide show
  1. package/README.md +117 -1
  2. package/dist/client.d.ts.map +1 -1
  3. package/dist/client.js +5 -1
  4. package/dist/client.js.map +1 -1
  5. package/dist/commerce/branding.d.ts +6 -0
  6. package/dist/commerce/branding.d.ts.map +1 -0
  7. package/dist/commerce/branding.js +138 -0
  8. package/dist/commerce/branding.js.map +1 -0
  9. package/dist/commerce/checkout.d.ts +4 -1
  10. package/dist/commerce/checkout.d.ts.map +1 -1
  11. package/dist/commerce/checkout.js +24 -2
  12. package/dist/commerce/checkout.js.map +1 -1
  13. package/dist/commerce/customer.d.ts +6 -1
  14. package/dist/commerce/customer.d.ts.map +1 -1
  15. package/dist/commerce/customer.js +31 -1
  16. package/dist/commerce/customer.js.map +1 -1
  17. package/dist/commerce/index.d.ts +2 -2
  18. package/dist/commerce/index.d.ts.map +1 -1
  19. package/dist/commerce/index.js +13 -1
  20. package/dist/commerce/index.js.map +1 -1
  21. package/dist/commerce/payments.d.ts +8 -0
  22. package/dist/commerce/payments.d.ts.map +1 -0
  23. package/dist/commerce/payments.js +30 -0
  24. package/dist/commerce/payments.js.map +1 -0
  25. package/dist/commerce/pickup-location-parser.d.ts +6 -0
  26. package/dist/commerce/pickup-location-parser.d.ts.map +1 -0
  27. package/dist/commerce/pickup-location-parser.js +97 -0
  28. package/dist/commerce/pickup-location-parser.js.map +1 -0
  29. package/dist/commerce/products.d.ts.map +1 -1
  30. package/dist/commerce/products.js +67 -6
  31. package/dist/commerce/products.js.map +1 -1
  32. package/dist/commerce/queries.d.ts +27 -15
  33. package/dist/commerce/queries.d.ts.map +1 -1
  34. package/dist/commerce/queries.js +259 -112
  35. package/dist/commerce/queries.js.map +1 -1
  36. package/dist/commerce/quotes.d.ts +10 -0
  37. package/dist/commerce/quotes.d.ts.map +1 -0
  38. package/dist/commerce/quotes.js +33 -0
  39. package/dist/commerce/quotes.js.map +1 -0
  40. package/dist/commerce/reviews.d.ts +2 -1
  41. package/dist/commerce/reviews.d.ts.map +1 -1
  42. package/dist/commerce/reviews.js +9 -0
  43. package/dist/commerce/reviews.js.map +1 -1
  44. package/dist/commerce/stock-notifications.d.ts +7 -0
  45. package/dist/commerce/stock-notifications.d.ts.map +1 -0
  46. package/dist/commerce/stock-notifications.js +48 -0
  47. package/dist/commerce/stock-notifications.js.map +1 -0
  48. package/dist/commerce/subscriptions.d.ts +6 -0
  49. package/dist/commerce/subscriptions.d.ts.map +1 -1
  50. package/dist/commerce/subscriptions.js +41 -13
  51. package/dist/commerce/subscriptions.js.map +1 -1
  52. package/dist/constants.d.ts +2 -0
  53. package/dist/constants.d.ts.map +1 -1
  54. package/dist/constants.js +12 -0
  55. package/dist/constants.js.map +1 -1
  56. package/dist/content/items.d.ts +2 -1
  57. package/dist/content/items.d.ts.map +1 -1
  58. package/dist/content/items.js +20 -0
  59. package/dist/content/items.js.map +1 -1
  60. package/dist/content/menus.d.ts.map +1 -1
  61. package/dist/content/menus.js +25 -7
  62. package/dist/content/menus.js.map +1 -1
  63. package/dist/credit/credit-status.d.ts +6 -0
  64. package/dist/credit/credit-status.d.ts.map +1 -0
  65. package/dist/credit/credit-status.js +26 -0
  66. package/dist/credit/credit-status.js.map +1 -0
  67. package/dist/credit/index.d.ts +4 -0
  68. package/dist/credit/index.d.ts.map +1 -0
  69. package/dist/credit/index.js +5 -0
  70. package/dist/credit/index.js.map +1 -0
  71. package/dist/index.d.ts +3 -2
  72. package/dist/index.d.ts.map +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/index.js.map +1 -1
  75. package/dist/media/video.d.ts +4 -1
  76. package/dist/media/video.d.ts.map +1 -1
  77. package/dist/media/video.js +20 -1
  78. package/dist/media/video.js.map +1 -1
  79. package/dist/navigation/routes.js +2 -2
  80. package/dist/navigation/routes.js.map +1 -1
  81. package/dist/seo/ai.d.ts +17 -0
  82. package/dist/seo/ai.d.ts.map +1 -0
  83. package/dist/seo/ai.js +32 -0
  84. package/dist/seo/ai.js.map +1 -0
  85. package/dist/seo/alternates.d.ts +4 -0
  86. package/dist/seo/alternates.d.ts.map +1 -0
  87. package/dist/seo/alternates.js +29 -0
  88. package/dist/seo/alternates.js.map +1 -0
  89. package/dist/seo/canonical.d.ts +4 -0
  90. package/dist/seo/canonical.d.ts.map +1 -0
  91. package/dist/seo/canonical.js +49 -0
  92. package/dist/seo/canonical.js.map +1 -0
  93. package/dist/seo/index.d.ts +9 -0
  94. package/dist/seo/index.d.ts.map +1 -0
  95. package/dist/seo/index.js +54 -0
  96. package/dist/seo/index.js.map +1 -0
  97. package/dist/seo/json-ld.d.ts +25 -0
  98. package/dist/seo/json-ld.d.ts.map +1 -0
  99. package/dist/seo/json-ld.js +113 -0
  100. package/dist/seo/json-ld.js.map +1 -0
  101. package/dist/seo/meta-tags.d.ts +58 -0
  102. package/dist/seo/meta-tags.d.ts.map +1 -0
  103. package/dist/seo/meta-tags.js +194 -0
  104. package/dist/seo/meta-tags.js.map +1 -0
  105. package/dist/seo/metadata-parser.d.ts +31 -0
  106. package/dist/seo/metadata-parser.d.ts.map +1 -0
  107. package/dist/seo/metadata-parser.js +180 -0
  108. package/dist/seo/metadata-parser.js.map +1 -0
  109. package/dist/seo/metadata-types.d.ts +63 -0
  110. package/dist/seo/metadata-types.d.ts.map +1 -0
  111. package/dist/seo/metadata-types.js +2 -0
  112. package/dist/seo/metadata-types.js.map +1 -0
  113. package/dist/seo/robots.d.ts +21 -0
  114. package/dist/seo/robots.d.ts.map +1 -0
  115. package/dist/seo/robots.js +39 -0
  116. package/dist/seo/robots.js.map +1 -0
  117. package/dist/seo/types.d.ts +54 -0
  118. package/dist/seo/types.d.ts.map +1 -0
  119. package/dist/seo/types.js +2 -0
  120. package/dist/seo/types.js.map +1 -0
  121. package/dist/seo/url-builder.d.ts +11 -0
  122. package/dist/seo/url-builder.d.ts.map +1 -0
  123. package/dist/seo/url-builder.js +40 -0
  124. package/dist/seo/url-builder.js.map +1 -0
  125. package/dist/types.d.ts +397 -7
  126. package/dist/types.d.ts.map +1 -1
  127. package/package.json +11 -9
@@ -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,8 +51,9 @@ 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 } }
28
- customFields { minOrderQuantity salesUnit }
56
+ customFields { minOrderQuantity salesUnit position }
29
57
  featuredAsset {
30
58
  source name
31
59
  customFields { altText }
@@ -39,7 +67,17 @@ export const GET_PRODUCT = `
39
67
  }
40
68
  optionGroups { id name code options { id name code } }
41
69
  facetValues { id name code facet { id name code } }
42
- 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}
43
81
  }
44
82
  }
45
83
  `;
@@ -69,8 +107,9 @@ export const GET_PRODUCT_BY_ID = `
69
107
  price priceWithTax currencyCode stockLevel
70
108
  priceListName retailPrice retailPriceWithTax
71
109
  priceTiers { minQuantity price priceWithTax discountLabel }
110
+ availabilityByLocation { locationId locationName inStock }
72
111
  options { id code name group { id name code } }
73
- customFields { minOrderQuantity salesUnit }
112
+ customFields { minOrderQuantity salesUnit position }
74
113
  featuredAsset {
75
114
  source name
76
115
  customFields { altText }
@@ -84,7 +123,17 @@ export const GET_PRODUCT_BY_ID = `
84
123
  }
85
124
  optionGroups { id name code options { id name code } }
86
125
  facetValues { id name code facet { id name code } }
87
- 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}
88
137
  }
89
138
  }
90
139
  `;
@@ -102,12 +151,18 @@ export const LIST_PRODUCTS = `
102
151
  id name sku
103
152
  price priceWithTax currencyCode stockLevel
104
153
  priceListName retailPrice retailPriceWithTax
105
- priceTiers { minQuantity price priceWithTax discountLabel }
106
154
  priceTiers { minQuantity price priceWithTax discountLabel }
107
- customFields { minOrderQuantity salesUnit }
155
+ availabilityByLocation { locationId locationName inStock }
156
+ customFields { minOrderQuantity salesUnit position }
108
157
  }
109
158
  facetValues { id name code facet { id name code } }
110
- 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
+ }
111
166
  }
112
167
  totalItems
113
168
  }
@@ -160,8 +215,9 @@ export const GET_COLLECTION = `
160
215
  }
161
216
  price priceWithTax currencyCode stockLevel
162
217
  priceListName retailPrice retailPriceWithTax
163
- priceTiers { minQuantity price priceWithTax discountLabel }
164
- customFields { minOrderQuantity salesUnit }
218
+ priceTiers { minQuantity price priceWithTax discountLabel }
219
+ availabilityByLocation { locationId locationName inStock }
220
+ customFields { minOrderQuantity salesUnit position }
165
221
  }
166
222
  totalItems
167
223
  }
@@ -178,53 +234,49 @@ export const SEARCH_PRODUCTS = `
178
234
  currencyCode
179
235
  productAsset { preview focalPoint { x y } }
180
236
  collectionIds
237
+ inStock
181
238
  }
182
239
  totalItems
183
240
  facetValues { facetValue { id name code facet { id name code } } count }
184
241
  }
185
242
  }
186
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
+ `;
187
271
  export const ACTIVE_ORDER = `
188
272
  query ActiveOrder {
189
- activeOrder {
190
- id code state active
191
- totalQuantity
192
- subTotal subTotalWithTax
193
- shipping shippingWithTax
194
- total totalWithTax
195
- currencyCode
196
- lines {
197
- id quantity
198
- unitPrice unitPriceWithTax
199
- linePrice linePriceWithTax
200
- productVariant {
201
- id name sku
202
- product { id name slug }
203
- options { id name group { name } }
204
- }
205
- featuredAsset { source presets { xs { url webpUrl } } }
206
- }
207
- shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }
208
- customer { id firstName lastName emailAddress }
209
- couponCodes
210
- }
273
+ activeOrder { ${ORDER_FIELDS} }
211
274
  }
212
275
  `;
213
276
  export const ADD_TO_CART = `
214
277
  mutation AddToCart($variantId: ID!, $quantity: Int!) {
215
278
  addItemToOrder(productVariantId: $variantId, quantity: $quantity) {
216
- ... on Order {
217
- id code state active totalQuantity
218
- subTotal subTotalWithTax shipping shippingWithTax total totalWithTax currencyCode
219
- lines {
220
- id quantity unitPrice unitPriceWithTax linePrice linePriceWithTax
221
- productVariant { id name sku product { id name slug } options { id name group { name } } }
222
- featuredAsset { source presets { xs { url webpUrl } } }
223
- }
224
- shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }
225
- customer { id firstName lastName emailAddress }
226
- couponCodes
227
- }
279
+ ... on Order { ${ORDER_FIELDS} }
228
280
  ... on OrderModificationError { errorCode message }
229
281
  ... on OrderLimitError { errorCode message maxItems }
230
282
  ... on NegativeQuantityError { errorCode message }
@@ -235,18 +287,7 @@ export const ADD_TO_CART = `
235
287
  export const ADJUST_ORDER_LINE = `
236
288
  mutation AdjustOrderLine($lineId: ID!, $quantity: Int!) {
237
289
  adjustOrderLine(orderLineId: $lineId, quantity: $quantity) {
238
- ... on Order {
239
- id code state active totalQuantity
240
- subTotal subTotalWithTax shipping shippingWithTax total totalWithTax currencyCode
241
- lines {
242
- id quantity unitPrice unitPriceWithTax linePrice linePriceWithTax
243
- productVariant { id name sku product { id name slug } options { id name group { name } } }
244
- featuredAsset { source presets { xs { url webpUrl } } }
245
- }
246
- shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }
247
- customer { id firstName lastName emailAddress }
248
- couponCodes
249
- }
290
+ ... on Order { ${ORDER_FIELDS} }
250
291
  ... on OrderModificationError { errorCode message }
251
292
  ... on OrderLimitError { errorCode message maxItems }
252
293
  ... on NegativeQuantityError { errorCode message }
@@ -257,18 +298,7 @@ export const ADJUST_ORDER_LINE = `
257
298
  export const REMOVE_ORDER_LINE = `
258
299
  mutation RemoveOrderLine($lineId: ID!) {
259
300
  removeOrderLine(orderLineId: $lineId) {
260
- ... on Order {
261
- id code state active totalQuantity
262
- subTotal subTotalWithTax shipping shippingWithTax total totalWithTax currencyCode
263
- lines {
264
- id quantity unitPrice unitPriceWithTax linePrice linePriceWithTax
265
- productVariant { id name sku product { id name slug } options { id name group { name } } }
266
- featuredAsset { source presets { xs { url webpUrl } } }
267
- }
268
- shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }
269
- customer { id firstName lastName emailAddress }
270
- couponCodes
271
- }
301
+ ... on Order { ${ORDER_FIELDS} }
272
302
  ... on OrderModificationError { errorCode message }
273
303
  }
274
304
  }
@@ -276,16 +306,7 @@ export const REMOVE_ORDER_LINE = `
276
306
  export const APPLY_COUPON = `
277
307
  mutation ApplyCoupon($code: String!) {
278
308
  applyCouponCode(couponCode: $code) {
279
- ... on Order {
280
- id code state active totalQuantity
281
- subTotal subTotalWithTax shipping shippingWithTax total totalWithTax currencyCode
282
- lines {
283
- id quantity unitPrice unitPriceWithTax linePrice linePriceWithTax
284
- productVariant { id name sku product { id name slug } options { id name group { name } } }
285
- featuredAsset { source presets { xs { url webpUrl } } }
286
- }
287
- couponCodes
288
- }
309
+ ... on Order { ${ORDER_FIELDS} }
289
310
  ... on CouponCodeExpiredError { errorCode message couponCode }
290
311
  ... on CouponCodeInvalidError { errorCode message couponCode }
291
312
  ... on CouponCodeLimitError { errorCode message couponCode limit }
@@ -294,16 +315,7 @@ export const APPLY_COUPON = `
294
315
  `;
295
316
  export const REMOVE_COUPON = `
296
317
  mutation RemoveCoupon($code: String!) {
297
- removeCouponCode(couponCode: $code) {
298
- id code state active totalQuantity
299
- subTotal subTotalWithTax shipping shippingWithTax total totalWithTax currencyCode
300
- lines {
301
- id quantity unitPrice unitPriceWithTax linePrice linePriceWithTax
302
- productVariant { id name sku product { id name slug } options { id name group { name } } }
303
- featuredAsset { source presets { xs { url webpUrl } } }
304
- }
305
- couponCodes
306
- }
318
+ removeCouponCode(couponCode: $code) { ${ORDER_FIELDS} }
307
319
  }
308
320
  `;
309
321
  export const SET_CUSTOMER = `
@@ -386,6 +398,79 @@ export const ADD_PAYMENT = `
386
398
  }
387
399
  }
388
400
  `;
401
+ const PICKUP_LOCATION_FIELDS = `
402
+ provider
403
+ carrier
404
+ locationCode
405
+ name
406
+ address {
407
+ streetLine1
408
+ number
409
+ postalCode
410
+ city
411
+ countryCode
412
+ region
413
+ }
414
+ openingHours {
415
+ weekday
416
+ open
417
+ close
418
+ }
419
+ details
420
+ `;
421
+ export const PICKUP_LOCATIONS = `
422
+ query PickupLocations($input: PickupLocationSearchInput!) {
423
+ pickupLocations(input: $input) {
424
+ ${PICKUP_LOCATION_FIELDS}
425
+ }
426
+ }
427
+ `;
428
+ export const ACTIVE_ORDER_PICKUP_LOCATION = `
429
+ query ActiveOrderPickupLocation {
430
+ activeOrderPickupLocation {
431
+ ${PICKUP_LOCATION_FIELDS}
432
+ }
433
+ }
434
+ `;
435
+ export const SET_ACTIVE_ORDER_PICKUP_LOCATION = `
436
+ mutation SetActiveOrderPickupLocation($location: StoredPickupLocationInput!) {
437
+ setActiveOrderPickupLocation(location: $location) {
438
+ __typename
439
+ ... on Order {
440
+ id code state
441
+ }
442
+ ... on ErrorResult {
443
+ errorCode
444
+ message
445
+ }
446
+ }
447
+ }
448
+ `;
449
+ export const CREATE_STRIPE_PAYMENT_INTENT = `
450
+ mutation CreateStripePaymentIntent {
451
+ createStripePaymentIntent
452
+ }
453
+ `;
454
+ export const MOLLIE_PAYMENT_METHODS = `
455
+ query MolliePaymentMethods($input: MolliePaymentMethodsInput!) {
456
+ molliePaymentMethods(input: $input) {
457
+ id
458
+ code
459
+ description
460
+ minimumAmount { value currency }
461
+ maximumAmount { value currency }
462
+ image { size1x size2x svg }
463
+ }
464
+ }
465
+ `;
466
+ export const CREATE_MOLLIE_PAYMENT_INTENT = `
467
+ mutation CreateMolliePaymentIntent($input: MolliePaymentIntentInput!) {
468
+ createMolliePaymentIntent(input: $input) {
469
+ ... on MolliePaymentIntent { url }
470
+ ... on MolliePaymentIntentError { errorCode message }
471
+ }
472
+ }
473
+ `;
389
474
  export const LOGIN = `
390
475
  mutation Login($email: String!, $password: String!) {
391
476
  login(username: $email, password: $password) {
@@ -555,28 +640,7 @@ export const AVAILABLE_COUNTRIES = `
555
640
  `;
556
641
  export const ORDER_BY_CODE = `
557
642
  query OrderByCode($code: String!) {
558
- orderByCode(code: $code) {
559
- id code state active
560
- totalQuantity
561
- subTotal subTotalWithTax
562
- shipping shippingWithTax
563
- total totalWithTax
564
- currencyCode
565
- lines {
566
- id quantity
567
- unitPrice unitPriceWithTax
568
- linePrice linePriceWithTax
569
- productVariant {
570
- id name sku
571
- product { id name slug }
572
- options { id name group { name } }
573
- }
574
- featuredAsset { source presets { xs { url webpUrl } } }
575
- }
576
- shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }
577
- customer { id firstName lastName emailAddress }
578
- couponCodes
579
- }
643
+ orderByCode(code: $code) { ${ORDER_FIELDS} }
580
644
  }
581
645
  `;
582
646
  export const FAVORITE_VARIANT_IDS = `
@@ -596,6 +660,7 @@ export const MY_FAVORITES = `
596
660
  price priceWithTax currencyCode stockLevel
597
661
  priceListName retailPrice retailPriceWithTax
598
662
  priceTiers { minQuantity price priceWithTax discountLabel }
663
+ availabilityByLocation { locationId locationName inStock }
599
664
  product {
600
665
  id name slug
601
666
  featuredAsset {
@@ -605,7 +670,7 @@ export const MY_FAVORITES = `
605
670
  }
606
671
  }
607
672
  options { id name group { name } }
608
- customFields { minOrderQuantity salesUnit }
673
+ customFields { minOrderQuantity salesUnit position }
609
674
  }
610
675
  }
611
676
  totalItems
@@ -622,6 +687,21 @@ export const REMOVE_FAVORITE = `
622
687
  removeFavorite(productVariantId: $productVariantId)
623
688
  }
624
689
  `;
690
+ const CHANNEL_CUSTOM_FIELDS_FRAGMENT = `
691
+ customFields {
692
+ businessName businessDescription
693
+ logoAssetId darkLogoAssetId coverAssetId faviconAssetId
694
+ websiteUrl primaryColor
695
+ contactEmail contactPhone
696
+ legalName vatNumber registrationNumber
697
+ addressLine1 addressLine2 city postalCode province country
698
+ socialLinks
699
+ commercePathPrefix commercePathPrefixTranslations
700
+ cdnDomain maintenanceMode
701
+ urlLocaleStrategy urlLocalePrefixDefault
702
+ twitterHandle defaultOgImageId llmsTxtEnabled
703
+ }
704
+ `;
625
705
  export const GET_ACTIVE_CHANNEL = `
626
706
  query ActiveChannel {
627
707
  activeChannel {
@@ -630,7 +710,7 @@ export const GET_ACTIVE_CHANNEL = `
630
710
  availableLanguageCodes
631
711
  defaultCurrencyCode
632
712
  availableCurrencyCodes
633
- customFields
713
+ ${CHANNEL_CUSTOM_FIELDS_FRAGMENT}
634
714
  }
635
715
  }
636
716
  `;
@@ -684,7 +764,8 @@ export const GET_PRODUCT_RECOMMENDATIONS = `
684
764
  price priceWithTax currencyCode stockLevel
685
765
  priceListName retailPrice retailPriceWithTax
686
766
  priceTiers { minQuantity price priceWithTax discountLabel }
687
- customFields { minOrderQuantity salesUnit }
767
+ availabilityByLocation { locationId locationName inStock }
768
+ customFields { minOrderQuantity salesUnit position }
688
769
  }
689
770
  }
690
771
  }
@@ -704,4 +785,70 @@ export const CONVERT_CURRENCY = `
704
785
  }
705
786
  }
706
787
  `;
788
+ const QUOTE_FIELDS = `
789
+ id code channelId customerId currencyCode status
790
+ expiresAt salesRepUserId customerNotes convertedOrderId
791
+ createdAt updatedAt
792
+ lines {
793
+ id productVariantId quantity unitPrice discountLabel position
794
+ createdAt updatedAt
795
+ }
796
+ `;
797
+ export const MY_QUOTES = `
798
+ query MyQuotes($options: QuoteListOptions) {
799
+ myQuotes(options: $options) {
800
+ items { ${QUOTE_FIELDS} }
801
+ totalItems
802
+ }
803
+ }
804
+ `;
805
+ export const MY_QUOTE = `
806
+ query MyQuote($id: ID!) {
807
+ myQuote(id: $id) { ${QUOTE_FIELDS} }
808
+ }
809
+ `;
810
+ export const CREATE_QUOTE_REQUEST = `
811
+ mutation CreateQuoteRequest($input: CreateQuoteRequestInput!) {
812
+ createQuoteRequest(input: $input) { ${QUOTE_FIELDS} }
813
+ }
814
+ `;
815
+ export const ACCEPT_QUOTE = `
816
+ mutation AcceptQuote($id: ID!) {
817
+ acceptQuote(id: $id) { ${ORDER_FIELDS} }
818
+ }
819
+ `;
820
+ export const CANCEL_MY_QUOTE = `
821
+ mutation CancelMyQuote($id: ID!, $reason: String) {
822
+ cancelMyQuote(id: $id, reason: $reason) { ${QUOTE_FIELDS} }
823
+ }
824
+ `;
825
+ export const GET_BRANDING = `
826
+ query GetBranding($ids: [ID!]!) {
827
+ activeChannel {
828
+ id
829
+ defaultLanguageCode
830
+ availableLanguageCodes
831
+ defaultCurrencyCode
832
+ }
833
+ fontResources {
834
+ id
835
+ identifier
836
+ kind
837
+ family
838
+ weights
839
+ files {
840
+ id
841
+ source
842
+ preview
843
+ mimeType
844
+ }
845
+ }
846
+ brandingAssets(ids: $ids) {
847
+ id
848
+ source
849
+ preview
850
+ mimeType
851
+ }
852
+ }
853
+ `;
707
854
  //# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4C1B,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4ChC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;CAwB5B,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;CAU1B,CAAC;AAIF,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;CAgB/B,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;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EF,MAAM,CAAC,MAAM,eAAe,GAAG;;;;CAI9B,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG;;;;CAI9B,CAAC;AASF,MAAM,8BAA8B,GAAG;;;;;;;;;;;;;;CActC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;QAQ1B,8BAA8B;;;CAGrC,CAAC;AAIF,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;CAc9B,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;CAiBjC,CAAC;AAIF,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;;;;;CAuB1C,CAAC;AAIF,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;CAMjC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;CAM/B,CAAC;AAIF,MAAM,YAAY,GAAG;;;;;;;;CAQpB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG;;;gBAGT,YAAY;;;;CAI3B,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;;yBAEC,YAAY;;CAEpC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG;;0CAEM,YAAY;;CAErD,CAAC;AAEF,MAAM,CAAC,MAAM,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,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAgC,oBAAoB,EAAE;gBACnF,KAAK;aACN,CAAC,CAAC;YACH,OAAO,IAAI,CAAC,kBAAkB,CAAC;QACjC,CAAC;QAED,KAAK,CAAC,WAAW,CAAC,EAAU;YAC1B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAyB,YAAY,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;YAC9E,OAAO,IAAI,CAAC,WAAW,CAAC;QAC1B,CAAC;QAED,KAAK,CAAC,aAAa,CAAC,EAAU,EAAE,MAAe;YAC7C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAA2B,eAAe,EAAE;gBACzE,EAAE;gBACF,MAAM;aACP,CAAC,CAAC;YACH,OAAO,IAAI,CAAC,aAAa,CAAC;QAC5B,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,11 +1,12 @@
1
1
  import type { HttpClient } from '../core/http.js';
2
- import type { CreateReviewInput, CreateReviewResult, ProductReview, ReviewAttribute, ReviewAttributeAggregation, ReviewChannelConfig, ReviewListOptions, ReviewMediaUploadResult, ReviewRatingSummary, UpdateReviewInput } from '../types.js';
2
+ import type { CreateReviewInput, CreateReviewResult, ProductReview, RecentReviewsOptions, ReviewAttribute, ReviewAttributeAggregation, ReviewChannelConfig, ReviewListOptions, ReviewMediaUploadResult, ReviewRatingSummary, UpdateReviewInput } from '../types.js';
3
3
  export declare function createReviewMethods(http: HttpClient): {
4
4
  getProductReviews(productId: string, options?: ReviewListOptions): Promise<{
5
5
  items: ProductReview[];
6
6
  totalItems: number;
7
7
  nextCursor: string | null;
8
8
  }>;
9
+ getRecentProductReviews(options?: RecentReviewsOptions): Promise<ProductReview[]>;
9
10
  getReviewRatingSummary(productId: string): Promise<ReviewRatingSummary>;
10
11
  getReviewAttributeAggregations(productId: string): Promise<ReviewAttributeAggregation[]>;
11
12
  getReviewAttributes(productId?: string): Promise<ReviewAttribute[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"reviews.d.ts","sourceRoot":"","sources":["../../src/commerce/reviews.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,0BAA0B,EAC1B,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAuGrB,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU;iCAGnC,MAAM,YACP,iBAAiB,GAC1B,OA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I,CAAA;KAAE,CAAC;sCAO7C,oBAAoB,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;sCAQ/C,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;8CAQ7B,MAAM,GAAG,OAAO,CAAC,0BAA0B,EAAE,CAAC;oCAOxD,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;2BAQ5C,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;8BAOnC,OAAO,CAAC,mBAAmB,CAAC;wBAOlC,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;qBAOlD,MAAM,SAAS,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC;qBAQzD,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;yBAKrB,MAAM,aAAa,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;2BAQ3C,MAAM,UAAU,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;6BAQvC,IAAI,EAAE,GAAG,OAAO,CAAC,uBAAuB,EAAE,CAAC;EAc7E"}
@@ -15,6 +15,11 @@ const GET_PRODUCT_REVIEWS = `
15
15
  }
16
16
  }
17
17
  `;
18
+ const GET_RECENT_PRODUCT_REVIEWS = `
19
+ query RecentProductReviews($options: RecentReviewsOptions) {
20
+ recentProductReviews(options: $options) { ${REVIEW_FRAGMENT} }
21
+ }
22
+ `;
18
23
  const GET_RATING_SUMMARY = `
19
24
  query ProductRatingSummary($productId: ID!) {
20
25
  productRatingSummary(productId: $productId) {
@@ -92,6 +97,10 @@ export function createReviewMethods(http) {
92
97
  const data = await http.graphql(GET_PRODUCT_REVIEWS, { productId, options });
93
98
  return data.productReviews;
94
99
  },
100
+ async getRecentProductReviews(options) {
101
+ const data = await http.graphql(GET_RECENT_PRODUCT_REVIEWS, { options });
102
+ return data.recentProductReviews;
103
+ },
95
104
  async getReviewRatingSummary(productId) {
96
105
  const data = await http.graphql(GET_RATING_SUMMARY, { productId });
97
106
  return data.productRatingSummary;
@@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nD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAiC,WAAW,EAAE;gBAC3E,QAAQ;gBACR,SAAS;aACV,CAAC,CAAC;YACH,OAAO,IAAI,CAAC,iBAAiB,CAAC;QAChC,CAAC;QAED,KAAK,CAAC,YAAY,CAAC,QAAgB,EAAE,MAAc;YACjD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAmC,aAAa,EAAE;gBAC/E,QAAQ;gBACR,MAAM;aACP,CAAC,CAAC;YACH,OAAO,IAAI,CAAC,mBAAmB,CAAC;QAClC,CAAC;QAED,KAAK,CAAC,iBAAiB,CAAC,KAAa;YACnC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAgB,CAAC;YACxC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;gBAC5B,OAAO,CAAC,GAAG,CAAC,mBAAmB,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;YACxD,CAAC,CAAC,CAAC;YAEH,MAAM,SAAS,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YAEnD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,aAAa,CAElC,mBAAmB,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;YAC5C,OAAO,IAAI,CAAC,iBAAiB,CAAC;QAChC,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { HttpClient } from '../core/http.js';
2
+ import type { StockNotificationSubscriptionResult } from '../types.js';
3
+ export declare function createStockNotificationsMethods(http: HttpClient): {
4
+ subscribeToStockNotification(productVariantId: string, emailAddress?: string): Promise<StockNotificationSubscriptionResult>;
5
+ unsubscribeFromStockNotification(token: string): Promise<boolean>;
6
+ };
7
+ //# sourceMappingURL=stock-notifications.d.ts.map
@@ -0,0 +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"}