@sixtyninecommerce/client 0.24.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -0
- package/dist/admin/forms.js +19 -0
- package/dist/admin/forms.js.map +1 -1
- package/dist/admin/http.d.ts +9 -0
- package/dist/admin/http.d.ts.map +1 -1
- package/dist/admin/http.js +3 -0
- package/dist/admin/http.js.map +1 -1
- package/dist/admin/index.d.ts +63 -0
- package/dist/admin/index.d.ts.map +1 -1
- package/dist/admin/index.js +67 -0
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/redirects.d.ts +6 -0
- package/dist/admin/redirects.d.ts.map +1 -1
- package/dist/admin/redirects.js +12 -0
- package/dist/admin/redirects.js.map +1 -1
- package/dist/admin/types.d.ts +63 -0
- package/dist/admin/types.d.ts.map +1 -1
- package/dist/cache-tags.d.ts +19 -0
- package/dist/cache-tags.d.ts.map +1 -1
- package/dist/cache-tags.js +19 -0
- package/dist/cache-tags.js.map +1 -1
- package/dist/client.d.ts +17 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +17 -0
- package/dist/client.js.map +1 -1
- package/dist/commerce/age-verification.js +3 -3
- package/dist/commerce/age-verification.js.map +1 -1
- package/dist/commerce/branding.js +7 -0
- package/dist/commerce/branding.js.map +1 -1
- package/dist/commerce/cart.js +25 -0
- package/dist/commerce/cart.js.map +1 -1
- package/dist/commerce/checkout.d.ts +68 -0
- package/dist/commerce/checkout.d.ts.map +1 -1
- package/dist/commerce/checkout.js +83 -0
- package/dist/commerce/checkout.js.map +1 -1
- package/dist/commerce/customer.d.ts +58 -0
- package/dist/commerce/customer.d.ts.map +1 -1
- package/dist/commerce/customer.js +65 -0
- package/dist/commerce/customer.js.map +1 -1
- package/dist/commerce/pickup-location-parser.d.ts +18 -0
- package/dist/commerce/pickup-location-parser.d.ts.map +1 -1
- package/dist/commerce/pickup-location-parser.js +28 -0
- package/dist/commerce/pickup-location-parser.js.map +1 -1
- package/dist/commerce/placement-error.d.ts +52 -0
- package/dist/commerce/placement-error.d.ts.map +1 -1
- package/dist/commerce/placement-error.js +87 -0
- package/dist/commerce/placement-error.js.map +1 -1
- package/dist/commerce/products.d.ts +48 -0
- package/dist/commerce/products.d.ts.map +1 -1
- package/dist/commerce/products.js +92 -0
- package/dist/commerce/products.js.map +1 -1
- package/dist/commerce/queries.d.ts +113 -27
- package/dist/commerce/queries.d.ts.map +1 -1
- package/dist/commerce/queries.js +188 -2
- package/dist/commerce/queries.js.map +1 -1
- package/dist/commerce/quotes.js +33 -0
- package/dist/commerce/quotes.js.map +1 -1
- package/dist/commerce/saved-lists.d.ts +7 -7
- package/dist/commerce/saved-lists.d.ts.map +1 -1
- package/dist/commerce/saved-lists.js +1 -1
- package/dist/commerce/search.js +3 -0
- package/dist/commerce/search.js.map +1 -1
- package/dist/commerce/shipping.js +3 -3
- package/dist/commerce/shipping.js.map +1 -1
- package/dist/commerce/stock-notifications.d.ts +11 -0
- package/dist/commerce/stock-notifications.d.ts.map +1 -1
- package/dist/commerce/stock-notifications.js +11 -0
- package/dist/commerce/stock-notifications.js.map +1 -1
- package/dist/commerce/vat-validation.js +4 -4
- package/dist/commerce/vat-validation.js.map +1 -1
- package/dist/constants.d.ts +31 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +32 -0
- package/dist/constants.js.map +1 -1
- package/dist/content/asset-urls.d.ts +50 -0
- package/dist/content/asset-urls.d.ts.map +1 -1
- package/dist/content/asset-urls.js +92 -0
- package/dist/content/asset-urls.js.map +1 -1
- package/dist/content/assets.d.ts +15 -0
- package/dist/content/assets.d.ts.map +1 -1
- package/dist/content/assets.js +15 -0
- package/dist/content/assets.js.map +1 -1
- package/dist/content/collection-pages.d.ts +5 -0
- package/dist/content/collection-pages.d.ts.map +1 -1
- package/dist/content/collection-pages.js +8 -0
- package/dist/content/collection-pages.js.map +1 -1
- package/dist/content/collections.d.ts +14 -0
- package/dist/content/collections.d.ts.map +1 -1
- package/dist/content/collections.js +16 -0
- package/dist/content/collections.js.map +1 -1
- package/dist/content/filtered-products.d.ts +18 -0
- package/dist/content/filtered-products.d.ts.map +1 -1
- package/dist/content/filtered-products.js +16 -0
- package/dist/content/filtered-products.js.map +1 -1
- package/dist/content/form-field-types.d.ts +6 -0
- package/dist/content/form-field-types.d.ts.map +1 -1
- package/dist/content/form-field-types.js +12 -0
- package/dist/content/form-field-types.js.map +1 -1
- package/dist/content/forms.d.ts +16 -0
- package/dist/content/forms.d.ts.map +1 -1
- package/dist/content/forms.js +23 -0
- package/dist/content/forms.js.map +1 -1
- package/dist/content/items.d.ts +26 -0
- package/dist/content/items.d.ts.map +1 -1
- package/dist/content/items.js +33 -0
- package/dist/content/items.js.map +1 -1
- package/dist/content/resolve.js +6 -0
- package/dist/content/resolve.js.map +1 -1
- package/dist/content/sitemap.d.ts +5 -0
- package/dist/content/sitemap.d.ts.map +1 -1
- package/dist/content/sitemap.js +5 -0
- package/dist/content/sitemap.js.map +1 -1
- package/dist/core/context.js +6 -0
- package/dist/core/context.js.map +1 -1
- package/dist/core/headers.js +2 -0
- package/dist/core/headers.js.map +1 -1
- package/dist/core/http.d.ts +8 -0
- package/dist/core/http.d.ts.map +1 -1
- package/dist/core/http.js +89 -1
- package/dist/core/http.js.map +1 -1
- package/dist/credit/credit-status.js +2 -2
- package/dist/credit/credit-status.js.map +1 -1
- package/dist/credit/payment-terms.js +2 -2
- package/dist/credit/payment-terms.js.map +1 -1
- package/dist/currency/exchange.d.ts +11 -0
- package/dist/currency/exchange.d.ts.map +1 -1
- package/dist/currency/exchange.js +11 -0
- package/dist/currency/exchange.js.map +1 -1
- package/dist/errors.d.ts +50 -2
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +48 -2
- package/dist/errors.js.map +1 -1
- package/dist/events/envelope.d.ts +60 -0
- package/dist/events/envelope.d.ts.map +1 -1
- package/dist/events/envelope.js +12 -0
- package/dist/events/envelope.js.map +1 -1
- package/dist/events/index.d.ts +14 -1
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +13 -0
- package/dist/events/index.js.map +1 -1
- package/dist/events/payloads.d.ts +19 -0
- package/dist/events/payloads.d.ts.map +1 -1
- package/dist/events/payloads.js +12 -0
- package/dist/events/payloads.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/media/index.js +2 -0
- package/dist/media/index.js.map +1 -1
- package/dist/media/urls.d.ts +52 -0
- package/dist/media/urls.d.ts.map +1 -1
- package/dist/media/urls.js +38 -0
- package/dist/media/urls.js.map +1 -1
- package/dist/media/video.d.ts +16 -0
- package/dist/media/video.d.ts.map +1 -1
- package/dist/media/video.js +16 -0
- package/dist/media/video.js.map +1 -1
- package/dist/next/artifact-handler.d.ts +22 -0
- package/dist/next/artifact-handler.d.ts.map +1 -1
- package/dist/next/artifact-handler.js +22 -0
- package/dist/next/artifact-handler.js.map +1 -1
- package/dist/next/event-revalidate-handler.d.ts +67 -0
- package/dist/next/event-revalidate-handler.d.ts.map +1 -1
- package/dist/next/event-revalidate-handler.js +48 -0
- package/dist/next/event-revalidate-handler.js.map +1 -1
- package/dist/next/index.d.ts +6 -0
- package/dist/next/index.d.ts.map +1 -1
- package/dist/next/index.js +6 -0
- package/dist/next/index.js.map +1 -1
- package/dist/next/json-ld.d.ts +9 -0
- package/dist/next/json-ld.d.ts.map +1 -1
- package/dist/next/json-ld.js +9 -0
- package/dist/next/json-ld.js.map +1 -1
- package/dist/next/metadata.d.ts +18 -0
- package/dist/next/metadata.d.ts.map +1 -1
- package/dist/next/metadata.js +21 -0
- package/dist/next/metadata.js.map +1 -1
- package/dist/next/redirect-middleware.d.ts +39 -0
- package/dist/next/redirect-middleware.d.ts.map +1 -1
- package/dist/next/redirect-middleware.js +32 -0
- package/dist/next/redirect-middleware.js.map +1 -1
- package/dist/next/revalidate-handler.d.ts +30 -0
- package/dist/next/revalidate-handler.d.ts.map +1 -1
- package/dist/next/revalidate-handler.js +22 -0
- package/dist/next/revalidate-handler.js.map +1 -1
- package/dist/order-scope.d.ts +27 -0
- package/dist/order-scope.d.ts.map +1 -1
- package/dist/order-scope.js +29 -0
- package/dist/order-scope.js.map +1 -1
- package/dist/pricing/format.d.ts +17 -0
- package/dist/pricing/format.d.ts.map +1 -1
- package/dist/pricing/format.js +19 -0
- package/dist/pricing/format.js.map +1 -1
- package/dist/pricing/index.d.ts +8 -1
- package/dist/pricing/index.d.ts.map +1 -1
- package/dist/pricing/index.js +18 -2
- package/dist/pricing/index.js.map +1 -1
- package/dist/pricing/tax-display.d.ts +77 -0
- package/dist/pricing/tax-display.d.ts.map +1 -1
- package/dist/pricing/tax-display.js +85 -0
- package/dist/pricing/tax-display.js.map +1 -1
- package/dist/pricing/tiers.d.ts +9 -0
- package/dist/pricing/tiers.d.ts.map +1 -1
- package/dist/pricing/tiers.js +9 -0
- package/dist/pricing/tiers.js.map +1 -1
- package/dist/pricing/validation.d.ts +56 -1
- package/dist/pricing/validation.d.ts.map +1 -1
- package/dist/pricing/validation.js +61 -0
- package/dist/pricing/validation.js.map +1 -1
- package/dist/redirects/index.d.ts +1 -0
- package/dist/redirects/index.d.ts.map +1 -1
- package/dist/redirects/index.js +1 -0
- package/dist/redirects/index.js.map +1 -1
- package/dist/redirects/store.d.ts +20 -0
- package/dist/redirects/store.d.ts.map +1 -1
- package/dist/redirects/store.js +57 -0
- package/dist/redirects/store.js.map +1 -1
- package/dist/redirects/types.d.ts +24 -0
- package/dist/redirects/types.d.ts.map +1 -1
- package/dist/redirects/types.js +1 -0
- package/dist/redirects/types.js.map +1 -1
- package/dist/revalidation/event-plan.d.ts +48 -0
- package/dist/revalidation/event-plan.d.ts.map +1 -1
- package/dist/revalidation/event-plan.js +61 -0
- package/dist/revalidation/event-plan.js.map +1 -1
- package/dist/revalidation/event-verify.d.ts +25 -0
- package/dist/revalidation/event-verify.d.ts.map +1 -1
- package/dist/revalidation/event-verify.js +27 -0
- package/dist/revalidation/event-verify.js.map +1 -1
- package/dist/revalidation/types.d.ts +20 -0
- package/dist/revalidation/types.d.ts.map +1 -1
- package/dist/revalidation/types.js +10 -0
- package/dist/revalidation/types.js.map +1 -1
- package/dist/revalidation/url-context.d.ts +25 -0
- package/dist/revalidation/url-context.d.ts.map +1 -1
- package/dist/revalidation/url-context.js +17 -0
- package/dist/revalidation/url-context.js.map +1 -1
- package/dist/revalidation/verify.d.ts +8 -0
- package/dist/revalidation/verify.d.ts.map +1 -1
- package/dist/revalidation/verify.js +8 -0
- package/dist/revalidation/verify.js.map +1 -1
- package/dist/seo/ai.d.ts +17 -0
- package/dist/seo/ai.d.ts.map +1 -1
- package/dist/seo/ai.js +12 -0
- package/dist/seo/ai.js.map +1 -1
- package/dist/seo/alternates.js +13 -0
- package/dist/seo/alternates.js.map +1 -1
- package/dist/seo/artifacts.d.ts +13 -0
- package/dist/seo/artifacts.d.ts.map +1 -1
- package/dist/seo/artifacts.js +19 -0
- package/dist/seo/artifacts.js.map +1 -1
- package/dist/seo/canonical.d.ts +15 -0
- package/dist/seo/canonical.d.ts.map +1 -1
- package/dist/seo/canonical.js +24 -0
- package/dist/seo/canonical.js.map +1 -1
- package/dist/seo/index.js +6 -0
- package/dist/seo/index.js.map +1 -1
- package/dist/seo/json-ld.d.ts +13 -0
- package/dist/seo/json-ld.d.ts.map +1 -1
- package/dist/seo/json-ld.js +32 -0
- package/dist/seo/json-ld.js.map +1 -1
- package/dist/seo/locale-tag.d.ts +31 -0
- package/dist/seo/locale-tag.d.ts.map +1 -1
- package/dist/seo/locale-tag.js +31 -0
- package/dist/seo/locale-tag.js.map +1 -1
- package/dist/seo/meta-tags.d.ts +29 -0
- package/dist/seo/meta-tags.d.ts.map +1 -1
- package/dist/seo/meta-tags.js +28 -0
- package/dist/seo/meta-tags.js.map +1 -1
- package/dist/seo/metadata-parser.d.ts +24 -0
- package/dist/seo/metadata-parser.d.ts.map +1 -1
- package/dist/seo/metadata-parser.js +38 -0
- package/dist/seo/metadata-parser.js.map +1 -1
- package/dist/seo/metadata-types.d.ts +16 -0
- package/dist/seo/metadata-types.d.ts.map +1 -1
- package/dist/seo/product-path.d.ts +96 -0
- package/dist/seo/product-path.d.ts.map +1 -1
- package/dist/seo/product-path.js +96 -0
- package/dist/seo/product-path.js.map +1 -1
- package/dist/seo/robots.d.ts +17 -0
- package/dist/seo/robots.d.ts.map +1 -1
- package/dist/seo/robots.js +12 -0
- package/dist/seo/robots.js.map +1 -1
- package/dist/seo/types.d.ts +39 -0
- package/dist/seo/types.d.ts.map +1 -1
- package/dist/seo/url-builder.d.ts +31 -0
- package/dist/seo/url-builder.d.ts.map +1 -1
- package/dist/seo/url-builder.js +36 -0
- package/dist/seo/url-builder.js.map +1 -1
- package/dist/types.d.ts +1163 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../src/commerce/queries.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../src/commerce/queries.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,WAAW,isFA0DvB,CAAC;AAEF,eAAO,MAAM,iBAAiB,2rFA0D7B,CAAC;AAEF,eAAO,MAAM,aAAa,itCAiCzB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,eAAO,MAAM,kBAAkB,ugCA6B9B,CAAC;AAEF,eAAO,MAAM,WAAW,wJAUvB,CAAC;AAIF,eAAO,MAAM,gBAAgB,0aAgB5B,CAAC;AAuDF,eAAO,MAAM,cAAc,qhDAI1B,CAAC;AAEF,eAAO,MAAM,oBAAoB,+gDAIhC,CAAC;AAIF,eAAO,MAAM,eAAe,ijBAgB3B,CAAC;AA8JF,eAAO,MAAM,YAAY,8sCAIxB,CAAC;A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AAO,MAAM,iBAAiB,6PAM7B,CAAC;AAEF,eAAO,MAAM,eAAe,yPAM3B,CAAC;AAEF,eAAO,MAAM,mBAAmB,iNAM/B,CAAC;AAwDF,eAAO,MAAM,SAAS,QAAiC,CAAC;AACxD,eAAO,MAAM,gBAAgB,QAAwC,CAAC;AAEtE,eAAO,MAAM,QAAQ,QAAgC,CAAC;AACtD,eAAO,MAAM,eAAe,QAAuC,CAAC;AAEpE,eAAO,MAAM,oBAAoB,QAA2C,CAAC;AAC7E,eAAO,MAAM,2BAA2B,QAAkD,CAAC;AAE3F,eAAO,MAAM,YAAY,ouCAIxB,CAAC;AAEF,eAAO,MAAM,eAAe,QAAsC,CAAC;AACnE,eAAO,MAAM,sBAAsB,QAA6C,CAAC;AAEjF;;;;GAIG;AACH,eAAO,MAAM,YAAY,kcA4BxB,CAAC;AAIF,eAAO,MAAM,gCAAgC,uPAW5C,CAAC;AAIF,eAAO,MAAM,iBAAiB,qMAM7B,CAAC;AAEF,eAAO,MAAM,cAAc,4IAM1B,CAAC;AAwBF,eAAO,MAAM,UAAU,8kBAOtB,CAAC;AAEF,eAAO,MAAM,SAAS,wfAIrB,CAAC;AAEF,eAAO,MAAM,cAAc,k0BAgB1B,CAAC;AAEF,eAAO,MAAM,gBAAgB,ugBAI5B,CAAC;AAEF,eAAO,MAAM,0BAA0B,oWAWtC,CAAC"}
|
package/dist/commerce/queries.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
// --- Product Queries ---
|
|
2
|
+
/**
|
|
3
|
+
* Fragment for `Product.metadata` (vendure-plugin-product-metadata). The
|
|
4
|
+
* server already picks the active-language translation and composes
|
|
5
|
+
* `metaRobots` + `resolvedBotDirectives` — the SDK only needs to validate +
|
|
6
|
+
* type-narrow the JSON-scalar fields at the boundary.
|
|
7
|
+
*/
|
|
1
8
|
const PRODUCT_METADATA_FRAGMENT = `
|
|
2
9
|
metadata {
|
|
3
10
|
seoTitle seoDescription canonicalUrl
|
|
@@ -51,6 +58,7 @@ export const GET_PRODUCT = `
|
|
|
51
58
|
price priceWithTax currencyCode stockLevel
|
|
52
59
|
stockOnHand stockAllocated saleable
|
|
53
60
|
incomingStock projectedSaleable nextExpectedArrival
|
|
61
|
+
backorderAllowance
|
|
54
62
|
priceListName retailPrice retailPriceWithTax taxRateApplied { value }
|
|
55
63
|
priceTiers { minQuantity price priceWithTax discountLabel }
|
|
56
64
|
availabilityByLocation { locationId locationName inStock }
|
|
@@ -109,6 +117,7 @@ export const GET_PRODUCT_BY_ID = `
|
|
|
109
117
|
price priceWithTax currencyCode stockLevel
|
|
110
118
|
stockOnHand stockAllocated saleable
|
|
111
119
|
incomingStock projectedSaleable nextExpectedArrival
|
|
120
|
+
backorderAllowance
|
|
112
121
|
priceListName retailPrice retailPriceWithTax taxRateApplied { value }
|
|
113
122
|
priceTiers { minQuantity price priceWithTax discountLabel }
|
|
114
123
|
availabilityByLocation { locationId locationName inStock }
|
|
@@ -156,6 +165,7 @@ export const LIST_PRODUCTS = `
|
|
|
156
165
|
price priceWithTax currencyCode stockLevel
|
|
157
166
|
stockOnHand stockAllocated saleable
|
|
158
167
|
incomingStock projectedSaleable nextExpectedArrival
|
|
168
|
+
backorderAllowance
|
|
159
169
|
priceListName retailPrice retailPriceWithTax taxRateApplied { value }
|
|
160
170
|
priceTiers { minQuantity price priceWithTax discountLabel }
|
|
161
171
|
availabilityByLocation { locationId locationName inStock }
|
|
@@ -174,6 +184,56 @@ export const LIST_PRODUCTS = `
|
|
|
174
184
|
}
|
|
175
185
|
}
|
|
176
186
|
`;
|
|
187
|
+
/**
|
|
188
|
+
* The card selection: what a product GRID tile renders, and nothing else.
|
|
189
|
+
*
|
|
190
|
+
* `LIST_PRODUCTS` above asks for detail-page data on every row. The costly part
|
|
191
|
+
* is NOT the byte count — it is the per-product and per-VARIANT field resolvers
|
|
192
|
+
* behind it, which turn one listing request into four figures of SQL statements.
|
|
193
|
+
*
|
|
194
|
+
* Dropped here, and why each is safe for a tile:
|
|
195
|
+
* - `availabilityByLocation` — one `stock_level` query PER VARIANT
|
|
196
|
+
* (vendure-plugin-stock-transfer); per-warehouse availability is a
|
|
197
|
+
* detail-page concern.
|
|
198
|
+
* - `stockOnHand` / `stockAllocated` — raw operational numbers a tile never
|
|
199
|
+
* shows, and another read per variant.
|
|
200
|
+
* - `incomingStock` / `projectedSaleable` / `nextExpectedArrival` — restock
|
|
201
|
+
* data, gated to B2B customer groups and only rendered on a detail page.
|
|
202
|
+
* - `description`, including the per-language copy inside `translations` —
|
|
203
|
+
* the single biggest contributor to the payload, and nothing a tile shows.
|
|
204
|
+
*
|
|
205
|
+
* KEPT, each for a concrete reason — do not "tidy" these away:
|
|
206
|
+
* - `saleable` + `backorderAllowance` + `enabled` — storefronts gate
|
|
207
|
+
* orderability on `saleable == null || saleable > 0 || backorderAllowance > 0`;
|
|
208
|
+
* dropping them changes which products look buyable. `backorderAllowance`
|
|
209
|
+
* is not free on a tenant that enabled backorders: for a signed-in buyer
|
|
210
|
+
* whose group may backorder, an `incoming` or `limited` variant costs an
|
|
211
|
+
* incoming-stock read and a ledger read per variant (a `deny` variant —
|
|
212
|
+
* the default everywhere — and an anonymous visitor cost neither). A grid
|
|
213
|
+
* that must not label a backorderable SKU "out of stock" pays that either
|
|
214
|
+
* way: asking for it in a second document would cost the same.
|
|
215
|
+
* - The whole `collections { … parent … translations … customFields }` block
|
|
216
|
+
* and `translations { languageCode name slug }` — `pickCanonicalRoot` /
|
|
217
|
+
* `isUserFacingRoot` (src/seo) derive a product's canonical URL from
|
|
218
|
+
* `customFields.isCanonical` + `parent.slug` + `position`, and its localized
|
|
219
|
+
* slug from the translations. A card row still satisfies `ProductForSeo`
|
|
220
|
+
* structurally, so omitting these does not fail to compile — it silently
|
|
221
|
+
* hands every product the FLAT path. Note these cost bytes, not queries:
|
|
222
|
+
* Vendure resolves `Product.collections` in one query per product whichever
|
|
223
|
+
* subfields are asked for.
|
|
224
|
+
* - `priceTiers` — the SDK's own `getPriceDisplay()` reads
|
|
225
|
+
* `variant.priceTiers?.length ? … : null`, so an ABSENT ladder is
|
|
226
|
+
* indistinguishable from "this variant has no tiers": a tile would quietly
|
|
227
|
+
* show the base price while the detail page and the cart show the tier
|
|
228
|
+
* price. It is also free of DB cost — the price-list plugin resolves tiers
|
|
229
|
+
* from an in-memory map filled during price application, not a query.
|
|
230
|
+
* - `sku`, `priceListName`, `retailPrice(WithTax)`, variant `customFields`
|
|
231
|
+
* (purchase constraints shown as "per 6") and `facetValues` (tiles derive
|
|
232
|
+
* producer/vintage/volume and filter tags from them).
|
|
233
|
+
*
|
|
234
|
+
* Reached with `getProducts(..., { detail: 'card' })`. The default stays
|
|
235
|
+
* `LIST_PRODUCTS`, so no existing caller changes behaviour.
|
|
236
|
+
*/
|
|
177
237
|
export const LIST_PRODUCT_CARDS = `
|
|
178
238
|
query ListProductCards($options: ProductListOptions) {
|
|
179
239
|
products(options: $options) {
|
|
@@ -186,7 +246,7 @@ export const LIST_PRODUCT_CARDS = `
|
|
|
186
246
|
}
|
|
187
247
|
variants {
|
|
188
248
|
id name sku
|
|
189
|
-
price priceWithTax currencyCode stockLevel saleable
|
|
249
|
+
price priceWithTax currencyCode stockLevel saleable backorderAllowance
|
|
190
250
|
priceListName retailPrice retailPriceWithTax taxRateApplied { value }
|
|
191
251
|
priceTiers { minQuantity price priceWithTax discountLabel }
|
|
192
252
|
customFields { minOrderQuantity salesUnit position }
|
|
@@ -215,6 +275,7 @@ export const LIST_FACETS = `
|
|
|
215
275
|
}
|
|
216
276
|
}
|
|
217
277
|
`;
|
|
278
|
+
// --- Collection Queries ---
|
|
218
279
|
export const LIST_COLLECTIONS = `
|
|
219
280
|
query ListCollections($options: CollectionListOptions) {
|
|
220
281
|
collections(options: $options) {
|
|
@@ -232,6 +293,7 @@ export const LIST_COLLECTIONS = `
|
|
|
232
293
|
}
|
|
233
294
|
}
|
|
234
295
|
`;
|
|
296
|
+
/** The collection-detail selection, shared by the slug and the id lookup. */
|
|
235
297
|
const COLLECTION_DETAIL_FIELDS = `
|
|
236
298
|
id name slug description position
|
|
237
299
|
featuredAsset {
|
|
@@ -274,6 +336,7 @@ const COLLECTION_DETAIL_FIELDS = `
|
|
|
274
336
|
price priceWithTax currencyCode stockLevel
|
|
275
337
|
stockOnHand stockAllocated saleable
|
|
276
338
|
incomingStock projectedSaleable nextExpectedArrival
|
|
339
|
+
backorderAllowance
|
|
277
340
|
priceListName retailPrice retailPriceWithTax taxRateApplied { value }
|
|
278
341
|
priceTiers { minQuantity price priceWithTax discountLabel }
|
|
279
342
|
availabilityByLocation { locationId locationName inStock }
|
|
@@ -292,6 +355,7 @@ export const GET_COLLECTION_BY_ID = `
|
|
|
292
355
|
collection(id: $id) {${COLLECTION_DETAIL_FIELDS} }
|
|
293
356
|
}
|
|
294
357
|
`;
|
|
358
|
+
// --- Search Query ---
|
|
295
359
|
export const SEARCH_PRODUCTS = `
|
|
296
360
|
query SearchProducts($input: SearchInput!) {
|
|
297
361
|
search(input: $input) {
|
|
@@ -309,6 +373,10 @@ export const SEARCH_PRODUCTS = `
|
|
|
309
373
|
}
|
|
310
374
|
}
|
|
311
375
|
`;
|
|
376
|
+
// --- Cart Mutations ---
|
|
377
|
+
// Shared selection set for full Order objects. Used by ACTIVE_ORDER, ADD_TO_CART,
|
|
378
|
+
// ADJUST_ORDER_LINE, REMOVE_ORDER_LINE, APPLY_COUPON, REMOVE_COUPON, ORDER_BY_CODE.
|
|
379
|
+
// Keep in one place so adding fields (e.g. discounts) lands everywhere consistently.
|
|
312
380
|
const ORDER_FIELDS = `
|
|
313
381
|
id code state active
|
|
314
382
|
createdAt orderPlacedAt
|
|
@@ -324,7 +392,7 @@ const ORDER_FIELDS = `
|
|
|
324
392
|
discountedLinePrice discountedLinePriceWithTax
|
|
325
393
|
discounts { adjustmentSource type description amount amountWithTax }
|
|
326
394
|
productVariant {
|
|
327
|
-
id name sku
|
|
395
|
+
id name sku saleable
|
|
328
396
|
product { id name slug }
|
|
329
397
|
options { id name group { name } }
|
|
330
398
|
}
|
|
@@ -340,6 +408,19 @@ const ORDER_FIELDS = `
|
|
|
340
408
|
customer { id firstName lastName emailAddress }
|
|
341
409
|
couponCodes
|
|
342
410
|
`;
|
|
411
|
+
/**
|
|
412
|
+
* Fulfillment/tracking selection for placed orders. Kept out of ORDER_FIELDS
|
|
413
|
+
* so cart mutations don't pay for it — active carts have no fulfillments.
|
|
414
|
+
* `trackingCode` feeds `trackShipment(barcode, postalCode)`.
|
|
415
|
+
*
|
|
416
|
+
* `externalShipments` is the carrier-agnostic list pushed by an external
|
|
417
|
+
* fulfilment system, and is the right thing to render for tracking: one
|
|
418
|
+
* fulfilment can cover SEVERAL parcels, which a single `trackingCode` cannot
|
|
419
|
+
* express. Render `reference` as a link when `isLink` is true and as a text block
|
|
420
|
+
* otherwise — a pallet carrier's reference or ex-works pickup instructions are
|
|
421
|
+
* prose, not URLs. The flag is derived server-side so the storefront never has
|
|
422
|
+
* to guess.
|
|
423
|
+
*/
|
|
343
424
|
const ORDER_FULFILLMENTS_FRAGMENT = `
|
|
344
425
|
fulfillments {
|
|
345
426
|
id state method trackingCode createdAt updatedAt
|
|
@@ -349,6 +430,7 @@ const ORDER_FULFILLMENTS_FRAGMENT = `
|
|
|
349
430
|
carrier reference isLink shippedAt deliveryNumber
|
|
350
431
|
}
|
|
351
432
|
`;
|
|
433
|
+
/** Immutable payment condition captured when a placed order was accepted. */
|
|
352
434
|
const ORDER_PAYMENT_TERMS_FRAGMENT = `
|
|
353
435
|
paymentTerms {
|
|
354
436
|
source managedExternally status
|
|
@@ -359,6 +441,7 @@ const ORDER_PAYMENT_TERMS_FRAGMENT = `
|
|
|
359
441
|
resolvedAt remoteConditionCode remoteConfirmedAt remoteMismatch
|
|
360
442
|
}
|
|
361
443
|
`;
|
|
444
|
+
/** Immutable delivery terms captured when a placed order was accepted. */
|
|
362
445
|
const ORDER_DELIVERY_TERMS_FRAGMENT = `
|
|
363
446
|
deliveryTerms {
|
|
364
447
|
source managedExternally status shippingMethodStatus policyStatus summary selectionSource
|
|
@@ -373,6 +456,12 @@ const ORDER_DELIVERY_TERMS_FRAGMENT = `
|
|
|
373
456
|
remoteConfirmedAt remoteMismatch
|
|
374
457
|
}
|
|
375
458
|
`;
|
|
459
|
+
/**
|
|
460
|
+
* Order-history list-item selection (customer order history). Enriched beyond a
|
|
461
|
+
* bare line count so a storefront can render thumbnails + per-line totals
|
|
462
|
+
* without a follow-up fetch. Shared by GET_CURRENT_CUSTOMER and
|
|
463
|
+
* GET_CUSTOMER_ORDERS — both map to OrderSummary.
|
|
464
|
+
*/
|
|
376
465
|
const ORDER_SUMMARY_FIELDS = `
|
|
377
466
|
id code state total totalWithTax currencyCode createdAt
|
|
378
467
|
lines {
|
|
@@ -386,6 +475,16 @@ const ORDER_SUMMARY_FIELDS = `
|
|
|
386
475
|
${ORDER_PAYMENT_TERMS_FRAGMENT}
|
|
387
476
|
${ORDER_DELIVERY_TERMS_FRAGMENT}
|
|
388
477
|
`;
|
|
478
|
+
/**
|
|
479
|
+
* The structured half of a placement rejection, selected wherever the Shop API
|
|
480
|
+
* can answer one.
|
|
481
|
+
*
|
|
482
|
+
* Storefronts used to keyword-match `transitionError` — operator English that
|
|
483
|
+
* is re-worded per merchant and translated. `code` is the stable thing to
|
|
484
|
+
* branch on and `customerMessage` is safe to render as-is; the metadata fields
|
|
485
|
+
* are populated per code and null otherwise, so selecting all of them costs
|
|
486
|
+
* one flat response object and saves a second round of documents per feature.
|
|
487
|
+
*/
|
|
389
488
|
const PLACEMENT_FIELDS = `
|
|
390
489
|
code
|
|
391
490
|
customerMessage
|
|
@@ -408,6 +507,15 @@ const PLACEMENT_FIELDS = `
|
|
|
408
507
|
}
|
|
409
508
|
details { field code message }
|
|
410
509
|
`;
|
|
510
|
+
/**
|
|
511
|
+
* WHICH line an `InsufficientStockError` is about.
|
|
512
|
+
*
|
|
513
|
+
* Core answers `quantityAvailable` and the whole order, which is not enough to
|
|
514
|
+
* mark a row: with several lines in flight the shopper is told "not enough
|
|
515
|
+
* stock" about nothing in particular. Every field is nullable and best-effort
|
|
516
|
+
* — an error raised outside the overridden cart mutations answers null to all
|
|
517
|
+
* of them. `inputIndex` is only ever non-null inside `addItemsToOrder`.
|
|
518
|
+
*/
|
|
411
519
|
const INSUFFICIENT_STOCK_FIELDS = `
|
|
412
520
|
errorCode message quantityAvailable
|
|
413
521
|
productVariantId orderLineId sku productName productVariantName
|
|
@@ -471,6 +579,11 @@ export const REMOVE_ALL_ORDER_LINES = `
|
|
|
471
579
|
}
|
|
472
580
|
}
|
|
473
581
|
`;
|
|
582
|
+
/**
|
|
583
|
+
* Bulk add (favourite-box bundles). `addItemsToOrder` returns
|
|
584
|
+
* UpdateMultipleOrderItemsResult: a single resulting Order plus a per-input
|
|
585
|
+
* `errorResults` list — partial success is possible, so surface both.
|
|
586
|
+
*/
|
|
474
587
|
export const ADD_ITEMS_TO_CART = `
|
|
475
588
|
mutation AddItemsToCart($inputs: [AddItemInput!]!) {
|
|
476
589
|
addItemsToOrder(inputs: $inputs) {
|
|
@@ -485,6 +598,7 @@ export const ADD_ITEMS_TO_CART = `
|
|
|
485
598
|
}
|
|
486
599
|
}
|
|
487
600
|
`;
|
|
601
|
+
// --- Checkout Mutations ---
|
|
488
602
|
export const SET_CUSTOMER = `
|
|
489
603
|
mutation SetCustomer($input: CreateCustomerInput!) {
|
|
490
604
|
setCustomerForOrder(input: $input) {
|
|
@@ -569,6 +683,23 @@ export const TRANSITION_TO_ARRANGING_PAYMENT = `
|
|
|
569
683
|
}
|
|
570
684
|
}
|
|
571
685
|
`;
|
|
686
|
+
/**
|
|
687
|
+
* Record how the buyer intends to pay AND re-price the order in one round trip.
|
|
688
|
+
*
|
|
689
|
+
* The re-price is the reason this is a mutation of its own rather than a
|
|
690
|
+
* `setOrderCustomFields` call: the engine only applies promotions that key on
|
|
691
|
+
* the intent when the order is recalculated, and `setOrderCustomFields` does not
|
|
692
|
+
* recalculate. The returned Order is therefore already the one to render —
|
|
693
|
+
* `discounts`, `promotions` and `totalWithTax` include (or no longer include)
|
|
694
|
+
* the pay-now discount.
|
|
695
|
+
*
|
|
696
|
+
* `customFields { paymentIntent }` is selected HERE and nowhere else, and that
|
|
697
|
+
* is deliberate. Putting it in the shared `ORDER_FIELDS` would make every order
|
|
698
|
+
* query and cart mutation in this client fail GraphQL validation against an
|
|
699
|
+
* engine that predates the field — one missing feature would take the whole cart
|
|
700
|
+
* down. Confined to this document, only the call that needs the field is
|
|
701
|
+
* coupled to an engine that has it.
|
|
702
|
+
*/
|
|
572
703
|
export const SET_PAYMENT_INTENT = `
|
|
573
704
|
mutation SetOrderPaymentIntent($intent: OrderPaymentIntent!) {
|
|
574
705
|
setOrderPaymentIntent(intent: $intent) {
|
|
@@ -606,6 +737,7 @@ export const ADD_PAYMENT = `
|
|
|
606
737
|
}
|
|
607
738
|
}
|
|
608
739
|
`;
|
|
740
|
+
// --- Carrier-agnostic pickup locations (vendure-plugin-myparcel Phase 6) ---
|
|
609
741
|
const PICKUP_LOCATION_FIELDS = `
|
|
610
742
|
provider
|
|
611
743
|
carrier
|
|
@@ -654,11 +786,13 @@ export const SET_ACTIVE_ORDER_PICKUP_LOCATION = `
|
|
|
654
786
|
}
|
|
655
787
|
}
|
|
656
788
|
`;
|
|
789
|
+
// --- Stripe (@vendure-community/stripe-plugin) ---
|
|
657
790
|
export const CREATE_STRIPE_PAYMENT_INTENT = `
|
|
658
791
|
mutation CreateStripePaymentIntent {
|
|
659
792
|
createStripePaymentIntent
|
|
660
793
|
}
|
|
661
794
|
`;
|
|
795
|
+
// --- Mollie (@vendure-community/mollie-plugin) ---
|
|
662
796
|
export const MOLLIE_PAYMENT_METHODS = `
|
|
663
797
|
query MolliePaymentMethods($input: MolliePaymentMethodsInput!) {
|
|
664
798
|
molliePaymentMethods(input: $input) {
|
|
@@ -700,6 +834,7 @@ export const SYNC_MOLLIE_PAYMENT_STATUS = `
|
|
|
700
834
|
}
|
|
701
835
|
}
|
|
702
836
|
`;
|
|
837
|
+
// --- Customer Queries/Mutations ---
|
|
703
838
|
export const LOGIN = `
|
|
704
839
|
mutation Login($email: String!, $password: String!) {
|
|
705
840
|
login(username: $email, password: $password) {
|
|
@@ -751,6 +886,7 @@ export const GET_CUSTOMER_ORDERS = `
|
|
|
751
886
|
orders(options: $options) {
|
|
752
887
|
items {
|
|
753
888
|
${ORDER_SUMMARY_FIELDS}
|
|
889
|
+
lines { id backorderedQuantity }
|
|
754
890
|
}
|
|
755
891
|
totalItems
|
|
756
892
|
}
|
|
@@ -762,6 +898,7 @@ export const LOGOUT = `
|
|
|
762
898
|
logout { success }
|
|
763
899
|
}
|
|
764
900
|
`;
|
|
901
|
+
// --- Customer Account Management ---
|
|
765
902
|
export const UPDATE_CUSTOMER = `
|
|
766
903
|
mutation UpdateCustomer($input: UpdateCustomerInput!) {
|
|
767
904
|
updateCustomer(input: $input) {
|
|
@@ -874,6 +1011,7 @@ export const REFRESH_VERIFICATION = `
|
|
|
874
1011
|
}
|
|
875
1012
|
}
|
|
876
1013
|
`;
|
|
1014
|
+
// --- Address Management ---
|
|
877
1015
|
export const CREATE_ADDRESS = `
|
|
878
1016
|
mutation CreateAddress($input: CreateAddressInput!) {
|
|
879
1017
|
createCustomerAddress(input: $input) {
|
|
@@ -899,6 +1037,7 @@ export const DELETE_ADDRESS = `
|
|
|
899
1037
|
}
|
|
900
1038
|
}
|
|
901
1039
|
`;
|
|
1040
|
+
// --- Utility Queries ---
|
|
902
1041
|
export const AVAILABLE_COUNTRIES = `
|
|
903
1042
|
query AvailableCountries {
|
|
904
1043
|
availableCountries {
|
|
@@ -906,16 +1045,27 @@ export const AVAILABLE_COUNTRIES = `
|
|
|
906
1045
|
}
|
|
907
1046
|
}
|
|
908
1047
|
`;
|
|
1048
|
+
/**
|
|
1049
|
+
* `lines { backorderedQuantity }` is selected HERE and on `GET_CUSTOMER_ORDERS`,
|
|
1050
|
+
* and nowhere else — the same rule `customFields { paymentIntent }` follows
|
|
1051
|
+
* below. In the shared `ORDER_FIELDS` fragment it would make every cart read
|
|
1052
|
+
* and mutation fail validation against an engine that predates the backorders
|
|
1053
|
+
* plugin, taking the whole cart down for a field a cart line never carries a
|
|
1054
|
+
* value for (the stamp is written at placement). GraphQL merges this `lines`
|
|
1055
|
+
* selection with the fragment's, so the line still comes back whole.
|
|
1056
|
+
*/
|
|
909
1057
|
export const ORDER_BY_CODE = `
|
|
910
1058
|
query OrderByCode($code: String!) {
|
|
911
1059
|
orderByCode(code: $code) {
|
|
912
1060
|
${ORDER_FIELDS}
|
|
1061
|
+
lines { id backorderedQuantity }
|
|
913
1062
|
${ORDER_FULFILLMENTS_FRAGMENT}
|
|
914
1063
|
${ORDER_PAYMENT_TERMS_FRAGMENT}
|
|
915
1064
|
${ORDER_DELIVERY_TERMS_FRAGMENT}
|
|
916
1065
|
}
|
|
917
1066
|
}
|
|
918
1067
|
`;
|
|
1068
|
+
// --- Favorites ---
|
|
919
1069
|
export const FAVORITE_VARIANT_IDS = `
|
|
920
1070
|
query FavoriteVariantIds {
|
|
921
1071
|
favoriteProductVariantIds
|
|
@@ -933,6 +1083,7 @@ export const MY_FAVORITES = `
|
|
|
933
1083
|
price priceWithTax currencyCode stockLevel
|
|
934
1084
|
stockOnHand stockAllocated saleable
|
|
935
1085
|
incomingStock projectedSaleable nextExpectedArrival
|
|
1086
|
+
backorderAllowance
|
|
936
1087
|
priceListName retailPrice retailPriceWithTax taxRateApplied { value }
|
|
937
1088
|
priceTiers { minQuantity price priceWithTax discountLabel }
|
|
938
1089
|
availabilityByLocation { locationId locationName inStock }
|
|
@@ -962,6 +1113,13 @@ export const REMOVE_FAVORITE = `
|
|
|
962
1113
|
removeFavorite(productVariantId: $productVariantId)
|
|
963
1114
|
}
|
|
964
1115
|
`;
|
|
1116
|
+
/**
|
|
1117
|
+
* Storefront-visible Channel customFields. Vendure's `ChannelCustomFields`
|
|
1118
|
+
* GraphQL type requires a sub-selection — querying `customFields` without
|
|
1119
|
+
* one returns 400. Keep this list aligned with `ChannelCustomFields`
|
|
1120
|
+
* in types.ts and the `public: true` Channel customFields configured on
|
|
1121
|
+
* the Vendure side.
|
|
1122
|
+
*/
|
|
965
1123
|
const CHANNEL_CUSTOM_FIELDS_FRAGMENT = `
|
|
966
1124
|
customFields {
|
|
967
1125
|
businessName businessDescription
|
|
@@ -992,6 +1150,7 @@ export const GET_ACTIVE_CHANNEL = `
|
|
|
992
1150
|
}
|
|
993
1151
|
}
|
|
994
1152
|
`;
|
|
1153
|
+
// --- Product Properties ---
|
|
995
1154
|
export const PROPERTY_GROUPS = `
|
|
996
1155
|
query PropertyGroups {
|
|
997
1156
|
productPropertyGroups {
|
|
@@ -1025,6 +1184,7 @@ export const PRODUCT_PROPERTIES = `
|
|
|
1025
1184
|
}
|
|
1026
1185
|
}
|
|
1027
1186
|
`;
|
|
1187
|
+
// --- Product Recommendations ---
|
|
1028
1188
|
export const GET_PRODUCT_RECOMMENDATIONS = `
|
|
1029
1189
|
query ProductRecommendations($productId: ID!, $groupSlug: String) {
|
|
1030
1190
|
productRecommendations(productId: $productId, groupSlug: $groupSlug) {
|
|
@@ -1042,6 +1202,7 @@ export const GET_PRODUCT_RECOMMENDATIONS = `
|
|
|
1042
1202
|
price priceWithTax currencyCode stockLevel
|
|
1043
1203
|
stockOnHand stockAllocated saleable
|
|
1044
1204
|
incomingStock projectedSaleable nextExpectedArrival
|
|
1205
|
+
backorderAllowance
|
|
1045
1206
|
priceListName retailPrice retailPriceWithTax taxRateApplied { value }
|
|
1046
1207
|
priceTiers { minQuantity price priceWithTax discountLabel }
|
|
1047
1208
|
availabilityByLocation { locationId locationName inStock }
|
|
@@ -1051,6 +1212,7 @@ export const GET_PRODUCT_RECOMMENDATIONS = `
|
|
|
1051
1212
|
}
|
|
1052
1213
|
}
|
|
1053
1214
|
`;
|
|
1215
|
+
// --- Exchange Rates ---
|
|
1054
1216
|
export const GET_EXCHANGE_RATES = `
|
|
1055
1217
|
query ExchangeRates {
|
|
1056
1218
|
exchangeRates {
|
|
@@ -1058,6 +1220,7 @@ export const GET_EXCHANGE_RATES = `
|
|
|
1058
1220
|
}
|
|
1059
1221
|
}
|
|
1060
1222
|
`;
|
|
1223
|
+
// Shared selection for the exchange-rates plugin's ConvertedAmount type.
|
|
1061
1224
|
const CONVERTED_AMOUNT_FIELDS = `
|
|
1062
1225
|
originalAmount originalCurrency convertedAmount targetCurrency rate rateDate
|
|
1063
1226
|
`;
|
|
@@ -1096,6 +1259,16 @@ export const CONVERT_TO_MULTIPLE = `
|
|
|
1096
1259
|
}
|
|
1097
1260
|
}
|
|
1098
1261
|
`;
|
|
1262
|
+
// --- B2B Quotes ---
|
|
1263
|
+
/**
|
|
1264
|
+
* Per-line tax + product identity. These fields reach the Shop API with the
|
|
1265
|
+
* `vendure-plugin-quotes` release that introduced them, and the SDK can be
|
|
1266
|
+
* upgraded before a tenant's Vendure is: an older server rejects the WHOLE
|
|
1267
|
+
* document at validation ("Cannot query field ..."), taking the quote page
|
|
1268
|
+
* down rather than dropping a column. So every quote document has a legacy
|
|
1269
|
+
* twin without them, and `createQuotesMethods` retries with it once — see
|
|
1270
|
+
* the fallback there. Keep the twins identical apart from this line.
|
|
1271
|
+
*/
|
|
1099
1272
|
const QUOTE_LINE_TAX_FIELDS = 'productName sku taxRate unitPriceWithTax lineTotal lineTotalWithTax';
|
|
1100
1273
|
const quoteFields = (lineTaxFields) => `
|
|
1101
1274
|
id code channelId customerId currencyCode status
|
|
@@ -1145,6 +1318,11 @@ export const ACCEPT_QUOTE = `
|
|
|
1145
1318
|
`;
|
|
1146
1319
|
export const CANCEL_MY_QUOTE = cancelMyQuoteDocument(QUOTE_FIELDS);
|
|
1147
1320
|
export const CANCEL_MY_QUOTE_LEGACY = cancelMyQuoteDocument(QUOTE_FIELDS_LEGACY);
|
|
1321
|
+
/**
|
|
1322
|
+
* Single-roundtrip branding query. activeChannel + fontResources (with
|
|
1323
|
+
* resolved file Assets) + brandingAssets for the channel-level logo, favicon,
|
|
1324
|
+
* and cover IDs already on ctx.channel.customFields.
|
|
1325
|
+
*/
|
|
1148
1326
|
export const GET_BRANDING = `
|
|
1149
1327
|
query GetBranding($ids: [ID!]!) {
|
|
1150
1328
|
activeChannel {
|
|
@@ -1174,6 +1352,7 @@ export const GET_BRANDING = `
|
|
|
1174
1352
|
}
|
|
1175
1353
|
}
|
|
1176
1354
|
`;
|
|
1355
|
+
// --- Order constraints (inline order-constraints plugin) ---
|
|
1177
1356
|
export const ACTIVE_CHANNEL_ORDER_CONSTRAINTS = `
|
|
1178
1357
|
query ActiveChannelOrderConstraints {
|
|
1179
1358
|
activeChannelOrderConstraints {
|
|
@@ -1186,6 +1365,7 @@ export const ACTIVE_CHANNEL_ORDER_CONSTRAINTS = `
|
|
|
1186
1365
|
}
|
|
1187
1366
|
}
|
|
1188
1367
|
`;
|
|
1368
|
+
// --- Customer invoices (vendure-plugin-order-documents shop surface) ---
|
|
1189
1369
|
export const MY_ORDER_INVOICES = `
|
|
1190
1370
|
query MyOrderInvoices($orderCode: String!) {
|
|
1191
1371
|
myOrderInvoices(orderCode: $orderCode) {
|
|
@@ -1200,6 +1380,12 @@ export const MY_INVOICE_PDF = `
|
|
|
1200
1380
|
}
|
|
1201
1381
|
}
|
|
1202
1382
|
`;
|
|
1383
|
+
// --- Order returns (vendure-plugin-returns shop surface) ---
|
|
1384
|
+
/**
|
|
1385
|
+
* Shared selection set for customer-facing OrderReturn objects. The Shop API
|
|
1386
|
+
* never exposes the admin-only fields (`adminNote`, `history`) — do not add
|
|
1387
|
+
* them here. Money values are Int minor units.
|
|
1388
|
+
*/
|
|
1203
1389
|
const RETURN_FIELDS = `
|
|
1204
1390
|
id code state
|
|
1205
1391
|
orderId orderCode currencyCode
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../../src/commerce/queries.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../../src/commerce/queries.ts"],"names":[],"mappings":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REATE_QUOTE_REQUEST, CREATE_QUOTE_REQUEST_LEGACY, MY_QUOTE, MY_QUOTE_LEGACY, MY_QUOTES, MY_QUOTES_LEGACY, } from './queries.js';
|
|
3
|
+
/**
|
|
4
|
+
* Whether a Shop API failure is "this Vendure does not know that field yet",
|
|
5
|
+
* as opposed to a transient failure that must not be papered over.
|
|
6
|
+
*
|
|
7
|
+
* Two spellings, because the message is not always preserved: graphql-js
|
|
8
|
+
* answers a validation rejection with HTTP 400, and the HTTP client turns any
|
|
9
|
+
* non-ok response into `Vendure Shop API returned 400` before it parses the
|
|
10
|
+
* body; when the body IS parsed, the message is graphql-js's standard
|
|
11
|
+
* `Cannot query field "x" on type "y"`. (Same two spellings the plugins
|
|
12
|
+
* service matches for its own compat fallback.)
|
|
13
|
+
*
|
|
14
|
+
* Everything else — a timeout, a 5xx from a rolling restart, a connection
|
|
15
|
+
* reset, a GraphQL error that is not a validation rejection — deliberately
|
|
16
|
+
* does NOT match: degrading on those would hide an outage behind silently
|
|
17
|
+
* missing fields.
|
|
18
|
+
*/
|
|
3
19
|
function isUnknownFieldRejection(error) {
|
|
4
20
|
if (!(error instanceof StorefrontError))
|
|
5
21
|
return false;
|
|
@@ -7,7 +23,22 @@ function isUnknownFieldRejection(error) {
|
|
|
7
23
|
/Cannot query field/i.test(error.message));
|
|
8
24
|
}
|
|
9
25
|
export function createQuotesMethods(http) {
|
|
26
|
+
/**
|
|
27
|
+
* Latched once a server has proved it predates the per-line tax + identity
|
|
28
|
+
* fields, so the downgrade costs one rejected request per client instance
|
|
29
|
+
* rather than one per call. Never un-latches: a client is short-lived
|
|
30
|
+
* relative to a deploy, and re-probing every call would put a guaranteed
|
|
31
|
+
* failure in front of every quote page.
|
|
32
|
+
*/
|
|
10
33
|
let quoteFieldsUnsupported = false;
|
|
34
|
+
/**
|
|
35
|
+
* Send `document`, and if this server rejects it for selecting a field it
|
|
36
|
+
* does not have, send `legacyDocument` instead — the same query without the
|
|
37
|
+
* six per-line tax/identity fields, which then arrive `undefined`.
|
|
38
|
+
*
|
|
39
|
+
* Safe for the mutations too: a document rejected at VALIDATION never
|
|
40
|
+
* executed, so nothing was created twice.
|
|
41
|
+
*/
|
|
11
42
|
async function withQuoteFieldFallback(document, legacyDocument, variables) {
|
|
12
43
|
if (quoteFieldsUnsupported)
|
|
13
44
|
return http.graphql(legacyDocument, variables);
|
|
@@ -18,6 +49,8 @@ export function createQuotesMethods(http) {
|
|
|
18
49
|
if (!isUnknownFieldRejection(error))
|
|
19
50
|
throw error;
|
|
20
51
|
const data = await http.graphql(legacyDocument, variables);
|
|
52
|
+
// Latch only once the legacy shape actually worked — if it fails the
|
|
53
|
+
// same way, the rejection was never about these fields.
|
|
21
54
|
quoteFieldsUnsupported = true;
|
|
22
55
|
return data;
|
|
23
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quotes.js","sourceRoot":"","sources":["../../src/commerce/quotes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAQ/C,OAAO,EACL,YAAY,EACZ,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,2BAA2B,EAC3B,QAAQ,EACR,eAAe,EACf,SAAS,EACT,gBAAgB,GACjB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"quotes.js","sourceRoot":"","sources":["../../src/commerce/quotes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAQ/C,OAAO,EACL,YAAY,EACZ,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,2BAA2B,EAC3B,QAAQ,EACR,eAAe,EACf,SAAS,EACT,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB;;;;;;;;;;;;;;;GAeG;AACH,SAAS,uBAAuB,CAAC,KAAc;IAC7C,IAAI,CAAC,CAAC,KAAK,YAAY,eAAe,CAAC;QAAE,OAAO,KAAK,CAAC;IACtD,OAAO,CACL,KAAK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D,MAAM,IAAI,GAAG,MAAM,sBAAsB,CACvC,oBAAoB,EACpB,2BAA2B,EAC3B,EAAE,KAAK,EAAE,CACV,CAAC;YACF,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,sBAAsB,CACvC,eAAe,EACf,sBAAsB,EACtB,EAAE,EAAE,EAAE,MAAM,EAAE,CACf,CAAC;YACF,OAAO,IAAI,CAAC,aAAa,CAAC;QAC5B,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { HttpClient } from '../core/http.js';
|
|
2
2
|
import type { SavedList } from '../types.js';
|
|
3
|
-
export declare const MY_SAVED_LISTS = "\n query MySavedLists {\n mySavedLists { \n id name createdAt updatedAt\n items {\n id productVariantId quantity position createdAt\n productVariant {\n id name sku\n price priceWithTax currencyCode stockLevel saleable\n incomingStock projectedSaleable nextExpectedArrival\n priceListName retailPrice retailPriceWithTax taxRateApplied { value }\n priceTiers { minQuantity price priceWithTax discountLabel }\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n product {\n id name slug\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n }\n options { id name group { name } }\n customFields { minOrderQuantity salesUnit position }\n }\n }\n }\n }\n";
|
|
4
|
-
export declare const MY_SAVED_LIST = "\n query MySavedList($id: ID!) {\n mySavedList(id: $id) { \n id name createdAt updatedAt\n items {\n id productVariantId quantity position createdAt\n productVariant {\n id name sku\n price priceWithTax currencyCode stockLevel saleable\n incomingStock projectedSaleable nextExpectedArrival\n priceListName retailPrice retailPriceWithTax taxRateApplied { value }\n priceTiers { minQuantity price priceWithTax discountLabel }\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n product {\n id name slug\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n }\n options { id name group { name } }\n customFields { minOrderQuantity salesUnit position }\n }\n }\n }\n }\n";
|
|
5
|
-
export declare const CREATE_SAVED_LIST = "\n mutation CreateSavedList($name: String!) {\n createSavedList(name: $name) { \n id name createdAt updatedAt\n items {\n id productVariantId quantity position createdAt\n productVariant {\n id name sku\n price priceWithTax currencyCode stockLevel saleable\n incomingStock projectedSaleable nextExpectedArrival\n priceListName retailPrice retailPriceWithTax taxRateApplied { value }\n priceTiers { minQuantity price priceWithTax discountLabel }\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n product {\n id name slug\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n }\n options { id name group { name } }\n customFields { minOrderQuantity salesUnit position }\n }\n }\n }\n }\n";
|
|
6
|
-
export declare const RENAME_SAVED_LIST = "\n mutation RenameSavedList($id: ID!, $name: String!) {\n renameSavedList(id: $id, name: $name) { \n id name createdAt updatedAt\n items {\n id productVariantId quantity position createdAt\n productVariant {\n id name sku\n price priceWithTax currencyCode stockLevel saleable\n incomingStock projectedSaleable nextExpectedArrival\n priceListName retailPrice retailPriceWithTax taxRateApplied { value }\n priceTiers { minQuantity price priceWithTax discountLabel }\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n product {\n id name slug\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n }\n options { id name group { name } }\n customFields { minOrderQuantity salesUnit position }\n }\n }\n }\n }\n";
|
|
3
|
+
export declare const MY_SAVED_LISTS = "\n query MySavedLists {\n mySavedLists { \n id name createdAt updatedAt\n items {\n id productVariantId quantity position createdAt\n productVariant {\n id name sku\n price priceWithTax currencyCode stockLevel saleable backorderAllowance\n incomingStock projectedSaleable nextExpectedArrival\n priceListName retailPrice retailPriceWithTax taxRateApplied { value }\n priceTiers { minQuantity price priceWithTax discountLabel }\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n product {\n id name slug\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n }\n options { id name group { name } }\n customFields { minOrderQuantity salesUnit position }\n }\n }\n }\n }\n";
|
|
4
|
+
export declare const MY_SAVED_LIST = "\n query MySavedList($id: ID!) {\n mySavedList(id: $id) { \n id name createdAt updatedAt\n items {\n id productVariantId quantity position createdAt\n productVariant {\n id name sku\n price priceWithTax currencyCode stockLevel saleable backorderAllowance\n incomingStock projectedSaleable nextExpectedArrival\n priceListName retailPrice retailPriceWithTax taxRateApplied { value }\n priceTiers { minQuantity price priceWithTax discountLabel }\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n product {\n id name slug\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n }\n options { id name group { name } }\n customFields { minOrderQuantity salesUnit position }\n }\n }\n }\n }\n";
|
|
5
|
+
export declare const CREATE_SAVED_LIST = "\n mutation CreateSavedList($name: String!) {\n createSavedList(name: $name) { \n id name createdAt updatedAt\n items {\n id productVariantId quantity position createdAt\n productVariant {\n id name sku\n price priceWithTax currencyCode stockLevel saleable backorderAllowance\n incomingStock projectedSaleable nextExpectedArrival\n priceListName retailPrice retailPriceWithTax taxRateApplied { value }\n priceTiers { minQuantity price priceWithTax discountLabel }\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n product {\n id name slug\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n }\n options { id name group { name } }\n customFields { minOrderQuantity salesUnit position }\n }\n }\n }\n }\n";
|
|
6
|
+
export declare const RENAME_SAVED_LIST = "\n mutation RenameSavedList($id: ID!, $name: String!) {\n renameSavedList(id: $id, name: $name) { \n id name createdAt updatedAt\n items {\n id productVariantId quantity position createdAt\n productVariant {\n id name sku\n price priceWithTax currencyCode stockLevel saleable backorderAllowance\n incomingStock projectedSaleable nextExpectedArrival\n priceListName retailPrice retailPriceWithTax taxRateApplied { value }\n priceTiers { minQuantity price priceWithTax discountLabel }\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n product {\n id name slug\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n }\n options { id name group { name } }\n customFields { minOrderQuantity salesUnit position }\n }\n }\n }\n }\n";
|
|
7
7
|
export declare const DELETE_SAVED_LIST = "\n mutation DeleteSavedList($id: ID!) {\n deleteSavedList(id: $id)\n }\n";
|
|
8
|
-
export declare const ADD_ITEM_TO_SAVED_LIST = "\n mutation AddItemToSavedList($listId: ID!, $variantId: ID!, $quantity: Int!) {\n addItemToSavedList(listId: $listId, variantId: $variantId, quantity: $quantity) { \n id name createdAt updatedAt\n items {\n id productVariantId quantity position createdAt\n productVariant {\n id name sku\n price priceWithTax currencyCode stockLevel saleable\n incomingStock projectedSaleable nextExpectedArrival\n priceListName retailPrice retailPriceWithTax taxRateApplied { value }\n priceTiers { minQuantity price priceWithTax discountLabel }\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n product {\n id name slug\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n }\n options { id name group { name } }\n customFields { minOrderQuantity salesUnit position }\n }\n }\n }\n }\n";
|
|
9
|
-
export declare const UPDATE_SAVED_LIST_ITEM = "\n mutation UpdateSavedListItem($listId: ID!, $variantId: ID!, $quantity: Int!) {\n updateSavedListItem(listId: $listId, variantId: $variantId, quantity: $quantity) { \n id name createdAt updatedAt\n items {\n id productVariantId quantity position createdAt\n productVariant {\n id name sku\n price priceWithTax currencyCode stockLevel saleable\n incomingStock projectedSaleable nextExpectedArrival\n priceListName retailPrice retailPriceWithTax taxRateApplied { value }\n priceTiers { minQuantity price priceWithTax discountLabel }\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n product {\n id name slug\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n }\n options { id name group { name } }\n customFields { minOrderQuantity salesUnit position }\n }\n }\n }\n }\n";
|
|
10
|
-
export declare const REMOVE_ITEM_FROM_SAVED_LIST = "\n mutation RemoveItemFromSavedList($listId: ID!, $variantId: ID!) {\n removeItemFromSavedList(listId: $listId, variantId: $variantId) { \n id name createdAt updatedAt\n items {\n id productVariantId quantity position createdAt\n productVariant {\n id name sku\n price priceWithTax currencyCode stockLevel saleable\n incomingStock projectedSaleable nextExpectedArrival\n priceListName retailPrice retailPriceWithTax taxRateApplied { value }\n priceTiers { minQuantity price priceWithTax discountLabel }\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n product {\n id name slug\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n }\n options { id name group { name } }\n customFields { minOrderQuantity salesUnit position }\n }\n }\n }\n }\n";
|
|
8
|
+
export declare const ADD_ITEM_TO_SAVED_LIST = "\n mutation AddItemToSavedList($listId: ID!, $variantId: ID!, $quantity: Int!) {\n addItemToSavedList(listId: $listId, variantId: $variantId, quantity: $quantity) { \n id name createdAt updatedAt\n items {\n id productVariantId quantity position createdAt\n productVariant {\n id name sku\n price priceWithTax currencyCode stockLevel saleable backorderAllowance\n incomingStock projectedSaleable nextExpectedArrival\n priceListName retailPrice retailPriceWithTax taxRateApplied { value }\n priceTiers { minQuantity price priceWithTax discountLabel }\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n product {\n id name slug\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n }\n options { id name group { name } }\n customFields { minOrderQuantity salesUnit position }\n }\n }\n }\n }\n";
|
|
9
|
+
export declare const UPDATE_SAVED_LIST_ITEM = "\n mutation UpdateSavedListItem($listId: ID!, $variantId: ID!, $quantity: Int!) {\n updateSavedListItem(listId: $listId, variantId: $variantId, quantity: $quantity) { \n id name createdAt updatedAt\n items {\n id productVariantId quantity position createdAt\n productVariant {\n id name sku\n price priceWithTax currencyCode stockLevel saleable backorderAllowance\n incomingStock projectedSaleable nextExpectedArrival\n priceListName retailPrice retailPriceWithTax taxRateApplied { value }\n priceTiers { minQuantity price priceWithTax discountLabel }\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n product {\n id name slug\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n }\n options { id name group { name } }\n customFields { minOrderQuantity salesUnit position }\n }\n }\n }\n }\n";
|
|
10
|
+
export declare const REMOVE_ITEM_FROM_SAVED_LIST = "\n mutation RemoveItemFromSavedList($listId: ID!, $variantId: ID!) {\n removeItemFromSavedList(listId: $listId, variantId: $variantId) { \n id name createdAt updatedAt\n items {\n id productVariantId quantity position createdAt\n productVariant {\n id name sku\n price priceWithTax currencyCode stockLevel saleable backorderAllowance\n incomingStock projectedSaleable nextExpectedArrival\n priceListName retailPrice retailPriceWithTax taxRateApplied { value }\n priceTiers { minQuantity price priceWithTax discountLabel }\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n product {\n id name slug\n featuredAsset {\n source\n presets { xs { url webpUrl } }\n }\n }\n options { id name group { name } }\n customFields { minOrderQuantity salesUnit position }\n }\n }\n }\n }\n";
|
|
11
11
|
export declare function createSavedListsMethods(http: HttpClient): {
|
|
12
12
|
getMySavedLists(): Promise<SavedList[]>;
|
|
13
13
|
getMySavedList(id: string): Promise<SavedList | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saved-lists.d.ts","sourceRoot":"","sources":["../../src/commerce/saved-lists.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AA6B7C,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"saved-lists.d.ts","sourceRoot":"","sources":["../../src/commerce/saved-lists.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AA6B7C,eAAO,MAAM,cAAc,wzBAI1B,CAAC;AAEF,eAAO,MAAM,aAAa,y0BAIzB,CAAC;AAEF,eAAO,MAAM,iBAAiB,81BAI7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,i3BAI7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,kFAI7B,CAAC;AAEF,eAAO,MAAM,sBAAsB,o7BAIlC,CAAC;AAEF,eAAO,MAAM,sBAAsB,s7BAIlC,CAAC;AAEF,eAAO,MAAM,2BAA2B,w5BAIvC,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,UAAU;uBAE3B,OAAO,CAAC,SAAS,EAAE,CAAC;uBAKpB,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;0BAK/B,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;wBAK7B,MAAM,QAAQ,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;wBAQzC,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;+BAMzC,MAAM,aACH,MAAM,YACP,MAAM,GACf,OAAO,CAAC,SAAS,CAAC;gCAUX,MAAM,aACH,MAAM,YACP,MAAM,GACf,OAAO,CAAC,SAAS,CAAC;oCASiB,MAAM,aAAa,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;EAQvF"}
|
|
@@ -4,7 +4,7 @@ const LIST_FIELDS = `
|
|
|
4
4
|
id productVariantId quantity position createdAt
|
|
5
5
|
productVariant {
|
|
6
6
|
id name sku
|
|
7
|
-
price priceWithTax currencyCode stockLevel saleable
|
|
7
|
+
price priceWithTax currencyCode stockLevel saleable backorderAllowance
|
|
8
8
|
incomingStock projectedSaleable nextExpectedArrival
|
|
9
9
|
priceListName retailPrice retailPriceWithTax taxRateApplied { value }
|
|
10
10
|
priceTiers { minQuantity price priceWithTax discountLabel }
|