@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
@@ -0,0 +1,30 @@
1
+ import { MutationError } from '../errors.js';
2
+ import { CREATE_MOLLIE_PAYMENT_INTENT, CREATE_STRIPE_PAYMENT_INTENT, MOLLIE_PAYMENT_METHODS, } from './queries.js';
3
+ export function createPaymentMethods(http) {
4
+ return {
5
+ async createStripePaymentIntent(options) {
6
+ const data = await http.graphql(CREATE_STRIPE_PAYMENT_INTENT, undefined, options);
7
+ const clientSecret = data.createStripePaymentIntent;
8
+ if (typeof clientSecret !== 'string' || clientSecret.length === 0) {
9
+ throw new MutationError('STRIPE_PAYMENT_INTENT_FAILED', 'Stripe did not return a clientSecret. Verify the order is in ArrangingPayment state and the channel has a Stripe PaymentMethod configured.');
10
+ }
11
+ return { clientSecret };
12
+ },
13
+ async getMolliePaymentMethods(input, options) {
14
+ const data = await http.graphql(MOLLIE_PAYMENT_METHODS, { input }, options);
15
+ return data.molliePaymentMethods;
16
+ },
17
+ async createMolliePaymentIntent(input, options) {
18
+ const data = await http.graphql(CREATE_MOLLIE_PAYMENT_INTENT, { input }, options);
19
+ const result = data.createMolliePaymentIntent;
20
+ if (!result) {
21
+ throw new MutationError('UNKNOWN_ERROR', 'No result from createMolliePaymentIntent');
22
+ }
23
+ if ('errorCode' in result) {
24
+ throw new MutationError(result.errorCode, result.message, result);
25
+ }
26
+ return { url: result.url };
27
+ },
28
+ };
29
+ }
30
+ //# sourceMappingURL=payments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payments.js","sourceRoot":"","sources":["../../src/commerce/payments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAS7C,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,cAAc,CAAC;AAEtB,MAAM,UAAU,oBAAoB,CAAC,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+ import type { PickupLocation } from '../types.js';
2
+ export declare function parsePickupLocation(value: unknown): PickupLocation;
3
+ export declare function parsePickupLocations(value: unknown): PickupLocation[];
4
+ export declare function parseOptionalPickupLocation(value: unknown): PickupLocation | null;
5
+ export declare function normalizePickupLocationInput(value: unknown): PickupLocation;
6
+ //# sourceMappingURL=pickup-location-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pickup-location-parser.d.ts","sourceRoot":"","sources":["../../src/commerce/pickup-location-parser.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,cAAc,EAGf,MAAM,aAAa,CAAC;AA4DrB,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,CAiClE;AAOD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,EAAE,CAIrE;AAGD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,GAAG,IAAI,CAGjF;AASD,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,CAE3E"}
@@ -0,0 +1,97 @@
1
+ import { StorefrontError } from '../errors.js';
2
+ function reject(field, message) {
3
+ throw new StorefrontError(`Invalid PickupLocation payload at "${field}": ${message}`, 'vendure');
4
+ }
5
+ function isPlainObject(value) {
6
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
7
+ }
8
+ function asNonEmptyString(value, field) {
9
+ if (typeof value !== 'string' || value.trim().length === 0) {
10
+ reject(field, 'expected non-empty string');
11
+ }
12
+ return value;
13
+ }
14
+ function asFiniteInteger(value, field, min, max) {
15
+ if (typeof value !== 'number' || !Number.isFinite(value) || !Number.isInteger(value)) {
16
+ reject(field, 'expected finite integer');
17
+ }
18
+ if (min !== undefined && value < min)
19
+ reject(field, `must be >= ${min}`);
20
+ if (max !== undefined && value > max)
21
+ reject(field, `must be <= ${max}`);
22
+ return value;
23
+ }
24
+ function parseAddress(value, field) {
25
+ if (!isPlainObject(value))
26
+ reject(field, 'expected object');
27
+ return {
28
+ streetLine1: asNonEmptyString(value.streetLine1, `${field}.streetLine1`),
29
+ number: asNonEmptyString(value.number, `${field}.number`),
30
+ postalCode: asNonEmptyString(value.postalCode, `${field}.postalCode`),
31
+ city: asNonEmptyString(value.city, `${field}.city`),
32
+ countryCode: asNonEmptyString(value.countryCode, `${field}.countryCode`),
33
+ ...(value.region !== undefined && value.region !== null
34
+ ? { region: asNonEmptyString(value.region, `${field}.region`) }
35
+ : {}),
36
+ };
37
+ }
38
+ const HHMM = /^[0-2]\d:[0-5]\d$/;
39
+ function parseOpeningHours(value, field) {
40
+ if (!isPlainObject(value))
41
+ reject(field, 'expected object');
42
+ const open = asNonEmptyString(value.open, `${field}.open`);
43
+ const close = asNonEmptyString(value.close, `${field}.close`);
44
+ if (!HHMM.test(open))
45
+ reject(`${field}.open`, 'expected HH:MM (24h)');
46
+ if (!HHMM.test(close))
47
+ reject(`${field}.close`, 'expected HH:MM (24h)');
48
+ return {
49
+ weekday: asFiniteInteger(value.weekday, `${field}.weekday`, 0, 6),
50
+ open,
51
+ close,
52
+ };
53
+ }
54
+ export function parsePickupLocation(value) {
55
+ if (!isPlainObject(value))
56
+ reject('pickupLocation', 'expected object');
57
+ const openingHoursRaw = value.openingHours;
58
+ if (openingHoursRaw !== undefined &&
59
+ openingHoursRaw !== null &&
60
+ !Array.isArray(openingHoursRaw)) {
61
+ reject('pickupLocation.openingHours', 'expected array when present');
62
+ }
63
+ const detailsRaw = value.details;
64
+ if (detailsRaw !== undefined && detailsRaw !== null && !isPlainObject(detailsRaw)) {
65
+ reject('pickupLocation.details', 'expected object when present');
66
+ }
67
+ const out = {
68
+ provider: asNonEmptyString(value.provider, 'pickupLocation.provider'),
69
+ carrier: asFiniteInteger(value.carrier, 'pickupLocation.carrier'),
70
+ locationCode: asNonEmptyString(value.locationCode, 'pickupLocation.locationCode'),
71
+ name: asNonEmptyString(value.name, 'pickupLocation.name'),
72
+ address: parseAddress(value.address, 'pickupLocation.address'),
73
+ };
74
+ if (Array.isArray(openingHoursRaw)) {
75
+ out.openingHours = openingHoursRaw.map((entry, idx) => parseOpeningHours(entry, `pickupLocation.openingHours[${idx}]`));
76
+ }
77
+ if (isPlainObject(detailsRaw)) {
78
+ out.details = detailsRaw;
79
+ }
80
+ return out;
81
+ }
82
+ export function parsePickupLocations(value) {
83
+ if (value === null || value === undefined)
84
+ return [];
85
+ if (!Array.isArray(value))
86
+ reject('pickupLocations', 'expected array');
87
+ return value.map((entry) => parsePickupLocation(entry));
88
+ }
89
+ export function parseOptionalPickupLocation(value) {
90
+ if (value === null || value === undefined)
91
+ return null;
92
+ return parsePickupLocation(value);
93
+ }
94
+ export function normalizePickupLocationInput(value) {
95
+ return parsePickupLocation(value);
96
+ }
97
+ //# sourceMappingURL=pickup-location-parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pickup-location-parser.js","sourceRoot":"","sources":["../../src/commerce/pickup-location-parser.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAO/C,SAAS,MAAM,CAAC,KAAa,EAAE,OAAe;IAC5C,MAAM,IAAI,eAAe,CAAC,sCAAsC,KAAK,MAAM,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;AACnG,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAc,EAAE,KAAa;IACrD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3D,MAAM,CAAC,KAAK,EAAE,2BAA2B,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,eAAe,CAAC,KAAc,EAA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C,KAAK,CAAC,CAAC,CAAC;AAC1D,CAAC;AAGD,MAAM,UAAU,2BAA2B,CAAC,KAAc;IACxD,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACvD,OAAO,mBAAmB,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC;AASD,MAAM,UAAU,4BAA4B,CAAC,KAAc;IACzD,OAAO,mBAAmB,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../src/commerce/products.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,qBAAqB,EACrB,KAAK,EACL,aAAa,EACb,OAAO,EACP,kBAAkB,EAClB,0BAA0B,EAC1B,cAAc,EACd,aAAa,EACb,cAAc,EACf,MAAM,aAAa,CAAC;AAYrB,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,UAAU;qBAE1B,MAAM,YAAY,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;uBAKjD,MAAM,YAAY,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;8BAM5D,kBAAkB,YACtB,cAAc,GACvB,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;wBAsBf,cAAc,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;iCAU3C,qBAAqB,YACzB,cAAc,GACvB,OAAO,CAAC,UAAU,EAAE,CAAC;wBAWE,MAAM,YAAY,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;gCASpD,cAAc,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;oCAU9D,MAAM,YACP,cAAc,GACvB,OAAO,CAAC,0BAA0B,EAAE,CAAC;EAO3C"}
1
+ {"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../src/commerce/products.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,qBAAqB,EACrB,KAAK,EACL,aAAa,EACb,OAAO,EACP,kBAAkB,EAClB,0BAA0B,EAC1B,cAAc,EACd,aAAa,EACb,cAAc,EAEf,MAAM,aAAa,CAAC;AA6ErB,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,UAAU;qBAE1B,MAAM,YAAY,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;uBAKjD,MAAM,YAAY,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;8BAM5D,kBAAkB,YACtB,cAAc,GACvB,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;wBA4Cf,cAAc,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;iCAU3C,qBAAqB,YACzB,cAAc,GACvB,OAAO,CAAC,UAAU,EAAE,CAAC;wBAWE,MAAM,YAAY,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;gCASpD,cAAc,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;oCAU9D,MAAM,YACP,cAAc,GACvB,OAAO,CAAC,0BAA0B,EAAE,CAAC;EAO3C"}
@@ -1,24 +1,85 @@
1
- import { GET_COLLECTION, GET_PRODUCT, GET_PRODUCT_BY_ID, LIST_COLLECTIONS, LIST_FACETS, LIST_PRODUCTS, PRODUCT_PROPERTIES, PROPERTY_GROUPS, } from './queries.js';
1
+ import { parseProductMetadata } from '../seo/metadata-parser.js';
2
+ import { GET_COLLECTION, GET_PRODUCT, GET_PRODUCT_BY_ID, LIST_COLLECTIONS, LIST_FACETS, LIST_PRODUCTS, PRODUCT_PROPERTIES, PROPERTY_GROUPS, SEARCH_PRODUCTS, } from './queries.js';
3
+ function hydrateProductMetadata(product) {
4
+ const raw = product.metadata;
5
+ return { ...product, metadata: parseProductMetadata(raw ?? null) };
6
+ }
7
+ function searchItemToProductSummary(item) {
8
+ const priceWithTax = priceValueOrMin(item.priceWithTax);
9
+ const price = priceValueOrMin(item.price);
10
+ const previewUrl = item.productAsset?.preview;
11
+ return {
12
+ id: item.productId,
13
+ name: item.productName,
14
+ slug: item.slug,
15
+ description: item.description,
16
+ featuredAsset: previewUrl
17
+ ? {
18
+ source: '',
19
+ presets: {
20
+ xxs: { url: previewUrl, webpUrl: previewUrl },
21
+ xs: { url: previewUrl, webpUrl: previewUrl },
22
+ s: { url: previewUrl, webpUrl: previewUrl },
23
+ m: { url: previewUrl, webpUrl: previewUrl },
24
+ l: { url: previewUrl, webpUrl: previewUrl },
25
+ xl: { url: previewUrl, webpUrl: previewUrl },
26
+ },
27
+ }
28
+ : null,
29
+ variants: [
30
+ {
31
+ id: item.productId,
32
+ name: item.productName,
33
+ sku: '',
34
+ price,
35
+ priceWithTax,
36
+ currencyCode: item.currencyCode,
37
+ stockLevel: item.inStock ? 'IN_STOCK' : 'OUT_OF_STOCK',
38
+ },
39
+ ],
40
+ };
41
+ }
42
+ function priceValueOrMin(value) {
43
+ if (!value)
44
+ return 0;
45
+ if (typeof value.value === 'number')
46
+ return value.value;
47
+ if (typeof value.min === 'number')
48
+ return value.min;
49
+ return 0;
50
+ }
2
51
  export function createProductMethods(http) {
3
52
  return {
4
53
  async getProduct(slug, options) {
5
54
  const data = await http.graphql(GET_PRODUCT, { slug }, options);
6
- return data.product;
55
+ return hydrateProductMetadata(data.product);
7
56
  },
8
57
  async getProductById(id, options) {
9
58
  const data = await http.graphql(GET_PRODUCT_BY_ID, { id }, options);
10
- return data.product;
59
+ return hydrateProductMetadata(data.product);
11
60
  },
12
61
  async getProducts(listOptions, options) {
62
+ if (listOptions?.collectionSlug) {
63
+ const data = await http.graphql(SEARCH_PRODUCTS, {
64
+ input: {
65
+ term: '',
66
+ collectionSlug: listOptions.collectionSlug,
67
+ take: listOptions.take ?? 20,
68
+ skip: listOptions.skip ?? 0,
69
+ ...(listOptions.sort ? { sort: listOptions.sort } : {}),
70
+ },
71
+ }, options);
72
+ return {
73
+ items: data.search.items.map(searchItemToProductSummary),
74
+ totalItems: data.search.totalItems,
75
+ };
76
+ }
13
77
  const vars = {};
14
78
  if (listOptions) {
15
79
  const queryOptions = {
16
80
  take: listOptions.take ?? 20,
17
81
  skip: listOptions.skip ?? 0,
18
82
  };
19
- if (listOptions.collectionSlug) {
20
- queryOptions.filter = { collectionSlug: { eq: listOptions.collectionSlug } };
21
- }
22
83
  if (listOptions.sort)
23
84
  queryOptions.sort = listOptions.sort;
24
85
  vars.options = queryOptions;
@@ -1 +1 @@
1
- {"version":3,"file":"products.js","sourceRoot":"","sources":["../../src/commerce/products.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,eAAe,GAChB,MAAM,cAAc,CAAC;AAEtB,MAAM,UAAU,oBAAoB,CAAC,IAAgB;IACnD,OAAO;QACL,KAAK,CAAC,UAAU,CAAC,IAAY,EAAE,OAAwB;YACrD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAuB,WAAW,EAAE,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;YACtF,OAAO,IAAI,CAAC,OAAO,CAAC;QACtB,CAAC;QAED,KAAK,CAAC,cAAc,CAAC,EAAU,EAAE,OAAwB;YACvD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAuB,iBAAiB,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;YAC1F,OAAO,IAAI,CAAC,OAAO,CAAC;QACtB,CAAC;QAED,KAAK,CAAC,WAAW,CACf,WAAgC,EAChC,OAAwB;YAExB,MAAM,IAAI,GAA4B,EAAE,CAAC;YACzC,IAAI,WAAW,EAAE,CAAC;gBAChB,MAAM,YAAY,GAA4B;oBAC5C,IAAI,EAAE,WAAW,CAAC,IAAI,IAAI,EAAE;oBAC5B,IAAI,EAAE,WAAW,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O,IAAI,CAAC,qBAAqB,CAAC;QACpC,CAAC;QAED,KAAK,CAAC,oBAAoB,CACxB,SAAiB,EACjB,OAAwB;YAExB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAE5B,kBAAkB,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC;YAC/C,OAAO,IAAI,CAAC,qBAAqB,CAAC;QACpC,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,16 +1,16 @@
1
- export declare const GET_PRODUCT = "\n query GetProduct($slug: String!) {\n product(slug: $slug) {\n id name slug description\n featuredAsset {\n source name\n customFields { altText }\n presets {\n xxs { url webpUrl } xs { url webpUrl }\n s { url webpUrl } m { url webpUrl }\n l { url webpUrl } xl { url webpUrl }\n }\n }\n assets {\n source name\n customFields { altText }\n presets {\n xs { url webpUrl } m { url webpUrl }\n l { url webpUrl } xl { url webpUrl }\n }\n }\n variants {\n id name sku\n price priceWithTax currencyCode stockLevel\n priceListName retailPrice retailPriceWithTax\n priceTiers { minQuantity price priceWithTax discountLabel }\n options { id code name group { id name code } }\n customFields { minOrderQuantity salesUnit }\n featuredAsset {\n source name\n customFields { altText }\n presets { xs { url webpUrl } m { url webpUrl } }\n }\n assets {\n source name\n customFields { altText }\n presets { m { url webpUrl } l { url webpUrl } }\n }\n }\n optionGroups { id name code options { id name code } }\n facetValues { id name code facet { id name code } }\n collections { id name slug }\n }\n }\n";
2
- export declare const GET_PRODUCT_BY_ID = "\n query GetProductById($id: ID!) {\n product(id: $id) {\n id name slug description\n featuredAsset {\n source name\n customFields { altText }\n presets {\n xxs { url webpUrl } xs { url webpUrl }\n s { url webpUrl } m { url webpUrl }\n l { url webpUrl } xl { url webpUrl }\n }\n }\n assets {\n source name\n customFields { altText }\n presets {\n xs { url webpUrl } m { url webpUrl }\n l { url webpUrl } xl { url webpUrl }\n }\n }\n variants {\n id name sku\n price priceWithTax currencyCode stockLevel\n priceListName retailPrice retailPriceWithTax\n priceTiers { minQuantity price priceWithTax discountLabel }\n options { id code name group { id name code } }\n customFields { minOrderQuantity salesUnit }\n featuredAsset {\n source name\n customFields { altText }\n presets { xs { url webpUrl } m { url webpUrl } }\n }\n assets {\n source name\n customFields { altText }\n presets { m { url webpUrl } l { url webpUrl } }\n }\n }\n optionGroups { id name code options { id name code } }\n facetValues { id name code facet { id name code } }\n collections { id name slug }\n }\n }\n";
3
- export declare const LIST_PRODUCTS = "\n query ListProducts($options: ProductListOptions) {\n products(options: $options) {\n items {\n id name slug description\n featuredAsset {\n source name\n customFields { altText }\n presets { xs { url webpUrl } m { url webpUrl } l { url webpUrl } }\n }\n variants {\n id name sku\n price priceWithTax currencyCode stockLevel\n priceListName retailPrice retailPriceWithTax\n priceTiers { minQuantity price priceWithTax discountLabel }\n priceTiers { minQuantity price priceWithTax discountLabel }\n customFields { minOrderQuantity salesUnit }\n }\n facetValues { id name code facet { id name code } }\n collections { id name slug }\n }\n totalItems\n }\n }\n";
1
+ export declare const GET_PRODUCT = "\n query GetProduct($slug: String!) {\n product(slug: $slug) {\n id name slug description\n featuredAsset {\n source name\n customFields { altText }\n presets {\n xxs { url webpUrl } xs { url webpUrl }\n s { url webpUrl } m { url webpUrl }\n l { url webpUrl } xl { url webpUrl }\n }\n }\n assets {\n source name\n customFields { altText }\n presets {\n xs { url webpUrl } m { url webpUrl }\n l { url webpUrl } xl { url webpUrl }\n }\n }\n variants {\n id name sku\n price priceWithTax currencyCode stockLevel\n priceListName retailPrice retailPriceWithTax\n priceTiers { minQuantity price priceWithTax discountLabel }\n availabilityByLocation { locationId locationName inStock }\n options { id code name group { id name code } }\n customFields { minOrderQuantity salesUnit position }\n featuredAsset {\n source name\n customFields { altText }\n presets { xs { url webpUrl } m { url webpUrl } }\n }\n assets {\n source name\n customFields { altText }\n presets { m { url webpUrl } l { url webpUrl } }\n }\n }\n optionGroups { id name code options { id name code } }\n facetValues { id name code facet { id name code } }\n translations { languageCode name slug description }\n collections {\n id name slug position\n parent { id }\n translations { languageCode name slug }\n customFields { isRoutable isCanonical }\n }\n documents {\n id position title description fileUrl fileMimeType fileSize fileName requiresAuth\n }\n \n metadata {\n seoTitle seoDescription canonicalUrl\n socialTitle socialDescription socialImageAlt socialOgType\n socialImage {\n source name\n customFields { altText }\n presets {\n xs { url webpUrl } m { url webpUrl }\n l { url webpUrl } xl { url webpUrl }\n }\n }\n twitterCardType twitterTitleOverride twitterDescriptionOverride\n twitterImageOverride {\n source name\n customFields { altText }\n presets {\n xs { url webpUrl } m { url webpUrl }\n l { url webpUrl } xl { url webpUrl }\n }\n }\n aiSummary qaPairs qaEmitFaqpageJsonld\n breadcrumbOverride hreflangOverrides\n metaRobots resolvedBotDirectives\n includeReviewsInJsonld\n }\n\n }\n }\n";
2
+ export declare const GET_PRODUCT_BY_ID = "\n query GetProductById($id: ID!) {\n product(id: $id) {\n id name slug description\n featuredAsset {\n source name\n customFields { altText }\n presets {\n xxs { url webpUrl } xs { url webpUrl }\n s { url webpUrl } m { url webpUrl }\n l { url webpUrl } xl { url webpUrl }\n }\n }\n assets {\n source name\n customFields { altText }\n presets {\n xs { url webpUrl } m { url webpUrl }\n l { url webpUrl } xl { url webpUrl }\n }\n }\n variants {\n id name sku\n price priceWithTax currencyCode stockLevel\n priceListName retailPrice retailPriceWithTax\n priceTiers { minQuantity price priceWithTax discountLabel }\n availabilityByLocation { locationId locationName inStock }\n options { id code name group { id name code } }\n customFields { minOrderQuantity salesUnit position }\n featuredAsset {\n source name\n customFields { altText }\n presets { xs { url webpUrl } m { url webpUrl } }\n }\n assets {\n source name\n customFields { altText }\n presets { m { url webpUrl } l { url webpUrl } }\n }\n }\n optionGroups { id name code options { id name code } }\n facetValues { id name code facet { id name code } }\n translations { languageCode name slug description }\n collections {\n id name slug position\n parent { id }\n translations { languageCode name slug }\n customFields { isRoutable isCanonical }\n }\n documents {\n id position title description fileUrl fileMimeType fileSize fileName requiresAuth\n }\n \n metadata {\n seoTitle seoDescription canonicalUrl\n socialTitle socialDescription socialImageAlt socialOgType\n socialImage {\n source name\n customFields { altText }\n presets {\n xs { url webpUrl } m { url webpUrl }\n l { url webpUrl } xl { url webpUrl }\n }\n }\n twitterCardType twitterTitleOverride twitterDescriptionOverride\n twitterImageOverride {\n source name\n customFields { altText }\n presets {\n xs { url webpUrl } m { url webpUrl }\n l { url webpUrl } xl { url webpUrl }\n }\n }\n aiSummary qaPairs qaEmitFaqpageJsonld\n breadcrumbOverride hreflangOverrides\n metaRobots resolvedBotDirectives\n includeReviewsInJsonld\n }\n\n }\n }\n";
3
+ export declare const LIST_PRODUCTS = "\n query ListProducts($options: ProductListOptions) {\n products(options: $options) {\n items {\n id name slug description\n featuredAsset {\n source name\n customFields { altText }\n presets { xs { url webpUrl } m { url webpUrl } l { url webpUrl } }\n }\n variants {\n id name sku\n price priceWithTax currencyCode stockLevel\n priceListName retailPrice retailPriceWithTax\n priceTiers { minQuantity price priceWithTax discountLabel }\n availabilityByLocation { locationId locationName inStock }\n customFields { minOrderQuantity salesUnit position }\n }\n facetValues { id name code facet { id name code } }\n translations { languageCode name slug description }\n collections {\n id name slug position\n parent { id }\n translations { languageCode name slug }\n customFields { isRoutable isCanonical }\n }\n }\n totalItems\n }\n }\n";
4
4
  export declare const LIST_FACETS = "\n query ListFacets {\n facets {\n items {\n id name code\n values { id name code }\n }\n totalItems\n }\n }\n";
5
5
  export declare const LIST_COLLECTIONS = "\n query ListCollections($options: CollectionListOptions) {\n collections(options: $options) {\n items {\n id name slug description\n breadcrumbs { id name slug }\n featuredAsset {\n source\n presets { xs { url webpUrl } m { url webpUrl } }\n }\n parent { id name slug }\n children { id name slug }\n }\n totalItems\n }\n }\n";
6
- export declare const GET_COLLECTION = "\n query GetCollection($slug: String!) {\n collection(slug: $slug) {\n id name slug description\n featuredAsset {\n source\n presets { l { url webpUrl } xl { url webpUrl } }\n }\n breadcrumbs { id name slug }\n children { id name slug }\n productVariants(options: { take: 20 }) {\n items {\n id\n product {\n id name slug\n featuredAsset { source presets { m { url webpUrl } } }\n }\n price priceWithTax currencyCode stockLevel\n priceListName retailPrice retailPriceWithTax\n priceTiers { minQuantity price priceWithTax discountLabel }\n customFields { minOrderQuantity salesUnit }\n }\n totalItems\n }\n }\n }\n";
7
- export declare const SEARCH_PRODUCTS = "\n query SearchProducts($input: SearchInput!) {\n search(input: $input) {\n items {\n productId productName slug description\n price { ... on SinglePrice { value } ... on PriceRange { min max } }\n priceWithTax { ... on SinglePrice { value } ... on PriceRange { min max } }\n currencyCode\n productAsset { preview focalPoint { x y } }\n collectionIds\n }\n totalItems\n facetValues { facetValue { id name code facet { id name code } } count }\n }\n }\n";
8
- export declare const ACTIVE_ORDER = "\n query ActiveOrder {\n activeOrder {\n id code state active\n totalQuantity\n subTotal subTotalWithTax\n shipping shippingWithTax\n total totalWithTax\n currencyCode\n lines {\n id quantity\n unitPrice unitPriceWithTax\n linePrice linePriceWithTax\n productVariant {\n id name sku\n product { id name slug }\n options { id name group { name } }\n }\n featuredAsset { source presets { xs { url webpUrl } } }\n }\n shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }\n customer { id firstName lastName emailAddress }\n couponCodes\n }\n }\n";
9
- export declare const ADD_TO_CART = "\n mutation AddToCart($variantId: ID!, $quantity: Int!) {\n addItemToOrder(productVariantId: $variantId, quantity: $quantity) {\n ... on Order {\n id code state active totalQuantity\n subTotal subTotalWithTax shipping shippingWithTax total totalWithTax currencyCode\n lines {\n id quantity unitPrice unitPriceWithTax linePrice linePriceWithTax\n productVariant { id name sku product { id name slug } options { id name group { name } } }\n featuredAsset { source presets { xs { url webpUrl } } }\n }\n shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }\n customer { id firstName lastName emailAddress }\n couponCodes\n }\n ... on OrderModificationError { errorCode message }\n ... on OrderLimitError { errorCode message maxItems }\n ... on NegativeQuantityError { errorCode message }\n ... on InsufficientStockError { errorCode message quantityAvailable order { id } }\n }\n }\n";
10
- export declare const ADJUST_ORDER_LINE = "\n mutation AdjustOrderLine($lineId: ID!, $quantity: Int!) {\n adjustOrderLine(orderLineId: $lineId, quantity: $quantity) {\n ... on Order {\n id code state active totalQuantity\n subTotal subTotalWithTax shipping shippingWithTax total totalWithTax currencyCode\n lines {\n id quantity unitPrice unitPriceWithTax linePrice linePriceWithTax\n productVariant { id name sku product { id name slug } options { id name group { name } } }\n featuredAsset { source presets { xs { url webpUrl } } }\n }\n shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }\n customer { id firstName lastName emailAddress }\n couponCodes\n }\n ... on OrderModificationError { errorCode message }\n ... on OrderLimitError { errorCode message maxItems }\n ... on NegativeQuantityError { errorCode message }\n ... on InsufficientStockError { errorCode message quantityAvailable }\n }\n }\n";
11
- export declare const REMOVE_ORDER_LINE = "\n mutation RemoveOrderLine($lineId: ID!) {\n removeOrderLine(orderLineId: $lineId) {\n ... on Order {\n id code state active totalQuantity\n subTotal subTotalWithTax shipping shippingWithTax total totalWithTax currencyCode\n lines {\n id quantity unitPrice unitPriceWithTax linePrice linePriceWithTax\n productVariant { id name sku product { id name slug } options { id name group { name } } }\n featuredAsset { source presets { xs { url webpUrl } } }\n }\n shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }\n customer { id firstName lastName emailAddress }\n couponCodes\n }\n ... on OrderModificationError { errorCode message }\n }\n }\n";
12
- export declare const APPLY_COUPON = "\n mutation ApplyCoupon($code: String!) {\n applyCouponCode(couponCode: $code) {\n ... on Order {\n id code state active totalQuantity\n subTotal subTotalWithTax shipping shippingWithTax total totalWithTax currencyCode\n lines {\n id quantity unitPrice unitPriceWithTax linePrice linePriceWithTax\n productVariant { id name sku product { id name slug } options { id name group { name } } }\n featuredAsset { source presets { xs { url webpUrl } } }\n }\n couponCodes\n }\n ... on CouponCodeExpiredError { errorCode message couponCode }\n ... on CouponCodeInvalidError { errorCode message couponCode }\n ... on CouponCodeLimitError { errorCode message couponCode limit }\n }\n }\n";
13
- export declare const REMOVE_COUPON = "\n mutation RemoveCoupon($code: String!) {\n removeCouponCode(couponCode: $code) {\n id code state active totalQuantity\n subTotal subTotalWithTax shipping shippingWithTax total totalWithTax currencyCode\n lines {\n id quantity unitPrice unitPriceWithTax linePrice linePriceWithTax\n productVariant { id name sku product { id name slug } options { id name group { name } } }\n featuredAsset { source presets { xs { url webpUrl } } }\n }\n couponCodes\n }\n }\n";
6
+ export declare const GET_COLLECTION = "\n query GetCollection($slug: String!) {\n collection(slug: $slug) {\n id name slug description\n featuredAsset {\n source\n presets { l { url webpUrl } xl { url webpUrl } }\n }\n breadcrumbs { id name slug }\n children { id name slug }\n productVariants(options: { take: 20 }) {\n items {\n id\n product {\n id name slug\n featuredAsset { source presets { m { url webpUrl } } }\n }\n price priceWithTax currencyCode stockLevel\n priceListName retailPrice retailPriceWithTax\n priceTiers { minQuantity price priceWithTax discountLabel }\n availabilityByLocation { locationId locationName inStock }\n customFields { minOrderQuantity salesUnit position }\n }\n totalItems\n }\n }\n }\n";
7
+ export declare const SEARCH_PRODUCTS = "\n query SearchProducts($input: SearchInput!) {\n search(input: $input) {\n items {\n productId productName slug description\n price { ... on SinglePrice { value } ... on PriceRange { min max } }\n priceWithTax { ... on SinglePrice { value } ... on PriceRange { min max } }\n currencyCode\n productAsset { preview focalPoint { x y } }\n collectionIds\n inStock\n }\n totalItems\n facetValues { facetValue { id name code facet { id name code } } count }\n }\n }\n";
8
+ export declare const ACTIVE_ORDER = "\n query ActiveOrder {\n activeOrder { \n id code state active\n totalQuantity\n subTotal subTotalWithTax\n shipping shippingWithTax\n total totalWithTax\n currencyCode\n lines {\n id quantity\n unitPrice unitPriceWithTax\n linePrice linePriceWithTax\n discountedLinePrice discountedLinePriceWithTax\n discounts { adjustmentSource type description amount amountWithTax }\n productVariant {\n id name sku\n product { id name slug }\n options { id name group { name } }\n }\n featuredAsset { source presets { xs { url webpUrl } } }\n }\n discounts { adjustmentSource type description amount amountWithTax }\n taxSummary { description taxRate taxBase taxTotal }\n promotions { id name couponCode description }\n shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }\n customer { id firstName lastName emailAddress }\n couponCodes\n }\n }\n";
9
+ export declare const ADD_TO_CART = "\n mutation AddToCart($variantId: ID!, $quantity: Int!) {\n addItemToOrder(productVariantId: $variantId, quantity: $quantity) {\n ... on Order { \n id code state active\n totalQuantity\n subTotal subTotalWithTax\n shipping shippingWithTax\n total totalWithTax\n currencyCode\n lines {\n id quantity\n unitPrice unitPriceWithTax\n linePrice linePriceWithTax\n discountedLinePrice discountedLinePriceWithTax\n discounts { adjustmentSource type description amount amountWithTax }\n productVariant {\n id name sku\n product { id name slug }\n options { id name group { name } }\n }\n featuredAsset { source presets { xs { url webpUrl } } }\n }\n discounts { adjustmentSource type description amount amountWithTax }\n taxSummary { description taxRate taxBase taxTotal }\n promotions { id name couponCode description }\n shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }\n customer { id firstName lastName emailAddress }\n couponCodes\n }\n ... on OrderModificationError { errorCode message }\n ... on OrderLimitError { errorCode message maxItems }\n ... on NegativeQuantityError { errorCode message }\n ... on InsufficientStockError { errorCode message quantityAvailable order { id } }\n }\n }\n";
10
+ export declare const ADJUST_ORDER_LINE = "\n mutation AdjustOrderLine($lineId: ID!, $quantity: Int!) {\n adjustOrderLine(orderLineId: $lineId, quantity: $quantity) {\n ... on Order { \n id code state active\n totalQuantity\n subTotal subTotalWithTax\n shipping shippingWithTax\n total totalWithTax\n currencyCode\n lines {\n id quantity\n unitPrice unitPriceWithTax\n linePrice linePriceWithTax\n discountedLinePrice discountedLinePriceWithTax\n discounts { adjustmentSource type description amount amountWithTax }\n productVariant {\n id name sku\n product { id name slug }\n options { id name group { name } }\n }\n featuredAsset { source presets { xs { url webpUrl } } }\n }\n discounts { adjustmentSource type description amount amountWithTax }\n taxSummary { description taxRate taxBase taxTotal }\n promotions { id name couponCode description }\n shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }\n customer { id firstName lastName emailAddress }\n couponCodes\n }\n ... on OrderModificationError { errorCode message }\n ... on OrderLimitError { errorCode message maxItems }\n ... on NegativeQuantityError { errorCode message }\n ... on InsufficientStockError { errorCode message quantityAvailable }\n }\n }\n";
11
+ export declare const REMOVE_ORDER_LINE = "\n mutation RemoveOrderLine($lineId: ID!) {\n removeOrderLine(orderLineId: $lineId) {\n ... on Order { \n id code state active\n totalQuantity\n subTotal subTotalWithTax\n shipping shippingWithTax\n total totalWithTax\n currencyCode\n lines {\n id quantity\n unitPrice unitPriceWithTax\n linePrice linePriceWithTax\n discountedLinePrice discountedLinePriceWithTax\n discounts { adjustmentSource type description amount amountWithTax }\n productVariant {\n id name sku\n product { id name slug }\n options { id name group { name } }\n }\n featuredAsset { source presets { xs { url webpUrl } } }\n }\n discounts { adjustmentSource type description amount amountWithTax }\n taxSummary { description taxRate taxBase taxTotal }\n promotions { id name couponCode description }\n shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }\n customer { id firstName lastName emailAddress }\n couponCodes\n }\n ... on OrderModificationError { errorCode message }\n }\n }\n";
12
+ export declare const APPLY_COUPON = "\n mutation ApplyCoupon($code: String!) {\n applyCouponCode(couponCode: $code) {\n ... on Order { \n id code state active\n totalQuantity\n subTotal subTotalWithTax\n shipping shippingWithTax\n total totalWithTax\n currencyCode\n lines {\n id quantity\n unitPrice unitPriceWithTax\n linePrice linePriceWithTax\n discountedLinePrice discountedLinePriceWithTax\n discounts { adjustmentSource type description amount amountWithTax }\n productVariant {\n id name sku\n product { id name slug }\n options { id name group { name } }\n }\n featuredAsset { source presets { xs { url webpUrl } } }\n }\n discounts { adjustmentSource type description amount amountWithTax }\n taxSummary { description taxRate taxBase taxTotal }\n promotions { id name couponCode description }\n shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }\n customer { id firstName lastName emailAddress }\n couponCodes\n }\n ... on CouponCodeExpiredError { errorCode message couponCode }\n ... on CouponCodeInvalidError { errorCode message couponCode }\n ... on CouponCodeLimitError { errorCode message couponCode limit }\n }\n }\n";
13
+ export declare const REMOVE_COUPON = "\n mutation RemoveCoupon($code: String!) {\n removeCouponCode(couponCode: $code) { \n id code state active\n totalQuantity\n subTotal subTotalWithTax\n shipping shippingWithTax\n total totalWithTax\n currencyCode\n lines {\n id quantity\n unitPrice unitPriceWithTax\n linePrice linePriceWithTax\n discountedLinePrice discountedLinePriceWithTax\n discounts { adjustmentSource type description amount amountWithTax }\n productVariant {\n id name sku\n product { id name slug }\n options { id name group { name } }\n }\n featuredAsset { source presets { xs { url webpUrl } } }\n }\n discounts { adjustmentSource type description amount amountWithTax }\n taxSummary { description taxRate taxBase taxTotal }\n promotions { id name couponCode description }\n shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }\n customer { id firstName lastName emailAddress }\n couponCodes\n }\n }\n";
14
14
  export declare const SET_CUSTOMER = "\n mutation SetCustomer($input: CreateCustomerInput!) {\n setCustomerForOrder(input: $input) {\n ... on Order {\n id customer { id firstName lastName emailAddress }\n }\n ... on AlreadyLoggedInError { errorCode message }\n ... on EmailAddressConflictError { errorCode message }\n ... on GuestCheckoutError { errorCode message }\n ... on NoActiveOrderError { errorCode message }\n }\n }\n";
15
15
  export declare const SET_SHIPPING_ADDRESS = "\n mutation SetShippingAddress($input: CreateAddressInput!) {\n setOrderShippingAddress(input: $input) {\n ... on Order {\n id shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }\n }\n ... on NoActiveOrderError { errorCode message }\n }\n }\n";
16
16
  export declare const SET_BILLING_ADDRESS = "\n mutation SetBillingAddress($input: CreateAddressInput!) {\n setOrderBillingAddress(input: $input) {\n ... on Order {\n id\n }\n ... on NoActiveOrderError { errorCode message }\n }\n }\n";
@@ -19,6 +19,12 @@ export declare const SET_SHIPPING_METHOD = "\n mutation SetShippingMethod($ids:
19
19
  export declare const ELIGIBLE_PAYMENT_METHODS = "\n query PaymentMethods {\n eligiblePaymentMethods {\n id name code description isEligible eligibilityMessage\n }\n }\n";
20
20
  export declare const TRANSITION_TO_ARRANGING_PAYMENT = "\n mutation TransitionToArrangingPayment {\n transitionOrderToState(state: \"ArrangingPayment\") {\n ... on Order { id state }\n ... on OrderStateTransitionError { errorCode message transitionError }\n }\n }\n";
21
21
  export declare const ADD_PAYMENT = "\n mutation AddPayment($input: PaymentInput!) {\n addPaymentToOrder(input: $input) {\n ... on Order { id code state totalWithTax }\n ... on OrderPaymentStateError { errorCode message }\n ... on IneligiblePaymentMethodError { errorCode message }\n ... on PaymentFailedError { errorCode message paymentErrorMessage }\n ... on PaymentDeclinedError { errorCode message paymentErrorMessage }\n ... on OrderStateTransitionError { errorCode message transitionError }\n ... on NoActiveOrderError { errorCode message }\n }\n }\n";
22
+ export declare const PICKUP_LOCATIONS = "\n query PickupLocations($input: PickupLocationSearchInput!) {\n pickupLocations(input: $input) {\n \n provider\n carrier\n locationCode\n name\n address {\n streetLine1\n number\n postalCode\n city\n countryCode\n region\n }\n openingHours {\n weekday\n open\n close\n }\n details\n\n }\n }\n";
23
+ export declare const ACTIVE_ORDER_PICKUP_LOCATION = "\n query ActiveOrderPickupLocation {\n activeOrderPickupLocation {\n \n provider\n carrier\n locationCode\n name\n address {\n streetLine1\n number\n postalCode\n city\n countryCode\n region\n }\n openingHours {\n weekday\n open\n close\n }\n details\n\n }\n }\n";
24
+ export declare const SET_ACTIVE_ORDER_PICKUP_LOCATION = "\n mutation SetActiveOrderPickupLocation($location: StoredPickupLocationInput!) {\n setActiveOrderPickupLocation(location: $location) {\n __typename\n ... on Order {\n id code state\n }\n ... on ErrorResult {\n errorCode\n message\n }\n }\n }\n";
25
+ export declare const CREATE_STRIPE_PAYMENT_INTENT = "\n mutation CreateStripePaymentIntent {\n createStripePaymentIntent\n }\n";
26
+ export declare const MOLLIE_PAYMENT_METHODS = "\n query MolliePaymentMethods($input: MolliePaymentMethodsInput!) {\n molliePaymentMethods(input: $input) {\n id\n code\n description\n minimumAmount { value currency }\n maximumAmount { value currency }\n image { size1x size2x svg }\n }\n }\n";
27
+ export declare const CREATE_MOLLIE_PAYMENT_INTENT = "\n mutation CreateMolliePaymentIntent($input: MolliePaymentIntentInput!) {\n createMolliePaymentIntent(input: $input) {\n ... on MolliePaymentIntent { url }\n ... on MolliePaymentIntentError { errorCode message }\n }\n }\n";
22
28
  export declare const LOGIN = "\n mutation Login($email: String!, $password: String!) {\n login(username: $email, password: $password) {\n ... on CurrentUser { id identifier }\n ... on InvalidCredentialsError { errorCode message authenticationError }\n ... on NotVerifiedError { errorCode message }\n ... on NativeAuthStrategyError { errorCode message }\n }\n }\n";
23
29
  export declare const REGISTER = "\n mutation Register($input: RegisterCustomerInput!) {\n registerCustomerAccount(input: $input) {\n ... on Success { success }\n ... on MissingPasswordError { errorCode message }\n ... on PasswordValidationError { errorCode message validationErrorMessage }\n ... on NativeAuthStrategyError { errorCode message }\n }\n }\n";
24
30
  export declare const GET_CURRENT_CUSTOMER = "\n query Me {\n activeCustomer {\n id firstName lastName emailAddress phoneNumber\n addresses {\n id fullName streetLine1 streetLine2 city province postalCode\n country { code name }\n defaultShippingAddress defaultBillingAddress\n }\n orders(options: { take: 10, sort: { createdAt: DESC } }) {\n items {\n id code state totalWithTax createdAt\n lines { id quantity productVariant { name } }\n }\n totalItems\n }\n }\n }\n";
@@ -36,15 +42,21 @@ export declare const CREATE_ADDRESS = "\n mutation CreateAddress($input: Create
36
42
  export declare const UPDATE_ADDRESS = "\n mutation UpdateAddress($input: UpdateAddressInput!) {\n updateCustomerAddress(input: $input) {\n id fullName streetLine1 streetLine2 city province postalCode\n country { code name }\n defaultShippingAddress defaultBillingAddress\n }\n }\n";
37
43
  export declare const DELETE_ADDRESS = "\n mutation DeleteAddress($id: ID!) {\n deleteCustomerAddress(id: $id) {\n success\n }\n }\n";
38
44
  export declare const AVAILABLE_COUNTRIES = "\n query AvailableCountries {\n availableCountries {\n id code name\n }\n }\n";
39
- export declare const ORDER_BY_CODE = "\n query OrderByCode($code: String!) {\n orderByCode(code: $code) {\n id code state active\n totalQuantity\n subTotal subTotalWithTax\n shipping shippingWithTax\n total totalWithTax\n currencyCode\n lines {\n id quantity\n unitPrice unitPriceWithTax\n linePrice linePriceWithTax\n productVariant {\n id name sku\n product { id name slug }\n options { id name group { name } }\n }\n featuredAsset { source presets { xs { url webpUrl } } }\n }\n shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }\n customer { id firstName lastName emailAddress }\n couponCodes\n }\n }\n";
45
+ export declare const ORDER_BY_CODE = "\n query OrderByCode($code: String!) {\n orderByCode(code: $code) { \n id code state active\n totalQuantity\n subTotal subTotalWithTax\n shipping shippingWithTax\n total totalWithTax\n currencyCode\n lines {\n id quantity\n unitPrice unitPriceWithTax\n linePrice linePriceWithTax\n discountedLinePrice discountedLinePriceWithTax\n discounts { adjustmentSource type description amount amountWithTax }\n productVariant {\n id name sku\n product { id name slug }\n options { id name group { name } }\n }\n featuredAsset { source presets { xs { url webpUrl } } }\n }\n discounts { adjustmentSource type description amount amountWithTax }\n taxSummary { description taxRate taxBase taxTotal }\n promotions { id name couponCode description }\n shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }\n customer { id firstName lastName emailAddress }\n couponCodes\n }\n }\n";
40
46
  export declare const FAVORITE_VARIANT_IDS = "\n query FavoriteVariantIds {\n favoriteProductVariantIds\n }\n";
41
- export declare const MY_FAVORITES = "\n query MyFavorites($options: FavoriteListOptions) {\n myFavorites(options: $options) {\n items {\n id\n productVariantId\n createdAt\n productVariant {\n id name sku\n price priceWithTax currencyCode stockLevel\n priceListName retailPrice retailPriceWithTax\n priceTiers { minQuantity price priceWithTax discountLabel }\n product {\n id name slug\n featuredAsset {\n source\n customFields { altText }\n presets { xs { url webpUrl } m { url webpUrl } l { url webpUrl } }\n }\n }\n options { id name group { name } }\n customFields { minOrderQuantity salesUnit }\n }\n }\n totalItems\n }\n }\n";
47
+ export declare const MY_FAVORITES = "\n query MyFavorites($options: FavoriteListOptions) {\n myFavorites(options: $options) {\n items {\n id\n productVariantId\n createdAt\n productVariant {\n id name sku\n price priceWithTax currencyCode stockLevel\n priceListName retailPrice retailPriceWithTax\n priceTiers { minQuantity price priceWithTax discountLabel }\n availabilityByLocation { locationId locationName inStock }\n product {\n id name slug\n featuredAsset {\n source\n customFields { altText }\n presets { xs { url webpUrl } m { url webpUrl } l { url webpUrl } }\n }\n }\n options { id name group { name } }\n customFields { minOrderQuantity salesUnit position }\n }\n }\n totalItems\n }\n }\n";
42
48
  export declare const TOGGLE_FAVORITE = "\n mutation ToggleFavorite($productVariantId: ID!) {\n toggleFavorite(productVariantId: $productVariantId)\n }\n";
43
49
  export declare const REMOVE_FAVORITE = "\n mutation RemoveFavorite($productVariantId: ID!) {\n removeFavorite(productVariantId: $productVariantId)\n }\n";
44
- export declare const GET_ACTIVE_CHANNEL = "\n query ActiveChannel {\n activeChannel {\n id code\n defaultLanguageCode\n availableLanguageCodes\n defaultCurrencyCode\n availableCurrencyCodes\n customFields\n }\n }\n";
50
+ export declare const GET_ACTIVE_CHANNEL = "\n query ActiveChannel {\n activeChannel {\n id code\n defaultLanguageCode\n availableLanguageCodes\n defaultCurrencyCode\n availableCurrencyCodes\n \n customFields {\n businessName businessDescription\n logoAssetId darkLogoAssetId coverAssetId faviconAssetId\n websiteUrl primaryColor\n contactEmail contactPhone\n legalName vatNumber registrationNumber\n addressLine1 addressLine2 city postalCode province country\n socialLinks\n commercePathPrefix commercePathPrefixTranslations\n cdnDomain maintenanceMode\n urlLocaleStrategy urlLocalePrefixDefault\n twitterHandle defaultOgImageId llmsTxtEnabled\n }\n\n }\n }\n";
45
51
  export declare const PROPERTY_GROUPS = "\n query PropertyGroups {\n productPropertyGroups {\n id position\n translations { id languageCode name }\n properties {\n id slug fieldType isFilterable isRequired position\n config { options { value label } min max maxLength allowedCollectionIds filterableFieldSlugs }\n facetId\n fieldFacets { fieldSlug fieldType facetId }\n translations { id languageCode name helpText }\n }\n }\n }\n";
46
52
  export declare const PRODUCT_PROPERTIES = "\n query ProductProperties($productId: ID!) {\n productPropertyValues(productId: $productId) {\n group {\n id position\n translations { id languageCode name }\n properties {\n id slug fieldType isFilterable isRequired position\n config { options { value label } min max maxLength }\n facetId\n fieldFacets { fieldSlug fieldType facetId }\n translations { id languageCode name helpText }\n }\n }\n values { id propertyId languageCode value }\n }\n }\n";
47
- export declare const GET_PRODUCT_RECOMMENDATIONS = "\n query ProductRecommendations($productId: ID!, $groupSlug: String) {\n productRecommendations(productId: $productId, groupSlug: $groupSlug) {\n groupName\n groupSlug\n products {\n id name slug description\n featuredAsset {\n source name\n customFields { altText }\n presets { xs { url webpUrl } m { url webpUrl } l { url webpUrl } }\n }\n variants {\n id name sku\n price priceWithTax currencyCode stockLevel\n priceListName retailPrice retailPriceWithTax\n priceTiers { minQuantity price priceWithTax discountLabel }\n customFields { minOrderQuantity salesUnit }\n }\n }\n }\n }\n";
53
+ export declare const GET_PRODUCT_RECOMMENDATIONS = "\n query ProductRecommendations($productId: ID!, $groupSlug: String) {\n productRecommendations(productId: $productId, groupSlug: $groupSlug) {\n groupName\n groupSlug\n products {\n id name slug description\n featuredAsset {\n source name\n customFields { altText }\n presets { xs { url webpUrl } m { url webpUrl } l { url webpUrl } }\n }\n variants {\n id name sku\n price priceWithTax currencyCode stockLevel\n priceListName retailPrice retailPriceWithTax\n priceTiers { minQuantity price priceWithTax discountLabel }\n availabilityByLocation { locationId locationName inStock }\n customFields { minOrderQuantity salesUnit position }\n }\n }\n }\n }\n";
48
54
  export declare const GET_EXCHANGE_RATES = "\n query ExchangeRates {\n exchangeRates {\n baseCurrency targetCurrency rate inverseRate rateDate\n }\n }\n";
49
55
  export declare const CONVERT_CURRENCY = "\n query ConvertCurrency($amount: String!, $from: String!, $to: String!) {\n convertCurrency(amount: $amount, fromCurrency: $from, toCurrency: $to) {\n amount fromCurrency toCurrency rate result\n }\n }\n";
56
+ export declare const MY_QUOTES = "\n query MyQuotes($options: QuoteListOptions) {\n myQuotes(options: $options) {\n items { \n id code channelId customerId currencyCode status\n expiresAt salesRepUserId customerNotes convertedOrderId\n createdAt updatedAt\n lines {\n id productVariantId quantity unitPrice discountLabel position\n createdAt updatedAt\n }\n }\n totalItems\n }\n }\n";
57
+ export declare const MY_QUOTE = "\n query MyQuote($id: ID!) {\n myQuote(id: $id) { \n id code channelId customerId currencyCode status\n expiresAt salesRepUserId customerNotes convertedOrderId\n createdAt updatedAt\n lines {\n id productVariantId quantity unitPrice discountLabel position\n createdAt updatedAt\n }\n }\n }\n";
58
+ export declare const CREATE_QUOTE_REQUEST = "\n mutation CreateQuoteRequest($input: CreateQuoteRequestInput!) {\n createQuoteRequest(input: $input) { \n id code channelId customerId currencyCode status\n expiresAt salesRepUserId customerNotes convertedOrderId\n createdAt updatedAt\n lines {\n id productVariantId quantity unitPrice discountLabel position\n createdAt updatedAt\n }\n }\n }\n";
59
+ export declare const ACCEPT_QUOTE = "\n mutation AcceptQuote($id: ID!) {\n acceptQuote(id: $id) { \n id code state active\n totalQuantity\n subTotal subTotalWithTax\n shipping shippingWithTax\n total totalWithTax\n currencyCode\n lines {\n id quantity\n unitPrice unitPriceWithTax\n linePrice linePriceWithTax\n discountedLinePrice discountedLinePriceWithTax\n discounts { adjustmentSource type description amount amountWithTax }\n productVariant {\n id name sku\n product { id name slug }\n options { id name group { name } }\n }\n featuredAsset { source presets { xs { url webpUrl } } }\n }\n discounts { adjustmentSource type description amount amountWithTax }\n taxSummary { description taxRate taxBase taxTotal }\n promotions { id name couponCode description }\n shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }\n customer { id firstName lastName emailAddress }\n couponCodes\n }\n }\n";
60
+ export declare const CANCEL_MY_QUOTE = "\n mutation CancelMyQuote($id: ID!, $reason: String) {\n cancelMyQuote(id: $id, reason: $reason) { \n id code channelId customerId currencyCode status\n expiresAt salesRepUserId customerNotes convertedOrderId\n createdAt updatedAt\n lines {\n id productVariantId quantity unitPrice discountLabel position\n createdAt updatedAt\n }\n }\n }\n";
61
+ export declare const GET_BRANDING = "\n query GetBranding($ids: [ID!]!) {\n activeChannel {\n id\n defaultLanguageCode\n availableLanguageCodes\n defaultCurrencyCode\n }\n fontResources {\n id\n identifier\n kind\n family\n weights\n files {\n id\n source\n preview\n mimeType\n }\n }\n brandingAssets(ids: $ids) {\n id\n source\n preview\n mimeType\n }\n }\n";
50
62
  //# sourceMappingURL=queries.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../src/commerce/queries.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,i2CA4CvB,CAAC;AAEF,eAAO,MAAM,iBAAiB,21CA4C7B,CAAC;AAEF,eAAO,MAAM,aAAa,+yBAwBzB,CAAC;AAEF,eAAO,MAAM,WAAW,wJAUvB,CAAC;AAIF,eAAO,MAAM,gBAAgB,6ZAgB5B,CAAC;AAEF,eAAO,MAAM,cAAc,2wBA0B1B,CAAC;AAIF,eAAO,MAAM,eAAe,+gBAe3B,CAAC;AAIF,eAAO,MAAM,YAAY,2sBAyBxB,CAAC;AAEF,eAAO,MAAM,WAAW,2gCAqBvB,CAAC;AAEF,eAAO,MAAM,iBAAiB,0/BAqB7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,gxBAkB7B,CAAC;AAEF,eAAO,MAAM,YAAY,0wBAkBxB,CAAC;AAEF,eAAO,MAAM,aAAa,ugBAazB,CAAC;AAIF,eAAO,MAAM,YAAY,qbAYxB,CAAC;AAEF,eAAO,MAAM,oBAAoB,2TAShC,CAAC;AAEF,eAAO,MAAM,mBAAmB,+NAS/B,CAAC;AAEF,eAAO,MAAM,yBAAyB,oIAMrC,CAAC;AAEF,eAAO,MAAM,mBAAmB,kYAW/B,CAAC;AAEF,eAAO,MAAM,wBAAwB,yIAMpC,CAAC;AAEF,eAAO,MAAM,+BAA+B,wOAO3C,CAAC;AAEF,eAAO,MAAM,WAAW,ujBAYvB,CAAC;AAIF,eAAO,MAAM,KAAK,6WASjB,CAAC;AAEF,eAAO,MAAM,QAAQ,kWASpB,CAAC;AAEF,eAAO,MAAM,oBAAoB,wgBAkBhC,CAAC;AAEF,eAAO,MAAM,mBAAmB,oSAY/B,CAA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