@sixtyninecommerce/client 0.29.0 → 0.31.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 +556 -16
- package/dist/admin/http.d.ts.map +1 -1
- package/dist/admin/http.js.map +1 -1
- package/dist/admin/types.d.ts.map +1 -1
- package/dist/build-client.d.ts +9 -0
- package/dist/build-client.d.ts.map +1 -0
- package/dist/build-client.js +58 -0
- package/dist/build-client.js.map +1 -0
- package/dist/cache-tags.d.ts +35 -1
- package/dist/cache-tags.d.ts.map +1 -1
- package/dist/cache-tags.js +39 -1
- package/dist/cache-tags.js.map +1 -1
- package/dist/client.d.ts +25 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +9 -62
- package/dist/client.js.map +1 -1
- package/dist/commerce/age-verification.d.ts +7 -4
- package/dist/commerce/age-verification.d.ts.map +1 -1
- package/dist/commerce/age-verification.js +6 -4
- package/dist/commerce/age-verification.js.map +1 -1
- package/dist/commerce/arguments.d.ts +13 -0
- package/dist/commerce/arguments.d.ts.map +1 -0
- package/dist/commerce/arguments.js +19 -0
- package/dist/commerce/arguments.js.map +1 -0
- package/dist/commerce/branding.d.ts.map +1 -1
- package/dist/commerce/branding.js.map +1 -1
- package/dist/commerce/capabilities.d.ts +40 -0
- package/dist/commerce/capabilities.d.ts.map +1 -0
- package/dist/commerce/capabilities.js +41 -0
- package/dist/commerce/capabilities.js.map +1 -0
- package/dist/commerce/cart.d.ts +9 -12
- package/dist/commerce/cart.d.ts.map +1 -1
- package/dist/commerce/cart.js +6 -1
- package/dist/commerce/cart.js.map +1 -1
- package/dist/commerce/checkout.d.ts +95 -15
- package/dist/commerce/checkout.d.ts.map +1 -1
- package/dist/commerce/checkout.js +230 -10
- package/dist/commerce/checkout.js.map +1 -1
- package/dist/commerce/customer.d.ts +82 -38
- package/dist/commerce/customer.d.ts.map +1 -1
- package/dist/commerce/customer.js +146 -10
- package/dist/commerce/customer.js.map +1 -1
- package/dist/commerce/favorites.d.ts +2 -5
- package/dist/commerce/favorites.d.ts.map +1 -1
- package/dist/commerce/favorites.js.map +1 -1
- package/dist/commerce/index.d.ts +189 -133
- package/dist/commerce/index.d.ts.map +1 -1
- package/dist/commerce/index.js +9 -0
- package/dist/commerce/index.js.map +1 -1
- package/dist/commerce/order-states.d.ts +18 -0
- package/dist/commerce/order-states.d.ts.map +1 -0
- package/dist/commerce/order-states.js +30 -0
- package/dist/commerce/order-states.js.map +1 -0
- package/dist/commerce/parcel-pricing.d.ts +48 -0
- package/dist/commerce/parcel-pricing.d.ts.map +1 -0
- package/dist/commerce/parcel-pricing.js +39 -0
- package/dist/commerce/parcel-pricing.js.map +1 -0
- package/dist/commerce/parked-orders.d.ts +22 -0
- package/dist/commerce/parked-orders.d.ts.map +1 -0
- package/dist/commerce/parked-orders.js +47 -0
- package/dist/commerce/parked-orders.js.map +1 -0
- package/dist/commerce/payments.d.ts +12 -5
- package/dist/commerce/payments.d.ts.map +1 -1
- package/dist/commerce/payments.js +10 -1
- package/dist/commerce/payments.js.map +1 -1
- package/dist/commerce/placement-error.d.ts +17 -0
- package/dist/commerce/placement-error.d.ts.map +1 -1
- package/dist/commerce/placement-error.js.map +1 -1
- package/dist/commerce/products.d.ts +92 -38
- package/dist/commerce/products.d.ts.map +1 -1
- package/dist/commerce/products.js +162 -123
- package/dist/commerce/products.js.map +1 -1
- package/dist/commerce/queries.d.ts +204 -49
- package/dist/commerce/queries.d.ts.map +1 -1
- package/dist/commerce/queries.js +1296 -737
- package/dist/commerce/queries.js.map +1 -1
- package/dist/commerce/quotes.d.ts +5 -4
- package/dist/commerce/quotes.d.ts.map +1 -1
- package/dist/commerce/quotes.js +1 -36
- package/dist/commerce/quotes.js.map +1 -1
- package/dist/commerce/recommendations.d.ts +3 -3
- package/dist/commerce/recommendations.d.ts.map +1 -1
- package/dist/commerce/recommendations.js +3 -1
- package/dist/commerce/recommendations.js.map +1 -1
- package/dist/commerce/returns.d.ts +7 -6
- package/dist/commerce/returns.d.ts.map +1 -1
- package/dist/commerce/returns.js.map +1 -1
- package/dist/commerce/reviews.d.ts +24 -15
- package/dist/commerce/reviews.d.ts.map +1 -1
- package/dist/commerce/reviews.js +67 -50
- package/dist/commerce/reviews.js.map +1 -1
- package/dist/commerce/saved-lists.d.ts +15 -15
- package/dist/commerce/saved-lists.d.ts.map +1 -1
- package/dist/commerce/saved-lists.js +67 -55
- package/dist/commerce/saved-lists.js.map +1 -1
- package/dist/commerce/search.d.ts +3 -2
- package/dist/commerce/search.d.ts.map +1 -1
- package/dist/commerce/search.js +10 -2
- package/dist/commerce/search.js.map +1 -1
- package/dist/commerce/shipping.d.ts +11 -4
- package/dist/commerce/shipping.d.ts.map +1 -1
- package/dist/commerce/shipping.js +17 -2
- package/dist/commerce/shipping.js.map +1 -1
- package/dist/commerce/stock-notifications.d.ts +2 -0
- package/dist/commerce/stock-notifications.d.ts.map +1 -1
- package/dist/commerce/stock-notifications.js +2 -2
- package/dist/commerce/stock-notifications.js.map +1 -1
- package/dist/commerce/subscriptions.d.ts +35 -37
- package/dist/commerce/subscriptions.d.ts.map +1 -1
- package/dist/commerce/subscriptions.js +159 -120
- package/dist/commerce/subscriptions.js.map +1 -1
- package/dist/commerce/vat-validation.d.ts +6 -3
- package/dist/commerce/vat-validation.d.ts.map +1 -1
- package/dist/commerce/vat-validation.js +24 -19
- package/dist/commerce/vat-validation.js.map +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/content/assets.d.ts +5 -4
- package/dist/content/assets.d.ts.map +1 -1
- package/dist/content/assets.js.map +1 -1
- package/dist/content/collection-pages.d.ts +3 -2
- package/dist/content/collection-pages.d.ts.map +1 -1
- package/dist/content/collection-pages.js.map +1 -1
- package/dist/content/collections.d.ts +5 -4
- package/dist/content/collections.d.ts.map +1 -1
- package/dist/content/collections.js.map +1 -1
- package/dist/content/filtered-products.d.ts.map +1 -1
- package/dist/content/filtered-products.js.map +1 -1
- package/dist/content/form-field-types.d.ts +3 -3
- package/dist/content/form-field-types.d.ts.map +1 -1
- package/dist/content/form-field-types.js.map +1 -1
- package/dist/content/forms.d.ts +4 -3
- package/dist/content/forms.d.ts.map +1 -1
- package/dist/content/forms.js +3 -0
- package/dist/content/forms.js.map +1 -1
- package/dist/content/index.d.ts +18 -17
- package/dist/content/index.d.ts.map +1 -1
- package/dist/content/items.d.ts +5 -4
- package/dist/content/items.d.ts.map +1 -1
- package/dist/content/items.js +2 -0
- package/dist/content/items.js.map +1 -1
- package/dist/content/menus.d.ts +3 -2
- package/dist/content/menus.d.ts.map +1 -1
- package/dist/content/menus.js +7 -1
- package/dist/content/menus.js.map +1 -1
- package/dist/content/resolve.d.ts +3 -2
- package/dist/content/resolve.d.ts.map +1 -1
- package/dist/content/resolve.js +1 -1
- package/dist/content/resolve.js.map +1 -1
- package/dist/content/sitemap.d.ts +3 -2
- package/dist/content/sitemap.d.ts.map +1 -1
- package/dist/content/sitemap.js.map +1 -1
- package/dist/content/strings.d.ts +16 -2
- package/dist/content/strings.d.ts.map +1 -1
- package/dist/content/strings.js +32 -4
- package/dist/content/strings.js.map +1 -1
- package/dist/core/context.d.ts +127 -1
- package/dist/core/context.d.ts.map +1 -1
- package/dist/core/context.js +436 -45
- package/dist/core/context.js.map +1 -1
- package/dist/core/currency.d.ts +14 -0
- package/dist/core/currency.d.ts.map +1 -0
- package/dist/core/currency.js +52 -0
- package/dist/core/currency.js.map +1 -0
- package/dist/core/deprecation.d.ts +23 -0
- package/dist/core/deprecation.d.ts.map +1 -0
- package/dist/core/deprecation.js +81 -0
- package/dist/core/deprecation.js.map +1 -0
- package/dist/core/http.d.ts +15 -1
- package/dist/core/http.d.ts.map +1 -1
- package/dist/core/http.js +55 -3
- package/dist/core/http.js.map +1 -1
- package/dist/core/public-artifact.d.ts +72 -0
- package/dist/core/public-artifact.d.ts.map +1 -0
- package/dist/core/public-artifact.js +122 -0
- package/dist/core/public-artifact.js.map +1 -0
- package/dist/core/unknown-field-rejection.d.ts +18 -0
- package/dist/core/unknown-field-rejection.d.ts.map +1 -0
- package/dist/core/unknown-field-rejection.js +37 -0
- package/dist/core/unknown-field-rejection.js.map +1 -0
- package/dist/credit/credit-status.d.ts +2 -0
- package/dist/credit/credit-status.d.ts.map +1 -1
- package/dist/credit/credit-status.js +71 -19
- package/dist/credit/credit-status.js.map +1 -1
- package/dist/credit/index.d.ts +1 -1
- package/dist/credit/payment-terms.d.ts +3 -3
- package/dist/credit/payment-terms.d.ts.map +1 -1
- package/dist/credit/payment-terms.js +28 -24
- package/dist/credit/payment-terms.js.map +1 -1
- package/dist/currency/exchange.d.ts +7 -7
- package/dist/currency/exchange.d.ts.map +1 -1
- package/dist/currency/exchange.js +5 -1
- package/dist/currency/exchange.js.map +1 -1
- package/dist/errors.d.ts +17 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +13 -0
- package/dist/errors.js.map +1 -1
- package/dist/events/index.d.ts +20 -7
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +17 -5
- package/dist/events/index.js.map +1 -1
- package/dist/events/payloads.d.ts +7 -4
- package/dist/events/payloads.d.ts.map +1 -1
- package/dist/events/payloads.js +6 -3
- package/dist/events/payloads.js.map +1 -1
- package/dist/feeds/index.d.ts +5 -0
- package/dist/feeds/index.d.ts.map +1 -0
- package/dist/feeds/index.js +12 -0
- package/dist/feeds/index.js.map +1 -0
- package/dist/feeds/types.d.ts +18 -0
- package/dist/feeds/types.d.ts.map +1 -0
- package/dist/feeds/types.js +8 -0
- package/dist/feeds/types.js.map +1 -0
- package/dist/generated/cms.d.ts +2136 -0
- package/dist/generated/cms.d.ts.map +1 -0
- package/dist/generated/cms.js +4 -0
- package/dist/generated/cms.js.map +1 -0
- package/dist/generated/plugins.d.ts +550 -0
- package/dist/generated/plugins.d.ts.map +1 -0
- package/dist/generated/plugins.js +4 -0
- package/dist/generated/plugins.js.map +1 -0
- package/dist/generated/shop.d.ts +5539 -0
- package/dist/generated/shop.d.ts.map +1 -0
- package/dist/generated/shop.js +5 -0
- package/dist/generated/shop.js.map +1 -0
- package/dist/graphql-document.d.ts +29 -0
- package/dist/graphql-document.d.ts.map +1 -0
- package/dist/graphql-document.js +21 -0
- package/dist/graphql-document.js.map +1 -0
- package/dist/index.d.ts +9 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/media/urls.d.ts.map +1 -1
- package/dist/media/urls.js +12 -1
- package/dist/media/urls.js.map +1 -1
- package/dist/media/video.d.ts.map +1 -1
- package/dist/media/video.js.map +1 -1
- package/dist/multi-store.d.ts +200 -0
- package/dist/multi-store.d.ts.map +1 -0
- package/dist/multi-store.js +558 -0
- package/dist/multi-store.js.map +1 -0
- package/dist/navigation/routes.d.ts +4 -3
- package/dist/navigation/routes.d.ts.map +1 -1
- package/dist/navigation/routes.js.map +1 -1
- package/dist/next/artifact-handler.d.ts +21 -13
- package/dist/next/artifact-handler.d.ts.map +1 -1
- package/dist/next/artifact-handler.js +28 -66
- package/dist/next/artifact-handler.js.map +1 -1
- package/dist/next/event-revalidate-handler.d.ts +26 -6
- package/dist/next/event-revalidate-handler.d.ts.map +1 -1
- package/dist/next/event-revalidate-handler.js +126 -19
- package/dist/next/event-revalidate-handler.js.map +1 -1
- package/dist/next/feed-handler.d.ts +50 -0
- package/dist/next/feed-handler.d.ts.map +1 -0
- package/dist/next/feed-handler.js +61 -0
- package/dist/next/feed-handler.js.map +1 -0
- package/dist/next/index.d.ts +3 -1
- package/dist/next/index.d.ts.map +1 -1
- package/dist/next/index.js +1 -0
- package/dist/next/index.js.map +1 -1
- package/dist/next/metadata.d.ts.map +1 -1
- package/dist/next/metadata.js.map +1 -1
- package/dist/next/redirect-middleware.d.ts +5 -31
- package/dist/next/redirect-middleware.d.ts.map +1 -1
- package/dist/next/redirect-middleware.js +4 -46
- package/dist/next/redirect-middleware.js.map +1 -1
- package/dist/next/revalidate-handler.d.ts.map +1 -1
- package/dist/next/revalidate-handler.js.map +1 -1
- package/dist/pricing/index.d.ts +1 -1
- package/dist/pricing/index.d.ts.map +1 -1
- package/dist/pricing/index.js +5 -2
- package/dist/pricing/index.js.map +1 -1
- package/dist/pricing/tax-display.js +1 -1
- package/dist/pricing/tax-display.js.map +1 -1
- package/dist/pricing/tiers.d.ts +3 -2
- package/dist/pricing/tiers.d.ts.map +1 -1
- package/dist/pricing/tiers.js.map +1 -1
- package/dist/pricing/validation.d.ts +152 -13
- package/dist/pricing/validation.d.ts.map +1 -1
- package/dist/pricing/validation.js +167 -13
- package/dist/pricing/validation.js.map +1 -1
- package/dist/redirects/index.d.ts.map +1 -1
- package/dist/redirects/index.js +2 -1
- package/dist/redirects/index.js.map +1 -1
- package/dist/redirects/store.d.ts.map +1 -1
- package/dist/redirects/store.js +6 -2
- package/dist/redirects/store.js.map +1 -1
- package/dist/redirects/types.d.ts +5 -2
- package/dist/redirects/types.d.ts.map +1 -1
- package/dist/revalidation/event-plan.d.ts +55 -4
- package/dist/revalidation/event-plan.d.ts.map +1 -1
- package/dist/revalidation/event-plan.js +115 -8
- package/dist/revalidation/event-plan.js.map +1 -1
- package/dist/revalidation/event-verify.d.ts +8 -37
- package/dist/revalidation/event-verify.d.ts.map +1 -1
- package/dist/revalidation/event-verify.js +7 -97
- package/dist/revalidation/event-verify.js.map +1 -1
- package/dist/revalidation/types.d.ts.map +1 -1
- package/dist/revalidation/url-context.d.ts +17 -0
- package/dist/revalidation/url-context.d.ts.map +1 -1
- package/dist/revalidation/url-context.js +35 -2
- package/dist/revalidation/url-context.js.map +1 -1
- package/dist/seo/ai.d.ts.map +1 -1
- package/dist/seo/ai.js.map +1 -1
- package/dist/seo/artifacts.d.ts +86 -4
- package/dist/seo/artifacts.d.ts.map +1 -1
- package/dist/seo/artifacts.js +115 -16
- package/dist/seo/artifacts.js.map +1 -1
- package/dist/seo/availability.d.ts +95 -0
- package/dist/seo/availability.d.ts.map +1 -0
- package/dist/seo/availability.js +89 -0
- package/dist/seo/availability.js.map +1 -0
- package/dist/seo/index.d.ts +4 -0
- package/dist/seo/index.d.ts.map +1 -1
- package/dist/seo/index.js +6 -1
- package/dist/seo/index.js.map +1 -1
- package/dist/seo/json-ld.d.ts.map +1 -1
- package/dist/seo/json-ld.js +34 -1
- package/dist/seo/json-ld.js.map +1 -1
- package/dist/seo/meta-tags.d.ts +40 -1
- package/dist/seo/meta-tags.d.ts.map +1 -1
- package/dist/seo/meta-tags.js +8 -1
- package/dist/seo/meta-tags.js.map +1 -1
- package/dist/seo/metadata-parser.d.ts.map +1 -1
- package/dist/seo/metadata-parser.js.map +1 -1
- package/dist/seo/metadata-types.d.ts.map +1 -1
- package/dist/seo/robots.d.ts.map +1 -1
- package/dist/seo/robots.js.map +1 -1
- package/dist/seo/types.d.ts +20 -2
- package/dist/seo/types.d.ts.map +1 -1
- package/dist/seo/url-builder.d.ts +5 -3
- package/dist/seo/url-builder.d.ts.map +1 -1
- package/dist/seo/url-builder.js +3 -1
- package/dist/seo/url-builder.js.map +1 -1
- package/dist/types.d.ts +1306 -2429
- package/dist/types.d.ts.map +1 -1
- package/dist/web/artifact-responder.d.ts +69 -0
- package/dist/web/artifact-responder.d.ts.map +1 -0
- package/dist/web/artifact-responder.js +90 -0
- package/dist/web/artifact-responder.js.map +1 -0
- package/dist/web/feed-responder.d.ts +72 -0
- package/dist/web/feed-responder.d.ts.map +1 -0
- package/dist/web/feed-responder.js +81 -0
- package/dist/web/feed-responder.js.map +1 -0
- package/dist/web/index.d.ts +23 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +19 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/redirect-middleware.d.ts +76 -0
- package/dist/web/redirect-middleware.d.ts.map +1 -0
- package/dist/web/redirect-middleware.js +94 -0
- package/dist/web/redirect-middleware.js.map +1 -0
- package/dist/web/respond.d.ts +20 -0
- package/dist/web/respond.d.ts.map +1 -0
- package/dist/web/respond.js +52 -0
- package/dist/web/respond.js.map +1 -0
- package/package.json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,EACtB,YAAoB;IAEpB,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,YAAY,EAAE,8BAA8B,CAAC;QAAE,OAAO,SAAS,CAAC;IAC5F,OAAO,sBAAsB,CAC3B,KAAK,EACL,6BAA6B,YAAY,iDAAiD;QACxF,8CAA8C,CACjD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { DeprecationNotice } from '@sixtyninecommerce/core';
|
|
2
|
+
import type { MethodDeprecationNotice, StorefrontClientConfig } from '../types.js';
|
|
3
|
+
type DeprecationHook = NonNullable<StorefrontClientConfig['onDeprecation']>;
|
|
4
|
+
export declare const GRAPHQL_DEPRECATION: MethodDeprecationNotice;
|
|
5
|
+
/**
|
|
6
|
+
* Who hears that a deprecated METHOD of this SDK was used. A configured hook is called once
|
|
7
|
+
* per reporter for each method — one reporter per single-store client, one per store router
|
|
8
|
+
* (shared by its per-request clients); without one the client prints the notice's line once
|
|
9
|
+
* per process.
|
|
10
|
+
*/
|
|
11
|
+
export declare function methodDeprecationReporter(onDeprecation?: DeprecationHook): (notice: MethodDeprecationNotice) => void;
|
|
12
|
+
/** For a context built without a reporter (by hand, in a test): the process-wide default. */
|
|
13
|
+
export declare const defaultMethodDeprecationReporter: (notice: MethodDeprecationNotice) => void;
|
|
14
|
+
/**
|
|
15
|
+
* The hook as `@sixtyninecommerce/core`'s transports want it, for a deprecated platform ROUTE
|
|
16
|
+
* (a `Deprecation` response header): tagged `kind: 'endpoint'`. Undefined without a hook, so
|
|
17
|
+
* core keeps printing those itself, exactly as before the hook existed.
|
|
18
|
+
*/
|
|
19
|
+
export declare function endpointDeprecationHook(onDeprecation?: DeprecationHook): ((notice: DeprecationNotice) => void) | undefined;
|
|
20
|
+
/** Refused at construction, before any request: a hook that is not a function. */
|
|
21
|
+
export declare function assertDeprecationHook(onDeprecation: unknown): void;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=deprecation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecation.d.ts","sourceRoot":"","sources":["../../src/core/deprecation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EAEvB,MAAM,aAAa,CAAC;AAErB,KAAK,eAAe,GAAG,WAAW,CAAC,sBAAsB,CAAC,eAAe,CAAC,CAAC,CAAC;AAc5E,eAAO,MAAM,mBAAmB,EAAE,uBAOhC,CAAC;AAyBH;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,aAAa,CAAC,EAAE,eAAe,GAC9B,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI,CAa3C;AAED,6FAA6F;AAC7F,eAAO,MAAM,gCAAgC,WAhBjC,uBAAuB,KAAK,IAgBmC,CAAC;AAE5E;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,aAAa,CAAC,EAAE,eAAe,GAC9B,CAAC,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC,GAAG,SAAS,CAGnD;AAED,kFAAkF;AAClF,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,OAAO,GAAG,IAAI,CAQlE"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { StorefrontError } from '../errors.js';
|
|
2
|
+
/**
|
|
3
|
+
* What `client.graphql()` is replaced by. Kept in step with the `@deprecated` tag on
|
|
4
|
+
* `StorefrontClient.graphql` (types.ts), which names the same methods in the editor.
|
|
5
|
+
* No removal DATE on purpose (user decision F9): it keeps working until 1.0.
|
|
6
|
+
*/
|
|
7
|
+
const GRAPHQL_REPLACEMENT = 'the typed methods: client.commerce.* for the Shop API (getCollectionById, getProductById, ' +
|
|
8
|
+
'getProduct(slug, { metafields: true }), setOrderCurrency, getCapabilities, getBranding, ' +
|
|
9
|
+
'authenticate, setOrderCustomFields, transitionOrder, …), client.content.* for the CMS ' +
|
|
10
|
+
'(getContentString, getAsset, …) and the other modules. The Shop API fields no method sends ' +
|
|
11
|
+
'yet are listed in the MCP capability catalog (storefront://capability-catalog).';
|
|
12
|
+
export const GRAPHQL_DEPRECATION = Object.freeze({
|
|
13
|
+
kind: 'method',
|
|
14
|
+
name: 'client.graphql',
|
|
15
|
+
replacement: GRAPHQL_REPLACEMENT,
|
|
16
|
+
message: `[@sixtyninecommerce/client] client.graphql() is deprecated and keeps working until 1.0: ` +
|
|
17
|
+
`call ${GRAPHQL_REPLACEMENT} Route or silence this notice with createStorefrontClient({ onDeprecation }).`,
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* Process-wide on purpose (spec §11, F9): the default warning is said ONCE per running
|
|
21
|
+
* process for each deprecated method, however many clients and routers the process builds —
|
|
22
|
+
* a storefront that builds a client per request would otherwise print it per request.
|
|
23
|
+
*/
|
|
24
|
+
const WARNED_METHODS = new Set();
|
|
25
|
+
/**
|
|
26
|
+
* Hand a notice to the consumer's hook without letting the hook decide the call it observes:
|
|
27
|
+
* a throw, or a promise that rejects (an unhandled rejection ends a Node process), is logged.
|
|
28
|
+
*/
|
|
29
|
+
function deliver(hook, notice) {
|
|
30
|
+
const about = notice.kind === 'method' ? notice.name : `${notice.method} ${notice.path}`;
|
|
31
|
+
const failed = (error) => {
|
|
32
|
+
console.warn(`[@sixtyninecommerce/client] the onDeprecation handler threw for ${about}`, error);
|
|
33
|
+
};
|
|
34
|
+
try {
|
|
35
|
+
void Promise.resolve(hook(notice)).catch(failed);
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
failed(error);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Who hears that a deprecated METHOD of this SDK was used. A configured hook is called once
|
|
43
|
+
* per reporter for each method — one reporter per single-store client, one per store router
|
|
44
|
+
* (shared by its per-request clients); without one the client prints the notice's line once
|
|
45
|
+
* per process.
|
|
46
|
+
*/
|
|
47
|
+
export function methodDeprecationReporter(onDeprecation) {
|
|
48
|
+
const told = new Set();
|
|
49
|
+
return (notice) => {
|
|
50
|
+
if (onDeprecation) {
|
|
51
|
+
if (told.has(notice.name))
|
|
52
|
+
return;
|
|
53
|
+
told.add(notice.name);
|
|
54
|
+
deliver(onDeprecation, notice);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (WARNED_METHODS.has(notice.name))
|
|
58
|
+
return;
|
|
59
|
+
WARNED_METHODS.add(notice.name);
|
|
60
|
+
console.warn(notice.message);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/** For a context built without a reporter (by hand, in a test): the process-wide default. */
|
|
64
|
+
export const defaultMethodDeprecationReporter = methodDeprecationReporter();
|
|
65
|
+
/**
|
|
66
|
+
* The hook as `@sixtyninecommerce/core`'s transports want it, for a deprecated platform ROUTE
|
|
67
|
+
* (a `Deprecation` response header): tagged `kind: 'endpoint'`. Undefined without a hook, so
|
|
68
|
+
* core keeps printing those itself, exactly as before the hook existed.
|
|
69
|
+
*/
|
|
70
|
+
export function endpointDeprecationHook(onDeprecation) {
|
|
71
|
+
if (!onDeprecation)
|
|
72
|
+
return undefined;
|
|
73
|
+
return (notice) => deliver(onDeprecation, { kind: 'endpoint', ...notice });
|
|
74
|
+
}
|
|
75
|
+
/** Refused at construction, before any request: a hook that is not a function. */
|
|
76
|
+
export function assertDeprecationHook(onDeprecation) {
|
|
77
|
+
if (onDeprecation === undefined || typeof onDeprecation === 'function')
|
|
78
|
+
return;
|
|
79
|
+
throw new StorefrontError(`onDeprecation must be a function (notice) => void; got ${onDeprecation === null ? 'null' : typeof onDeprecation}`, 'cms', 400, 'INVALID_ARGUMENT');
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=deprecation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecation.js","sourceRoot":"","sources":["../../src/core/deprecation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAS/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,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACtB,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;YAC/B,OAAO;QACT,CAAC;QACD,IAAI,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;YAAE,OAAO;QAC5C,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAChC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC,CAAC;AACJ,CAAC;AAED,6FAA6F;AAC7F,MAAM,CAAC,MAAM,gCAAgC,GAAG,yBAAyB,EAAE,CAAC;AAE5E;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CACrC,aAA+B;IAE/B,IAAI,CAAC,aAAa;QAAE,OAAO,SAAS,CAAC;IACrC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;AAC7E,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,qBAAqB,CAAC,aAAsB;IAC1D,IAAI,aAAa,KAAK,SAAS,IAAI,OAAO,aAAa,KAAK,UAAU;QAAE,OAAO;IAC/E,MAAM,IAAI,eAAe,CACvB,0DAA0D,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,aAAa,EAAE,EAClH,KAAK,EACL,GAAG,EACH,kBAAkB,CACnB,CAAC;AACJ,CAAC"}
|
package/dist/core/http.d.ts
CHANGED
|
@@ -24,9 +24,23 @@ export interface RequestOptions {
|
|
|
24
24
|
readonly operation: string;
|
|
25
25
|
readonly tags: readonly string[];
|
|
26
26
|
};
|
|
27
|
+
/** See the public `RequestOptions.buyerIp`. */
|
|
28
|
+
buyerIp?: string;
|
|
29
|
+
/**
|
|
30
|
+
* SDK-internal: sent as the `Idempotency-Key` header on a Vendure call. Only
|
|
31
|
+
* the keyed payment calls set it — `commerce.addPayment`, `payDeposit` and
|
|
32
|
+
* `createDepositPaymentIntent` — for the Shop API operations that read it.
|
|
33
|
+
*/
|
|
34
|
+
idempotencyKey?: string;
|
|
27
35
|
}
|
|
28
|
-
/** Mark a request as a taggable
|
|
36
|
+
/** Mark a request as a taggable read, keeping the caller's own options. */
|
|
29
37
|
export declare function tagRequest(options: RequestOptions | undefined, operation: string, tags?: readonly string[]): RequestOptions;
|
|
38
|
+
/**
|
|
39
|
+
* Mark a request as a CATALOGUE read: its own tags plus {@link CATALOG_TAG},
|
|
40
|
+
* which the events that move catalogue data without naming a product purge
|
|
41
|
+
* (`facet.*`, `price_list.changed`).
|
|
42
|
+
*/
|
|
43
|
+
export declare function tagCatalogRead(options: RequestOptions | undefined, operation: string, tags?: readonly string[]): RequestOptions;
|
|
30
44
|
export interface HttpClient {
|
|
31
45
|
graphql<T = unknown>(query: string, variables?: Record<string, unknown>, options?: RequestOptions): Promise<T>;
|
|
32
46
|
graphqlUpload<T = unknown>(query: string, variables: Record<string, unknown>, files: Map<string, File>, options?: RequestOptions): Promise<T>;
|
package/dist/core/http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/core/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/core/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAYH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAIhD,qCAAqC;AACrC,MAAM,WAAW,cAAc;IAC7B,mFAAmF;IACnF,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,0FAA0F;IAC1F,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B;;;OAGG;IACH,YAAY,CAAC,EAAE;QAAE,QAAQ,CAAC,SAAS,EAAE,MAA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AG,OAAO,CAAC,CAAC,CAAC,CAAC;IACxF,UAAU,CAAC,CAAC,GAAG,OAAO,EACpB,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,CAAC,CAAC,CAAC;CACf;AAuDD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,YAAY,GAAG,UAAU,CA8O9D"}
|
package/dist/core/http.js
CHANGED
|
@@ -10,12 +10,22 @@
|
|
|
10
10
|
* off).
|
|
11
11
|
*/
|
|
12
12
|
import { createTransport, } from '@sixtyninecommerce/core';
|
|
13
|
+
import { CATALOG_TAG, storeCacheTag } from '../cache-tags.js';
|
|
13
14
|
import { REQUEST_TIMEOUT_MS } from '../constants.js';
|
|
14
15
|
import { StorefrontError, toStorefrontError } from '../errors.js';
|
|
15
|
-
|
|
16
|
+
import { sessionCurrencyRefusal } from './currency.js';
|
|
17
|
+
/** Mark a request as a taggable read, keeping the caller's own options. */
|
|
16
18
|
export function tagRequest(options, operation, tags = []) {
|
|
17
19
|
return { ...options, cacheTagging: { operation, tags } };
|
|
18
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Mark a request as a CATALOGUE read: its own tags plus {@link CATALOG_TAG},
|
|
23
|
+
* which the events that move catalogue data without naming a product purge
|
|
24
|
+
* (`facet.*`, `price_list.changed`).
|
|
25
|
+
*/
|
|
26
|
+
export function tagCatalogRead(options, operation, tags = []) {
|
|
27
|
+
return tagRequest(options, operation, [CATALOG_TAG, ...tags]);
|
|
28
|
+
}
|
|
19
29
|
/**
|
|
20
30
|
* The tags to send as `next: { tags }`, or `null` for none. Resolved per
|
|
21
31
|
* request so a resolver sees exactly what it is deciding for.
|
|
@@ -28,7 +38,13 @@ function fetchCacheTags(ctx, options) {
|
|
|
28
38
|
const extra = options?.cacheTags ?? [];
|
|
29
39
|
if (!tagging && extra.length === 0)
|
|
30
40
|
return null;
|
|
31
|
-
const
|
|
41
|
+
const bare = [...new Set([...(tagging?.tags ?? []), ...extra])];
|
|
42
|
+
// A multi-store client serves several stores from one process, so a bare
|
|
43
|
+
// `catalog` purge would drop every store's catalogue. The scoped copy lets a
|
|
44
|
+
// store's own events purge only its own reads; the bare tag stays beside it.
|
|
45
|
+
const merged = ctx.storeScopedCacheTags
|
|
46
|
+
? [...bare, ...bare.map((tag) => storeCacheTag(ctx.channel.code, tag))]
|
|
47
|
+
: bare;
|
|
32
48
|
const resolved = typeof setting === 'function'
|
|
33
49
|
? setting(merged, { operation: tagging?.operation ?? 'graphql' })
|
|
34
50
|
: merged;
|
|
@@ -94,10 +110,15 @@ export function createHttpClient(ctx) {
|
|
|
94
110
|
tenant: () => ({
|
|
95
111
|
scope: { kind: 'channel', code: ctx.channel.code },
|
|
96
112
|
...(ctx.languageCode ? { language: ctx.languageCode } : {}),
|
|
113
|
+
...(ctx.sessionCurrencyCode ? { currency: ctx.sessionCurrencyCode } : {}),
|
|
97
114
|
...(ctx.orderScope ? { orderScope: ctx.orderScope } : {}),
|
|
115
|
+
// `core` stamps it as `x-head` on every service; the platform composes
|
|
116
|
+
// the links it emails for this request on that head's origin.
|
|
117
|
+
...(ctx.head ? { head: ctx.head } : {}),
|
|
98
118
|
}),
|
|
99
119
|
channels: channelResolverFor(ctx),
|
|
100
120
|
fetch: ctx.fetch,
|
|
121
|
+
...(ctx.onDeprecation ? { onDeprecation: ctx.onDeprecation } : {}),
|
|
101
122
|
// `attempts: 0` used to mean one attempt here (`Math.max(1, …)`); core
|
|
102
123
|
// treats a value below 1 as unset and would fall back to its own default,
|
|
103
124
|
// so the floor is applied before it gets there.
|
|
@@ -111,6 +132,11 @@ export function createHttpClient(ctx) {
|
|
|
111
132
|
// and each maps its own response. Converting underneath them would rename
|
|
112
133
|
// every key they read.
|
|
113
134
|
convertCase: false,
|
|
135
|
+
// A server-side storefront's credential, on every service. `core` refuses
|
|
136
|
+
// it in a browser; `createStoreContext` already did, before any request.
|
|
137
|
+
...(ctx.privateToken
|
|
138
|
+
? { storefrontToken: ctx.privateToken, buyerIp: () => ctx.buyerIp ?? undefined }
|
|
139
|
+
: {}),
|
|
114
140
|
};
|
|
115
141
|
/** Vendure: the shopper's session, when there is one. */
|
|
116
142
|
const vendureTransport = createTransport({
|
|
@@ -143,6 +169,9 @@ export function createHttpClient(ctx) {
|
|
|
143
169
|
const restTransport = createTransport({
|
|
144
170
|
...shared,
|
|
145
171
|
principal: { kind: 'anonymous' },
|
|
172
|
+
// On by default (F6). Only this transport: it is the anonymous one, and
|
|
173
|
+
// the Vendure transport above carries the shopper's session.
|
|
174
|
+
conditionalReads: ctx.conditionalReads ?? true,
|
|
146
175
|
});
|
|
147
176
|
/**
|
|
148
177
|
* Decide whether the stored session is genuinely dead and fire `onAuthExpired`
|
|
@@ -191,11 +220,32 @@ export function createHttpClient(ctx) {
|
|
|
191
220
|
return null;
|
|
192
221
|
}
|
|
193
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* A session currency the channel refuses fails EVERY Shop API request, this
|
|
225
|
+
* one included, before any resolver runs — so it is reported as
|
|
226
|
+
* `CURRENCY_NOT_AVAILABLE` and cleared, never left to break the next call
|
|
227
|
+
* too. Cleared only when it is still the code the refusal named: a request
|
|
228
|
+
* that raced a newer `setOrderCurrency` must not undo the shopper's choice.
|
|
229
|
+
*/
|
|
230
|
+
function currencyReset(error, sent) {
|
|
231
|
+
if (!sent)
|
|
232
|
+
return error;
|
|
233
|
+
const refusal = sessionCurrencyRefusal(error, sent);
|
|
234
|
+
if (!refusal)
|
|
235
|
+
return error;
|
|
236
|
+
if (ctx.sessionCurrencyCode === sent) {
|
|
237
|
+
ctx.sessionCurrencyCode = null;
|
|
238
|
+
ctx.currencyCode = ctx.channel.defaultCurrencyCode;
|
|
239
|
+
}
|
|
240
|
+
return refusal;
|
|
241
|
+
}
|
|
194
242
|
/** The per-call options `core` takes, plus this SDK's cache tagging. */
|
|
195
243
|
function callOptions(options, extra) {
|
|
196
244
|
const tags = fetchCacheTags(ctx, options);
|
|
197
245
|
return {
|
|
198
246
|
...(options?.signal ? { signal: options.signal } : {}),
|
|
247
|
+
...(options?.buyerIp ? { buyerIp: options.buyerIp } : {}),
|
|
248
|
+
...(options?.idempotencyKey ? { idempotencyKey: options.idempotencyKey } : {}),
|
|
199
249
|
// Next.js reads `next.tags` off the fetch init for `revalidateTag`; other
|
|
200
250
|
// fetch implementations ignore keys they do not know. No cache policy is set.
|
|
201
251
|
...(tags ? { fetchInit: { next: { tags } } } : {}),
|
|
@@ -203,6 +253,8 @@ export function createHttpClient(ctx) {
|
|
|
203
253
|
};
|
|
204
254
|
}
|
|
205
255
|
async function graphqlRequest(query, variables, options, isProbe, files) {
|
|
256
|
+
// What this request names: `setOrderCurrency` may change it while in flight.
|
|
257
|
+
const sentCurrency = ctx.sessionCurrencyCode ?? null;
|
|
206
258
|
try {
|
|
207
259
|
return await vendureTransport.graphql({ query, variables, api: 'shop', ...(files ? { files } : {}) },
|
|
208
260
|
// An upload streams a file body; 15s is the read timeout for a JSON
|
|
@@ -212,7 +264,7 @@ export function createHttpClient(ctx) {
|
|
|
212
264
|
catch (error) {
|
|
213
265
|
const converted = toStorefrontError(error, 'vendure');
|
|
214
266
|
await maybeSignalAuthExpired(converted, isProbe);
|
|
215
|
-
throw converted;
|
|
267
|
+
throw currencyReset(converted, sentCurrency);
|
|
216
268
|
}
|
|
217
269
|
}
|
|
218
270
|
function graphql(query, variables, options) {
|
package/dist/core/http.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/core/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAGL,eAAe,GAGhB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+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AAI,CAAI,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC;QAC5D,OAAO,EAAE,CAAc,IAAY,EAAE,IAAa,EAAE,OAAwB,EAAE,EAAE,CAC9E,IAAI,CAAI,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC;QACxD,UAAU,EAAE,CACV,IAAY,EACZ,MAA+B,EAC/B,OAAwB,EACxB,EAAE,CAAC,IAAI,CAAI,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC;KACjE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One read of a platform-rendered public file — a sitemap, robots.txt,
|
|
3
|
+
* llms.txt, the IndexNow key, a product feed — reduced to the four outcomes a
|
|
4
|
+
* proxy has to tell apart. Framework-neutral: a `fetch` in, a plain object out.
|
|
5
|
+
*
|
|
6
|
+
* Deliberately NOT the SDK transport (`core/http.ts`):
|
|
7
|
+
* - the bodies are XML and text, not JSON;
|
|
8
|
+
* - the upstream `ETag` must reach the storefront's caller untouched, and a
|
|
9
|
+
* `304` must come back AS a `304`: a transport-level conditional-read cache
|
|
10
|
+
* answers a `304` from memory with the stored body, which is right for a
|
|
11
|
+
* menu read and wrong for a crawler that asked "has this changed?";
|
|
12
|
+
* - no credential is ever sent, the private storefront token included. The
|
|
13
|
+
* files are public, keyed by the store code in the path, and the same bytes
|
|
14
|
+
* for every caller; a secret on the request would buy nothing and travel
|
|
15
|
+
* with a response every CDN on the way is told to share.
|
|
16
|
+
*/
|
|
17
|
+
/** Seconds a crawler is told to wait after a `503`. */
|
|
18
|
+
export declare const ARTIFACT_RETRY_AFTER_SECONDS = 60;
|
|
19
|
+
/**
|
|
20
|
+
* What the platform answered, as one of four outcomes:
|
|
21
|
+
* - `200` — the body, its `Content-Type` and `ETag` as the platform sent them;
|
|
22
|
+
* - `304` — unchanged since the `ifNoneMatch` you sent (no body);
|
|
23
|
+
* - `404` — the platform has no such file for this store. It says why in
|
|
24
|
+
* `detail` (llms.txt is off, the store lacks the SEO plugin or a storefront
|
|
25
|
+
* URL, the feed is unknown or paused) — diagnostics for YOUR logs and tools;
|
|
26
|
+
* the responders never put it in a crawler's response;
|
|
27
|
+
* - `503` — anything else. `upstreamStatus` (with the platform's `detail`)
|
|
28
|
+
* when the platform answered some other status; `error` when the request
|
|
29
|
+
* itself failed — the network, or the timeout. `retryAfterSeconds` is the
|
|
30
|
+
* wait to advertise.
|
|
31
|
+
*/
|
|
32
|
+
export type PublicArtifactRead<Body> = {
|
|
33
|
+
status: 200;
|
|
34
|
+
body: Body;
|
|
35
|
+
contentType?: string;
|
|
36
|
+
etag?: string;
|
|
37
|
+
} | {
|
|
38
|
+
status: 304;
|
|
39
|
+
etag?: string;
|
|
40
|
+
} | {
|
|
41
|
+
status: 404;
|
|
42
|
+
detail?: string;
|
|
43
|
+
} | {
|
|
44
|
+
status: 503;
|
|
45
|
+
retryAfterSeconds: number;
|
|
46
|
+
upstreamStatus?: number;
|
|
47
|
+
detail?: string;
|
|
48
|
+
error?: string;
|
|
49
|
+
};
|
|
50
|
+
export interface PublicArtifactReadOptions {
|
|
51
|
+
/** Sent upstream as `If-None-Match`; a match answers `304`. */
|
|
52
|
+
ifNoneMatch?: string;
|
|
53
|
+
/**
|
|
54
|
+
* The caller's cancellation. An abort through it REJECTS with the signal's
|
|
55
|
+
* reason (the caller asked to stop); the timeout below is a `503` instead.
|
|
56
|
+
*/
|
|
57
|
+
signal?: AbortSignal;
|
|
58
|
+
/** Deadline for the whole exchange, body included. */
|
|
59
|
+
timeoutMs: number;
|
|
60
|
+
/**
|
|
61
|
+
* Extra `RequestInit` keys (the Next adapters' `next: { tags }`). Never
|
|
62
|
+
* `headers` or `signal`: those are this function's.
|
|
63
|
+
*/
|
|
64
|
+
init?: Record<string, unknown>;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* GET `url` once. `readBody` runs INSIDE the deadline: a transfer that stalls
|
|
68
|
+
* or drops mid-body is a `503`, never a truncated `200` — a proxy that let the
|
|
69
|
+
* `200` and its `Cache-Control` out first would have a CDN cache half a feed.
|
|
70
|
+
*/
|
|
71
|
+
export declare function readPublicArtifact<Body>(fetchFn: typeof globalThis.fetch, url: string, readBody: (response: Response) => Promise<Body>, options: PublicArtifactReadOptions): Promise<PublicArtifactRead<Body>>;
|
|
72
|
+
//# sourceMappingURL=public-artifact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-artifact.d.ts","sourceRoot":"","sources":["../../src/core/public-artifact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,uDAAuD;AACvD,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAG/C;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,kBAAkB,CAAC,IAAI,IAC/B;IAAE,MAAM,EAAE,GAAG,CAAC;IAAC,IAAI,EAAE,IAAI,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAChE;IAAE,MAAM,EAAE,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,MAAM,EAAE,GAAG,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAChC;IACE,MAAM,EAAE,GAAG,CAAC;IACZ,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AA4BN,MAAM,WAAW,yBAAyB;IACxC,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAiCD;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAC3C,OAAO,EAAE,OAAO,UAAU,CAAC,KAAK,EAChC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC,IAAI,CAAC,EAC/C,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CA6CnC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One read of a platform-rendered public file — a sitemap, robots.txt,
|
|
3
|
+
* llms.txt, the IndexNow key, a product feed — reduced to the four outcomes a
|
|
4
|
+
* proxy has to tell apart. Framework-neutral: a `fetch` in, a plain object out.
|
|
5
|
+
*
|
|
6
|
+
* Deliberately NOT the SDK transport (`core/http.ts`):
|
|
7
|
+
* - the bodies are XML and text, not JSON;
|
|
8
|
+
* - the upstream `ETag` must reach the storefront's caller untouched, and a
|
|
9
|
+
* `304` must come back AS a `304`: a transport-level conditional-read cache
|
|
10
|
+
* answers a `304` from memory with the stored body, which is right for a
|
|
11
|
+
* menu read and wrong for a crawler that asked "has this changed?";
|
|
12
|
+
* - no credential is ever sent, the private storefront token included. The
|
|
13
|
+
* files are public, keyed by the store code in the path, and the same bytes
|
|
14
|
+
* for every caller; a secret on the request would buy nothing and travel
|
|
15
|
+
* with a response every CDN on the way is told to share.
|
|
16
|
+
*/
|
|
17
|
+
/** Seconds a crawler is told to wait after a `503`. */
|
|
18
|
+
export const ARTIFACT_RETRY_AFTER_SECONDS = 60;
|
|
19
|
+
/** Longest platform `detail` passed on; a problem body is short, a proxy page is not. */
|
|
20
|
+
const MAX_DETAIL_LENGTH = 500;
|
|
21
|
+
/**
|
|
22
|
+
* The `detail` of an RFC 9457 problem body (or its legacy `message`), when the
|
|
23
|
+
* platform sent one. Never throws: an unreadable or non-problem body simply
|
|
24
|
+
* has no detail, and must not turn a clean `404` into a `503`.
|
|
25
|
+
*/
|
|
26
|
+
async function problemDetail(response) {
|
|
27
|
+
const contentType = response.headers.get('content-type') ?? '';
|
|
28
|
+
if (!contentType.includes('json')) {
|
|
29
|
+
response.body?.cancel().catch(() => undefined);
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
const parsed = (await response.json());
|
|
34
|
+
const detail = parsed?.detail ?? parsed?.message;
|
|
35
|
+
return typeof detail === 'string' && detail.trim() !== ''
|
|
36
|
+
? detail.slice(0, MAX_DETAIL_LENGTH)
|
|
37
|
+
: undefined;
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* One signal that fires on the timeout OR the caller's abort, whichever comes
|
|
45
|
+
* first. Linked by hand: `AbortSignal.any` is missing from runtimes this
|
|
46
|
+
* package still supports.
|
|
47
|
+
*/
|
|
48
|
+
function deadline(timeoutMs, callerSignal) {
|
|
49
|
+
const controller = new AbortController();
|
|
50
|
+
// The same reason `AbortSignal.timeout()` rejects with, so a timed-out proxy
|
|
51
|
+
// reports what it always has.
|
|
52
|
+
const timer = setTimeout(() => {
|
|
53
|
+
controller.abort(new DOMException('The operation was aborted due to timeout', 'TimeoutError'));
|
|
54
|
+
}, timeoutMs);
|
|
55
|
+
const onCallerAbort = () => {
|
|
56
|
+
controller.abort(callerSignal?.reason);
|
|
57
|
+
};
|
|
58
|
+
if (callerSignal?.aborted)
|
|
59
|
+
onCallerAbort();
|
|
60
|
+
else
|
|
61
|
+
callerSignal?.addEventListener('abort', onCallerAbort, { once: true });
|
|
62
|
+
return {
|
|
63
|
+
signal: controller.signal,
|
|
64
|
+
dispose() {
|
|
65
|
+
clearTimeout(timer);
|
|
66
|
+
callerSignal?.removeEventListener('abort', onCallerAbort);
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* GET `url` once. `readBody` runs INSIDE the deadline: a transfer that stalls
|
|
72
|
+
* or drops mid-body is a `503`, never a truncated `200` — a proxy that let the
|
|
73
|
+
* `200` and its `Cache-Control` out first would have a CDN cache half a feed.
|
|
74
|
+
*/
|
|
75
|
+
export async function readPublicArtifact(fetchFn, url, readBody, options) {
|
|
76
|
+
// Only the validator. The inbound User-Agent in particular is never
|
|
77
|
+
// forwarded: the platform host blocks crawler UAs and must see this server.
|
|
78
|
+
const headers = {};
|
|
79
|
+
if (options.ifNoneMatch)
|
|
80
|
+
headers['If-None-Match'] = options.ifNoneMatch;
|
|
81
|
+
const limit = deadline(options.timeoutMs, options.signal);
|
|
82
|
+
try {
|
|
83
|
+
const upstream = await fetchFn(url, { ...options.init, headers, signal: limit.signal });
|
|
84
|
+
const etag = upstream.headers.get('etag') ?? undefined;
|
|
85
|
+
if (upstream.status === 304) {
|
|
86
|
+
return etag === undefined ? { status: 304 } : { status: 304, etag };
|
|
87
|
+
}
|
|
88
|
+
if (!upstream.ok) {
|
|
89
|
+
const detail = await problemDetail(upstream);
|
|
90
|
+
const why = detail === undefined ? {} : { detail };
|
|
91
|
+
return upstream.status === 404
|
|
92
|
+
? { status: 404, ...why }
|
|
93
|
+
: {
|
|
94
|
+
status: 503,
|
|
95
|
+
retryAfterSeconds: ARTIFACT_RETRY_AFTER_SECONDS,
|
|
96
|
+
upstreamStatus: upstream.status,
|
|
97
|
+
...why,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
const body = await readBody(upstream);
|
|
101
|
+
const contentType = upstream.headers.get('content-type') ?? undefined;
|
|
102
|
+
return {
|
|
103
|
+
status: 200,
|
|
104
|
+
body,
|
|
105
|
+
...(contentType === undefined ? {} : { contentType }),
|
|
106
|
+
...(etag === undefined ? {} : { etag }),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
if (options.signal?.aborted)
|
|
111
|
+
throw options.signal.reason;
|
|
112
|
+
return {
|
|
113
|
+
status: 503,
|
|
114
|
+
retryAfterSeconds: ARTIFACT_RETRY_AFTER_SECONDS,
|
|
115
|
+
error: error instanceof Error ? error.message : 'Proxy failed',
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
finally {
|
|
119
|
+
limit.dispose();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=public-artifact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-artifact.js","sourceRoot":"","sources":["../../src/core/public-artifact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,uDAAuD;AACvD,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,CAAC;AA4B/C,yFAAyF;AACzF,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B;;;;GAIG;AACH,KAAK,UAAU,aAAa,CAAC,QAAkB;IAC7C,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;IAC/D,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QAC/C,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAmD,CAAC;QACzF,MAAM,MAAM,GAAG,MAAM,EAAE,MAAM,IAAI,MAAM,EAAE,OAAO,CAAC;QACjD,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE;YACvD,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC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AAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;YACrD,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;SACxC,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,OAAO,CAAC,MAAM,EAAE,OAAO;YAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;QACzD,OAAO;YACL,MAAM,EAAE,GAAG;YACX,iBAAiB,EAAE,4BAA4B;YAC/C,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc;SAC/D,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a Shop API failure is "this Vendure does not know that field yet",
|
|
3
|
+
* as opposed to a transient failure that must not be papered over.
|
|
4
|
+
*
|
|
5
|
+
* Two spellings, because the message is not always preserved: graphql-js
|
|
6
|
+
* answers a validation rejection with HTTP 400, and the HTTP client turns any
|
|
7
|
+
* non-ok response into `Vendure Shop API returned 400` before it parses the
|
|
8
|
+
* body; when the body IS parsed, the message is graphql-js's standard
|
|
9
|
+
* `Cannot query field "x" on type "y"`. (Same two spellings the plugins
|
|
10
|
+
* service matches for its own compat fallback.)
|
|
11
|
+
*
|
|
12
|
+
* Everything else — a timeout, a 5xx from a rolling restart, a connection
|
|
13
|
+
* reset, a GraphQL error that is not a validation rejection — deliberately
|
|
14
|
+
* does NOT match: degrading on those would hide an outage behind silently
|
|
15
|
+
* missing fields.
|
|
16
|
+
*/
|
|
17
|
+
export declare function isUnknownFieldRejection(error: unknown): boolean;
|
|
18
|
+
//# sourceMappingURL=unknown-field-rejection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unknown-field-rejection.d.ts","sourceRoot":"","sources":["../../src/core/unknown-field-rejection.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAkB/D"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { StorefrontError } from '../errors.js';
|
|
2
|
+
/**
|
|
3
|
+
* Whether a Shop API failure is "this Vendure does not know that field yet",
|
|
4
|
+
* as opposed to a transient failure that must not be papered over.
|
|
5
|
+
*
|
|
6
|
+
* Two spellings, because the message is not always preserved: graphql-js
|
|
7
|
+
* answers a validation rejection with HTTP 400, and the HTTP client turns any
|
|
8
|
+
* non-ok response into `Vendure Shop API returned 400` before it parses the
|
|
9
|
+
* body; when the body IS parsed, the message is graphql-js's standard
|
|
10
|
+
* `Cannot query field "x" on type "y"`. (Same two spellings the plugins
|
|
11
|
+
* service matches for its own compat fallback.)
|
|
12
|
+
*
|
|
13
|
+
* Everything else — a timeout, a 5xx from a rolling restart, a connection
|
|
14
|
+
* reset, a GraphQL error that is not a validation rejection — deliberately
|
|
15
|
+
* does NOT match: degrading on those would hide an outage behind silently
|
|
16
|
+
* missing fields.
|
|
17
|
+
*/
|
|
18
|
+
export function isUnknownFieldRejection(error) {
|
|
19
|
+
if (!(error instanceof StorefrontError))
|
|
20
|
+
return false;
|
|
21
|
+
if (error.service !== 'vendure')
|
|
22
|
+
return false;
|
|
23
|
+
// NOT every 400. `BAD_USER_INPUT` and `USER_INPUT_ERROR` are also mapped to
|
|
24
|
+
// 400, and those are EXECUTION-time refusals — `getMyQuote` on somebody
|
|
25
|
+
// else's quote is one — where the document did run. Re-issuing the legacy
|
|
26
|
+
// document there doubles the request, reports the second attempt's error
|
|
27
|
+
// instead of the first, and for a mutation replays a write that only
|
|
28
|
+
// `@Transaction()` rolled back. The two codes below both mean the document
|
|
29
|
+
// was refused before execution:
|
|
30
|
+
// BAD_REQUEST — an HTTP 400 with no GraphQL body, which is how graphql-js
|
|
31
|
+
// answers a validation failure;
|
|
32
|
+
// GRAPHQL_VALIDATION_FAILED — the same refusal as a coded `errors[]` entry.
|
|
33
|
+
return (error.errorCode === 'BAD_REQUEST' ||
|
|
34
|
+
error.errorCode === 'GRAPHQL_VALIDATION_FAILED' ||
|
|
35
|
+
/Cannot query field/i.test(error.message));
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=unknown-field-rejection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unknown-field-rejection.js","sourceRoot":"","sources":["../../src/core/unknown-field-rejection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAc;IACpD,IAAI,CAAC,CAAC,KAAK,YAAY,eAAe,CAAC;QAAE,OAAO,KAAK,CAAC;IACtD,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAC9C,4EAA4E;IAC5E,wEAAwE;IACxE,0EAA0E;IAC1E,yEAAyE;IACzE,qEAAqE;IACrE,2EAA2E;IAC3E,gCAAgC;IAChC,4EAA4E;IAC5E,gDAAgD;IAChD,8EAA8E;IAC9E,OAAO,CACL,KAAK,CAAC,SAAS,KAAK,aAAa;QACjC,KAAK,CAAC,SAAS,KAAK,2BAA2B;QAC/C,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAC1C,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { HttpClient, RequestOptions } from '../core/http.js';
|
|
2
2
|
import type { B2bCreditStatus } from '../types.js';
|
|
3
|
+
export declare const B2B_CREDIT_STATUS: string;
|
|
4
|
+
export declare const B2B_CREDIT_STATUS_LEGACY: string;
|
|
3
5
|
export declare function createCreditStatusMethods(http: HttpClient): {
|
|
4
6
|
getCreditStatus(options?: RequestOptions): Promise<B2bCreditStatus | null>;
|
|
5
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credit-status.d.ts","sourceRoot":"","sources":["../../src/credit/credit-status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"credit-status.d.ts","sourceRoot":"","sources":["../../src/credit/credit-status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIlE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAyCnD,eAAO,MAAM,iBAAiB,QAO7B,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAOpC,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,UAAU;8BAOtB,cAAc,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;EA6BnF"}
|