From 6e057af0ccdd6e34bf5a2cc0d0388cca0e4228f1 Mon Sep 17 00:00:00 2001 From: Bret Little Date: Mon, 29 Jul 2024 10:40:14 -0400 Subject: [PATCH 01/97] Update the `createWithCache` docs to warn about caching errors (#2373) * Update the `createWithCache` docs to warn about caching errors * Feedback updates --- .../lib/createRickAndMortyClient.server.ts | 1 + .../docs/generated/generated_docs_data.json | 13087 +++++++--------- .../src/cache/create-with-cache.doc.ts | 2 +- .../src/cache/create-with-cache.example.js | 3 +- .../src/cache/create-with-cache.example.ts | 3 +- .../hydrogen/src/cache/create-with-cache.ts | 13 +- 6 files changed, 5901 insertions(+), 7208 deletions(-) diff --git a/examples/third-party-queries-caching/app/lib/createRickAndMortyClient.server.ts b/examples/third-party-queries-caching/app/lib/createRickAndMortyClient.server.ts index d189c23dc..4c996e6ba 100644 --- a/examples/third-party-queries-caching/app/lib/createRickAndMortyClient.server.ts +++ b/examples/third-party-queries-caching/app/lib/createRickAndMortyClient.server.ts @@ -42,6 +42,7 @@ export function createRickAndMortyClient({ }); if (!response.ok) { + // Throwing is important to prevent the results from being cached throw new Error( `Error fetching from rick and morty api: ${response.statusText}`, ); diff --git a/packages/hydrogen/docs/generated/generated_docs_data.json b/packages/hydrogen/docs/generated/generated_docs_data.json index 7a820f4cd..8feb8730d 100644 --- a/packages/hydrogen/docs/generated/generated_docs_data.json +++ b/packages/hydrogen/docs/generated/generated_docs_data.json @@ -32,7 +32,7 @@ "type": "AnalyticsCartViewGeneratedType", "typeDefinitions": { "AnalyticsCartViewGeneratedType": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "name": "AnalyticsCartViewGeneratedType", "description": "", "params": [ @@ -40,11 +40,11 @@ "name": "props", "description": "", "value": "BasicViewProps", - "filePath": "src/analytics-manager/AnalyticsView.tsx" + "filePath": "/analytics-manager/AnalyticsView.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "description": "", "name": "", "value": "" @@ -52,24 +52,24 @@ "value": "export function AnalyticsCartView(props: BasicViewProps) {\n return ;\n}" }, "BasicViewProps": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "BasicViewProps", "value": "{\n data?: OtherData;\n customData?: OtherData;\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "customData", + "name": "data", "value": "OtherData", "description": "", "isOptional": true }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "data", + "name": "customData", "value": "OtherData", "description": "", "isOptional": true @@ -120,7 +120,7 @@ "type": "AnalyticsCollectionViewGeneratedType", "typeDefinitions": { "AnalyticsCollectionViewGeneratedType": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "name": "AnalyticsCollectionViewGeneratedType", "description": "", "params": [ @@ -128,11 +128,11 @@ "name": "props", "description": "", "value": "CollectionViewProps", - "filePath": "src/analytics-manager/AnalyticsView.tsx" + "filePath": "/analytics-manager/AnalyticsView.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "description": "", "name": "", "value": "" @@ -140,45 +140,38 @@ "value": "export function AnalyticsCollectionView(props: CollectionViewProps) {\n return ;\n}" }, "CollectionViewProps": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CollectionViewProps", "value": "{\n data: CollectionPayload;\n customData?: OtherData;\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", + "syntaxKind": "PropertySignature", + "name": "data", + "value": "CollectionPayload", + "description": "" + }, + { + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", "name": "customData", "value": "OtherData", "description": "", "isOptional": true - }, - { - "filePath": "src/analytics-manager/AnalyticsView.tsx", - "syntaxKind": "PropertySignature", - "name": "data", - "value": "CollectionPayload", - "description": "" } ] }, - "OtherData": { - "description": "", - "name": "OtherData", - "value": "OtherData", - "members": [], - "override": "Any `` pair" - }, "CollectionPayload": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CollectionPayload", "value": "{\n collection: CollectionPayloadDetails;\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", "name": "collection", "value": "CollectionPayloadDetails", @@ -187,27 +180,34 @@ ] }, "CollectionPayloadDetails": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CollectionPayloadDetails", "value": "{\n /** The collection id. */\n id: string;\n /** The collection handle. */\n handle: string;\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "handle", + "name": "id", "value": "string", - "description": "The collection handle." + "description": "The collection id." }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "id", + "name": "handle", "value": "string", - "description": "The collection id." + "description": "The collection handle." } ] + }, + "OtherData": { + "description": "", + "name": "OtherData", + "value": "OtherData", + "members": [], + "override": "Any `` pair" } } } @@ -246,7 +246,7 @@ "type": "AnalyticsCustomViewGeneratedType", "typeDefinitions": { "AnalyticsCustomViewGeneratedType": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "name": "AnalyticsCustomViewGeneratedType", "description": "", "params": [ @@ -254,11 +254,11 @@ "name": "props", "description": "", "value": "CustomViewProps", - "filePath": "src/analytics-manager/AnalyticsView.tsx" + "filePath": "/analytics-manager/AnalyticsView.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "description": "", "name": "", "value": "" @@ -266,22 +266,21 @@ "value": "export function AnalyticsCustomView(props: CustomViewProps) {\n return ;\n}" }, "CustomViewProps": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CustomViewProps", "value": "{\n type: typeof AnalyticsEvent.CUSTOM_EVENT;\n data?: OtherData;\n customData?: OtherData;\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "customData", - "value": "OtherData", - "description": "", - "isOptional": true + "name": "type", + "value": "`custom_${string}`", + "description": "" }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", "name": "data", "value": "OtherData", @@ -289,11 +288,12 @@ "isOptional": true }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "type", - "value": "`custom_${string}`", - "description": "" + "name": "customData", + "value": "OtherData", + "description": "", + "isOptional": true } ] }, @@ -341,60 +341,59 @@ "type": "AnalyticsProviderProps", "typeDefinitions": { "AnalyticsProviderProps": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "AnalyticsProviderProps", "value": "{\n /** React children to render. */\n children?: ReactNode;\n /** The cart or cart promise to track for cart analytics. When there is a difference between the state of the cart, `AnalyticsProvider` will trigger a `cart_updated` event. It will also produce `product_added_to_cart` and `product_removed_from_cart` based on cart line quantity and cart line id changes. */\n cart: Promise | CartReturn | null;\n /** An optional function to set wether the user can be tracked. Defaults to Customer Privacy API's `window.Shopify.customerPrivacy.analyticsProcessingAllowed()`. */\n canTrack?: () => boolean;\n /** An optional custom payload to pass to all events. e.g language/locale/currency. */\n customData?: Record;\n /** The shop configuration required to publish analytics events to Shopify. Use [`getShopAnalytics`](/docs/api/hydrogen/2024-07/utilities/getshopanalytics). */\n shop: Promise | ShopAnalytics | null;\n /** The customer privacy consent configuration and options. */\n consent: Partial<\n Pick<\n CustomerPrivacyApiProps,\n 'checkoutDomain' | 'storefrontAccessToken' | 'withPrivacyBanner'\n >\n >;\n /** @deprecated Disable throwing errors when required props are missing. */\n disableThrowOnError?: boolean;\n /** The domain scope of the cookie set with `useShopifyCookies`. **/\n cookieDomain?: string;\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "PropertySignature", - "name": "canTrack", - "value": "() => boolean", - "description": "An optional function to set wether the user can be tracked. Defaults to Customer Privacy API's `window.Shopify.customerPrivacy.analyticsProcessingAllowed()`.", + "name": "children", + "value": "ReactNode", + "description": "React children to render.", "isOptional": true }, { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "PropertySignature", "name": "cart", - "value": "Promise | CartReturn | null", + "value": "CartReturn | Promise", "description": "The cart or cart promise to track for cart analytics. When there is a difference between the state of the cart, `AnalyticsProvider` will trigger a `cart_updated` event. It will also produce `product_added_to_cart` and `product_removed_from_cart` based on cart line quantity and cart line id changes." }, { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "PropertySignature", - "name": "children", - "value": "ReactNode", - "description": "React children to render.", + "name": "canTrack", + "value": "() => boolean", + "description": "An optional function to set wether the user can be tracked. Defaults to Customer Privacy API's `window.Shopify.customerPrivacy.analyticsProcessingAllowed()`.", "isOptional": true }, { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "PropertySignature", - "name": "consent", - "value": "Partial<\n Pick<\n CustomerPrivacyApiProps,\n 'checkoutDomain' | 'storefrontAccessToken' | 'withPrivacyBanner'\n >\n >", - "description": "The customer privacy consent configuration and options." + "name": "customData", + "value": "Record", + "description": "An optional custom payload to pass to all events. e.g language/locale/currency.", + "isOptional": true }, { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "PropertySignature", - "name": "cookieDomain", - "value": "string", - "description": "The domain scope of the cookie set with `useShopifyCookies`. *", - "isOptional": true + "name": "shop", + "value": "ShopAnalytics | Promise", + "description": "The shop configuration required to publish analytics events to Shopify. Use [`getShopAnalytics`](/docs/api/hydrogen/2024-07/utilities/getshopanalytics)." }, { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "PropertySignature", - "name": "customData", - "value": "Record", - "description": "An optional custom payload to pass to all events. e.g language/locale/currency.", - "isOptional": true + "name": "consent", + "value": "Partial<\n Pick<\n CustomerPrivacyApiProps,\n 'checkoutDomain' | 'storefrontAccessToken' | 'withPrivacyBanner'\n >\n >", + "description": "The customer privacy consent configuration and options." }, { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "PropertySignature", "name": "disableThrowOnError", "value": "boolean", @@ -403,16 +402,17 @@ "deprecationMessage": "Disable throwing errors when required props are missing." }, { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "PropertySignature", - "name": "shop", - "value": "Promise | ShopAnalytics | null", - "description": "The shop configuration required to publish analytics events to Shopify. Use [`getShopAnalytics`](/docs/api/hydrogen/2024-07/utilities/getshopanalytics)." + "name": "cookieDomain", + "value": "string", + "description": "The domain scope of the cookie set with `useShopifyCookies`. *", + "isOptional": true } ] }, "CartReturn": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartReturn", "value": "Cart & {\n errors?: StorefrontApiErrors;\n}", @@ -426,44 +426,80 @@ "override": "[Cart](/docs/api/storefront/2024-07/objects/Cart) - Storefront API type" }, "StorefrontApiErrors": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "StorefrontApiErrors", "value": "JsonGraphQLError[] | undefined", "description": "" }, - "JsonGraphQLError": { - "filePath": "src/storefront.ts", + "ShopAnalytics": { + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "TypeAliasDeclaration", - "name": "JsonGraphQLError", - "value": "ReturnType", + "name": "ShopAnalytics", + "value": "{\n /** The shop ID. */\n shopId: string;\n /** The language code that is being displayed to user. */\n acceptedLanguage: LanguageCode;\n /** The currency code that is being displayed to user. */\n currency: CurrencyCode;\n /** The Hydrogen subchannel ID generated by Oxygen in the environment variable. */\n hydrogenSubchannelId: string | '0';\n}", "description": "", - "members": [] + "members": [ + { + "filePath": "/analytics-manager/AnalyticsProvider.tsx", + "syntaxKind": "PropertySignature", + "name": "shopId", + "value": "string", + "description": "The shop ID." + }, + { + "filePath": "/analytics-manager/AnalyticsProvider.tsx", + "syntaxKind": "PropertySignature", + "name": "acceptedLanguage", + "value": "LanguageCode", + "description": "The language code that is being displayed to user." + }, + { + "filePath": "/analytics-manager/AnalyticsProvider.tsx", + "syntaxKind": "PropertySignature", + "name": "currency", + "value": "CurrencyCode", + "description": "The currency code that is being displayed to user." + }, + { + "filePath": "/analytics-manager/AnalyticsProvider.tsx", + "syntaxKind": "PropertySignature", + "name": "hydrogenSubchannelId", + "value": "string", + "description": "The Hydrogen subchannel ID generated by Oxygen in the environment variable." + } + ] }, "CustomerPrivacyApiProps": { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CustomerPrivacyApiProps", "value": "{\n /** The production shop checkout domain url. */\n checkoutDomain: string;\n /** The storefront access token for the shop. */\n storefrontAccessToken: string;\n /** Whether to load the Shopify privacy banner as configured in Shopify admin. Defaults to true. */\n withPrivacyBanner?: boolean;\n /** Callback to be called when visitor consent is collected. */\n onVisitorConsentCollected?: (consent: VisitorConsentCollected) => void;\n /** Callback to be call when customer privacy api is ready. */\n onReady?: () => void;\n}", "description": "", "members": [ { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", "name": "checkoutDomain", "value": "string", "description": "The production shop checkout domain url." }, { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", - "name": "onReady", - "value": "() => void", - "description": "Callback to be call when customer privacy api is ready.", + "name": "storefrontAccessToken", + "value": "string", + "description": "The storefront access token for the shop." + }, + { + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", + "syntaxKind": "PropertySignature", + "name": "withPrivacyBanner", + "value": "boolean", + "description": "Whether to load the Shopify privacy banner as configured in Shopify admin. Defaults to true.", "isOptional": true }, { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", "name": "onVisitorConsentCollected", "value": "(consent: VisitorConsentCollected) => void", @@ -471,66 +507,59 @@ "isOptional": true }, { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", - "syntaxKind": "PropertySignature", - "name": "storefrontAccessToken", - "value": "string", - "description": "The storefront access token for the shop." - }, - { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", - "name": "withPrivacyBanner", - "value": "boolean", - "description": "Whether to load the Shopify privacy banner as configured in Shopify admin. Defaults to true.", + "name": "onReady", + "value": "() => void", + "description": "Callback to be call when customer privacy api is ready.", "isOptional": true } ] }, "VisitorConsentCollected": { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "VisitorConsentCollected", "value": "{\n analyticsAllowed: boolean;\n firstPartyMarketingAllowed: boolean;\n marketingAllowed: boolean;\n preferencesAllowed: boolean;\n saleOfDataAllowed: boolean;\n thirdPartyMarketingAllowed: boolean;\n}", "description": "", "members": [ { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", "name": "analyticsAllowed", "value": "boolean", "description": "" }, { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", "name": "firstPartyMarketingAllowed", "value": "boolean", "description": "" }, { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", "name": "marketingAllowed", "value": "boolean", "description": "" }, { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", "name": "preferencesAllowed", "value": "boolean", "description": "" }, { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", "name": "saleOfDataAllowed", "value": "boolean", "description": "" }, { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", "name": "thirdPartyMarketingAllowed", "value": "boolean", @@ -539,14 +568,14 @@ ] }, "PrivacyBanner": { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "PrivacyBanner", "value": "{\n loadBanner: (options: CustomerPrivacyConsentConfig) => void;\n}", "description": "", "members": [ { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", "name": "loadBanner", "value": "(options: CustomerPrivacyConsentConfig) => void", @@ -555,14 +584,14 @@ ] }, "CustomerPrivacyConsentConfig": { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CustomerPrivacyConsentConfig", "value": "{\n checkoutRootDomain?: string;\n storefrontRootDomain?: string;\n storefrontAccessToken?: string;\n}", "description": "", "members": [ { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", "name": "checkoutRootDomain", "value": "string", @@ -570,59 +599,22 @@ "isOptional": true }, { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", - "name": "storefrontAccessToken", + "name": "storefrontRootDomain", "value": "string", "description": "", "isOptional": true }, { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", - "name": "storefrontRootDomain", + "name": "storefrontAccessToken", "value": "string", "description": "", "isOptional": true } ] - }, - "ShopAnalytics": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", - "syntaxKind": "TypeAliasDeclaration", - "name": "ShopAnalytics", - "value": "{\n /** The shop ID. */\n shopId: string;\n /** The language code that is being displayed to user. */\n acceptedLanguage: LanguageCode;\n /** The currency code that is being displayed to user. */\n currency: CurrencyCode;\n /** The Hydrogen subchannel ID generated by Oxygen in the environment variable. */\n hydrogenSubchannelId: string | '0';\n}", - "description": "", - "members": [ - { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", - "syntaxKind": "PropertySignature", - "name": "acceptedLanguage", - "value": "LanguageCode", - "description": "The language code that is being displayed to user." - }, - { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", - "syntaxKind": "PropertySignature", - "name": "currency", - "value": "CurrencyCode", - "description": "The currency code that is being displayed to user." - }, - { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", - "syntaxKind": "PropertySignature", - "name": "hydrogenSubchannelId", - "value": "string | '0'", - "description": "The Hydrogen subchannel ID generated by Oxygen in the environment variable." - }, - { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", - "syntaxKind": "PropertySignature", - "name": "shopId", - "value": "string", - "description": "The shop ID." - } - ] } } } @@ -661,7 +653,7 @@ "type": "AnalyticsProductViewGeneratedType", "typeDefinitions": { "AnalyticsProductViewGeneratedType": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "name": "AnalyticsProductViewGeneratedType", "description": "", "params": [ @@ -669,11 +661,11 @@ "name": "props", "description": "", "value": "ProductViewProps", - "filePath": "src/analytics-manager/AnalyticsView.tsx" + "filePath": "/analytics-manager/AnalyticsView.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "description": "", "name": "", "value": "" @@ -681,45 +673,38 @@ "value": "export function AnalyticsProductView(props: ProductViewProps) {\n return ;\n}" }, "ProductViewProps": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "ProductViewProps", "value": "{\n data: ProductsPayload;\n customData?: OtherData;\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", + "syntaxKind": "PropertySignature", + "name": "data", + "value": "ProductsPayload", + "description": "" + }, + { + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", "name": "customData", "value": "OtherData", "description": "", "isOptional": true - }, - { - "filePath": "src/analytics-manager/AnalyticsView.tsx", - "syntaxKind": "PropertySignature", - "name": "data", - "value": "ProductsPayload", - "description": "" } ] }, - "OtherData": { - "description": "", - "name": "OtherData", - "value": "OtherData", - "members": [], - "override": "Any `` pair" - }, "ProductsPayload": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "ProductsPayload", "value": "{\n /** The products associated with this event. */\n products: Array;\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", "name": "products", "value": "Array", @@ -728,78 +713,85 @@ ] }, "ProductPayload": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "ProductPayload", "value": "{\n /** The product id. */\n id: Product['id'];\n /** The product title. */\n title: Product['title'];\n /** The displaying variant price. */\n price: ProductVariant['price']['amount'];\n /** The product vendor. */\n vendor: Product['vendor'];\n /** The displaying variant id. */\n variantId: ProductVariant['id'];\n /** The displaying variant title. */\n variantTitle: ProductVariant['title'];\n /** The quantity of product. */\n quantity: number;\n /** The product sku. */\n sku?: ProductVariant['sku'];\n /** The product type. */\n productType?: Product['productType'];\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", "name": "id", "value": "string", "description": "The product id." }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "price", + "name": "title", "value": "string", - "description": "The displaying variant price." + "description": "The product title." }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "productType", + "name": "price", "value": "string", - "description": "The product type.", - "isOptional": true + "description": "The displaying variant price." }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "quantity", - "value": "number", - "description": "The quantity of product." + "name": "vendor", + "value": "string", + "description": "The product vendor." }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "sku", + "name": "variantId", "value": "string", - "description": "The product sku.", - "isOptional": true + "description": "The displaying variant id." }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "title", + "name": "variantTitle", "value": "string", - "description": "The product title." + "description": "The displaying variant title." }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "variantId", - "value": "string", - "description": "The displaying variant id." + "name": "quantity", + "value": "number", + "description": "The quantity of product." }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "variantTitle", + "name": "sku", "value": "string", - "description": "The displaying variant title." + "description": "The product sku.", + "isOptional": true }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "vendor", + "name": "productType", "value": "string", - "description": "The product vendor." + "description": "The product type.", + "isOptional": true } ] + }, + "OtherData": { + "description": "", + "name": "OtherData", + "value": "OtherData", + "members": [], + "override": "Any `` pair" } } } @@ -838,7 +830,7 @@ "type": "AnalyticsSearchViewGeneratedType", "typeDefinitions": { "AnalyticsSearchViewGeneratedType": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "name": "AnalyticsSearchViewGeneratedType", "description": "", "params": [ @@ -846,11 +838,11 @@ "name": "props", "description": "", "value": "SearchViewProps", - "filePath": "src/analytics-manager/AnalyticsView.tsx" + "filePath": "/analytics-manager/AnalyticsView.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "description": "", "name": "", "value": "" @@ -858,60 +850,60 @@ "value": "export function AnalyticsSearchView(props: SearchViewProps) {\n return ;\n}" }, "SearchViewProps": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "SearchViewProps", "value": "{\n data?: SearchPayload;\n customData?: OtherData;\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "customData", - "value": "OtherData", + "name": "data", + "value": "SearchPayload", "description": "", "isOptional": true }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "data", - "value": "SearchPayload", + "name": "customData", + "value": "OtherData", "description": "", "isOptional": true } ] }, - "OtherData": { - "description": "", - "name": "OtherData", - "value": "OtherData", - "members": [], - "override": "Any `` pair" - }, "SearchPayload": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "SearchPayload", "value": "{\n /** The search term used for the search results page */\n searchTerm: string;\n /** The search results */\n searchResults?: any;\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", + "syntaxKind": "PropertySignature", + "name": "searchTerm", + "value": "string", + "description": "The search term used for the search results page" + }, + { + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", "name": "searchResults", "value": "any", "description": "The search results", "isOptional": true - }, - { - "filePath": "src/analytics-manager/AnalyticsView.tsx", - "syntaxKind": "PropertySignature", - "name": "searchTerm", - "value": "string", - "description": "The search term used for the search results page" } ] + }, + "OtherData": { + "description": "", + "name": "OtherData", + "value": "OtherData", + "members": [], + "override": "Any `` pair" } } } @@ -949,7 +941,7 @@ "type": "GetShopAnalyticsGeneratedType", "typeDefinitions": { "GetShopAnalyticsGeneratedType": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "name": "GetShopAnalyticsGeneratedType", "description": "", "params": [ @@ -957,11 +949,11 @@ "name": "input1", "description": "", "value": "ShopAnalyticsProps", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "description": "", "name": "Promise", "value": "Promise" @@ -969,249 +961,241 @@ "value": "export async function getShopAnalytics({\n storefront,\n publicStorefrontId = '0',\n}: ShopAnalyticsProps): Promise {\n return storefront\n .query(SHOP_QUERY, {\n cache: storefront.CacheLong(),\n })\n .then(({shop, localization}: {shop: Shop; localization: Localization}) => {\n return {\n shopId: shop.id,\n acceptedLanguage: localization.language.isoCode,\n currency: localization.country.currency.isoCode,\n hydrogenSubchannelId: publicStorefrontId,\n };\n });\n}" }, "ShopAnalyticsProps": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "ShopAnalyticsProps", "value": "{\n /**\n * The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/2024-07/utilities/createstorefrontclient).\n */\n storefront: Storefront;\n /**\n * The `PUBLIC_STOREFRONT_ID` generated by Oxygen in the environment variable.\n */\n publicStorefrontId: string;\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", - "syntaxKind": "PropertySignature", - "name": "publicStorefrontId", - "value": "string", - "description": "The `PUBLIC_STOREFRONT_ID` generated by Oxygen in the environment variable." - }, - { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "PropertySignature", "name": "storefront", "value": "Storefront", "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/2024-07/utilities/createstorefrontclient)." + }, + { + "filePath": "/analytics-manager/AnalyticsProvider.tsx", + "syntaxKind": "PropertySignature", + "name": "publicStorefrontId", + "value": "string", + "description": "The `PUBLIC_STOREFRONT_ID` generated by Oxygen in the environment variable." } ] }, "Storefront": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "Storefront", "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", "description": "Interface to interact with the Storefront API.", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "cache", - "value": "Cache", - "description": "", - "isOptional": true + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "CacheCustom", - "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "CacheLong", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "cache", + "value": "Cache", + "description": "", + "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", "name": "CacheNone", "value": "() => NoStoreStrategy", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "CacheShort", + "name": "CacheLong", "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "generateCacheControlHeader", - "value": "(cacheOptions: AllCacheOptions) => string", + "name": "CacheShort", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "(props?: Partial>) => string", + "name": "CacheCustom", + "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getPrivateTokenHeaders", - "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", + "name": "generateCacheControlHeader", + "value": "(cacheOptions: AllCacheOptions) => string", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", "name": "getPublicTokenHeaders", "value": "(props?: Partial> & Pick) => Record", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getShopifyDomain", - "value": "(props?: Partial>) => string", + "name": "getPrivateTokenHeaders", + "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "i18n", - "value": "TI18n", + "name": "getShopifyDomain", + "value": "(props?: Partial>) => string", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "name": "getApiUrl", + "value": "(props?: Partial>) => string", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "name": "i18n", + "value": "TI18n", "description": "" } ] }, - "AllCacheOptions": { - "filePath": "src/cache/strategies.ts", - "name": "AllCacheOptions", - "description": "Override options for a cache strategy.", + "StorefrontQueries": { + "filePath": "/storefront.ts", + "name": "StorefrontQueries", + "description": "Maps all the queries found in the project to variables and return types.", + "members": [], + "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + }, + "AutoAddedVariableNames": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "AutoAddedVariableNames", + "value": "'country' | 'language'", + "description": "" + }, + "StorefrontCommonExtraParams": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontCommonExtraParams", + "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", + "description": "", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "name": "headers", + "value": "HeadersInit", + "description": "", "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "mode", + "name": "storefrontApiVersion", "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", + "description": "", "isOptional": true }, { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true - } - ], - "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" - }, - "NoStoreStrategy": { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "NoStoreStrategy", - "value": "{\n mode: string;\n}", - "description": "", - "members": [ - { - "filePath": "src/cache/strategies.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "mode", + "name": "displayName", "value": "string", - "description": "" + "description": "", + "isOptional": true } ] }, - "StorefrontMutations": { - "filePath": "src/storefront.ts", - "name": "StorefrontMutations", - "description": "Maps all the mutations found in the project to variables and return types.", - "members": [], - "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" - }, - "AutoAddedVariableNames": { - "filePath": "src/storefront.ts", + "StorefrontQueryOptions": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "AutoAddedVariableNames", - "value": "'country' | 'language'", + "name": "StorefrontQueryOptions", + "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", "description": "" }, - "StorefrontCommonExtraParams": { - "filePath": "src/storefront.ts", + "CachingStrategy": { + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontCommonExtraParams", - "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", - "description": "", + "name": "CachingStrategy", + "value": "AllCacheOptions", + "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "displayName", + "name": "mode", "value": "string", - "description": "", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "headers", - "value": "HeadersInit", - "description": "", + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "storefrontApiVersion", - "value": "string", - "description": "", + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", "isOptional": true } ] }, "StorefrontError": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "StorefrontError", "value": "{\n errors?: StorefrontApiErrors;\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", "name": "errors", "value": "StorefrontApiErrors", @@ -1221,43 +1205,50 @@ ] }, "StorefrontApiErrors": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "StorefrontApiErrors", "value": "JsonGraphQLError[] | undefined", "description": "" }, - "JsonGraphQLError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "JsonGraphQLError", - "value": "ReturnType", - "description": "", - "members": [] - }, - "StorefrontQueries": { - "filePath": "src/storefront.ts", - "name": "StorefrontQueries", - "description": "Maps all the queries found in the project to variables and return types.", + "StorefrontMutations": { + "filePath": "/storefront.ts", + "name": "StorefrontMutations", + "description": "Maps all the mutations found in the project to variables and return types.", "members": [], - "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" }, - "StorefrontQueryOptions": { - "filePath": "src/storefront.ts", + "NoStoreStrategy": { + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontQueryOptions", - "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", - "description": "" + "name": "NoStoreStrategy", + "value": "{\n mode: string;\n}", + "description": "", + "members": [ + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "" + } + ] }, - "CachingStrategy": { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CachingStrategy", - "value": "AllCacheOptions", - "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", + "AllCacheOptions": { + "filePath": "/cache/strategies.ts", + "name": "AllCacheOptions", + "description": "Override options for a cache strategy.", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "maxAge", "value": "number", @@ -1265,15 +1256,15 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "sMaxAge", "value": "number", @@ -1281,57 +1272,50 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "staleIfError", "value": "number", "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true } - ] - }, + ], + "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" + }, "ShopAnalytics": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "ShopAnalytics", "value": "{\n /** The shop ID. */\n shopId: string;\n /** The language code that is being displayed to user. */\n acceptedLanguage: LanguageCode;\n /** The currency code that is being displayed to user. */\n currency: CurrencyCode;\n /** The Hydrogen subchannel ID generated by Oxygen in the environment variable. */\n hydrogenSubchannelId: string | '0';\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", + "syntaxKind": "PropertySignature", + "name": "shopId", + "value": "string", + "description": "The shop ID." + }, + { + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "PropertySignature", "name": "acceptedLanguage", "value": "LanguageCode", "description": "The language code that is being displayed to user." }, { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "PropertySignature", "name": "currency", "value": "CurrencyCode", "description": "The currency code that is being displayed to user." }, { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "PropertySignature", "name": "hydrogenSubchannelId", - "value": "string | '0'", - "description": "The Hydrogen subchannel ID generated by Oxygen in the environment variable." - }, - { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", - "syntaxKind": "PropertySignature", - "name": "shopId", "value": "string", - "description": "The shop ID." + "description": "The Hydrogen subchannel ID generated by Oxygen in the environment variable." } ] } @@ -1371,14 +1355,14 @@ "type": "AnalyticsContextValueForDoc", "typeDefinitions": { "AnalyticsContextValueForDoc": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "AnalyticsContextValueForDoc", "value": "{\n /** A function to tell you the current state of if the user can be tracked by analytics. Defaults to Customer Privacy API's `window.Shopify.customerPrivacy.analyticsProcessingAllowed()`. */\n canTrack?: () => boolean;\n /** The current cart state. */\n cart?: Promise | CartReturn | null;\n /** The custom data passed in from the `AnalyticsProvider`. */\n customData?: Record;\n /** The previous cart state. */\n prevCart?: Promise | CartReturn | null;\n /** A function to publish an analytics event. */\n publish?: AnalyticsContextPublishForDoc;\n /** A function to register with the analytics provider. It holds the first browser load events until all registered key has executed the supplied `ready` function. [See example register usage](/docs/api/hydrogen/2024-07/hooks/useanalytics#example-useanalytics.register). */\n register?: (key: string) => {ready: () => void};\n /** The shop configuration required to publish events to Shopify. */\n shop?: Promise | ShopAnalytics | null;\n /** A function to subscribe to analytics events. */\n subscribe?: AnalyticsContextSubscribeForDoc;\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "PropertySignature", "name": "canTrack", "value": "() => boolean", @@ -1386,15 +1370,15 @@ "isOptional": true }, { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "PropertySignature", "name": "cart", - "value": "Promise | CartReturn | null", + "value": "CartReturn | Promise", "description": "The current cart state.", "isOptional": true }, { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "PropertySignature", "name": "customData", "value": "Record", @@ -1402,15 +1386,15 @@ "isOptional": true }, { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "PropertySignature", "name": "prevCart", - "value": "Promise | CartReturn | null", + "value": "CartReturn | Promise", "description": "The previous cart state.", "isOptional": true }, { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "PropertySignature", "name": "publish", "value": "AnalyticsContextPublishForDoc", @@ -1418,7 +1402,7 @@ "isOptional": true }, { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "PropertySignature", "name": "register", "value": "(key: string) => { ready: () => void; }", @@ -1426,15 +1410,15 @@ "isOptional": true }, { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "PropertySignature", "name": "shop", - "value": "Promise | ShopAnalytics | null", + "value": "ShopAnalytics | Promise", "description": "The shop configuration required to publish events to Shopify.", "isOptional": true }, { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "PropertySignature", "name": "subscribe", "value": "AnalyticsContextSubscribeForDoc", @@ -1444,7 +1428,7 @@ ] }, "CartReturn": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartReturn", "value": "Cart & {\n errors?: StorefrontApiErrors;\n}", @@ -1458,29 +1442,21 @@ "override": "[Cart](/docs/api/storefront/2024-07/objects/Cart) - Storefront API type" }, "StorefrontApiErrors": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "StorefrontApiErrors", "value": "JsonGraphQLError[] | undefined", "description": "" }, - "JsonGraphQLError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "JsonGraphQLError", - "value": "ReturnType", - "description": "", - "members": [] - }, "AnalyticsContextPublishForDoc": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "AnalyticsContextPublishForDoc", "value": "PublishPageView | PublishProductView | PublishCollectionView | PublishCartView | PublishSearchView | PublishCartUpdated | PublishProductAddedToCart | PublishProductRemovedFromCart | PublishCustomEvent", "description": "" }, "PublishPageView": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "name": "PublishPageView", "description": "", "params": [ @@ -1488,17 +1464,17 @@ "name": "event", "description": "", "value": "\"page_viewed\"", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" }, { "name": "payload", "description": "", "value": "PageViewPayload", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "description": "", "name": "void", "value": "void" @@ -1506,21 +1482,21 @@ "value": "type PublishPageView = (event: 'page_viewed', payload: PageViewPayload) => void;" }, "PageViewPayload": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "PageViewPayload", "value": "UrlPayload & BasePayload", "description": "" }, "UrlPayload": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "UrlPayload", "value": "{\n /** The url location of when this event is collected. */\n url: string;\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", "name": "url", "value": "string", @@ -1529,68 +1505,68 @@ ] }, "BasePayload": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "BasePayload", "value": "{\n /** The shop data passed in from the `AnalyticsProvider`. */\n shop: ShopAnalytics | null;\n /** The custom data passed in from the `AnalyticsProvider`. */\n customData?: AnalyticsProviderProps['customData'];\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", + "syntaxKind": "PropertySignature", + "name": "shop", + "value": "ShopAnalytics", + "description": "The shop data passed in from the `AnalyticsProvider`." + }, + { + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", "name": "customData", "value": "Record", "description": "The custom data passed in from the `AnalyticsProvider`.", "isOptional": true - }, - { - "filePath": "src/analytics-manager/AnalyticsView.tsx", - "syntaxKind": "PropertySignature", - "name": "shop", - "value": "ShopAnalytics | null", - "description": "The shop data passed in from the `AnalyticsProvider`." } ] }, "ShopAnalytics": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "ShopAnalytics", "value": "{\n /** The shop ID. */\n shopId: string;\n /** The language code that is being displayed to user. */\n acceptedLanguage: LanguageCode;\n /** The currency code that is being displayed to user. */\n currency: CurrencyCode;\n /** The Hydrogen subchannel ID generated by Oxygen in the environment variable. */\n hydrogenSubchannelId: string | '0';\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", + "syntaxKind": "PropertySignature", + "name": "shopId", + "value": "string", + "description": "The shop ID." + }, + { + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "PropertySignature", "name": "acceptedLanguage", "value": "LanguageCode", "description": "The language code that is being displayed to user." }, { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "PropertySignature", "name": "currency", "value": "CurrencyCode", "description": "The currency code that is being displayed to user." }, { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "PropertySignature", "name": "hydrogenSubchannelId", - "value": "string | '0'", - "description": "The Hydrogen subchannel ID generated by Oxygen in the environment variable." - }, - { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", - "syntaxKind": "PropertySignature", - "name": "shopId", "value": "string", - "description": "The shop ID." + "description": "The Hydrogen subchannel ID generated by Oxygen in the environment variable." } ] }, "PublishProductView": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "name": "PublishProductView", "description": "", "params": [ @@ -1598,17 +1574,17 @@ "name": "event", "description": "", "value": "\"product_viewed\"", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" }, { "name": "payload", "description": "", "value": "ProductViewPayload", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "description": "", "name": "void", "value": "void" @@ -1616,21 +1592,21 @@ "value": "type PublishProductView = (\n event: 'product_viewed',\n payload: ProductViewPayload,\n) => void;" }, "ProductViewPayload": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "ProductViewPayload", "value": "ProductsPayload & UrlPayload & BasePayload", "description": "" }, "ProductsPayload": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "ProductsPayload", "value": "{\n /** The products associated with this event. */\n products: Array;\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", "name": "products", "value": "Array", @@ -1639,76 +1615,76 @@ ] }, "ProductPayload": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "ProductPayload", "value": "{\n /** The product id. */\n id: Product['id'];\n /** The product title. */\n title: Product['title'];\n /** The displaying variant price. */\n price: ProductVariant['price']['amount'];\n /** The product vendor. */\n vendor: Product['vendor'];\n /** The displaying variant id. */\n variantId: ProductVariant['id'];\n /** The displaying variant title. */\n variantTitle: ProductVariant['title'];\n /** The quantity of product. */\n quantity: number;\n /** The product sku. */\n sku?: ProductVariant['sku'];\n /** The product type. */\n productType?: Product['productType'];\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", "name": "id", "value": "string", "description": "The product id." }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "price", + "name": "title", "value": "string", - "description": "The displaying variant price." + "description": "The product title." }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "productType", + "name": "price", "value": "string", - "description": "The product type.", - "isOptional": true + "description": "The displaying variant price." }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "quantity", - "value": "number", - "description": "The quantity of product." + "name": "vendor", + "value": "string", + "description": "The product vendor." }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "sku", + "name": "variantId", "value": "string", - "description": "The product sku.", - "isOptional": true + "description": "The displaying variant id." }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "title", + "name": "variantTitle", "value": "string", - "description": "The product title." + "description": "The displaying variant title." }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "variantId", - "value": "string", - "description": "The displaying variant id." + "name": "quantity", + "value": "number", + "description": "The quantity of product." }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "variantTitle", + "name": "sku", "value": "string", - "description": "The displaying variant title." + "description": "The product sku.", + "isOptional": true }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "vendor", + "name": "productType", "value": "string", - "description": "The product vendor." + "description": "The product type.", + "isOptional": true } ] }, @@ -1720,7 +1696,7 @@ "override": "Any `` pair" }, "PublishCollectionView": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "name": "PublishCollectionView", "description": "", "params": [ @@ -1728,17 +1704,17 @@ "name": "event", "description": "", "value": "\"collection_viewed\"", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" }, { "name": "payload", "description": "", "value": "CollectionViewPayload", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "description": "", "name": "void", "value": "void" @@ -1746,21 +1722,21 @@ "value": "type PublishCollectionView = (\n event: 'collection_viewed',\n payload: CollectionViewPayload,\n) => void;" }, "CollectionViewPayload": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CollectionViewPayload", "value": "CollectionPayload & UrlPayload & BasePayload", "description": "" }, "CollectionPayload": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CollectionPayload", "value": "{\n collection: CollectionPayloadDetails;\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", "name": "collection", "value": "CollectionPayloadDetails", @@ -1769,30 +1745,30 @@ ] }, "CollectionPayloadDetails": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CollectionPayloadDetails", "value": "{\n /** The collection id. */\n id: string;\n /** The collection handle. */\n handle: string;\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "handle", + "name": "id", "value": "string", - "description": "The collection handle." + "description": "The collection id." }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "id", + "name": "handle", "value": "string", - "description": "The collection id." + "description": "The collection handle." } ] }, "PublishCartView": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "name": "PublishCartView", "description": "", "params": [ @@ -1800,17 +1776,17 @@ "name": "event", "description": "", "value": "\"cart_viewed\"", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" }, { "name": "payload", "description": "", "value": "CartViewPayload", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "description": "", "name": "void", "value": "void" @@ -1818,37 +1794,37 @@ "value": "type PublishCartView = (event: 'cart_viewed', payload: CartViewPayload) => void;" }, "CartViewPayload": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CartViewPayload", "value": "CartPayload & UrlPayload & BasePayload", "description": "" }, "CartPayload": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CartPayload", "value": "{\n /** The current cart state. */\n cart: CartReturn | null;\n /** The previous cart state. */\n prevCart: CartReturn | null;\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", "name": "cart", - "value": "CartReturn | null", + "value": "CartReturn", "description": "The current cart state." }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", "name": "prevCart", - "value": "CartReturn | null", + "value": "CartReturn", "description": "The previous cart state." } ] }, "PublishSearchView": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "name": "PublishSearchView", "description": "", "params": [ @@ -1856,17 +1832,17 @@ "name": "event", "description": "", "value": "\"search_viewed\"", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" }, { "name": "payload", "description": "", "value": "SearchViewPayload", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "description": "", "name": "void", "value": "void" @@ -1874,38 +1850,38 @@ "value": "type PublishSearchView = (\n event: 'search_viewed',\n payload: SearchViewPayload,\n) => void;" }, "SearchViewPayload": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "SearchViewPayload", "value": "SearchPayload & UrlPayload & BasePayload", "description": "" }, "SearchPayload": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "SearchPayload", "value": "{\n /** The search term used for the search results page */\n searchTerm: string;\n /** The search results */\n searchResults?: any;\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", + "syntaxKind": "PropertySignature", + "name": "searchTerm", + "value": "string", + "description": "The search term used for the search results page" + }, + { + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", "name": "searchResults", "value": "any", "description": "The search results", "isOptional": true - }, - { - "filePath": "src/analytics-manager/AnalyticsView.tsx", - "syntaxKind": "PropertySignature", - "name": "searchTerm", - "value": "string", - "description": "The search term used for the search results page" } ] }, "PublishCartUpdated": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "name": "PublishCartUpdated", "description": "", "params": [ @@ -1913,17 +1889,17 @@ "name": "event", "description": "", "value": "\"cart_updated\"", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" }, { "name": "payload", "description": "", "value": "CartUpdatePayload", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "description": "", "name": "void", "value": "void" @@ -1931,14 +1907,14 @@ "value": "type PublishCartUpdated = (\n event: 'cart_updated',\n payload: CartUpdatePayload,\n) => void;" }, "CartUpdatePayload": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CartUpdatePayload", "value": "CartPayload & BasePayload & OtherData", "description": "" }, "PublishProductAddedToCart": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "name": "PublishProductAddedToCart", "description": "", "params": [ @@ -1946,17 +1922,17 @@ "name": "event", "description": "", "value": "\"product_added_to_cart\"", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" }, { "name": "payload", "description": "", "value": "CartLineUpdatePayload", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "description": "", "name": "void", "value": "void" @@ -1964,39 +1940,39 @@ "value": "type PublishProductAddedToCart = (\n event: 'product_added_to_cart',\n payload: CartLineUpdatePayload,\n) => void;" }, "CartLineUpdatePayload": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CartLineUpdatePayload", "value": "CartLinePayload & CartPayload & BasePayload & OtherData", "description": "" }, "CartLinePayload": { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CartLinePayload", "value": "{\n /** The previous state of the cart line that got updated. */\n prevLine?: CartLine | ComponentizableCartLine;\n /** The current state of the cart line that got updated. */\n currentLine?: CartLine | ComponentizableCartLine;\n}", "description": "", "members": [ { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "currentLine", + "name": "prevLine", "value": "CartLine | ComponentizableCartLine", - "description": "The current state of the cart line that got updated.", + "description": "The previous state of the cart line that got updated.", "isOptional": true }, { - "filePath": "src/analytics-manager/AnalyticsView.tsx", + "filePath": "/analytics-manager/AnalyticsView.tsx", "syntaxKind": "PropertySignature", - "name": "prevLine", + "name": "currentLine", "value": "CartLine | ComponentizableCartLine", - "description": "The previous state of the cart line that got updated.", + "description": "The current state of the cart line that got updated.", "isOptional": true } ] }, "PublishProductRemovedFromCart": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "name": "PublishProductRemovedFromCart", "description": "", "params": [ @@ -2004,17 +1980,17 @@ "name": "event", "description": "", "value": "\"product_removed_from_cart\"", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" }, { "name": "payload", "description": "", "value": "CartLineUpdatePayload", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "description": "", "name": "void", "value": "void" @@ -2022,7 +1998,7 @@ "value": "type PublishProductRemovedFromCart = (\n event: 'product_removed_from_cart',\n payload: CartLineUpdatePayload,\n) => void;" }, "PublishCustomEvent": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "name": "PublishCustomEvent", "description": "", "params": [ @@ -2030,17 +2006,17 @@ "name": "event", "description": "", "value": "`custom_${string}`", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" }, { "name": "payload", "description": "", "value": "OtherData", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "description": "", "name": "void", "value": "void" @@ -2048,14 +2024,14 @@ "value": "type PublishCustomEvent = (\n event: `custom_${string}`,\n payload: OtherData,\n) => void;" }, "AnalyticsContextSubscribeForDoc": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "AnalyticsContextSubscribeForDoc", "value": "SubscribePageView | SubscribeProductView | SubscribeCollectionView | SubscribeCartView | SubscribeSearchView | SubscribeCartUpdated | SubscribeProductAddedToCart | SubscribeProductRemovedFromCart | SubscribeCustomEvent", "description": "" }, "SubscribePageView": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "name": "SubscribePageView", "description": "", "params": [ @@ -2063,17 +2039,17 @@ "name": "event", "description": "", "value": "\"page_viewed\"", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" }, { "name": "callback", "description": "", "value": "(payload: PageViewPayload) => void", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "description": "", "name": "void", "value": "void" @@ -2081,7 +2057,7 @@ "value": "type SubscribePageView = (\n event: 'page_viewed',\n callback: (payload: PageViewPayload) => void,\n) => void;" }, "SubscribeProductView": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "name": "SubscribeProductView", "description": "", "params": [ @@ -2089,17 +2065,17 @@ "name": "event", "description": "", "value": "\"product_viewed\"", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" }, { "name": "callback", "description": "", "value": "(payload: ProductViewPayload) => void", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "description": "", "name": "void", "value": "void" @@ -2107,7 +2083,7 @@ "value": "type SubscribeProductView = (\n event: 'product_viewed',\n callback: (payload: ProductViewPayload) => void,\n) => void;" }, "SubscribeCollectionView": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "name": "SubscribeCollectionView", "description": "", "params": [ @@ -2115,17 +2091,17 @@ "name": "event", "description": "", "value": "\"collection_viewed\"", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" }, { "name": "callback", "description": "", "value": "(payload: CollectionViewPayload) => void", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "description": "", "name": "void", "value": "void" @@ -2133,7 +2109,7 @@ "value": "type SubscribeCollectionView = (\n event: 'collection_viewed',\n callback: (payload: CollectionViewPayload) => void,\n) => void;" }, "SubscribeCartView": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "name": "SubscribeCartView", "description": "", "params": [ @@ -2141,17 +2117,17 @@ "name": "event", "description": "", "value": "\"cart_viewed\"", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" }, { "name": "callback", "description": "", "value": "(payload: CartViewPayload) => void", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "description": "", "name": "void", "value": "void" @@ -2159,7 +2135,7 @@ "value": "type SubscribeCartView = (\n event: 'cart_viewed',\n callback: (payload: CartViewPayload) => void,\n) => void;" }, "SubscribeSearchView": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "name": "SubscribeSearchView", "description": "", "params": [ @@ -2167,17 +2143,17 @@ "name": "event", "description": "", "value": "\"search_viewed\"", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" }, { "name": "callback", "description": "", "value": "(payload: SearchViewPayload) => void", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "description": "", "name": "void", "value": "void" @@ -2185,7 +2161,7 @@ "value": "type SubscribeSearchView = (\n event: 'search_viewed',\n callback: (payload: SearchViewPayload) => void,\n) => void;" }, "SubscribeCartUpdated": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "name": "SubscribeCartUpdated", "description": "", "params": [ @@ -2193,17 +2169,17 @@ "name": "event", "description": "", "value": "\"cart_updated\"", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" }, { "name": "callback", "description": "", "value": "(payload: CartUpdatePayload) => void", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "description": "", "name": "void", "value": "void" @@ -2211,7 +2187,7 @@ "value": "type SubscribeCartUpdated = (\n event: 'cart_updated',\n callback: (payload: CartUpdatePayload) => void,\n) => void;" }, "SubscribeProductAddedToCart": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "name": "SubscribeProductAddedToCart", "description": "", "params": [ @@ -2219,17 +2195,17 @@ "name": "event", "description": "", "value": "\"product_added_to_cart\"", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" }, { "name": "callback", "description": "", "value": "(payload: CartLineUpdatePayload) => void", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "description": "", "name": "void", "value": "void" @@ -2237,7 +2213,7 @@ "value": "type SubscribeProductAddedToCart = (\n event: 'product_added_to_cart',\n callback: (payload: CartLineUpdatePayload) => void,\n) => void;" }, "SubscribeProductRemovedFromCart": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "name": "SubscribeProductRemovedFromCart", "description": "", "params": [ @@ -2245,17 +2221,17 @@ "name": "event", "description": "", "value": "\"product_removed_from_cart\"", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" }, { "name": "callback", "description": "", "value": "(payload: CartLineUpdatePayload) => void", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "description": "", "name": "void", "value": "void" @@ -2263,7 +2239,7 @@ "value": "type SubscribeProductRemovedFromCart = (\n event: 'product_removed_from_cart',\n callback: (payload: CartLineUpdatePayload) => void,\n) => void;" }, "SubscribeCustomEvent": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "name": "SubscribeCustomEvent", "description": "", "params": [ @@ -2271,17 +2247,17 @@ "name": "event", "description": "", "value": "`custom_${string}`", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" }, { "name": "callback", "description": "", "value": "(payload: OtherData) => void", - "filePath": "src/analytics-manager/AnalyticsProvider.tsx" + "filePath": "/analytics-manager/AnalyticsProvider.tsx" } ], "returns": { - "filePath": "src/analytics-manager/AnalyticsProvider.tsx", + "filePath": "/analytics-manager/AnalyticsProvider.tsx", "description": "", "name": "void", "value": "void" @@ -2369,7 +2345,7 @@ "type": "CacheCustomGeneratedType", "typeDefinitions": { "CacheCustomGeneratedType": { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "name": "CacheCustomGeneratedType", "description": "", "params": [ @@ -2377,11 +2353,11 @@ "name": "overrideOptions", "description": "", "value": "AllCacheOptions", - "filePath": "src/cache/strategies.ts" + "filePath": "/cache/strategies.ts" } ], "returns": { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "description": "", "name": "AllCacheOptions", "value": "AllCacheOptions" @@ -2389,12 +2365,20 @@ "value": "export function CacheCustom(overrideOptions: CachingStrategy): AllCacheOptions {\n return overrideOptions as AllCacheOptions;\n}" }, "AllCacheOptions": { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "name": "AllCacheOptions", "description": "Override options for a cache strategy.", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "maxAge", "value": "number", @@ -2402,15 +2386,15 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "sMaxAge", "value": "number", @@ -2418,20 +2402,12 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "staleIfError", "value": "number", "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true } ], "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" @@ -2494,7 +2470,7 @@ "type": "CacheLongGeneratedType", "typeDefinitions": { "CacheLongGeneratedType": { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "name": "CacheLongGeneratedType", "description": "", "params": [ @@ -2503,11 +2479,11 @@ "description": "", "value": "AllCacheOptions", "isOptional": true, - "filePath": "src/cache/strategies.ts" + "filePath": "/cache/strategies.ts" } ], "returns": { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "description": "", "name": "AllCacheOptions", "value": "AllCacheOptions" @@ -2515,12 +2491,20 @@ "value": "export function CacheLong(overrideOptions?: CachingStrategy): AllCacheOptions {\n guardExpirableModeType(overrideOptions);\n return {\n mode: PUBLIC,\n maxAge: 3600, // 1 hour\n staleWhileRevalidate: 82800, // 23 Hours\n ...overrideOptions,\n };\n}" }, "AllCacheOptions": { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "name": "AllCacheOptions", "description": "Override options for a cache strategy.", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "maxAge", "value": "number", @@ -2528,15 +2512,15 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "sMaxAge", "value": "number", @@ -2544,20 +2528,12 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "staleIfError", "value": "number", "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true } ], "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" @@ -2620,12 +2596,12 @@ "type": "CacheNoneGeneratedType", "typeDefinitions": { "CacheNoneGeneratedType": { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "name": "CacheNoneGeneratedType", "description": "", "params": [], "returns": { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "description": "", "name": "NoStoreStrategy", "value": "NoStoreStrategy" @@ -2633,14 +2609,14 @@ "value": "export function CacheNone(): NoStoreStrategy {\n return {\n mode: NO_STORE,\n };\n}" }, "NoStoreStrategy": { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", "name": "NoStoreStrategy", "value": "{\n mode: string;\n}", "description": "", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "mode", "value": "string", @@ -2706,7 +2682,7 @@ "type": "CacheShortGeneratedType", "typeDefinitions": { "CacheShortGeneratedType": { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "name": "CacheShortGeneratedType", "description": "", "params": [ @@ -2715,11 +2691,11 @@ "description": "", "value": "AllCacheOptions", "isOptional": true, - "filePath": "src/cache/strategies.ts" + "filePath": "/cache/strategies.ts" } ], "returns": { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "description": "", "name": "AllCacheOptions", "value": "AllCacheOptions" @@ -2727,12 +2703,20 @@ "value": "export function CacheShort(overrideOptions?: CachingStrategy): AllCacheOptions {\n guardExpirableModeType(overrideOptions);\n return {\n mode: PUBLIC,\n maxAge: 1,\n staleWhileRevalidate: 9,\n ...overrideOptions,\n };\n}" }, "AllCacheOptions": { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "name": "AllCacheOptions", "description": "Override options for a cache strategy.", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "maxAge", "value": "number", @@ -2740,15 +2724,15 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "sMaxAge", "value": "number", @@ -2756,20 +2740,12 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "staleIfError", "value": "number", "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true } ], "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" @@ -2813,7 +2789,7 @@ "subCategory": "caching", "isVisualComponent": false, "related": [], - "description": "Creates a utility function that executes an asynchronous operation \n like `fetch` and caches the result according to the strategy provided.\nUse this to call any third-party APIs from loaders or actions.", + "description": "Creates a utility function that executes an asynchronous operation \n like `fetch` and caches the result according to the strategy provided.\nUse this to call any third-party APIs from loaders or actions.\n > Note:\n > Sometimes a request to a third-party API might fail, so you shouldn't cache the result. To prevent caching, throw when a request fails. If you don't throw, then the result is cached.", "type": "utility", "defaultExample": { "description": "I am the default example", @@ -2821,12 +2797,12 @@ "tabs": [ { "title": "JavaScript", - "code": "// In your app's `server.ts` file:\nimport * as remixBuild from '@remix-run/dev/server-build';\nimport {createWithCache, CacheLong} from '@shopify/hydrogen';\n// Use another `createRequestHandler` if deploying off oxygen\nimport {createRequestHandler} from '@shopify/remix-oxygen';\n\nexport default {\n async fetch(request, env, executionContext) {\n const cache = await caches.open('my-cms');\n const withCache = createWithCache({\n cache,\n waitUntil: executionContext.waitUntil.bind(executionContext),\n request,\n });\n\n // Create a custom utility to query a third-party API:\n const fetchMyCMS = (query) => {\n // Prefix the cache key and make it unique based on arguments.\n return withCache(['my-cms', query], CacheLong(), async (params) => {\n const response = await fetch('my-cms.com/api', {\n method: 'POST',\n body: query,\n });\n\n // Throw if the response is unsuccessful\n if (!response.ok) throw new Error(response.statusText);\n\n // Assuming the API returns errors in the body:\n const {data, error} = await response.json();\n\n // Validate data and throw to avoid caching errors.\n if (error || !data) throw new Error(error ?? 'Missing data');\n\n // Optionally, add extra information to show\n // in the Subrequest Profiler utility.\n params.addDebugData({displayName: 'My CMS query', response});\n\n return data;\n });\n };\n\n const handleRequest = createRequestHandler({\n build: remixBuild,\n mode: process.env.NODE_ENV,\n getLoadContext: () => ({\n // If you have one, update your env.d.ts to\n // include `fetchMyCMS` in `AppLoadContext`.\n fetchMyCMS,\n }),\n });\n\n return handleRequest(request);\n },\n};\n", + "code": "// In your app's `server.ts` file:\nimport * as remixBuild from '@remix-run/dev/server-build';\nimport {createWithCache, CacheLong} from '@shopify/hydrogen';\n// Use another `createRequestHandler` if deploying off oxygen\nimport {createRequestHandler} from '@shopify/remix-oxygen';\n\nexport default {\n async fetch(request, env, executionContext) {\n const cache = await caches.open('my-cms');\n const withCache = createWithCache({\n cache,\n waitUntil: executionContext.waitUntil.bind(executionContext),\n request,\n });\n\n // Create a custom utility to query a third-party API:\n const fetchMyCMS = (query) => {\n // Prefix the cache key and make it unique based on arguments.\n return withCache(['my-cms', query], CacheLong(), async (params) => {\n const response = await fetch('my-cms.com/api', {\n method: 'POST',\n body: query,\n });\n\n // Throw if the response is unsuccessful.\n // This is important to prevent the results from being cached.\n if (!response.ok) throw new Error(response.statusText);\n\n // Assuming the API returns errors in the body:\n const {data, error} = await response.json();\n\n // Validate data and throw to avoid caching errors.\n if (error || !data) throw new Error(error ?? 'Missing data');\n\n // Optionally, add extra information to show\n // in the Subrequest Profiler utility.\n params.addDebugData({displayName: 'My CMS query', response});\n\n return data;\n });\n };\n\n const handleRequest = createRequestHandler({\n build: remixBuild,\n mode: process.env.NODE_ENV,\n getLoadContext: () => ({\n // If you have one, update your env.d.ts to\n // include `fetchMyCMS` in `AppLoadContext`.\n fetchMyCMS,\n }),\n });\n\n return handleRequest(request);\n },\n};\n", "language": "js" }, { "title": "TypeScript", - "code": "// In your app's `server.ts` file:\nimport * as remixBuild from '@remix-run/dev/server-build';\nimport {createWithCache, CacheLong} from '@shopify/hydrogen';\n// Use another `createRequestHandler` if deploying off oxygen\nimport {createRequestHandler} from '@shopify/remix-oxygen';\n\nexport default {\n async fetch(\n request: Request,\n env: Record<string, string>,\n executionContext: ExecutionContext,\n ) {\n const cache = await caches.open('my-cms');\n const withCache = createWithCache({\n cache,\n waitUntil: executionContext.waitUntil.bind(executionContext),\n request,\n });\n\n // Create a custom utility to query a third-party API:\n const fetchMyCMS = (query: string) => {\n // Prefix the cache key and make it unique based on arguments.\n return withCache(['my-cms', query], CacheLong(), async (params) => {\n const response = await fetch('my-cms.com/api', {\n method: 'POST',\n body: query,\n });\n\n // Throw if the response is unsuccessful\n if (!response.ok) throw new Error(response.statusText);\n\n const {data, error} = (await response.json()) as {\n data: unknown;\n error?: string;\n };\n\n // Validate data and throw to avoid caching errors.\n if (error || !data) throw new Error(error ?? 'Missing data');\n\n // Optionally, add extra information to show\n // in the Subrequest Profiler utility.\n params.addDebugData({displayName: 'My CMS query', response});\n\n return data;\n });\n };\n\n const handleRequest = createRequestHandler({\n build: remixBuild,\n mode: process.env.NODE_ENV,\n getLoadContext: () => ({\n // Make sure to update env.d.ts to\n // include `fetchMyCMS` in `AppLoadContext`.\n fetchMyCMS,\n }),\n });\n\n return handleRequest(request);\n },\n};\n", + "code": "// In your app's `server.ts` file:\nimport * as remixBuild from '@remix-run/dev/server-build';\nimport {createWithCache, CacheLong} from '@shopify/hydrogen';\n// Use another `createRequestHandler` if deploying off oxygen\nimport {createRequestHandler} from '@shopify/remix-oxygen';\n\nexport default {\n async fetch(\n request: Request,\n env: Record<string, string>,\n executionContext: ExecutionContext,\n ) {\n const cache = await caches.open('my-cms');\n const withCache = createWithCache({\n cache,\n waitUntil: executionContext.waitUntil.bind(executionContext),\n request,\n });\n\n // Create a custom utility to query a third-party API:\n const fetchMyCMS = (query: string) => {\n // Prefix the cache key and make it unique based on arguments.\n return withCache(['my-cms', query], CacheLong(), async (params) => {\n const response = await fetch('my-cms.com/api', {\n method: 'POST',\n body: query,\n });\n\n // Throw if the response is unsuccessful.\n // This is important to prevent the results from being cached.\n if (!response.ok) throw new Error(response.statusText);\n\n const {data, error} = (await response.json()) as {\n data: unknown;\n error?: string;\n };\n\n // Validate data and throw to avoid caching errors.\n if (error || !data) throw new Error(error ?? 'Missing data');\n\n // Optionally, add extra information to show\n // in the Subrequest Profiler utility.\n params.addDebugData({displayName: 'My CMS query', response});\n\n return data;\n });\n };\n\n const handleRequest = createRequestHandler({\n build: remixBuild,\n mode: process.env.NODE_ENV,\n getLoadContext: () => ({\n // Make sure to update env.d.ts to\n // include `fetchMyCMS` in `AppLoadContext`.\n fetchMyCMS,\n }),\n });\n\n return handleRequest(request);\n },\n};\n", "language": "ts" } ], @@ -2840,72 +2816,73 @@ "type": "CreateWithCacheGeneratedType", "typeDefinitions": { "CreateWithCacheGeneratedType": { - "filePath": "src/cache/create-with-cache.ts", + "filePath": "/cache/create-with-cache.ts", "name": "CreateWithCacheGeneratedType", - "description": "Creates a utility function that executes an asynchronous operation like `fetch` and caches the result according to the strategy provided. Use this to call any third-party APIs from loaders or actions.", + "description": "Creates a utility function that executes an asynchronous operation like `fetch` and caches the result according to the strategy provided. Use this to call any third-party APIs from loaders or actions.\n\n> Note: > Sometimes a request to a third-party API might fail, so you shouldn't cache the result. > To prevent caching, throw when a request fails. If you don't throw, then the result is cached.", "params": [ { - "name": "input1", + "name": "cacheOptions", "description": "", "value": "CreateWithCacheOptions", - "filePath": "src/cache/create-with-cache.ts" + "filePath": "/cache/create-with-cache.ts" } ], "returns": { - "filePath": "src/cache/create-with-cache.ts", + "filePath": "/cache/create-with-cache.ts", "description": "", "name": "CreateWithCacheReturn", "value": "CreateWithCacheReturn" }, - "value": "export function createWithCache({\n cache,\n waitUntil,\n request,\n}: CreateWithCacheOptions): CreateWithCacheReturn {\n return function withCache(\n cacheKey: CacheKey,\n strategy: CachingStrategy,\n actionFn: ({addDebugData}: CacheActionFunctionParam) => T | Promise,\n ) {\n return runWithCache(cacheKey, actionFn, {\n strategy,\n cacheInstance: cache,\n waitUntil,\n debugInfo: {\n ...getDebugHeaders(request),\n stackInfo: getCallerStackLine?.(),\n },\n });\n };\n}" + "value": "export function createWithCache(\n cacheOptions: CreateWithCacheOptions,\n): CreateWithCacheReturn {\n const {cache, waitUntil, request} = cacheOptions;\n\n return function withCache(\n cacheKey: CacheKey,\n strategy: CachingStrategy,\n actionFn: ({addDebugData}: CacheActionFunctionParam) => T | Promise,\n ) {\n return runWithCache(cacheKey, actionFn, {\n strategy,\n cacheInstance: cache,\n waitUntil,\n debugInfo: {\n ...getDebugHeaders(request),\n stackInfo: getCallerStackLine?.(),\n },\n });\n };\n}" }, "CreateWithCacheOptions": { - "filePath": "src/cache/create-with-cache.ts", + "filePath": "/cache/create-with-cache.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CreateWithCacheOptions", "value": "{\n /** An instance that implements the [Cache API](https://developer.mozilla.org/en-US/docs/Web/API/Cache) */\n cache: Cache;\n /** The `waitUntil` function is used to keep the current request/response lifecycle alive even after a response has been sent. It should be provided by your platform. */\n waitUntil: WaitUntil;\n /** The `request` object is used to access certain headers for debugging */\n request?: CrossRuntimeRequest;\n}", "description": "", "members": [ { - "filePath": "src/cache/create-with-cache.ts", + "filePath": "/cache/create-with-cache.ts", "syntaxKind": "PropertySignature", "name": "cache", "value": "Cache", "description": "An instance that implements the [Cache API](https://developer.mozilla.org/en-US/docs/Web/API/Cache)" }, { - "filePath": "src/cache/create-with-cache.ts", + "filePath": "/cache/create-with-cache.ts", + "syntaxKind": "PropertySignature", + "name": "waitUntil", + "value": "WaitUntil", + "description": "The `waitUntil` function is used to keep the current request/response lifecycle alive even after a response has been sent. It should be provided by your platform." + }, + { + "filePath": "/cache/create-with-cache.ts", "syntaxKind": "PropertySignature", "name": "request", "value": "CrossRuntimeRequest", "description": "The `request` object is used to access certain headers for debugging", "isOptional": true - }, - { - "filePath": "src/cache/create-with-cache.ts", - "syntaxKind": "PropertySignature", - "name": "waitUntil", - "value": "WaitUntil", - "description": "The `waitUntil` function is used to keep the current request/response lifecycle alive even after a response has been sent. It should be provided by your platform." } ] }, "CrossRuntimeRequest": { - "filePath": "src/utils/request.ts", + "filePath": "/utils/request.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CrossRuntimeRequest", "value": "{\n url?: string;\n method?: string;\n headers: {\n get?: (key: string) => string | null | undefined;\n [key: string]: any;\n };\n}", "description": "", "members": [ { - "filePath": "src/utils/request.ts", + "filePath": "/utils/request.ts", "syntaxKind": "PropertySignature", - "name": "headers", - "value": "{ [key: string]: any; get?: (key: string) => string; }", - "description": "" + "name": "url", + "value": "string", + "description": "", + "isOptional": true }, { - "filePath": "src/utils/request.ts", + "filePath": "/utils/request.ts", "syntaxKind": "PropertySignature", "name": "method", "value": "string", @@ -2913,17 +2890,16 @@ "isOptional": true }, { - "filePath": "src/utils/request.ts", + "filePath": "/utils/request.ts", "syntaxKind": "PropertySignature", - "name": "url", - "value": "string", - "description": "", - "isOptional": true + "name": "headers", + "value": "{ [key: string]: any; get?: (key: string) => string; }", + "description": "" } ] }, "CreateWithCacheReturn": { - "filePath": "src/cache/create-with-cache.ts", + "filePath": "/cache/create-with-cache.ts", "name": "CreateWithCacheReturn", "description": "This is a caching async function. Whatever data is returned from the `actionFn` will be cached according to the strategy provided.\n\nUse the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the built-in caching strategies: `CacheNone`, `CacheShort`, `CacheLong`.", "params": [ @@ -2931,43 +2907,51 @@ "name": "cacheKey", "description": "", "value": "CacheKey", - "filePath": "src/cache/create-with-cache.ts" + "filePath": "/cache/create-with-cache.ts" }, { "name": "strategy", "description": "", "value": "AllCacheOptions", - "filePath": "src/cache/create-with-cache.ts" + "filePath": "/cache/create-with-cache.ts" }, { "name": "actionFn", "description": "", "value": "({ addDebugData }: CacheActionFunctionParam) => U | Promise", - "filePath": "src/cache/create-with-cache.ts" + "filePath": "/cache/create-with-cache.ts" } ], "returns": { - "filePath": "src/cache/create-with-cache.ts", + "filePath": "/cache/create-with-cache.ts", "description": "", - "name": "interface Promise {\n /**\n * Attaches callbacks for the resolution and/or rejection of the Promise.\n * @param onfulfilled The callback to execute when the Promise is resolved.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of which ever callback is executed.\n */\n then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise;\n\n /**\n * Attaches a callback for only the rejection of the Promise.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of the callback.\n */\n catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise;\n}, interface Promise {}, Promise: PromiseConstructor, interface Promise {\n readonly [Symbol.toStringTag]: string;\n}, interface Promise {\n /**\n * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The\n * resolved value cannot be modified from the callback.\n * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).\n * @returns A Promise for the completion of the callback.\n */\n finally(onfinally?: (() => void) | undefined | null): Promise;\n}", - "value": "interface Promise {\n /**\n * Attaches callbacks for the resolution and/or rejection of the Promise.\n * @param onfulfilled The callback to execute when the Promise is resolved.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of which ever callback is executed.\n */\n then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise;\n\n /**\n * Attaches a callback for only the rejection of the Promise.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of the callback.\n */\n catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise;\n}, interface Promise {}, Promise: PromiseConstructor, interface Promise {\n readonly [Symbol.toStringTag]: string;\n}, interface Promise {\n /**\n * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The\n * resolved value cannot be modified from the callback.\n * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).\n * @returns A Promise for the completion of the callback.\n */\n finally(onfinally?: (() => void) | undefined | null): Promise;\n}" + "name": "interface Promise {\r\n /**\r\n * Attaches callbacks for the resolution and/or rejection of the Promise.\r\n * @param onfulfilled The callback to execute when the Promise is resolved.\r\n * @param onrejected The callback to execute when the Promise is rejected.\r\n * @returns A Promise for the completion of which ever callback is executed.\r\n */\r\n then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise;\r\n\r\n /**\r\n * Attaches a callback for only the rejection of the Promise.\r\n * @param onrejected The callback to execute when the Promise is rejected.\r\n * @returns A Promise for the completion of the callback.\r\n */\r\n catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise;\r\n}, interface Promise { }, Promise: PromiseConstructor, interface Promise {\r\n readonly [Symbol.toStringTag]: string;\r\n}, interface Promise {\r\n /**\r\n * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The\r\n * resolved value cannot be modified from the callback.\r\n * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).\r\n * @returns A Promise for the completion of the callback.\r\n */\r\n finally(onfinally?: (() => void) | undefined | null): Promise\r\n}", + "value": "interface Promise {\r\n /**\r\n * Attaches callbacks for the resolution and/or rejection of the Promise.\r\n * @param onfulfilled The callback to execute when the Promise is resolved.\r\n * @param onrejected The callback to execute when the Promise is rejected.\r\n * @returns A Promise for the completion of which ever callback is executed.\r\n */\r\n then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise;\r\n\r\n /**\r\n * Attaches a callback for only the rejection of the Promise.\r\n * @param onrejected The callback to execute when the Promise is rejected.\r\n * @returns A Promise for the completion of the callback.\r\n */\r\n catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise;\r\n}, interface Promise { }, Promise: PromiseConstructor, interface Promise {\r\n readonly [Symbol.toStringTag]: string;\r\n}, interface Promise {\r\n /**\r\n * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The\r\n * resolved value cannot be modified from the callback.\r\n * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).\r\n * @returns A Promise for the completion of the callback.\r\n */\r\n finally(onfinally?: (() => void) | undefined | null): Promise\r\n}" }, "value": "type CreateWithCacheReturn = (\n cacheKey: CacheKey,\n strategy: CachingStrategy,\n actionFn: ({addDebugData}: CacheActionFunctionParam) => U | Promise,\n) => Promise;" }, "CacheKey": { - "filePath": "src/cache/run-with-cache.ts", + "filePath": "/cache/run-with-cache.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CacheKey", "value": "string | readonly unknown[]", "description": "The cache key is used to uniquely identify a value in the cache." }, "AllCacheOptions": { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "name": "AllCacheOptions", "description": "Override options for a cache strategy.", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "maxAge", "value": "number", @@ -2975,15 +2959,15 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "sMaxAge", "value": "number", @@ -2991,33 +2975,25 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "staleIfError", "value": "number", "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true } ], "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" }, "CacheActionFunctionParam": { - "filePath": "src/cache/run-with-cache.ts", + "filePath": "/cache/run-with-cache.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CacheActionFunctionParam", "value": "{\n addDebugData: (info: AddDebugDataParam) => void;\n}", "description": "", "members": [ { - "filePath": "src/cache/run-with-cache.ts", + "filePath": "/cache/run-with-cache.ts", "syntaxKind": "PropertySignature", "name": "addDebugData", "value": "(info: AddDebugDataParam) => void", @@ -3026,14 +3002,14 @@ ] }, "AddDebugDataParam": { - "filePath": "src/cache/run-with-cache.ts", + "filePath": "/cache/run-with-cache.ts", "syntaxKind": "TypeAliasDeclaration", "name": "AddDebugDataParam", "value": "{\n displayName?: string;\n response?: Pick;\n}", "description": "", "members": [ { - "filePath": "src/cache/run-with-cache.ts", + "filePath": "/cache/run-with-cache.ts", "syntaxKind": "PropertySignature", "name": "displayName", "value": "string", @@ -3041,7 +3017,7 @@ "isOptional": true }, { - "filePath": "src/cache/run-with-cache.ts", + "filePath": "/cache/run-with-cache.ts", "syntaxKind": "PropertySignature", "name": "response", "value": "Pick", @@ -3087,7 +3063,7 @@ "type": "GenerateCacheControlHeaderGeneratedType", "typeDefinitions": { "GenerateCacheControlHeaderGeneratedType": { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "name": "GenerateCacheControlHeaderGeneratedType", "description": "", "params": [ @@ -3095,11 +3071,11 @@ "name": "cacheOptions", "description": "", "value": "AllCacheOptions", - "filePath": "src/cache/strategies.ts" + "filePath": "/cache/strategies.ts" } ], "returns": { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "description": "", "name": "string", "value": "string" @@ -3107,12 +3083,20 @@ "value": "export function generateCacheControlHeader(\n cacheOptions: CachingStrategy,\n): string {\n const cacheControl: string[] = [];\n Object.keys(cacheOptions).forEach((key: string) => {\n if (key === 'mode') {\n cacheControl.push(cacheOptions[key] as string);\n } else if (optionMapping[key]) {\n cacheControl.push(\n `${optionMapping[key]}=${cacheOptions[key as keyof CachingStrategy]}`,\n );\n }\n });\n return cacheControl.join(', ');\n}" }, "AllCacheOptions": { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "name": "AllCacheOptions", "description": "Override options for a cache strategy.", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "maxAge", "value": "number", @@ -3120,15 +3104,15 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "sMaxAge", "value": "number", @@ -3136,20 +3120,12 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "staleIfError", "value": "number", "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true } ], "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" @@ -3190,35 +3166,35 @@ "type": "CartFormProps", "typeDefinitions": { "CartFormProps": { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CartFormProps", "value": "CartActionInputProps & CartFormCommonProps", "description": "" }, "CartActionInputProps": { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CartActionInputProps", "value": "CartAttributesUpdateProps | CartBuyerIdentityUpdateProps | CartCreateProps | CartDiscountCodesUpdateProps | CartLinesAddProps | CartLinesUpdateProps | CartLinesRemoveProps | CartNoteUpdateProps | CartSelectedDeliveryOptionsUpdateProps | CartMetafieldsSetProps | CartMetafieldDeleteProps | CartCustomProps", "description": "" }, "CartAttributesUpdateProps": { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CartAttributesUpdateProps", "value": "{\n action: 'AttributesUpdateInput';\n inputs?: {\n attributes: AttributeInput[];\n } & OtherFormData;\n}", "description": "", "members": [ { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "action", "value": "\"AttributesUpdateInput\"", "description": "" }, { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "inputs", "value": "{ attributes: AttributeInput[]; } & OtherFormData", @@ -3242,21 +3218,21 @@ "override": "Any `` pair" }, "CartBuyerIdentityUpdateProps": { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CartBuyerIdentityUpdateProps", "value": "{\n action: 'BuyerIdentityUpdate';\n inputs?: {\n buyerIdentity: CartBuyerIdentityInput;\n } & OtherFormData;\n}", "description": "", "members": [ { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "action", "value": "\"BuyerIdentityUpdate\"", "description": "" }, { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "inputs", "value": "{ buyerIdentity: CartBuyerIdentityInput; } & OtherFormData", @@ -3273,21 +3249,21 @@ "override": "[CartBuyerIdentityInput](/docs/api/storefront/2024-07/input-objects/CartBuyerIdentityInput) - Storefront API type" }, "CartCreateProps": { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CartCreateProps", "value": "{\n action: 'Create';\n inputs?: {\n input: CartInput;\n } & OtherFormData;\n}", "description": "", "members": [ { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "action", "value": "\"Create\"", "description": "" }, { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "inputs", "value": "{ input: CartInput; } & OtherFormData", @@ -3304,21 +3280,21 @@ "override": "[CartInput](/docs/api/storefront/2024-07/input-objects/CartInput) - Storefront API type" }, "CartDiscountCodesUpdateProps": { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CartDiscountCodesUpdateProps", "value": "{\n action: 'DiscountCodesUpdate';\n inputs?: {\n discountCodes: string[];\n } & OtherFormData;\n}", "description": "", "members": [ { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "action", "value": "\"DiscountCodesUpdate\"", "description": "" }, { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "inputs", "value": "{ discountCodes: string[]; } & OtherFormData", @@ -3328,21 +3304,21 @@ ] }, "CartLinesAddProps": { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CartLinesAddProps", "value": "{\n action: 'LinesAdd';\n inputs?: {\n lines: Array;\n } & OtherFormData;\n}", "description": "", "members": [ { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "action", "value": "\"LinesAdd\"", "description": "" }, { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "inputs", "value": "{ lines: OptimisticCartLineInput[]; } & OtherFormData", @@ -3352,7 +3328,7 @@ ] }, "OptimisticCartLineInput": { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "OptimisticCartLineInput", "value": "CartLineInput & {\n selectedVariant?: unknown;\n}", @@ -3366,21 +3342,21 @@ "override": "[CartLineInput](/docs/api/storefront/2024-07/input-objects/CartLineInput) - Storefront API type" }, "CartLinesUpdateProps": { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CartLinesUpdateProps", "value": "{\n action: 'LinesUpdate';\n inputs?: {\n lines: CartLineUpdateInput[];\n } & OtherFormData;\n}", "description": "", "members": [ { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "action", "value": "\"LinesUpdate\"", "description": "" }, { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "inputs", "value": "{ lines: CartLineUpdateInput[]; } & OtherFormData", @@ -3397,21 +3373,21 @@ "override": "[CartLineUpdateInput](/docs/api/storefront/2024-07/input-objects/CartLineUpdateInput) - Storefront API type" }, "CartLinesRemoveProps": { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CartLinesRemoveProps", "value": "{\n action: 'LinesRemove';\n inputs?: {\n lineIds: string[];\n } & OtherFormData;\n}", "description": "", "members": [ { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "action", "value": "\"LinesRemove\"", "description": "" }, { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "inputs", "value": "{ lineIds: string[]; } & OtherFormData", @@ -3421,21 +3397,21 @@ ] }, "CartNoteUpdateProps": { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CartNoteUpdateProps", "value": "{\n action: 'NoteUpdate';\n inputs?: {\n note: string;\n } & OtherFormData;\n}", "description": "", "members": [ { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "action", "value": "\"NoteUpdate\"", "description": "" }, { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "inputs", "value": "{ note: string; } & OtherFormData", @@ -3445,21 +3421,21 @@ ] }, "CartSelectedDeliveryOptionsUpdateProps": { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CartSelectedDeliveryOptionsUpdateProps", "value": "{\n action: 'SelectedDeliveryOptionsUpdate';\n inputs?: {\n selectedDeliveryOptions: CartSelectedDeliveryOptionInput[];\n } & OtherFormData;\n}", "description": "", "members": [ { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "action", "value": "\"SelectedDeliveryOptionsUpdate\"", "description": "" }, { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "inputs", "value": "{ selectedDeliveryOptions: CartSelectedDeliveryOptionInput[]; } & OtherFormData", @@ -3476,21 +3452,21 @@ "override": "[CartSelectedDeliveryOptionInput](/docs/api/storefront/2024-07/input-objects/CartSelectedDeliveryOptionInput) - Storefront API type" }, "CartMetafieldsSetProps": { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CartMetafieldsSetProps", "value": "{\n action: 'MetafieldsSet';\n inputs?: {\n metafields: MetafieldWithoutOwnerId[];\n } & OtherFormData;\n}", "description": "", "members": [ { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "action", "value": "\"MetafieldsSet\"", "description": "" }, { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "inputs", "value": "{ metafields: MetafieldWithoutOwnerId[]; } & OtherFormData", @@ -3507,21 +3483,21 @@ "override": "Same as [CartMetafieldsSetInput](https://shopify.dev/docs/api/storefront/2024-07/input-objects/CartMetafieldsSetInput) Storefront API type but without `ownerId`. `ownerId` is always set to the cart id." }, "CartMetafieldDeleteProps": { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CartMetafieldDeleteProps", "value": "{\n action: 'MetafieldsDelete';\n inputs?: {\n key: Scalars['String']['input'];\n } & OtherFormData;\n}", "description": "", "members": [ { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "action", "value": "\"MetafieldsDelete\"", "description": "" }, { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "inputs", "value": "{ key: string; } & OtherFormData", @@ -3531,21 +3507,21 @@ ] }, "CartCustomProps": { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CartCustomProps", "value": "{\n action: `Custom${string}`;\n inputs?: Record;\n}", "description": "", "members": [ { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "action", "value": "`Custom${string}`", "description": "" }, { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "inputs", "value": "Record", @@ -3555,33 +3531,33 @@ ] }, "CartFormCommonProps": { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CartFormCommonProps", "value": "{\n /**\n * Children nodes of CartForm.\n * Children can be a render prop that receives the fetcher.\n */\n children: ReactNode | ((fetcher: FetcherWithComponents) => ReactNode);\n /**\n * The route to submit the form to. Defaults to the current route.\n */\n route?: string;\n /**\n * Optional key to use for the fetcher.\n * @see https://remix.run/hooks/use-fetcher#key\n */\n fetcherKey?: string;\n}", "description": "", "members": [ { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", "name": "children", "value": "ReactNode | ((fetcher: FetcherWithComponents) => ReactNode)", "description": "Children nodes of CartForm. Children can be a render prop that receives the fetcher." }, { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", - "name": "fetcherKey", + "name": "route", "value": "string", - "description": "Optional key to use for the fetcher.", + "description": "The route to submit the form to. Defaults to the current route.", "isOptional": true }, { - "filePath": "src/cart/CartForm.tsx", + "filePath": "/cart/CartForm.tsx", "syntaxKind": "PropertySignature", - "name": "route", + "name": "fetcherKey", "value": "string", - "description": "The route to submit the form to. Defaults to the current route.", + "description": "Optional key to use for the fetcher.", "isOptional": true } ] @@ -3692,7 +3668,7 @@ "type": "CartGetIdDefaultGeneratedType", "typeDefinitions": { "CartGetIdDefaultGeneratedType": { - "filePath": "src/cart/cartGetIdDefault.ts", + "filePath": "/cart/cartGetIdDefault.ts", "name": "CartGetIdDefaultGeneratedType", "description": "", "params": [ @@ -3700,11 +3676,11 @@ "name": "requestHeaders", "description": "", "value": "Headers", - "filePath": "src/cart/cartGetIdDefault.ts" + "filePath": "/cart/cartGetIdDefault.ts" } ], "returns": { - "filePath": "src/cart/cartGetIdDefault.ts", + "filePath": "/cart/cartGetIdDefault.ts", "description": "", "name": "", "value": "" @@ -3750,7 +3726,7 @@ "type": "CartSetIdDefaultGeneratedType", "typeDefinitions": { "CartSetIdDefaultGeneratedType": { - "filePath": "src/cart/cartSetIdDefault.ts", + "filePath": "/cart/cartSetIdDefault.ts", "name": "CartSetIdDefaultGeneratedType", "description": "", "params": [ @@ -3759,11 +3735,11 @@ "description": "", "value": "CookieOptions", "isOptional": true, - "filePath": "src/cart/cartSetIdDefault.ts" + "filePath": "/cart/cartSetIdDefault.ts" } ], "returns": { - "filePath": "src/cart/cartSetIdDefault.ts", + "filePath": "/cart/cartSetIdDefault.ts", "description": "", "name": "", "value": "" @@ -3771,65 +3747,65 @@ "value": "cartSetIdDefault = (cookieOptions?: CookieOptions) => {\n return (cartId: string) => {\n const headers = new Headers();\n headers.append(\n 'Set-Cookie',\n stringify('cart', cartId.split('/').pop() || '', {\n path: '/',\n ...cookieOptions,\n }),\n );\n return headers;\n };\n}" }, "CookieOptions": { - "filePath": "src/cart/cartSetIdDefault.ts", + "filePath": "/cart/cartSetIdDefault.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CookieOptions", "value": "{\n maxage?: number;\n expires?: Date | number | string;\n samesite?: 'Lax' | 'Strict' | 'None';\n secure?: boolean;\n httponly?: boolean;\n domain?: string;\n path?: string;\n}", "description": "", "members": [ { - "filePath": "src/cart/cartSetIdDefault.ts", + "filePath": "/cart/cartSetIdDefault.ts", "syntaxKind": "PropertySignature", - "name": "domain", - "value": "string", + "name": "maxage", + "value": "number", "description": "", "isOptional": true }, { - "filePath": "src/cart/cartSetIdDefault.ts", + "filePath": "/cart/cartSetIdDefault.ts", "syntaxKind": "PropertySignature", "name": "expires", - "value": "Date | number | string", + "value": "string | number | Date", "description": "", "isOptional": true }, { - "filePath": "src/cart/cartSetIdDefault.ts", + "filePath": "/cart/cartSetIdDefault.ts", "syntaxKind": "PropertySignature", - "name": "httponly", - "value": "boolean", + "name": "samesite", + "value": "\"Lax\" | \"Strict\" | \"None\"", "description": "", "isOptional": true }, { - "filePath": "src/cart/cartSetIdDefault.ts", + "filePath": "/cart/cartSetIdDefault.ts", "syntaxKind": "PropertySignature", - "name": "maxage", - "value": "number", + "name": "secure", + "value": "boolean", "description": "", "isOptional": true }, { - "filePath": "src/cart/cartSetIdDefault.ts", + "filePath": "/cart/cartSetIdDefault.ts", "syntaxKind": "PropertySignature", - "name": "path", - "value": "string", + "name": "httponly", + "value": "boolean", "description": "", "isOptional": true }, { - "filePath": "src/cart/cartSetIdDefault.ts", + "filePath": "/cart/cartSetIdDefault.ts", "syntaxKind": "PropertySignature", - "name": "samesite", - "value": "'Lax' | 'Strict' | 'None'", + "name": "domain", + "value": "string", "description": "", "isOptional": true }, { - "filePath": "src/cart/cartSetIdDefault.ts", + "filePath": "/cart/cartSetIdDefault.ts", "syntaxKind": "PropertySignature", - "name": "secure", - "value": "boolean", + "name": "path", + "value": "string", "description": "", "isOptional": true } @@ -3872,14 +3848,35 @@ "type": "CartHandlerOptionsForDocs", "typeDefinitions": { "CartHandlerOptionsForDocs": { - "filePath": "src/cart/createCartHandler.ts", + "filePath": "/cart/createCartHandler.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartHandlerOptionsForDocs", "value": "{\n /**\n * A function that returns the cart id in the form of `gid://shopify/Cart/c1-123`.\n */\n getCartId: () => string | undefined;\n /**\n * A function that sets the cart ID.\n */\n setCartId: (cartId: string) => Headers;\n /**\n * The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/2024-07/utilities/createstorefrontclient).\n */\n storefront: Storefront;\n /**\n * The cart mutation fragment used in most mutation requests, except for `setMetafields` and `deleteMetafield`.\n * See the [example usage](/docs/api/hydrogen/2024-07/utilities/createcarthandler#example-cart-fragments) in the documentation.\n */\n cartMutateFragment?: string;\n /**\n * The cart query fragment used by `cart.get()`.\n * See the [example usage](/docs/api/hydrogen/2024-07/utilities/createcarthandler#example-cart-fragments) in the documentation.\n */\n cartQueryFragment?: string;\n /**\n * Define custom methods or override existing methods for your cart API instance.\n * See the [example usage](/docs/api/hydrogen/2024-07/utilities/createcarthandler#example-custom-methods) in the documentation.\n */\n customMethods?: TCustomMethods;\n}", "description": "", "members": [ { - "filePath": "src/cart/createCartHandler.ts", + "filePath": "/cart/createCartHandler.ts", + "syntaxKind": "PropertySignature", + "name": "getCartId", + "value": "() => string", + "description": "A function that returns the cart id in the form of `gid://shopify/Cart/c1-123`." + }, + { + "filePath": "/cart/createCartHandler.ts", + "syntaxKind": "PropertySignature", + "name": "setCartId", + "value": "(cartId: string) => Headers", + "description": "A function that sets the cart ID." + }, + { + "filePath": "/cart/createCartHandler.ts", + "syntaxKind": "PropertySignature", + "name": "storefront", + "value": "Storefront", + "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/2024-07/utilities/createstorefrontclient)." + }, + { + "filePath": "/cart/createCartHandler.ts", "syntaxKind": "PropertySignature", "name": "cartMutateFragment", "value": "string", @@ -3887,7 +3884,7 @@ "isOptional": true }, { - "filePath": "src/cart/createCartHandler.ts", + "filePath": "/cart/createCartHandler.ts", "syntaxKind": "PropertySignature", "name": "cartQueryFragment", "value": "string", @@ -3895,33 +3892,12 @@ "isOptional": true }, { - "filePath": "src/cart/createCartHandler.ts", + "filePath": "/cart/createCartHandler.ts", "syntaxKind": "PropertySignature", "name": "customMethods", "value": "TCustomMethods", "description": "Define custom methods or override existing methods for your cart API instance. See the [example usage](/docs/api/hydrogen/2024-07/utilities/createcarthandler#example-custom-methods) in the documentation.", "isOptional": true - }, - { - "filePath": "src/cart/createCartHandler.ts", - "syntaxKind": "PropertySignature", - "name": "getCartId", - "value": "() => string", - "description": "A function that returns the cart id in the form of `gid://shopify/Cart/c1-123`." - }, - { - "filePath": "src/cart/createCartHandler.ts", - "syntaxKind": "PropertySignature", - "name": "setCartId", - "value": "(cartId: string) => Headers", - "description": "A function that sets the cart ID." - }, - { - "filePath": "src/cart/createCartHandler.ts", - "syntaxKind": "PropertySignature", - "name": "storefront", - "value": "Storefront", - "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/2024-07/utilities/createstorefrontclient)." } ] }, @@ -3933,201 +3909,129 @@ "override": "[Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) - Web API" }, "Storefront": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "Storefront", "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", "description": "Interface to interact with the Storefront API.", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "cache", - "value": "Cache", - "description": "", - "isOptional": true + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "CacheCustom", - "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "CacheLong", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "cache", + "value": "Cache", + "description": "", + "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", "name": "CacheNone", "value": "() => NoStoreStrategy", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "CacheShort", + "name": "CacheLong", "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "generateCacheControlHeader", - "value": "(cacheOptions: AllCacheOptions) => string", + "name": "CacheShort", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "(props?: Partial>) => string", + "name": "CacheCustom", + "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getPrivateTokenHeaders", - "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", + "name": "generateCacheControlHeader", + "value": "(cacheOptions: AllCacheOptions) => string", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", "name": "getPublicTokenHeaders", "value": "(props?: Partial> & Pick) => Record", "description": "" }, { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "getShopifyDomain", - "value": "(props?: Partial>) => string", - "description": "" - }, - { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "i18n", - "value": "TI18n", + "name": "getPrivateTokenHeaders", + "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "name": "getShopifyDomain", + "value": "(props?: Partial>) => string", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "name": "getApiUrl", + "value": "(props?: Partial>) => string", "description": "" - } - ] - }, - "AllCacheOptions": { - "filePath": "src/cache/strategies.ts", - "name": "AllCacheOptions", - "description": "Override options for a cache strategy.", - "members": [ - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", - "isOptional": true }, { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true - } - ], - "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" - }, - "NoStoreStrategy": { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "NoStoreStrategy", - "value": "{\n mode: string;\n}", - "description": "", - "members": [ - { - "filePath": "src/cache/strategies.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", + "name": "i18n", + "value": "TI18n", "description": "" } ] }, - "StorefrontMutations": { - "filePath": "src/storefront.ts", - "name": "StorefrontMutations", - "description": "Maps all the mutations found in the project to variables and return types.", + "StorefrontQueries": { + "filePath": "/storefront.ts", + "name": "StorefrontQueries", + "description": "Maps all the queries found in the project to variables and return types.", "members": [], - "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" }, "AutoAddedVariableNames": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "AutoAddedVariableNames", "value": "'country' | 'language'", "description": "" }, "StorefrontCommonExtraParams": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "StorefrontCommonExtraParams", "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "displayName", - "value": "string", - "description": "", - "isOptional": true - }, - { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", "name": "headers", "value": "HeadersInit", @@ -4135,70 +4039,47 @@ "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", "name": "storefrontApiVersion", "value": "string", "description": "", "isOptional": true - } - ] - }, - "StorefrontError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontError", - "value": "{\n errors?: StorefrontApiErrors;\n}", - "description": "", - "members": [ + }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "errors", - "value": "StorefrontApiErrors", + "name": "displayName", + "value": "string", "description": "", "isOptional": true } ] }, - "StorefrontApiErrors": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontApiErrors", - "value": "JsonGraphQLError[] | undefined", - "description": "" - }, - "JsonGraphQLError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "JsonGraphQLError", - "value": "ReturnType", - "description": "", - "members": [] - }, - "StorefrontQueries": { - "filePath": "src/storefront.ts", - "name": "StorefrontQueries", - "description": "Maps all the queries found in the project to variables and return types.", - "members": [], - "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" - }, "StorefrontQueryOptions": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "StorefrontQueryOptions", "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", "description": "" }, "CachingStrategy": { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CachingStrategy", "value": "AllCacheOptions", "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "maxAge", "value": "number", @@ -4206,15 +4087,15 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "sMaxAge", "value": "number", @@ -4222,47 +4103,134 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "staleIfError", "value": "number", "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", "isOptional": true - }, + } + ] + }, + "StorefrontError": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontError", + "value": "{\n errors?: StorefrontApiErrors;\n}", + "description": "", + "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "name": "errors", + "value": "StorefrontApiErrors", + "description": "", "isOptional": true } ] - } - } - }, - { - "title": "Returns", - "description": "The handler returns the following default methods. Any [custom](/docs/api/hydrogen/2024-07/utilities/createcarthandler#example-custom-methods) or overwritten methods will also be available in the returned cart instance.", - "type": "HydrogenCartForDocs", - "typeDefinitions": { - "HydrogenCartForDocs": { - "filePath": "src/cart/createCartHandler.ts", + }, + "StorefrontApiErrors": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "HydrogenCartForDocs", - "value": "{\n /**\n * Adds items to the cart.\n * If the cart doesn't exist, a new one will be created.\n */\n addLines?: CartLinesAddFunction;\n /**\n * Creates a new cart.\n */\n create?: CartCreateFunction;\n /**\n * Removes a custom field (metafield) from the cart.\n */\n deleteMetafield?: CartMetafieldDeleteFunction;\n /**\n * Retrieves the cart information.\n */\n get?: CartGetFunction;\n /**\n * Retrieves the unique identifier of the cart.\n * By default, it gets the ID from the request cookie.\n */\n getCartId?: () => string | undefined;\n /**\n * Removes items from the cart.\n */\n removeLines?: CartLinesRemoveFunction;\n /**\n * Sets the unique identifier of the cart.\n * By default, it sets the ID in the header cookie.\n */\n setCartId?: (cartId: string) => Headers;\n /**\n * Adds extra information (metafields) to the cart.\n * If the cart doesn't exist, a new one will be created.\n */\n setMetafields?: CartMetafieldsSetFunction;\n /**\n * Updates additional information (attributes) in the cart.\n */\n updateAttributes?: CartAttributesUpdateFunction;\n /**\n * Updates the buyer's information in the cart.\n * If the cart doesn't exist, a new one will be created.\n */\n updateBuyerIdentity?: CartBuyerIdentityUpdateFunction;\n /**\n * Updates discount codes in the cart.\n */\n updateDiscountCodes?: CartDiscountCodesUpdateFunction;\n /**\n * Updates items in the cart.\n */\n updateLines?: CartLinesUpdateFunction;\n /**\n * Updates the note in the cart.\n * If the cart doesn't exist, a new one will be created.\n */\n updateNote?: CartNoteUpdateFunction;\n /**\n * Updates the selected delivery options in the cart.\n * Only available for carts associated with a customer access token.\n */\n updateSelectedDeliveryOption?: CartSelectedDeliveryOptionsUpdateFunction;\n}", + "name": "StorefrontApiErrors", + "value": "JsonGraphQLError[] | undefined", + "description": "" + }, + "StorefrontMutations": { + "filePath": "/storefront.ts", + "name": "StorefrontMutations", + "description": "Maps all the mutations found in the project to variables and return types.", + "members": [], + "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + }, + "NoStoreStrategy": { + "filePath": "/cache/strategies.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "NoStoreStrategy", + "value": "{\n mode: string;\n}", "description": "", "members": [ { - "filePath": "src/cart/createCartHandler.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "addLines", - "value": "CartLinesAddFunction", + "name": "mode", + "value": "string", + "description": "" + } + ] + }, + "AllCacheOptions": { + "filePath": "/cache/strategies.ts", + "name": "AllCacheOptions", + "description": "Override options for a cache strategy.", + "members": [ + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", + "isOptional": true + } + ], + "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" + } + } + }, + { + "title": "Returns", + "description": "The handler returns the following default methods. Any [custom](/docs/api/hydrogen/2024-07/utilities/createcarthandler#example-custom-methods) or overwritten methods will also be available in the returned cart instance.", + "type": "HydrogenCartForDocs", + "typeDefinitions": { + "HydrogenCartForDocs": { + "filePath": "/cart/createCartHandler.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "HydrogenCartForDocs", + "value": "{\n /**\n * Adds items to the cart.\n * If the cart doesn't exist, a new one will be created.\n */\n addLines?: CartLinesAddFunction;\n /**\n * Creates a new cart.\n */\n create?: CartCreateFunction;\n /**\n * Removes a custom field (metafield) from the cart.\n */\n deleteMetafield?: CartMetafieldDeleteFunction;\n /**\n * Retrieves the cart information.\n */\n get?: CartGetFunction;\n /**\n * Retrieves the unique identifier of the cart.\n * By default, it gets the ID from the request cookie.\n */\n getCartId?: () => string | undefined;\n /**\n * Removes items from the cart.\n */\n removeLines?: CartLinesRemoveFunction;\n /**\n * Sets the unique identifier of the cart.\n * By default, it sets the ID in the header cookie.\n */\n setCartId?: (cartId: string) => Headers;\n /**\n * Adds extra information (metafields) to the cart.\n * If the cart doesn't exist, a new one will be created.\n */\n setMetafields?: CartMetafieldsSetFunction;\n /**\n * Updates additional information (attributes) in the cart.\n */\n updateAttributes?: CartAttributesUpdateFunction;\n /**\n * Updates the buyer's information in the cart.\n * If the cart doesn't exist, a new one will be created.\n */\n updateBuyerIdentity?: CartBuyerIdentityUpdateFunction;\n /**\n * Updates discount codes in the cart.\n */\n updateDiscountCodes?: CartDiscountCodesUpdateFunction;\n /**\n * Updates items in the cart.\n */\n updateLines?: CartLinesUpdateFunction;\n /**\n * Updates the note in the cart.\n * If the cart doesn't exist, a new one will be created.\n */\n updateNote?: CartNoteUpdateFunction;\n /**\n * Updates the selected delivery options in the cart.\n * Only available for carts associated with a customer access token.\n */\n updateSelectedDeliveryOption?: CartSelectedDeliveryOptionsUpdateFunction;\n}", + "description": "", + "members": [ + { + "filePath": "/cart/createCartHandler.ts", + "syntaxKind": "PropertySignature", + "name": "addLines", + "value": "CartLinesAddFunction", "description": "Adds items to the cart. If the cart doesn't exist, a new one will be created.", "isOptional": true }, { - "filePath": "src/cart/createCartHandler.ts", + "filePath": "/cart/createCartHandler.ts", "syntaxKind": "PropertySignature", "name": "create", "value": "CartCreateFunction", @@ -4270,7 +4238,7 @@ "isOptional": true }, { - "filePath": "src/cart/createCartHandler.ts", + "filePath": "/cart/createCartHandler.ts", "syntaxKind": "PropertySignature", "name": "deleteMetafield", "value": "CartMetafieldDeleteFunction", @@ -4278,7 +4246,7 @@ "isOptional": true }, { - "filePath": "src/cart/createCartHandler.ts", + "filePath": "/cart/createCartHandler.ts", "syntaxKind": "PropertySignature", "name": "get", "value": "CartGetFunction", @@ -4286,7 +4254,7 @@ "isOptional": true }, { - "filePath": "src/cart/createCartHandler.ts", + "filePath": "/cart/createCartHandler.ts", "syntaxKind": "PropertySignature", "name": "getCartId", "value": "() => string", @@ -4294,7 +4262,7 @@ "isOptional": true }, { - "filePath": "src/cart/createCartHandler.ts", + "filePath": "/cart/createCartHandler.ts", "syntaxKind": "PropertySignature", "name": "removeLines", "value": "CartLinesRemoveFunction", @@ -4302,7 +4270,7 @@ "isOptional": true }, { - "filePath": "src/cart/createCartHandler.ts", + "filePath": "/cart/createCartHandler.ts", "syntaxKind": "PropertySignature", "name": "setCartId", "value": "(cartId: string) => Headers", @@ -4310,7 +4278,7 @@ "isOptional": true }, { - "filePath": "src/cart/createCartHandler.ts", + "filePath": "/cart/createCartHandler.ts", "syntaxKind": "PropertySignature", "name": "setMetafields", "value": "CartMetafieldsSetFunction", @@ -4318,7 +4286,7 @@ "isOptional": true }, { - "filePath": "src/cart/createCartHandler.ts", + "filePath": "/cart/createCartHandler.ts", "syntaxKind": "PropertySignature", "name": "updateAttributes", "value": "CartAttributesUpdateFunction", @@ -4326,7 +4294,7 @@ "isOptional": true }, { - "filePath": "src/cart/createCartHandler.ts", + "filePath": "/cart/createCartHandler.ts", "syntaxKind": "PropertySignature", "name": "updateBuyerIdentity", "value": "CartBuyerIdentityUpdateFunction", @@ -4334,7 +4302,7 @@ "isOptional": true }, { - "filePath": "src/cart/createCartHandler.ts", + "filePath": "/cart/createCartHandler.ts", "syntaxKind": "PropertySignature", "name": "updateDiscountCodes", "value": "CartDiscountCodesUpdateFunction", @@ -4342,7 +4310,7 @@ "isOptional": true }, { - "filePath": "src/cart/createCartHandler.ts", + "filePath": "/cart/createCartHandler.ts", "syntaxKind": "PropertySignature", "name": "updateLines", "value": "CartLinesUpdateFunction", @@ -4350,7 +4318,7 @@ "isOptional": true }, { - "filePath": "src/cart/createCartHandler.ts", + "filePath": "/cart/createCartHandler.ts", "syntaxKind": "PropertySignature", "name": "updateNote", "value": "CartNoteUpdateFunction", @@ -4358,7 +4326,7 @@ "isOptional": true }, { - "filePath": "src/cart/createCartHandler.ts", + "filePath": "/cart/createCartHandler.ts", "syntaxKind": "PropertySignature", "name": "updateSelectedDeliveryOption", "value": "CartSelectedDeliveryOptionsUpdateFunction", @@ -4368,7 +4336,7 @@ ] }, "CartLinesAddFunction": { - "filePath": "src/cart/queries/cartLinesAddDefault.ts", + "filePath": "/cart/queries/cartLinesAddDefault.ts", "name": "CartLinesAddFunction", "description": "", "params": [ @@ -4376,18 +4344,18 @@ "name": "lines", "description": "", "value": "CartLineInput[]", - "filePath": "src/cart/queries/cartLinesAddDefault.ts" + "filePath": "/cart/queries/cartLinesAddDefault.ts" }, { "name": "optionalParams", "description": "", "value": "CartOptionalInput", "isOptional": true, - "filePath": "src/cart/queries/cartLinesAddDefault.ts" + "filePath": "/cart/queries/cartLinesAddDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartLinesAddDefault.ts", + "filePath": "/cart/queries/cartLinesAddDefault.ts", "description": "", "name": "Promise", "value": "Promise" @@ -4402,14 +4370,14 @@ "override": "[CartLineInput](/docs/api/storefront/2024-07/input-objects/CartLineInput) - Storefront API type" }, "CartOptionalInput": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartOptionalInput", "value": "{\n /**\n * The cart id.\n * @default cart.getCartId();\n */\n cartId?: Scalars['ID']['input'];\n /**\n * The country code.\n * @default storefront.i18n.country\n */\n country?: CountryCode;\n /**\n * The language code.\n * @default storefront.i18n.language\n */\n language?: LanguageCode;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cartId", "value": "string", @@ -4418,7 +4386,7 @@ "defaultValue": "cart.getCartId();" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "country", "value": "CountryCode", @@ -4427,7 +4395,7 @@ "defaultValue": "storefront.i18n.country" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "language", "value": "LanguageCode", @@ -4438,31 +4406,31 @@ ] }, "CartQueryDataReturn": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryDataReturn", "value": "CartQueryData & {\n errors?: StorefrontApiErrors;\n}", "description": "" }, "CartQueryData": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryData", "value": "{\n cart: Cart;\n userErrors?:\n | CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[];\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cart", "value": "Cart", "description": "" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "userErrors", - "value": "| CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[]", + "value": "CartUserError[] | MetafieldsSetUserError[] | MetafieldDeleteUserError[]", "description": "", "isOptional": true } @@ -4497,22 +4465,14 @@ "override": "[MetafieldDeleteUserError](/docs/api/storefront/2024-07/objects/MetafieldDeleteUserError) - Storefront API type" }, "StorefrontApiErrors": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "StorefrontApiErrors", "value": "JsonGraphQLError[] | undefined", "description": "" }, - "JsonGraphQLError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "JsonGraphQLError", - "value": "ReturnType", - "description": "", - "members": [] - }, "CartCreateFunction": { - "filePath": "src/cart/queries/cartCreateDefault.ts", + "filePath": "/cart/queries/cartCreateDefault.ts", "name": "CartCreateFunction", "description": "", "params": [ @@ -4520,18 +4480,18 @@ "name": "input", "description": "", "value": "CartInput", - "filePath": "src/cart/queries/cartCreateDefault.ts" + "filePath": "/cart/queries/cartCreateDefault.ts" }, { "name": "optionalParams", "description": "", "value": "CartOptionalInput", "isOptional": true, - "filePath": "src/cart/queries/cartCreateDefault.ts" + "filePath": "/cart/queries/cartCreateDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartCreateDefault.ts", + "filePath": "/cart/queries/cartCreateDefault.ts", "description": "", "name": "Promise", "value": "Promise" @@ -4546,7 +4506,7 @@ "override": "[CartInput](/docs/api/storefront/2024-07/input-objects/CartInput) - Storefront API type" }, "CartMetafieldDeleteFunction": { - "filePath": "src/cart/queries/cartMetafieldDeleteDefault.ts", + "filePath": "/cart/queries/cartMetafieldDeleteDefault.ts", "name": "CartMetafieldDeleteFunction", "description": "", "params": [ @@ -4554,18 +4514,18 @@ "name": "key", "description": "", "value": "string", - "filePath": "src/cart/queries/cartMetafieldDeleteDefault.ts" + "filePath": "/cart/queries/cartMetafieldDeleteDefault.ts" }, { "name": "optionalParams", "description": "", "value": "CartOptionalInput", "isOptional": true, - "filePath": "src/cart/queries/cartMetafieldDeleteDefault.ts" + "filePath": "/cart/queries/cartMetafieldDeleteDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartMetafieldDeleteDefault.ts", + "filePath": "/cart/queries/cartMetafieldDeleteDefault.ts", "description": "", "name": "Promise", "value": "Promise" @@ -4573,7 +4533,7 @@ "value": "export type CartMetafieldDeleteFunction = (\n key: Scalars['String']['input'],\n optionalParams?: CartOptionalInput,\n) => Promise;" }, "CartGetFunction": { - "filePath": "src/cart/queries/cartGetDefault.ts", + "filePath": "/cart/queries/cartGetDefault.ts", "name": "CartGetFunction", "description": "", "params": [ @@ -4582,11 +4542,11 @@ "description": "", "value": "CartGetProps", "isOptional": true, - "filePath": "src/cart/queries/cartGetDefault.ts" + "filePath": "/cart/queries/cartGetDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartGetDefault.ts", + "filePath": "/cart/queries/cartGetDefault.ts", "description": "", "name": "Promise", "value": "Promise" @@ -4594,14 +4554,14 @@ "value": "export type CartGetFunction = (\n cartInput?: CartGetProps,\n) => Promise;" }, "CartGetProps": { - "filePath": "src/cart/queries/cartGetDefault.ts", + "filePath": "/cart/queries/cartGetDefault.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartGetProps", "value": "{\n /**\n * The cart ID.\n * @default cart.getCartId();\n */\n cartId?: string;\n /**\n * The country code.\n * @default storefront.i18n.country\n */\n country?: CountryCode;\n /**\n * The language code.\n * @default storefront.i18n.language\n */\n language?: LanguageCode;\n /**\n * The number of cart lines to be returned.\n * @default 100\n */\n numCartLines?: number;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cartGetDefault.ts", + "filePath": "/cart/queries/cartGetDefault.ts", "syntaxKind": "PropertySignature", "name": "cartId", "value": "string", @@ -4610,7 +4570,7 @@ "defaultValue": "cart.getCartId();" }, { - "filePath": "src/cart/queries/cartGetDefault.ts", + "filePath": "/cart/queries/cartGetDefault.ts", "syntaxKind": "PropertySignature", "name": "country", "value": "CountryCode", @@ -4619,7 +4579,7 @@ "defaultValue": "storefront.i18n.country" }, { - "filePath": "src/cart/queries/cartGetDefault.ts", + "filePath": "/cart/queries/cartGetDefault.ts", "syntaxKind": "PropertySignature", "name": "language", "value": "LanguageCode", @@ -4628,7 +4588,7 @@ "defaultValue": "storefront.i18n.language" }, { - "filePath": "src/cart/queries/cartGetDefault.ts", + "filePath": "/cart/queries/cartGetDefault.ts", "syntaxKind": "PropertySignature", "name": "numCartLines", "value": "number", @@ -4639,14 +4599,14 @@ ] }, "CartReturn": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartReturn", "value": "Cart & {\n errors?: StorefrontApiErrors;\n}", "description": "" }, "CartLinesRemoveFunction": { - "filePath": "src/cart/queries/cartLinesRemoveDefault.ts", + "filePath": "/cart/queries/cartLinesRemoveDefault.ts", "name": "CartLinesRemoveFunction", "description": "", "params": [ @@ -4654,18 +4614,18 @@ "name": "lineIds", "description": "", "value": "string[]", - "filePath": "src/cart/queries/cartLinesRemoveDefault.ts" + "filePath": "/cart/queries/cartLinesRemoveDefault.ts" }, { "name": "optionalParams", "description": "", "value": "CartOptionalInput", "isOptional": true, - "filePath": "src/cart/queries/cartLinesRemoveDefault.ts" + "filePath": "/cart/queries/cartLinesRemoveDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartLinesRemoveDefault.ts", + "filePath": "/cart/queries/cartLinesRemoveDefault.ts", "description": "", "name": "Promise", "value": "Promise" @@ -4680,7 +4640,7 @@ "override": "[Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) - Web API" }, "CartMetafieldsSetFunction": { - "filePath": "src/cart/queries/cartMetafieldsSetDefault.ts", + "filePath": "/cart/queries/cartMetafieldsSetDefault.ts", "name": "CartMetafieldsSetFunction", "description": "", "params": [ @@ -4688,18 +4648,18 @@ "name": "metafields", "description": "", "value": "MetafieldWithoutOwnerId[]", - "filePath": "src/cart/queries/cartMetafieldsSetDefault.ts" + "filePath": "/cart/queries/cartMetafieldsSetDefault.ts" }, { "name": "optionalParams", "description": "", "value": "CartOptionalInput", "isOptional": true, - "filePath": "src/cart/queries/cartMetafieldsSetDefault.ts" + "filePath": "/cart/queries/cartMetafieldsSetDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartMetafieldsSetDefault.ts", + "filePath": "/cart/queries/cartMetafieldsSetDefault.ts", "description": "", "name": "Promise", "value": "Promise" @@ -4714,7 +4674,7 @@ "override": "Same as [CartMetafieldsSetInput](https://shopify.dev/docs/api/storefront/2024-07/input-objects/CartMetafieldsSetInput) Storefront API type but without `ownerId`. `ownerId` is always set to the cart id." }, "CartAttributesUpdateFunction": { - "filePath": "src/cart/queries/cartAttributesUpdateDefault.ts", + "filePath": "/cart/queries/cartAttributesUpdateDefault.ts", "name": "CartAttributesUpdateFunction", "description": "", "params": [ @@ -4722,18 +4682,18 @@ "name": "attributes", "description": "", "value": "AttributeInput[]", - "filePath": "src/cart/queries/cartAttributesUpdateDefault.ts" + "filePath": "/cart/queries/cartAttributesUpdateDefault.ts" }, { "name": "optionalParams", "description": "", "value": "CartOptionalInput", "isOptional": true, - "filePath": "src/cart/queries/cartAttributesUpdateDefault.ts" + "filePath": "/cart/queries/cartAttributesUpdateDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartAttributesUpdateDefault.ts", + "filePath": "/cart/queries/cartAttributesUpdateDefault.ts", "description": "", "name": "Promise", "value": "Promise" @@ -4748,7 +4708,7 @@ "override": "[AttributeInput](/docs/api/storefront/2024-07/input-objects/AttributeInput) - Storefront API type" }, "CartBuyerIdentityUpdateFunction": { - "filePath": "src/cart/queries/cartBuyerIdentityUpdateDefault.ts", + "filePath": "/cart/queries/cartBuyerIdentityUpdateDefault.ts", "name": "CartBuyerIdentityUpdateFunction", "description": "", "params": [ @@ -4756,18 +4716,18 @@ "name": "buyerIdentity", "description": "", "value": "CartBuyerIdentityInput", - "filePath": "src/cart/queries/cartBuyerIdentityUpdateDefault.ts" + "filePath": "/cart/queries/cartBuyerIdentityUpdateDefault.ts" }, { "name": "optionalParams", "description": "", "value": "CartOptionalInput", "isOptional": true, - "filePath": "src/cart/queries/cartBuyerIdentityUpdateDefault.ts" + "filePath": "/cart/queries/cartBuyerIdentityUpdateDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartBuyerIdentityUpdateDefault.ts", + "filePath": "/cart/queries/cartBuyerIdentityUpdateDefault.ts", "description": "", "name": "Promise", "value": "Promise" @@ -4782,7 +4742,7 @@ "override": "[CartBuyerIdentityInput](/docs/api/storefront/2024-07/input-objects/CartBuyerIdentityInput) - Storefront API type" }, "CartDiscountCodesUpdateFunction": { - "filePath": "src/cart/queries/cartDiscountCodesUpdateDefault.ts", + "filePath": "/cart/queries/cartDiscountCodesUpdateDefault.ts", "name": "CartDiscountCodesUpdateFunction", "description": "", "params": [ @@ -4790,18 +4750,18 @@ "name": "discountCodes", "description": "", "value": "string[]", - "filePath": "src/cart/queries/cartDiscountCodesUpdateDefault.ts" + "filePath": "/cart/queries/cartDiscountCodesUpdateDefault.ts" }, { "name": "optionalParams", "description": "", "value": "CartOptionalInput", "isOptional": true, - "filePath": "src/cart/queries/cartDiscountCodesUpdateDefault.ts" + "filePath": "/cart/queries/cartDiscountCodesUpdateDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartDiscountCodesUpdateDefault.ts", + "filePath": "/cart/queries/cartDiscountCodesUpdateDefault.ts", "description": "", "name": "Promise", "value": "Promise" @@ -4809,7 +4769,7 @@ "value": "export type CartDiscountCodesUpdateFunction = (\n discountCodes: string[],\n optionalParams?: CartOptionalInput,\n) => Promise;" }, "CartLinesUpdateFunction": { - "filePath": "src/cart/queries/cartLinesUpdateDefault.ts", + "filePath": "/cart/queries/cartLinesUpdateDefault.ts", "name": "CartLinesUpdateFunction", "description": "", "params": [ @@ -4817,18 +4777,18 @@ "name": "lines", "description": "", "value": "CartLineUpdateInput[]", - "filePath": "src/cart/queries/cartLinesUpdateDefault.ts" + "filePath": "/cart/queries/cartLinesUpdateDefault.ts" }, { "name": "optionalParams", "description": "", "value": "CartOptionalInput", "isOptional": true, - "filePath": "src/cart/queries/cartLinesUpdateDefault.ts" + "filePath": "/cart/queries/cartLinesUpdateDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartLinesUpdateDefault.ts", + "filePath": "/cart/queries/cartLinesUpdateDefault.ts", "description": "", "name": "Promise", "value": "Promise" @@ -4843,7 +4803,7 @@ "override": "[CartLineUpdateInput](/docs/api/storefront/2024-07/input-objects/CartLineUpdateInput) - Storefront API type" }, "CartNoteUpdateFunction": { - "filePath": "src/cart/queries/cartNoteUpdateDefault.ts", + "filePath": "/cart/queries/cartNoteUpdateDefault.ts", "name": "CartNoteUpdateFunction", "description": "", "params": [ @@ -4851,18 +4811,18 @@ "name": "note", "description": "", "value": "string", - "filePath": "src/cart/queries/cartNoteUpdateDefault.ts" + "filePath": "/cart/queries/cartNoteUpdateDefault.ts" }, { "name": "optionalParams", "description": "", "value": "CartOptionalInput", "isOptional": true, - "filePath": "src/cart/queries/cartNoteUpdateDefault.ts" + "filePath": "/cart/queries/cartNoteUpdateDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartNoteUpdateDefault.ts", + "filePath": "/cart/queries/cartNoteUpdateDefault.ts", "description": "", "name": "Promise", "value": "Promise" @@ -4870,7 +4830,7 @@ "value": "export type CartNoteUpdateFunction = (\n note: string,\n optionalParams?: CartOptionalInput,\n) => Promise;" }, "CartSelectedDeliveryOptionsUpdateFunction": { - "filePath": "src/cart/queries/cartSelectedDeliveryOptionsUpdateDefault.ts", + "filePath": "/cart/queries/cartSelectedDeliveryOptionsUpdateDefault.ts", "name": "CartSelectedDeliveryOptionsUpdateFunction", "description": "", "params": [ @@ -4878,18 +4838,18 @@ "name": "selectedDeliveryOptions", "description": "", "value": "CartSelectedDeliveryOptionInput[]", - "filePath": "src/cart/queries/cartSelectedDeliveryOptionsUpdateDefault.ts" + "filePath": "/cart/queries/cartSelectedDeliveryOptionsUpdateDefault.ts" }, { "name": "optionalParams", "description": "", "value": "CartOptionalInput", "isOptional": true, - "filePath": "src/cart/queries/cartSelectedDeliveryOptionsUpdateDefault.ts" + "filePath": "/cart/queries/cartSelectedDeliveryOptionsUpdateDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartSelectedDeliveryOptionsUpdateDefault.ts", + "filePath": "/cart/queries/cartSelectedDeliveryOptionsUpdateDefault.ts", "description": "", "name": "Promise", "value": "Promise" @@ -5173,7 +5133,7 @@ "type": "UseOptimisticCartGeneratedType", "typeDefinitions": { "UseOptimisticCartGeneratedType": { - "filePath": "src/cart/optimistic/useOptimisticCart.tsx", + "filePath": "/cart/optimistic/useOptimisticCart.tsx", "name": "UseOptimisticCartGeneratedType", "description": "", "params": [ @@ -5182,11 +5142,11 @@ "description": "The cart object from `context.cart.get()` returned by a server loader.", "value": "DefaultCart", "isOptional": true, - "filePath": "src/cart/optimistic/useOptimisticCart.tsx" + "filePath": "/cart/optimistic/useOptimisticCart.tsx" } ], "returns": { - "filePath": "src/cart/optimistic/useOptimisticCart.tsx", + "filePath": "/cart/optimistic/useOptimisticCart.tsx", "description": "A new cart object augmented with optimistic state. Each cart line item that is optimistically added includes an `isOptimistic` property. Also if the cart has _any_ optimistic state, a root property `isOptimistic` will be set to `true`.", "name": "OptimisticCart;\n };\n }>", "value": "OptimisticCart;\n };\n }>" @@ -5194,21 +5154,21 @@ "value": "export function useOptimisticCart<\n DefaultCart = {\n lines?: {\n nodes: Array<{id: string; quantity: number; merchandise: {is: string}}>;\n };\n },\n>(cart?: DefaultCart): OptimisticCart {\n const fetchers = useFetchers();\n\n if (!fetchers || !fetchers.length) return cart as OptimisticCart;\n\n const optimisticCart = (cart as CartReturn)?.lines\n ? (structuredClone(cart) as OptimisticCart)\n : ({lines: {nodes: []}} as unknown as OptimisticCart);\n\n const cartLines = optimisticCart.lines.nodes;\n\n let isOptimistic = false;\n\n for (const {formData} of fetchers) {\n if (!formData) continue;\n\n const cartFormData = CartForm.getFormInput(formData);\n\n if (cartFormData.action === CartForm.ACTIONS.LinesAdd) {\n for (const input of cartFormData.inputs.lines) {\n if (!input.selectedVariant) {\n console.error(\n '[h2:error:useOptimisticCart] No selected variant was passed in the cart action. Make sure to pass the selected variant if you want to use an optimistic cart',\n );\n continue;\n }\n\n const existingLine = cartLines.find(\n (line) =>\n line.merchandise.id ===\n (input.selectedVariant as ProductVariant)?.id,\n );\n\n isOptimistic = true;\n\n if (existingLine) {\n existingLine.quantity =\n (existingLine.quantity || 1) + (input.quantity || 1);\n existingLine.isOptimistic = true;\n } else {\n cartLines.unshift({\n id: getOptimisticLineId((input.selectedVariant as any).id),\n merchandise: input.selectedVariant,\n isOptimistic: true,\n quantity: input.quantity || 1,\n } as CartLine & {isOptimistic?: boolean});\n }\n }\n } else if (cartFormData.action === CartForm.ACTIONS.LinesRemove) {\n for (const lineId of cartFormData.inputs.lineIds) {\n const index = cartLines.findIndex((line) => line.id === lineId);\n\n if (index !== -1) {\n if (isOptimisticLineId(cartLines[index].id)) {\n console.error(\n '[h2:error:useOptimisticCart] Tried to remove an optimistic line that has not been added to the cart yet',\n );\n continue;\n }\n\n cartLines.splice(index, 1);\n isOptimistic = true;\n } else {\n console.warn(\n `[h2:warn:useOptimisticCart] Tried to remove line '${lineId}' but it doesn't exist in the cart`,\n );\n }\n }\n } else if (cartFormData.action === CartForm.ACTIONS.LinesUpdate) {\n for (const line of cartFormData.inputs.lines) {\n const index = cartLines.findIndex(\n (optimisticLine) => line.id === optimisticLine.id,\n );\n\n if (index > -1) {\n if (isOptimisticLineId(cartLines[index].id)) {\n console.error(\n '[h2:error:useOptimisticCart] Tried to update an optimistic line that has not been added to the cart yet',\n );\n continue;\n }\n\n cartLines[index].quantity = line.quantity as number;\n\n if (cartLines[index].quantity === 0) {\n cartLines.splice(index, 1);\n }\n\n isOptimistic = true;\n } else {\n console.warn(\n `[h2:warn:useOptimisticCart] Tried to update line '${line.id}' but it doesn't exist in the cart`,\n );\n }\n }\n }\n }\n\n if (isOptimistic) {\n optimisticCart.isOptimistic = isOptimistic;\n }\n\n return optimisticCart;\n}" }, "OptimisticCart": { - "filePath": "src/cart/optimistic/useOptimisticCart.tsx", + "filePath": "/cart/optimistic/useOptimisticCart.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "OptimisticCart", "value": "T extends undefined | null\n ? // This is the null/undefined case, where the cart has yet to be created.\n // But we still need to provide an optimistic cart object.\n {\n isOptimistic?: boolean;\n lines: {\n nodes: Array;\n };\n } & Omit, 'lines'>\n : Omit & {\n isOptimistic?: boolean;\n lines: {\n nodes: Array;\n };\n }", "description": "" }, "OptimisticCartLine": { - "filePath": "src/cart/optimistic/useOptimisticCart.tsx", + "filePath": "/cart/optimistic/useOptimisticCart.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "OptimisticCartLine", "value": "T & {isOptimistic?: boolean}", "description": "" }, "CartReturn": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartReturn", "value": "Cart & {\n errors?: StorefrontApiErrors;\n}", @@ -5222,19 +5182,11 @@ "override": "[Cart](/docs/api/storefront/2024-07/objects/Cart) - Storefront API type" }, "StorefrontApiErrors": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "StorefrontApiErrors", "value": "JsonGraphQLError[] | undefined", "description": "" - }, - "JsonGraphQLError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "JsonGraphQLError", - "value": "ReturnType", - "description": "", - "members": [] } } } @@ -5268,7 +5220,7 @@ "type": "CartAttributesUpdateDefaultGeneratedType", "typeDefinitions": { "CartAttributesUpdateDefaultGeneratedType": { - "filePath": "src/cart/queries/cartAttributesUpdateDefault.ts", + "filePath": "/cart/queries/cartAttributesUpdateDefault.ts", "name": "CartAttributesUpdateDefaultGeneratedType", "description": "", "params": [ @@ -5276,11 +5228,11 @@ "name": "options", "description": "", "value": "CartQueryOptions", - "filePath": "src/cart/queries/cartAttributesUpdateDefault.ts" + "filePath": "/cart/queries/cartAttributesUpdateDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartAttributesUpdateDefault.ts", + "filePath": "/cart/queries/cartAttributesUpdateDefault.ts", "description": "", "name": "CartAttributesUpdateFunction", "value": "CartAttributesUpdateFunction" @@ -5288,14 +5240,28 @@ "value": "export function cartAttributesUpdateDefault(\n options: CartQueryOptions,\n): CartAttributesUpdateFunction {\n return async (attributes, optionalParams) => {\n const {cartAttributesUpdate, errors} = await options.storefront.mutate<{\n cartAttributesUpdate: CartQueryData;\n errors: StorefrontApiErrors;\n }>(CART_ATTRIBUTES_UPDATE_MUTATION(options.cartFragment), {\n variables: {\n cartId: optionalParams?.cartId || options.getCartId(),\n attributes,\n },\n });\n return formatAPIResult(cartAttributesUpdate, errors);\n };\n}" }, "CartQueryOptions": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryOptions", "value": "{\n /**\n * The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient).\n */\n storefront: Storefront;\n /**\n * A function that returns the cart ID.\n */\n getCartId: () => string | undefined;\n /**\n * The cart fragment to override the one used in this query.\n */\n cartFragment?: string;\n /**\n * The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).\n */\n customerAccount?: CustomerAccount;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "storefront", + "value": "Storefront", + "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." + }, + { + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "getCartId", + "value": "() => string", + "description": "A function that returns the cart ID." + }, + { + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cartFragment", "value": "string", @@ -5303,581 +5269,457 @@ "isOptional": true }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "customerAccount", "value": "CustomerAccount", "description": "The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).", "isOptional": true - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "getCartId", - "value": "() => string", - "description": "A function that returns the cart ID." - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "storefront", - "value": "Storefront", - "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." } ] }, - "CustomerAccount": { - "filePath": "src/customer/types.ts", + "Storefront": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAccount", - "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", - "description": "", + "name": "Storefront", + "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", + "description": "Interface to interact with the Storefront API.", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "authorize", - "value": "() => Promise", - "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getAccessToken", - "value": "() => Promise", - "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "() => string", - "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." + "name": "cache", + "value": "Cache", + "description": "", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "handleAuthStatus", - "value": "() => void | DataFunctionValue", - "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." + "name": "CacheNone", + "value": "() => NoStoreStrategy", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "isLoggedIn", - "value": "() => Promise", - "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." + "name": "CacheLong", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "login", - "value": "(options?: LoginOptions) => Promise", - "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" + "name": "CacheShort", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "logout", - "value": "(options?: LogoutOptions) => Promise", - "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." + "name": "CacheCustom", + "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." + "name": "generateCacheControlHeader", + "value": "(cacheOptions: AllCacheOptions) => string", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." + "name": "getPublicTokenHeaders", + "value": "(props?: Partial> & Pick) => Record", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_getBuyer", - "value": "() => Promise>", - "description": "UNSTABLE feature. Get buyer token and company location id from session." + "name": "getPrivateTokenHeaders", + "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_setBuyer", - "value": "(buyer: Partial) => void", - "description": "UNSTABLE feature. Set buyer information into session." + "name": "getShopifyDomain", + "value": "(props?: Partial>) => string", + "description": "" + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "getApiUrl", + "value": "(props?: Partial>) => string", + "description": "" + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "i18n", + "value": "TI18n", + "description": "" } ] }, - "DataFunctionValue": { - "filePath": "src/customer/types.ts", + "StorefrontQueries": { + "filePath": "/storefront.ts", + "name": "StorefrontQueries", + "description": "Maps all the queries found in the project to variables and return types.", + "members": [], + "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + }, + "AutoAddedVariableNames": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "DataFunctionValue", - "value": "Response | NonNullable | null", + "name": "AutoAddedVariableNames", + "value": "'country' | 'language'", "description": "" }, - "LoginOptions": { - "filePath": "src/customer/types.ts", + "StorefrontCommonExtraParams": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "LoginOptions", - "value": "{\n uiLocales?: LanguageCode;\n}", + "name": "StorefrontCommonExtraParams", + "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", "description": "", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "uiLocales", - "value": "LanguageCode", + "name": "headers", + "value": "HeadersInit", "description": "", "isOptional": true - } - ] - }, - "LogoutOptions": { - "filePath": "src/customer/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "LogoutOptions", - "value": "{\n postLogoutRedirectUri?: string;\n}", - "description": "", - "members": [ + }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "postLogoutRedirectUri", + "name": "storefrontApiVersion", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "displayName", "value": "string", "description": "", "isOptional": true } ] }, - "CustomerAccountMutations": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountMutations", - "description": "", - "members": [], - "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + "StorefrontQueryOptions": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontQueryOptions", + "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", + "description": "" }, - "CustomerAPIResponse": { - "filePath": "src/customer/types.ts", + "CachingStrategy": { + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAPIResponse", - "value": "{\n data: ReturnType;\n errors: Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>;\n extensions: {\n cost: {\n requestQueryCost: number;\n actualQueryCakes: number;\n throttleStatus: {\n maximumAvailable: number;\n currentAvailable: number;\n restoreRate: number;\n };\n };\n };\n}", - "description": "", + "name": "CachingStrategy", + "value": "AllCacheOptions", + "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "data", - "value": "ReturnType", - "description": "" + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "errors", - "value": "Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>", - "description": "" + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "extensions", - "value": "{ cost: { requestQueryCost: number; actualQueryCakes: number; throttleStatus: { maximumAvailable: number; currentAvailable: number; restoreRate: number; }; }; }", - "description": "" - } - ] - }, - "GraphQLError": { - "filePath": "src/utils/graphql.ts", - "name": "GraphQLError", - "description": "", - "members": [ - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "locations", - "value": "{ line: number; column: number; }[]", - "description": "If an error can be associated to a particular point in the requested GraphQL document, it should contain a list of locations." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "path", - "value": "(string | number)[]", - "description": "If an error can be associated to a particular field in the GraphQL result, it _must_ contain an entry with the key `path` that details the path of the response field which experienced the error. This allows clients to identify whether a null result is intentional or caused by a runtime error." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "extensions", - "value": "{ [key: string]: unknown; }", - "description": "Reserved for implementors to extend the protocol however they see fit, and hence there are no additional restrictions on its contents." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toString", - "value": "() => string", - "description": "Note: `toString()` is internally used by `console.log(...)` / `console.error(...)` when ingesting logs in Oxygen production. Therefore, we want to make sure that the error message is as informative as possible instead of `[object Object]`." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toJSON", - "value": "() => Pick", - "description": "Note: toJSON` is internally used by `JSON.stringify(...)`. The most common scenario when this error instance is going to be stringified is when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`. In this situation, we don't want to expose private error information to the browser so we only do it in development." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "GetAccessor", - "name": "__@toStringTag@690", - "value": "string", - "description": "" + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "name", - "value": "string", - "description": "" + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "message", - "value": "string", - "description": "" - }, + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", + "isOptional": true + } + ] + }, + "StorefrontError": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontError", + "value": "{\n errors?: StorefrontApiErrors;\n}", + "description": "", + "members": [ { - "filePath": "src/utils/graphql.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "stack", - "value": "string", + "name": "errors", + "value": "StorefrontApiErrors", "description": "", "isOptional": true } - ], - "value": "export class GraphQLError extends Error {\n /**\n * If an error can be associated to a particular point in the requested\n * GraphQL document, it should contain a list of locations.\n */\n locations?: Array<{line: number; column: number}>;\n /**\n * If an error can be associated to a particular field in the GraphQL result,\n * it _must_ contain an entry with the key `path` that details the path of\n * the response field which experienced the error. This allows clients to\n * identify whether a null result is intentional or caused by a runtime error.\n */\n path?: Array;\n /**\n * Reserved for implementors to extend the protocol however they see fit,\n * and hence there are no additional restrictions on its contents.\n */\n extensions?: {[key: string]: unknown};\n\n constructor(\n message?: string,\n options: Pick<\n GraphQLError,\n 'locations' | 'path' | 'extensions' | 'stack' | 'cause'\n > & {\n query?: string;\n queryVariables?: GenericVariables;\n requestId?: string | null;\n clientOperation?: string;\n } = {},\n ) {\n const h2Prefix = options.clientOperation\n ? `[h2:error:${options.clientOperation}] `\n : '';\n\n const enhancedMessage =\n h2Prefix +\n message +\n (options.requestId ? ` - Request ID: ${options.requestId}` : '');\n\n super(enhancedMessage);\n this.name = 'GraphQLError';\n this.extensions = options.extensions;\n this.locations = options.locations;\n this.path = options.path;\n this.stack = options.stack || undefined;\n\n try {\n this.cause = JSON.stringify({\n ...(typeof options.cause === 'object' ? options.cause : {}),\n requestId: options.requestId,\n ...(process.env.NODE_ENV === 'development' && {\n path: options.path,\n extensions: options.extensions,\n graphql: h2Prefix &&\n options.query && {\n query: options.query,\n variables: JSON.stringify(options.queryVariables),\n },\n }),\n });\n } catch {\n if (options.cause) this.cause = options.cause;\n }\n }\n\n get [Symbol.toStringTag]() {\n return this.name;\n }\n\n /**\n * Note: `toString()` is internally used by `console.log(...)` / `console.error(...)`\n * when ingesting logs in Oxygen production. Therefore, we want to make sure that\n * the error message is as informative as possible instead of `[object Object]`.\n */\n override toString() {\n let result = `${this.name}: ${this.message}`;\n\n if (this.path) {\n try {\n result += ` | path: ${JSON.stringify(this.path)}`;\n } catch {}\n }\n\n if (this.extensions) {\n try {\n result += ` | extensions: ${JSON.stringify(this.extensions)}`;\n } catch {}\n }\n\n result += '\\n';\n\n if (this.stack) {\n // Remove the message line from the stack.\n result += `${this.stack.slice(this.stack.indexOf('\\n') + 1)}\\n`;\n }\n\n return result;\n }\n\n /**\n * Note: toJSON` is internally used by `JSON.stringify(...)`.\n * The most common scenario when this error instance is going to be stringified is\n * when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`.\n * In this situation, we don't want to expose private error information to the browser so we only\n * do it in development.\n */\n toJSON() {\n const formatted: Pick<\n GraphQLError,\n 'name' | 'message' | 'path' | 'extensions' | 'locations' | 'stack'\n > = {name: 'Error', message: ''};\n\n if (process.env.NODE_ENV === 'development') {\n formatted.name = this.name;\n formatted.message = 'Development: ' + this.message;\n if (this.path) formatted.path = this.path;\n if (this.locations) formatted.locations = this.locations;\n if (this.extensions) formatted.extensions = this.extensions;\n // Skip stack on purpose because we don't want to expose it to the browser.\n }\n\n return formatted;\n }\n}" + ] }, - "CustomerAccountQueries": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountQueries", - "description": "", + "StorefrontApiErrors": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontApiErrors", + "value": "JsonGraphQLError[] | undefined", + "description": "" + }, + "StorefrontMutations": { + "filePath": "/storefront.ts", + "name": "StorefrontMutations", + "description": "Maps all the mutations found in the project to variables and return types.", "members": [], - "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" }, - "Storefront": { - "filePath": "src/storefront.ts", + "NoStoreStrategy": { + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "Storefront", - "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", - "description": "Interface to interact with the Storefront API.", + "name": "NoStoreStrategy", + "value": "{\n mode: string;\n}", + "description": "", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "cache", - "value": "Cache", - "description": "", - "isOptional": true - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "CacheCustom", - "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", + "name": "mode", + "value": "string", "description": "" - }, + } + ] + }, + "AllCacheOptions": { + "filePath": "/cache/strategies.ts", + "name": "AllCacheOptions", + "description": "Override options for a cache strategy.", + "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "CacheLong", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "CacheNone", - "value": "() => NoStoreStrategy", - "description": "" + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "CacheShort", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "generateCacheControlHeader", - "value": "(cacheOptions: AllCacheOptions) => string", - "description": "" + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "(props?: Partial>) => string", - "description": "" - }, + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", + "isOptional": true + } + ], + "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" + }, + "CustomerAccount": { + "filePath": "/customer/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "CustomerAccount", + "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", + "description": "", + "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getPrivateTokenHeaders", - "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", - "description": "" + "name": "login", + "value": "(options?: LoginOptions) => Promise", + "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getPublicTokenHeaders", - "value": "(props?: Partial> & Pick) => Record", - "description": "" + "name": "authorize", + "value": "() => Promise", + "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getShopifyDomain", - "value": "(props?: Partial>) => string", - "description": "" + "name": "isLoggedIn", + "value": "() => Promise", + "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "i18n", - "value": "TI18n", - "description": "" + "name": "handleAuthStatus", + "value": "() => void | DataFunctionValue", + "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", - "description": "" + "name": "getAccessToken", + "value": "() => Promise", + "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", - "description": "" - } - ] - }, - "AllCacheOptions": { - "filePath": "src/cache/strategies.ts", - "name": "AllCacheOptions", - "description": "Override options for a cache strategy.", - "members": [ + "name": "getApiUrl", + "value": "() => string", + "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." + }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", - "isOptional": true + "name": "logout", + "value": "(options?: LogoutOptions) => Promise", + "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", - "isOptional": true + "name": "UNSTABLE_setBuyer", + "value": "(buyer: Partial) => void", + "description": "UNSTABLE feature. Set buyer information into session." }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true + "name": "UNSTABLE_getBuyer", + "value": "() => Promise>", + "description": "UNSTABLE feature. Get buyer token and company location id from session." } - ], - "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" + ] }, - "NoStoreStrategy": { - "filePath": "src/cache/strategies.ts", + "LoginOptions": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "NoStoreStrategy", - "value": "{\n mode: string;\n}", + "name": "LoginOptions", + "value": "{\n uiLocales?: LanguageCode;\n}", "description": "", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "" + "name": "uiLocales", + "value": "LanguageCode", + "description": "", + "isOptional": true } ] }, - "StorefrontMutations": { - "filePath": "src/storefront.ts", - "name": "StorefrontMutations", - "description": "Maps all the mutations found in the project to variables and return types.", - "members": [], - "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" - }, - "AutoAddedVariableNames": { - "filePath": "src/storefront.ts", + "DataFunctionValue": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "AutoAddedVariableNames", - "value": "'country' | 'language'", + "name": "DataFunctionValue", + "value": "Response | NonNullable | null", "description": "" }, - "StorefrontCommonExtraParams": { - "filePath": "src/storefront.ts", + "LogoutOptions": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontCommonExtraParams", - "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", + "name": "LogoutOptions", + "value": "{\n postLogoutRedirectUri?: string;\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "displayName", - "value": "string", - "description": "", - "isOptional": true - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "headers", - "value": "HeadersInit", - "description": "", - "isOptional": true - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "storefrontApiVersion", + "name": "postLogoutRedirectUri", "value": "string", "description": "", "isOptional": true } ] }, - "StorefrontError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontError", - "value": "{\n errors?: StorefrontApiErrors;\n}", + "CustomerAccountQueries": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountQueries", "description": "", - "members": [ - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "errors", - "value": "StorefrontApiErrors", - "description": "", - "isOptional": true - } - ] - }, - "StorefrontApiErrors": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontApiErrors", - "value": "JsonGraphQLError[] | undefined", - "description": "" + "members": [], + "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" }, - "JsonGraphQLError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "JsonGraphQLError", - "value": "ReturnType", + "CustomerAccountMutations": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountMutations", "description": "", - "members": [] - }, - "StorefrontQueries": { - "filePath": "src/storefront.ts", - "name": "StorefrontQueries", - "description": "Maps all the queries found in the project to variables and return types.", "members": [], - "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" - }, - "StorefrontQueryOptions": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontQueryOptions", - "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", - "description": "" - }, - "CachingStrategy": { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CachingStrategy", - "value": "AllCacheOptions", - "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", - "members": [ - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true - } - ] + "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" }, "CartAttributesUpdateFunction": { - "filePath": "src/cart/queries/cartAttributesUpdateDefault.ts", + "filePath": "/cart/queries/cartAttributesUpdateDefault.ts", "name": "CartAttributesUpdateFunction", "description": "", "params": [ @@ -5885,18 +5727,18 @@ "name": "attributes", "description": "", "value": "AttributeInput[]", - "filePath": "src/cart/queries/cartAttributesUpdateDefault.ts" + "filePath": "/cart/queries/cartAttributesUpdateDefault.ts" }, { "name": "optionalParams", "description": "", "value": "CartOptionalInput", "isOptional": true, - "filePath": "src/cart/queries/cartAttributesUpdateDefault.ts" + "filePath": "/cart/queries/cartAttributesUpdateDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartAttributesUpdateDefault.ts", + "filePath": "/cart/queries/cartAttributesUpdateDefault.ts", "description": "", "name": "Promise", "value": "Promise" @@ -5911,14 +5753,14 @@ "override": "[AttributeInput](/docs/api/storefront/2024-07/input-objects/AttributeInput) - Storefront API type" }, "CartOptionalInput": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartOptionalInput", "value": "{\n /**\n * The cart id.\n * @default cart.getCartId();\n */\n cartId?: Scalars['ID']['input'];\n /**\n * The country code.\n * @default storefront.i18n.country\n */\n country?: CountryCode;\n /**\n * The language code.\n * @default storefront.i18n.language\n */\n language?: LanguageCode;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cartId", "value": "string", @@ -5927,7 +5769,7 @@ "defaultValue": "cart.getCartId();" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "country", "value": "CountryCode", @@ -5936,7 +5778,7 @@ "defaultValue": "storefront.i18n.country" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "language", "value": "LanguageCode", @@ -5947,31 +5789,31 @@ ] }, "CartQueryDataReturn": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryDataReturn", "value": "CartQueryData & {\n errors?: StorefrontApiErrors;\n}", "description": "" }, "CartQueryData": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryData", "value": "{\n cart: Cart;\n userErrors?:\n | CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[];\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cart", "value": "Cart", "description": "" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "userErrors", - "value": "| CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[]", + "value": "CartUserError[] | MetafieldsSetUserError[] | MetafieldDeleteUserError[]", "description": "", "isOptional": true } @@ -6037,7 +5879,7 @@ "type": "CartBuyerIdentityUpdateDefaultGeneratedType", "typeDefinitions": { "CartBuyerIdentityUpdateDefaultGeneratedType": { - "filePath": "src/cart/queries/cartBuyerIdentityUpdateDefault.ts", + "filePath": "/cart/queries/cartBuyerIdentityUpdateDefault.ts", "name": "CartBuyerIdentityUpdateDefaultGeneratedType", "description": "", "params": [ @@ -6045,11 +5887,11 @@ "name": "options", "description": "", "value": "CartQueryOptions", - "filePath": "src/cart/queries/cartBuyerIdentityUpdateDefault.ts" + "filePath": "/cart/queries/cartBuyerIdentityUpdateDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartBuyerIdentityUpdateDefault.ts", + "filePath": "/cart/queries/cartBuyerIdentityUpdateDefault.ts", "description": "", "name": "CartBuyerIdentityUpdateFunction", "value": "CartBuyerIdentityUpdateFunction" @@ -6057,14 +5899,28 @@ "value": "export function cartBuyerIdentityUpdateDefault(\n options: CartQueryOptions,\n): CartBuyerIdentityUpdateFunction {\n return async (buyerIdentity, optionalParams) => {\n if (buyerIdentity.companyLocationId && options.customerAccount) {\n options.customerAccount.UNSTABLE_setBuyer({\n companyLocationId: buyerIdentity.companyLocationId,\n });\n }\n\n const buyer = options.customerAccount\n ? await options.customerAccount.UNSTABLE_getBuyer()\n : undefined;\n\n const {cartBuyerIdentityUpdate, errors} = await options.storefront.mutate<{\n cartBuyerIdentityUpdate: CartQueryData;\n errors: StorefrontApiErrors;\n }>(CART_BUYER_IDENTITY_UPDATE_MUTATION(options.cartFragment), {\n variables: {\n cartId: options.getCartId(),\n buyerIdentity: {\n ...buyer,\n ...buyerIdentity,\n },\n ...optionalParams,\n },\n });\n return formatAPIResult(cartBuyerIdentityUpdate, errors);\n };\n}" }, "CartQueryOptions": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryOptions", "value": "{\n /**\n * The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient).\n */\n storefront: Storefront;\n /**\n * A function that returns the cart ID.\n */\n getCartId: () => string | undefined;\n /**\n * The cart fragment to override the one used in this query.\n */\n cartFragment?: string;\n /**\n * The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).\n */\n customerAccount?: CustomerAccount;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "storefront", + "value": "Storefront", + "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." + }, + { + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "getCartId", + "value": "() => string", + "description": "A function that returns the cart ID." + }, + { + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cartFragment", "value": "string", @@ -6072,581 +5928,457 @@ "isOptional": true }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "customerAccount", "value": "CustomerAccount", "description": "The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).", "isOptional": true - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "getCartId", - "value": "() => string", - "description": "A function that returns the cart ID." - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "storefront", - "value": "Storefront", - "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." } ] }, - "CustomerAccount": { - "filePath": "src/customer/types.ts", + "Storefront": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAccount", - "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", - "description": "", + "name": "Storefront", + "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", + "description": "Interface to interact with the Storefront API.", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "authorize", - "value": "() => Promise", - "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getAccessToken", - "value": "() => Promise", - "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "() => string", - "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." + "name": "cache", + "value": "Cache", + "description": "", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "handleAuthStatus", - "value": "() => void | DataFunctionValue", - "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." + "name": "CacheNone", + "value": "() => NoStoreStrategy", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "isLoggedIn", - "value": "() => Promise", - "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." + "name": "CacheLong", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "login", - "value": "(options?: LoginOptions) => Promise", - "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" + "name": "CacheShort", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "logout", - "value": "(options?: LogoutOptions) => Promise", - "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." + "name": "CacheCustom", + "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." + "name": "generateCacheControlHeader", + "value": "(cacheOptions: AllCacheOptions) => string", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." + "name": "getPublicTokenHeaders", + "value": "(props?: Partial> & Pick) => Record", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_getBuyer", - "value": "() => Promise>", - "description": "UNSTABLE feature. Get buyer token and company location id from session." + "name": "getPrivateTokenHeaders", + "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_setBuyer", - "value": "(buyer: Partial) => void", - "description": "UNSTABLE feature. Set buyer information into session." + "name": "getShopifyDomain", + "value": "(props?: Partial>) => string", + "description": "" + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "getApiUrl", + "value": "(props?: Partial>) => string", + "description": "" + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "i18n", + "value": "TI18n", + "description": "" } ] }, - "DataFunctionValue": { - "filePath": "src/customer/types.ts", + "StorefrontQueries": { + "filePath": "/storefront.ts", + "name": "StorefrontQueries", + "description": "Maps all the queries found in the project to variables and return types.", + "members": [], + "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + }, + "AutoAddedVariableNames": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "DataFunctionValue", - "value": "Response | NonNullable | null", + "name": "AutoAddedVariableNames", + "value": "'country' | 'language'", "description": "" }, - "LoginOptions": { - "filePath": "src/customer/types.ts", + "StorefrontCommonExtraParams": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "LoginOptions", - "value": "{\n uiLocales?: LanguageCode;\n}", + "name": "StorefrontCommonExtraParams", + "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", "description": "", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "uiLocales", - "value": "LanguageCode", + "name": "headers", + "value": "HeadersInit", "description": "", "isOptional": true - } - ] - }, - "LogoutOptions": { - "filePath": "src/customer/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "LogoutOptions", - "value": "{\n postLogoutRedirectUri?: string;\n}", - "description": "", - "members": [ + }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "postLogoutRedirectUri", + "name": "storefrontApiVersion", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "displayName", "value": "string", "description": "", "isOptional": true } ] }, - "CustomerAccountMutations": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountMutations", - "description": "", - "members": [], - "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + "StorefrontQueryOptions": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontQueryOptions", + "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", + "description": "" }, - "CustomerAPIResponse": { - "filePath": "src/customer/types.ts", + "CachingStrategy": { + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAPIResponse", - "value": "{\n data: ReturnType;\n errors: Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>;\n extensions: {\n cost: {\n requestQueryCost: number;\n actualQueryCakes: number;\n throttleStatus: {\n maximumAvailable: number;\n currentAvailable: number;\n restoreRate: number;\n };\n };\n };\n}", - "description": "", + "name": "CachingStrategy", + "value": "AllCacheOptions", + "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "data", - "value": "ReturnType", - "description": "" + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "errors", - "value": "Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>", - "description": "" + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "extensions", - "value": "{ cost: { requestQueryCost: number; actualQueryCakes: number; throttleStatus: { maximumAvailable: number; currentAvailable: number; restoreRate: number; }; }; }", - "description": "" - } - ] - }, - "GraphQLError": { - "filePath": "src/utils/graphql.ts", - "name": "GraphQLError", - "description": "", - "members": [ - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "locations", - "value": "{ line: number; column: number; }[]", - "description": "If an error can be associated to a particular point in the requested GraphQL document, it should contain a list of locations." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "path", - "value": "(string | number)[]", - "description": "If an error can be associated to a particular field in the GraphQL result, it _must_ contain an entry with the key `path` that details the path of the response field which experienced the error. This allows clients to identify whether a null result is intentional or caused by a runtime error." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "extensions", - "value": "{ [key: string]: unknown; }", - "description": "Reserved for implementors to extend the protocol however they see fit, and hence there are no additional restrictions on its contents." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toString", - "value": "() => string", - "description": "Note: `toString()` is internally used by `console.log(...)` / `console.error(...)` when ingesting logs in Oxygen production. Therefore, we want to make sure that the error message is as informative as possible instead of `[object Object]`." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toJSON", - "value": "() => Pick", - "description": "Note: toJSON` is internally used by `JSON.stringify(...)`. The most common scenario when this error instance is going to be stringified is when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`. In this situation, we don't want to expose private error information to the browser so we only do it in development." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "GetAccessor", - "name": "__@toStringTag@690", - "value": "string", - "description": "" + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "name", - "value": "string", - "description": "" + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "message", - "value": "string", - "description": "" - }, + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", + "isOptional": true + } + ] + }, + "StorefrontError": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontError", + "value": "{\n errors?: StorefrontApiErrors;\n}", + "description": "", + "members": [ { - "filePath": "src/utils/graphql.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "stack", - "value": "string", + "name": "errors", + "value": "StorefrontApiErrors", "description": "", "isOptional": true } - ], - "value": "export class GraphQLError extends Error {\n /**\n * If an error can be associated to a particular point in the requested\n * GraphQL document, it should contain a list of locations.\n */\n locations?: Array<{line: number; column: number}>;\n /**\n * If an error can be associated to a particular field in the GraphQL result,\n * it _must_ contain an entry with the key `path` that details the path of\n * the response field which experienced the error. This allows clients to\n * identify whether a null result is intentional or caused by a runtime error.\n */\n path?: Array;\n /**\n * Reserved for implementors to extend the protocol however they see fit,\n * and hence there are no additional restrictions on its contents.\n */\n extensions?: {[key: string]: unknown};\n\n constructor(\n message?: string,\n options: Pick<\n GraphQLError,\n 'locations' | 'path' | 'extensions' | 'stack' | 'cause'\n > & {\n query?: string;\n queryVariables?: GenericVariables;\n requestId?: string | null;\n clientOperation?: string;\n } = {},\n ) {\n const h2Prefix = options.clientOperation\n ? `[h2:error:${options.clientOperation}] `\n : '';\n\n const enhancedMessage =\n h2Prefix +\n message +\n (options.requestId ? ` - Request ID: ${options.requestId}` : '');\n\n super(enhancedMessage);\n this.name = 'GraphQLError';\n this.extensions = options.extensions;\n this.locations = options.locations;\n this.path = options.path;\n this.stack = options.stack || undefined;\n\n try {\n this.cause = JSON.stringify({\n ...(typeof options.cause === 'object' ? options.cause : {}),\n requestId: options.requestId,\n ...(process.env.NODE_ENV === 'development' && {\n path: options.path,\n extensions: options.extensions,\n graphql: h2Prefix &&\n options.query && {\n query: options.query,\n variables: JSON.stringify(options.queryVariables),\n },\n }),\n });\n } catch {\n if (options.cause) this.cause = options.cause;\n }\n }\n\n get [Symbol.toStringTag]() {\n return this.name;\n }\n\n /**\n * Note: `toString()` is internally used by `console.log(...)` / `console.error(...)`\n * when ingesting logs in Oxygen production. Therefore, we want to make sure that\n * the error message is as informative as possible instead of `[object Object]`.\n */\n override toString() {\n let result = `${this.name}: ${this.message}`;\n\n if (this.path) {\n try {\n result += ` | path: ${JSON.stringify(this.path)}`;\n } catch {}\n }\n\n if (this.extensions) {\n try {\n result += ` | extensions: ${JSON.stringify(this.extensions)}`;\n } catch {}\n }\n\n result += '\\n';\n\n if (this.stack) {\n // Remove the message line from the stack.\n result += `${this.stack.slice(this.stack.indexOf('\\n') + 1)}\\n`;\n }\n\n return result;\n }\n\n /**\n * Note: toJSON` is internally used by `JSON.stringify(...)`.\n * The most common scenario when this error instance is going to be stringified is\n * when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`.\n * In this situation, we don't want to expose private error information to the browser so we only\n * do it in development.\n */\n toJSON() {\n const formatted: Pick<\n GraphQLError,\n 'name' | 'message' | 'path' | 'extensions' | 'locations' | 'stack'\n > = {name: 'Error', message: ''};\n\n if (process.env.NODE_ENV === 'development') {\n formatted.name = this.name;\n formatted.message = 'Development: ' + this.message;\n if (this.path) formatted.path = this.path;\n if (this.locations) formatted.locations = this.locations;\n if (this.extensions) formatted.extensions = this.extensions;\n // Skip stack on purpose because we don't want to expose it to the browser.\n }\n\n return formatted;\n }\n}" + ] }, - "CustomerAccountQueries": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountQueries", - "description": "", + "StorefrontApiErrors": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontApiErrors", + "value": "JsonGraphQLError[] | undefined", + "description": "" + }, + "StorefrontMutations": { + "filePath": "/storefront.ts", + "name": "StorefrontMutations", + "description": "Maps all the mutations found in the project to variables and return types.", "members": [], - "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" }, - "Storefront": { - "filePath": "src/storefront.ts", + "NoStoreStrategy": { + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "Storefront", - "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", - "description": "Interface to interact with the Storefront API.", + "name": "NoStoreStrategy", + "value": "{\n mode: string;\n}", + "description": "", "members": [ { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "cache", - "value": "Cache", - "description": "", - "isOptional": true - }, - { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "CacheCustom", - "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", + "name": "mode", + "value": "string", "description": "" - }, + } + ] + }, + "AllCacheOptions": { + "filePath": "/cache/strategies.ts", + "name": "AllCacheOptions", + "description": "Override options for a cache strategy.", + "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "CacheLong", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "CacheNone", - "value": "() => NoStoreStrategy", - "description": "" + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "CacheShort", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "generateCacheControlHeader", - "value": "(cacheOptions: AllCacheOptions) => string", - "description": "" + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "(props?: Partial>) => string", - "description": "" - }, + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", + "isOptional": true + } + ], + "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" + }, + "CustomerAccount": { + "filePath": "/customer/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "CustomerAccount", + "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", + "description": "", + "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getPrivateTokenHeaders", - "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", - "description": "" + "name": "login", + "value": "(options?: LoginOptions) => Promise", + "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getPublicTokenHeaders", - "value": "(props?: Partial> & Pick) => Record", - "description": "" + "name": "authorize", + "value": "() => Promise", + "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getShopifyDomain", - "value": "(props?: Partial>) => string", - "description": "" + "name": "isLoggedIn", + "value": "() => Promise", + "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "i18n", - "value": "TI18n", - "description": "" + "name": "handleAuthStatus", + "value": "() => void | DataFunctionValue", + "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", - "description": "" + "name": "getAccessToken", + "value": "() => Promise", + "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", - "description": "" - } - ] - }, - "AllCacheOptions": { - "filePath": "src/cache/strategies.ts", - "name": "AllCacheOptions", - "description": "Override options for a cache strategy.", - "members": [ + "name": "getApiUrl", + "value": "() => string", + "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." + }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", - "isOptional": true + "name": "logout", + "value": "(options?: LogoutOptions) => Promise", + "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", - "isOptional": true + "name": "UNSTABLE_setBuyer", + "value": "(buyer: Partial) => void", + "description": "UNSTABLE feature. Set buyer information into session." }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true + "name": "UNSTABLE_getBuyer", + "value": "() => Promise>", + "description": "UNSTABLE feature. Get buyer token and company location id from session." } - ], - "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" + ] }, - "NoStoreStrategy": { - "filePath": "src/cache/strategies.ts", + "LoginOptions": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "NoStoreStrategy", - "value": "{\n mode: string;\n}", + "name": "LoginOptions", + "value": "{\n uiLocales?: LanguageCode;\n}", "description": "", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "" + "name": "uiLocales", + "value": "LanguageCode", + "description": "", + "isOptional": true } ] }, - "StorefrontMutations": { - "filePath": "src/storefront.ts", - "name": "StorefrontMutations", - "description": "Maps all the mutations found in the project to variables and return types.", - "members": [], - "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" - }, - "AutoAddedVariableNames": { - "filePath": "src/storefront.ts", + "DataFunctionValue": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "AutoAddedVariableNames", - "value": "'country' | 'language'", + "name": "DataFunctionValue", + "value": "Response | NonNullable | null", "description": "" }, - "StorefrontCommonExtraParams": { - "filePath": "src/storefront.ts", + "LogoutOptions": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontCommonExtraParams", - "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", + "name": "LogoutOptions", + "value": "{\n postLogoutRedirectUri?: string;\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "displayName", - "value": "string", - "description": "", - "isOptional": true - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "headers", - "value": "HeadersInit", - "description": "", - "isOptional": true - }, - { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "storefrontApiVersion", + "name": "postLogoutRedirectUri", "value": "string", "description": "", "isOptional": true } ] }, - "StorefrontError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontError", - "value": "{\n errors?: StorefrontApiErrors;\n}", + "CustomerAccountQueries": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountQueries", "description": "", - "members": [ - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "errors", - "value": "StorefrontApiErrors", - "description": "", - "isOptional": true - } - ] - }, - "StorefrontApiErrors": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontApiErrors", - "value": "JsonGraphQLError[] | undefined", - "description": "" + "members": [], + "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" }, - "JsonGraphQLError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "JsonGraphQLError", - "value": "ReturnType", + "CustomerAccountMutations": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountMutations", "description": "", - "members": [] - }, - "StorefrontQueries": { - "filePath": "src/storefront.ts", - "name": "StorefrontQueries", - "description": "Maps all the queries found in the project to variables and return types.", "members": [], - "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" - }, - "StorefrontQueryOptions": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontQueryOptions", - "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", - "description": "" - }, - "CachingStrategy": { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CachingStrategy", - "value": "AllCacheOptions", - "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", - "members": [ - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true - } - ] + "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" }, "CartBuyerIdentityUpdateFunction": { - "filePath": "src/cart/queries/cartBuyerIdentityUpdateDefault.ts", + "filePath": "/cart/queries/cartBuyerIdentityUpdateDefault.ts", "name": "CartBuyerIdentityUpdateFunction", "description": "", "params": [ @@ -6654,18 +6386,18 @@ "name": "buyerIdentity", "description": "", "value": "CartBuyerIdentityInput", - "filePath": "src/cart/queries/cartBuyerIdentityUpdateDefault.ts" + "filePath": "/cart/queries/cartBuyerIdentityUpdateDefault.ts" }, { "name": "optionalParams", "description": "", "value": "CartOptionalInput", "isOptional": true, - "filePath": "src/cart/queries/cartBuyerIdentityUpdateDefault.ts" + "filePath": "/cart/queries/cartBuyerIdentityUpdateDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartBuyerIdentityUpdateDefault.ts", + "filePath": "/cart/queries/cartBuyerIdentityUpdateDefault.ts", "description": "", "name": "Promise", "value": "Promise" @@ -6680,14 +6412,14 @@ "override": "[CartBuyerIdentityInput](/docs/api/storefront/2024-07/input-objects/CartBuyerIdentityInput) - Storefront API type" }, "CartOptionalInput": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartOptionalInput", "value": "{\n /**\n * The cart id.\n * @default cart.getCartId();\n */\n cartId?: Scalars['ID']['input'];\n /**\n * The country code.\n * @default storefront.i18n.country\n */\n country?: CountryCode;\n /**\n * The language code.\n * @default storefront.i18n.language\n */\n language?: LanguageCode;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cartId", "value": "string", @@ -6696,7 +6428,7 @@ "defaultValue": "cart.getCartId();" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "country", "value": "CountryCode", @@ -6705,7 +6437,7 @@ "defaultValue": "storefront.i18n.country" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "language", "value": "LanguageCode", @@ -6716,31 +6448,31 @@ ] }, "CartQueryDataReturn": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryDataReturn", "value": "CartQueryData & {\n errors?: StorefrontApiErrors;\n}", "description": "" }, "CartQueryData": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryData", "value": "{\n cart: Cart;\n userErrors?:\n | CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[];\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cart", "value": "Cart", "description": "" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "userErrors", - "value": "| CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[]", + "value": "CartUserError[] | MetafieldsSetUserError[] | MetafieldDeleteUserError[]", "description": "", "isOptional": true } @@ -6806,7 +6538,7 @@ "type": "CartCreateDefaultGeneratedType", "typeDefinitions": { "CartCreateDefaultGeneratedType": { - "filePath": "src/cart/queries/cartCreateDefault.ts", + "filePath": "/cart/queries/cartCreateDefault.ts", "name": "CartCreateDefaultGeneratedType", "description": "", "params": [ @@ -6814,11 +6546,11 @@ "name": "options", "description": "", "value": "CartQueryOptions", - "filePath": "src/cart/queries/cartCreateDefault.ts" + "filePath": "/cart/queries/cartCreateDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartCreateDefault.ts", + "filePath": "/cart/queries/cartCreateDefault.ts", "description": "", "name": "CartCreateFunction", "value": "CartCreateFunction" @@ -6826,14 +6558,28 @@ "value": "export function cartCreateDefault(\n options: CartQueryOptions,\n): CartCreateFunction {\n return async (input, optionalParams) => {\n const buyer = options.customerAccount\n ? await options.customerAccount.UNSTABLE_getBuyer()\n : undefined;\n const {cartId, ...restOfOptionalParams} = optionalParams || {};\n const {buyerIdentity, ...restOfInput} = input;\n const {cartCreate, errors} = await options.storefront.mutate<{\n cartCreate: CartQueryData;\n errors: StorefrontApiErrors;\n }>(CART_CREATE_MUTATION(options.cartFragment), {\n variables: {\n input: {\n ...restOfInput,\n buyerIdentity: {\n ...buyer,\n ...buyerIdentity,\n },\n },\n ...restOfOptionalParams,\n },\n });\n return formatAPIResult(cartCreate, errors);\n };\n}" }, "CartQueryOptions": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryOptions", "value": "{\n /**\n * The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient).\n */\n storefront: Storefront;\n /**\n * A function that returns the cart ID.\n */\n getCartId: () => string | undefined;\n /**\n * The cart fragment to override the one used in this query.\n */\n cartFragment?: string;\n /**\n * The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).\n */\n customerAccount?: CustomerAccount;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "storefront", + "value": "Storefront", + "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." + }, + { + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "getCartId", + "value": "() => string", + "description": "A function that returns the cart ID." + }, + { + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cartFragment", "value": "string", @@ -6841,380 +6587,281 @@ "isOptional": true }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "customerAccount", "value": "CustomerAccount", "description": "The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).", "isOptional": true - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "getCartId", - "value": "() => string", - "description": "A function that returns the cart ID." - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "storefront", - "value": "Storefront", - "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." } ] }, - "CustomerAccount": { - "filePath": "src/customer/types.ts", + "Storefront": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAccount", - "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", - "description": "", + "name": "Storefront", + "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", + "description": "Interface to interact with the Storefront API.", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "authorize", - "value": "() => Promise", - "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getAccessToken", - "value": "() => Promise", - "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "() => string", - "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." + "name": "cache", + "value": "Cache", + "description": "", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "handleAuthStatus", - "value": "() => void | DataFunctionValue", - "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." + "name": "CacheNone", + "value": "() => NoStoreStrategy", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "isLoggedIn", - "value": "() => Promise", - "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." + "name": "CacheLong", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "login", - "value": "(options?: LoginOptions) => Promise", - "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" + "name": "CacheShort", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "logout", - "value": "(options?: LogoutOptions) => Promise", - "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." + "name": "CacheCustom", + "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." + "name": "generateCacheControlHeader", + "value": "(cacheOptions: AllCacheOptions) => string", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." + "name": "getPublicTokenHeaders", + "value": "(props?: Partial> & Pick) => Record", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_getBuyer", - "value": "() => Promise>", - "description": "UNSTABLE feature. Get buyer token and company location id from session." + "name": "getPrivateTokenHeaders", + "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_setBuyer", - "value": "(buyer: Partial) => void", - "description": "UNSTABLE feature. Set buyer information into session." + "name": "getShopifyDomain", + "value": "(props?: Partial>) => string", + "description": "" + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "getApiUrl", + "value": "(props?: Partial>) => string", + "description": "" + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "i18n", + "value": "TI18n", + "description": "" } ] }, - "DataFunctionValue": { - "filePath": "src/customer/types.ts", + "StorefrontQueries": { + "filePath": "/storefront.ts", + "name": "StorefrontQueries", + "description": "Maps all the queries found in the project to variables and return types.", + "members": [], + "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + }, + "AutoAddedVariableNames": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "DataFunctionValue", - "value": "Response | NonNullable | null", + "name": "AutoAddedVariableNames", + "value": "'country' | 'language'", "description": "" }, - "LoginOptions": { - "filePath": "src/customer/types.ts", + "StorefrontCommonExtraParams": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "LoginOptions", - "value": "{\n uiLocales?: LanguageCode;\n}", + "name": "StorefrontCommonExtraParams", + "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", "description": "", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "uiLocales", - "value": "LanguageCode", + "name": "headers", + "value": "HeadersInit", "description": "", "isOptional": true - } - ] - }, - "LogoutOptions": { - "filePath": "src/customer/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "LogoutOptions", - "value": "{\n postLogoutRedirectUri?: string;\n}", - "description": "", - "members": [ + }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "postLogoutRedirectUri", + "name": "storefrontApiVersion", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "displayName", "value": "string", "description": "", "isOptional": true } ] }, - "CustomerAccountMutations": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountMutations", - "description": "", - "members": [], - "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + "StorefrontQueryOptions": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontQueryOptions", + "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", + "description": "" }, - "CustomerAPIResponse": { - "filePath": "src/customer/types.ts", + "CachingStrategy": { + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAPIResponse", - "value": "{\n data: ReturnType;\n errors: Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>;\n extensions: {\n cost: {\n requestQueryCost: number;\n actualQueryCakes: number;\n throttleStatus: {\n maximumAvailable: number;\n currentAvailable: number;\n restoreRate: number;\n };\n };\n };\n}", - "description": "", + "name": "CachingStrategy", + "value": "AllCacheOptions", + "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "data", - "value": "ReturnType", - "description": "" + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "errors", - "value": "Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>", - "description": "" + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "extensions", - "value": "{ cost: { requestQueryCost: number; actualQueryCakes: number; throttleStatus: { maximumAvailable: number; currentAvailable: number; restoreRate: number; }; }; }", - "description": "" - } - ] - }, - "GraphQLError": { - "filePath": "src/utils/graphql.ts", - "name": "GraphQLError", - "description": "", - "members": [ - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "locations", - "value": "{ line: number; column: number; }[]", - "description": "If an error can be associated to a particular point in the requested GraphQL document, it should contain a list of locations." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "path", - "value": "(string | number)[]", - "description": "If an error can be associated to a particular field in the GraphQL result, it _must_ contain an entry with the key `path` that details the path of the response field which experienced the error. This allows clients to identify whether a null result is intentional or caused by a runtime error." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "extensions", - "value": "{ [key: string]: unknown; }", - "description": "Reserved for implementors to extend the protocol however they see fit, and hence there are no additional restrictions on its contents." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toString", - "value": "() => string", - "description": "Note: `toString()` is internally used by `console.log(...)` / `console.error(...)` when ingesting logs in Oxygen production. Therefore, we want to make sure that the error message is as informative as possible instead of `[object Object]`." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toJSON", - "value": "() => Pick", - "description": "Note: toJSON` is internally used by `JSON.stringify(...)`. The most common scenario when this error instance is going to be stringified is when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`. In this situation, we don't want to expose private error information to the browser so we only do it in development." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "GetAccessor", - "name": "__@toStringTag@690", - "value": "string", - "description": "" + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "name", - "value": "string", - "description": "" + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "message", - "value": "string", - "description": "" - }, + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", + "isOptional": true + } + ] + }, + "StorefrontError": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontError", + "value": "{\n errors?: StorefrontApiErrors;\n}", + "description": "", + "members": [ { - "filePath": "src/utils/graphql.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "stack", - "value": "string", + "name": "errors", + "value": "StorefrontApiErrors", "description": "", "isOptional": true } - ], - "value": "export class GraphQLError extends Error {\n /**\n * If an error can be associated to a particular point in the requested\n * GraphQL document, it should contain a list of locations.\n */\n locations?: Array<{line: number; column: number}>;\n /**\n * If an error can be associated to a particular field in the GraphQL result,\n * it _must_ contain an entry with the key `path` that details the path of\n * the response field which experienced the error. This allows clients to\n * identify whether a null result is intentional or caused by a runtime error.\n */\n path?: Array;\n /**\n * Reserved for implementors to extend the protocol however they see fit,\n * and hence there are no additional restrictions on its contents.\n */\n extensions?: {[key: string]: unknown};\n\n constructor(\n message?: string,\n options: Pick<\n GraphQLError,\n 'locations' | 'path' | 'extensions' | 'stack' | 'cause'\n > & {\n query?: string;\n queryVariables?: GenericVariables;\n requestId?: string | null;\n clientOperation?: string;\n } = {},\n ) {\n const h2Prefix = options.clientOperation\n ? `[h2:error:${options.clientOperation}] `\n : '';\n\n const enhancedMessage =\n h2Prefix +\n message +\n (options.requestId ? ` - Request ID: ${options.requestId}` : '');\n\n super(enhancedMessage);\n this.name = 'GraphQLError';\n this.extensions = options.extensions;\n this.locations = options.locations;\n this.path = options.path;\n this.stack = options.stack || undefined;\n\n try {\n this.cause = JSON.stringify({\n ...(typeof options.cause === 'object' ? options.cause : {}),\n requestId: options.requestId,\n ...(process.env.NODE_ENV === 'development' && {\n path: options.path,\n extensions: options.extensions,\n graphql: h2Prefix &&\n options.query && {\n query: options.query,\n variables: JSON.stringify(options.queryVariables),\n },\n }),\n });\n } catch {\n if (options.cause) this.cause = options.cause;\n }\n }\n\n get [Symbol.toStringTag]() {\n return this.name;\n }\n\n /**\n * Note: `toString()` is internally used by `console.log(...)` / `console.error(...)`\n * when ingesting logs in Oxygen production. Therefore, we want to make sure that\n * the error message is as informative as possible instead of `[object Object]`.\n */\n override toString() {\n let result = `${this.name}: ${this.message}`;\n\n if (this.path) {\n try {\n result += ` | path: ${JSON.stringify(this.path)}`;\n } catch {}\n }\n\n if (this.extensions) {\n try {\n result += ` | extensions: ${JSON.stringify(this.extensions)}`;\n } catch {}\n }\n\n result += '\\n';\n\n if (this.stack) {\n // Remove the message line from the stack.\n result += `${this.stack.slice(this.stack.indexOf('\\n') + 1)}\\n`;\n }\n\n return result;\n }\n\n /**\n * Note: toJSON` is internally used by `JSON.stringify(...)`.\n * The most common scenario when this error instance is going to be stringified is\n * when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`.\n * In this situation, we don't want to expose private error information to the browser so we only\n * do it in development.\n */\n toJSON() {\n const formatted: Pick<\n GraphQLError,\n 'name' | 'message' | 'path' | 'extensions' | 'locations' | 'stack'\n > = {name: 'Error', message: ''};\n\n if (process.env.NODE_ENV === 'development') {\n formatted.name = this.name;\n formatted.message = 'Development: ' + this.message;\n if (this.path) formatted.path = this.path;\n if (this.locations) formatted.locations = this.locations;\n if (this.extensions) formatted.extensions = this.extensions;\n // Skip stack on purpose because we don't want to expose it to the browser.\n }\n\n return formatted;\n }\n}" + ] }, - "CustomerAccountQueries": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountQueries", - "description": "", + "StorefrontApiErrors": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontApiErrors", + "value": "JsonGraphQLError[] | undefined", + "description": "" + }, + "StorefrontMutations": { + "filePath": "/storefront.ts", + "name": "StorefrontMutations", + "description": "Maps all the mutations found in the project to variables and return types.", "members": [], - "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" }, - "Storefront": { - "filePath": "src/storefront.ts", + "NoStoreStrategy": { + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "Storefront", - "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", - "description": "Interface to interact with the Storefront API.", + "name": "NoStoreStrategy", + "value": "{\n mode: string;\n}", + "description": "", "members": [ { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "cache", - "value": "Cache", - "description": "", - "isOptional": true - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "CacheCustom", - "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "CacheLong", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "CacheNone", - "value": "() => NoStoreStrategy", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "CacheShort", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "generateCacheControlHeader", - "value": "(cacheOptions: AllCacheOptions) => string", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "(props?: Partial>) => string", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "getPrivateTokenHeaders", - "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "getPublicTokenHeaders", - "value": "(props?: Partial> & Pick) => Record", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "getShopifyDomain", - "value": "(props?: Partial>) => string", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "i18n", - "value": "TI18n", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", - "description": "" - }, - { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "name": "mode", + "value": "string", "description": "" } ] }, "AllCacheOptions": { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "name": "AllCacheOptions", "description": "Override options for a cache strategy.", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "maxAge", "value": "number", @@ -7222,15 +6869,15 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "sMaxAge", "value": "number", @@ -7238,184 +6885,159 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "staleIfError", "value": "number", "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true } ], "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" }, - "NoStoreStrategy": { - "filePath": "src/cache/strategies.ts", + "CustomerAccount": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "NoStoreStrategy", - "value": "{\n mode: string;\n}", + "name": "CustomerAccount", + "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", "description": "", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "" - } - ] - }, - "StorefrontMutations": { - "filePath": "src/storefront.ts", - "name": "StorefrontMutations", - "description": "Maps all the mutations found in the project to variables and return types.", - "members": [], - "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" - }, - "AutoAddedVariableNames": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "AutoAddedVariableNames", - "value": "'country' | 'language'", - "description": "" - }, - "StorefrontCommonExtraParams": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontCommonExtraParams", - "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", - "description": "", - "members": [ + "name": "login", + "value": "(options?: LoginOptions) => Promise", + "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" + }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "displayName", - "value": "string", - "description": "", - "isOptional": true + "name": "authorize", + "value": "() => Promise", + "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "headers", - "value": "HeadersInit", - "description": "", - "isOptional": true + "name": "isLoggedIn", + "value": "() => Promise", + "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "storefrontApiVersion", - "value": "string", - "description": "", - "isOptional": true + "name": "handleAuthStatus", + "value": "() => void | DataFunctionValue", + "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "getAccessToken", + "value": "() => Promise", + "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "getApiUrl", + "value": "() => string", + "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "logout", + "value": "(options?: LogoutOptions) => Promise", + "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "UNSTABLE_setBuyer", + "value": "(buyer: Partial) => void", + "description": "UNSTABLE feature. Set buyer information into session." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "UNSTABLE_getBuyer", + "value": "() => Promise>", + "description": "UNSTABLE feature. Get buyer token and company location id from session." } ] }, - "StorefrontError": { - "filePath": "src/storefront.ts", + "LoginOptions": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontError", - "value": "{\n errors?: StorefrontApiErrors;\n}", + "name": "LoginOptions", + "value": "{\n uiLocales?: LanguageCode;\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "errors", - "value": "StorefrontApiErrors", + "name": "uiLocales", + "value": "LanguageCode", "description": "", "isOptional": true } ] }, - "StorefrontApiErrors": { - "filePath": "src/storefront.ts", + "DataFunctionValue": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontApiErrors", - "value": "JsonGraphQLError[] | undefined", + "name": "DataFunctionValue", + "value": "Response | NonNullable | null", "description": "" }, - "JsonGraphQLError": { - "filePath": "src/storefront.ts", + "LogoutOptions": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "JsonGraphQLError", - "value": "ReturnType", + "name": "LogoutOptions", + "value": "{\n postLogoutRedirectUri?: string;\n}", "description": "", - "members": [] - }, - "StorefrontQueries": { - "filePath": "src/storefront.ts", - "name": "StorefrontQueries", - "description": "Maps all the queries found in the project to variables and return types.", - "members": [], - "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" - }, - "StorefrontQueryOptions": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontQueryOptions", - "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", - "description": "" - }, - "CachingStrategy": { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CachingStrategy", - "value": "AllCacheOptions", - "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", "members": [ { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "mode", + "name": "postLogoutRedirectUri", "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "description": "", "isOptional": true } ] }, + "CustomerAccountQueries": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountQueries", + "description": "", + "members": [], + "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + }, + "CustomerAccountMutations": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountMutations", + "description": "", + "members": [], + "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + }, "CartCreateFunction": { - "filePath": "src/cart/queries/cartCreateDefault.ts", + "filePath": "/cart/queries/cartCreateDefault.ts", "name": "CartCreateFunction", "description": "", "params": [ @@ -7423,18 +7045,18 @@ "name": "input", "description": "", "value": "CartInput", - "filePath": "src/cart/queries/cartCreateDefault.ts" + "filePath": "/cart/queries/cartCreateDefault.ts" }, { "name": "optionalParams", "description": "", "value": "CartOptionalInput", "isOptional": true, - "filePath": "src/cart/queries/cartCreateDefault.ts" + "filePath": "/cart/queries/cartCreateDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartCreateDefault.ts", + "filePath": "/cart/queries/cartCreateDefault.ts", "description": "", "name": "Promise", "value": "Promise" @@ -7449,14 +7071,14 @@ "override": "[CartInput](/docs/api/storefront/2024-07/input-objects/CartInput) - Storefront API type" }, "CartOptionalInput": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartOptionalInput", "value": "{\n /**\n * The cart id.\n * @default cart.getCartId();\n */\n cartId?: Scalars['ID']['input'];\n /**\n * The country code.\n * @default storefront.i18n.country\n */\n country?: CountryCode;\n /**\n * The language code.\n * @default storefront.i18n.language\n */\n language?: LanguageCode;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cartId", "value": "string", @@ -7465,7 +7087,7 @@ "defaultValue": "cart.getCartId();" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "country", "value": "CountryCode", @@ -7474,7 +7096,7 @@ "defaultValue": "storefront.i18n.country" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "language", "value": "LanguageCode", @@ -7485,31 +7107,31 @@ ] }, "CartQueryDataReturn": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryDataReturn", "value": "CartQueryData & {\n errors?: StorefrontApiErrors;\n}", "description": "" }, "CartQueryData": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryData", "value": "{\n cart: Cart;\n userErrors?:\n | CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[];\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cart", "value": "Cart", "description": "" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "userErrors", - "value": "| CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[]", + "value": "CartUserError[] | MetafieldsSetUserError[] | MetafieldDeleteUserError[]", "description": "", "isOptional": true } @@ -7575,7 +7197,7 @@ "type": "CartDiscountCodesUpdateDefaultGeneratedType", "typeDefinitions": { "CartDiscountCodesUpdateDefaultGeneratedType": { - "filePath": "src/cart/queries/cartDiscountCodesUpdateDefault.ts", + "filePath": "/cart/queries/cartDiscountCodesUpdateDefault.ts", "name": "CartDiscountCodesUpdateDefaultGeneratedType", "description": "", "params": [ @@ -7583,11 +7205,11 @@ "name": "options", "description": "", "value": "CartQueryOptions", - "filePath": "src/cart/queries/cartDiscountCodesUpdateDefault.ts" + "filePath": "/cart/queries/cartDiscountCodesUpdateDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartDiscountCodesUpdateDefault.ts", + "filePath": "/cart/queries/cartDiscountCodesUpdateDefault.ts", "description": "", "name": "CartDiscountCodesUpdateFunction", "value": "CartDiscountCodesUpdateFunction" @@ -7595,14 +7217,28 @@ "value": "export function cartDiscountCodesUpdateDefault(\n options: CartQueryOptions,\n): CartDiscountCodesUpdateFunction {\n return async (discountCodes, optionalParams) => {\n // Ensure the discount codes are unique\n const uniqueCodes = discountCodes.filter((value, index, array) => {\n return array.indexOf(value) === index;\n });\n\n const {cartDiscountCodesUpdate, errors} = await options.storefront.mutate<{\n cartDiscountCodesUpdate: CartQueryData;\n errors: StorefrontApiErrors;\n }>(CART_DISCOUNT_CODE_UPDATE_MUTATION(options.cartFragment), {\n variables: {\n cartId: options.getCartId(),\n discountCodes: uniqueCodes,\n ...optionalParams,\n },\n });\n return formatAPIResult(cartDiscountCodesUpdate, errors);\n };\n}" }, "CartQueryOptions": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryOptions", "value": "{\n /**\n * The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient).\n */\n storefront: Storefront;\n /**\n * A function that returns the cart ID.\n */\n getCartId: () => string | undefined;\n /**\n * The cart fragment to override the one used in this query.\n */\n cartFragment?: string;\n /**\n * The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).\n */\n customerAccount?: CustomerAccount;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "storefront", + "value": "Storefront", + "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." + }, + { + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "getCartId", + "value": "() => string", + "description": "A function that returns the cart ID." + }, + { + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cartFragment", "value": "string", @@ -7610,581 +7246,457 @@ "isOptional": true }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "customerAccount", "value": "CustomerAccount", "description": "The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).", "isOptional": true - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "getCartId", - "value": "() => string", - "description": "A function that returns the cart ID." - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "storefront", - "value": "Storefront", - "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." } ] }, - "CustomerAccount": { - "filePath": "src/customer/types.ts", + "Storefront": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAccount", - "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", - "description": "", + "name": "Storefront", + "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", + "description": "Interface to interact with the Storefront API.", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "authorize", - "value": "() => Promise", - "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getAccessToken", - "value": "() => Promise", - "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "() => string", - "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." + "name": "cache", + "value": "Cache", + "description": "", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "handleAuthStatus", - "value": "() => void | DataFunctionValue", - "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." + "name": "CacheNone", + "value": "() => NoStoreStrategy", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "isLoggedIn", - "value": "() => Promise", - "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." + "name": "CacheLong", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "login", - "value": "(options?: LoginOptions) => Promise", - "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" + "name": "CacheShort", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "logout", - "value": "(options?: LogoutOptions) => Promise", - "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." + "name": "CacheCustom", + "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." + "name": "generateCacheControlHeader", + "value": "(cacheOptions: AllCacheOptions) => string", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." + "name": "getPublicTokenHeaders", + "value": "(props?: Partial> & Pick) => Record", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_getBuyer", - "value": "() => Promise>", - "description": "UNSTABLE feature. Get buyer token and company location id from session." + "name": "getPrivateTokenHeaders", + "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_setBuyer", - "value": "(buyer: Partial) => void", - "description": "UNSTABLE feature. Set buyer information into session." + "name": "getShopifyDomain", + "value": "(props?: Partial>) => string", + "description": "" + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "getApiUrl", + "value": "(props?: Partial>) => string", + "description": "" + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "i18n", + "value": "TI18n", + "description": "" } ] }, - "DataFunctionValue": { - "filePath": "src/customer/types.ts", + "StorefrontQueries": { + "filePath": "/storefront.ts", + "name": "StorefrontQueries", + "description": "Maps all the queries found in the project to variables and return types.", + "members": [], + "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + }, + "AutoAddedVariableNames": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "DataFunctionValue", - "value": "Response | NonNullable | null", + "name": "AutoAddedVariableNames", + "value": "'country' | 'language'", "description": "" }, - "LoginOptions": { - "filePath": "src/customer/types.ts", + "StorefrontCommonExtraParams": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "LoginOptions", - "value": "{\n uiLocales?: LanguageCode;\n}", + "name": "StorefrontCommonExtraParams", + "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", "description": "", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "uiLocales", - "value": "LanguageCode", + "name": "headers", + "value": "HeadersInit", "description": "", "isOptional": true - } - ] - }, - "LogoutOptions": { - "filePath": "src/customer/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "LogoutOptions", - "value": "{\n postLogoutRedirectUri?: string;\n}", - "description": "", - "members": [ + }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "postLogoutRedirectUri", + "name": "storefrontApiVersion", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "displayName", "value": "string", "description": "", "isOptional": true } ] }, - "CustomerAccountMutations": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountMutations", - "description": "", - "members": [], - "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + "StorefrontQueryOptions": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontQueryOptions", + "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", + "description": "" }, - "CustomerAPIResponse": { - "filePath": "src/customer/types.ts", + "CachingStrategy": { + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAPIResponse", - "value": "{\n data: ReturnType;\n errors: Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>;\n extensions: {\n cost: {\n requestQueryCost: number;\n actualQueryCakes: number;\n throttleStatus: {\n maximumAvailable: number;\n currentAvailable: number;\n restoreRate: number;\n };\n };\n };\n}", - "description": "", + "name": "CachingStrategy", + "value": "AllCacheOptions", + "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "data", - "value": "ReturnType", - "description": "" + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "errors", - "value": "Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>", - "description": "" + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "extensions", - "value": "{ cost: { requestQueryCost: number; actualQueryCakes: number; throttleStatus: { maximumAvailable: number; currentAvailable: number; restoreRate: number; }; }; }", - "description": "" + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", + "isOptional": true } ] }, - "GraphQLError": { - "filePath": "src/utils/graphql.ts", - "name": "GraphQLError", + "StorefrontError": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontError", + "value": "{\n errors?: StorefrontApiErrors;\n}", "description": "", "members": [ { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "locations", - "value": "{ line: number; column: number; }[]", - "description": "If an error can be associated to a particular point in the requested GraphQL document, it should contain a list of locations." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "path", - "value": "(string | number)[]", - "description": "If an error can be associated to a particular field in the GraphQL result, it _must_ contain an entry with the key `path` that details the path of the response field which experienced the error. This allows clients to identify whether a null result is intentional or caused by a runtime error." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "extensions", - "value": "{ [key: string]: unknown; }", - "description": "Reserved for implementors to extend the protocol however they see fit, and hence there are no additional restrictions on its contents." - }, + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "errors", + "value": "StorefrontApiErrors", + "description": "", + "isOptional": true + } + ] + }, + "StorefrontApiErrors": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontApiErrors", + "value": "JsonGraphQLError[] | undefined", + "description": "" + }, + "StorefrontMutations": { + "filePath": "/storefront.ts", + "name": "StorefrontMutations", + "description": "Maps all the mutations found in the project to variables and return types.", + "members": [], + "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + }, + "NoStoreStrategy": { + "filePath": "/cache/strategies.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "NoStoreStrategy", + "value": "{\n mode: string;\n}", + "description": "", + "members": [ { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toString", - "value": "() => string", - "description": "Note: `toString()` is internally used by `console.log(...)` / `console.error(...)` when ingesting logs in Oxygen production. Therefore, we want to make sure that the error message is as informative as possible instead of `[object Object]`." - }, + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "" + } + ] + }, + "AllCacheOptions": { + "filePath": "/cache/strategies.ts", + "name": "AllCacheOptions", + "description": "Override options for a cache strategy.", + "members": [ { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toJSON", - "value": "() => Pick", - "description": "Note: toJSON` is internally used by `JSON.stringify(...)`. The most common scenario when this error instance is going to be stringified is when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`. In this situation, we don't want to expose private error information to the browser so we only do it in development." + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "GetAccessor", - "name": "__@toStringTag@690", - "value": "string", - "description": "" + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "name", - "value": "string", - "description": "" + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "message", - "value": "string", - "description": "" + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "stack", - "value": "string", - "description": "", + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", "isOptional": true } ], - "value": "export class GraphQLError extends Error {\n /**\n * If an error can be associated to a particular point in the requested\n * GraphQL document, it should contain a list of locations.\n */\n locations?: Array<{line: number; column: number}>;\n /**\n * If an error can be associated to a particular field in the GraphQL result,\n * it _must_ contain an entry with the key `path` that details the path of\n * the response field which experienced the error. This allows clients to\n * identify whether a null result is intentional or caused by a runtime error.\n */\n path?: Array;\n /**\n * Reserved for implementors to extend the protocol however they see fit,\n * and hence there are no additional restrictions on its contents.\n */\n extensions?: {[key: string]: unknown};\n\n constructor(\n message?: string,\n options: Pick<\n GraphQLError,\n 'locations' | 'path' | 'extensions' | 'stack' | 'cause'\n > & {\n query?: string;\n queryVariables?: GenericVariables;\n requestId?: string | null;\n clientOperation?: string;\n } = {},\n ) {\n const h2Prefix = options.clientOperation\n ? `[h2:error:${options.clientOperation}] `\n : '';\n\n const enhancedMessage =\n h2Prefix +\n message +\n (options.requestId ? ` - Request ID: ${options.requestId}` : '');\n\n super(enhancedMessage);\n this.name = 'GraphQLError';\n this.extensions = options.extensions;\n this.locations = options.locations;\n this.path = options.path;\n this.stack = options.stack || undefined;\n\n try {\n this.cause = JSON.stringify({\n ...(typeof options.cause === 'object' ? options.cause : {}),\n requestId: options.requestId,\n ...(process.env.NODE_ENV === 'development' && {\n path: options.path,\n extensions: options.extensions,\n graphql: h2Prefix &&\n options.query && {\n query: options.query,\n variables: JSON.stringify(options.queryVariables),\n },\n }),\n });\n } catch {\n if (options.cause) this.cause = options.cause;\n }\n }\n\n get [Symbol.toStringTag]() {\n return this.name;\n }\n\n /**\n * Note: `toString()` is internally used by `console.log(...)` / `console.error(...)`\n * when ingesting logs in Oxygen production. Therefore, we want to make sure that\n * the error message is as informative as possible instead of `[object Object]`.\n */\n override toString() {\n let result = `${this.name}: ${this.message}`;\n\n if (this.path) {\n try {\n result += ` | path: ${JSON.stringify(this.path)}`;\n } catch {}\n }\n\n if (this.extensions) {\n try {\n result += ` | extensions: ${JSON.stringify(this.extensions)}`;\n } catch {}\n }\n\n result += '\\n';\n\n if (this.stack) {\n // Remove the message line from the stack.\n result += `${this.stack.slice(this.stack.indexOf('\\n') + 1)}\\n`;\n }\n\n return result;\n }\n\n /**\n * Note: toJSON` is internally used by `JSON.stringify(...)`.\n * The most common scenario when this error instance is going to be stringified is\n * when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`.\n * In this situation, we don't want to expose private error information to the browser so we only\n * do it in development.\n */\n toJSON() {\n const formatted: Pick<\n GraphQLError,\n 'name' | 'message' | 'path' | 'extensions' | 'locations' | 'stack'\n > = {name: 'Error', message: ''};\n\n if (process.env.NODE_ENV === 'development') {\n formatted.name = this.name;\n formatted.message = 'Development: ' + this.message;\n if (this.path) formatted.path = this.path;\n if (this.locations) formatted.locations = this.locations;\n if (this.extensions) formatted.extensions = this.extensions;\n // Skip stack on purpose because we don't want to expose it to the browser.\n }\n\n return formatted;\n }\n}" - }, - "CustomerAccountQueries": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountQueries", - "description": "", - "members": [], - "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" }, - "Storefront": { - "filePath": "src/storefront.ts", + "CustomerAccount": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "Storefront", - "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", - "description": "Interface to interact with the Storefront API.", + "name": "CustomerAccount", + "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", + "description": "", "members": [ { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "cache", - "value": "Cache", - "description": "", - "isOptional": true - }, - { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "CacheCustom", - "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "login", + "value": "(options?: LoginOptions) => Promise", + "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "CacheLong", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "authorize", + "value": "() => Promise", + "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "CacheNone", - "value": "() => NoStoreStrategy", - "description": "" + "name": "isLoggedIn", + "value": "() => Promise", + "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "CacheShort", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "handleAuthStatus", + "value": "() => void | DataFunctionValue", + "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "generateCacheControlHeader", - "value": "(cacheOptions: AllCacheOptions) => string", - "description": "" + "name": "getAccessToken", + "value": "() => Promise", + "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", "name": "getApiUrl", - "value": "(props?: Partial>) => string", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "getPrivateTokenHeaders", - "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", - "description": "" + "value": "() => string", + "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getPublicTokenHeaders", - "value": "(props?: Partial> & Pick) => Record", - "description": "" + "name": "logout", + "value": "(options?: LogoutOptions) => Promise", + "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getShopifyDomain", - "value": "(props?: Partial>) => string", - "description": "" + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "i18n", - "value": "TI18n", - "description": "" + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", - "description": "" + "name": "UNSTABLE_setBuyer", + "value": "(buyer: Partial) => void", + "description": "UNSTABLE feature. Set buyer information into session." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", - "description": "" + "name": "UNSTABLE_getBuyer", + "value": "() => Promise>", + "description": "UNSTABLE feature. Get buyer token and company location id from session." } ] }, - "AllCacheOptions": { - "filePath": "src/cache/strategies.ts", - "name": "AllCacheOptions", - "description": "Override options for a cache strategy.", + "LoginOptions": { + "filePath": "/customer/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "LoginOptions", + "value": "{\n uiLocales?: LanguageCode;\n}", + "description": "", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "name": "uiLocales", + "value": "LanguageCode", + "description": "", "isOptional": true } - ], - "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" - }, - "NoStoreStrategy": { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "NoStoreStrategy", - "value": "{\n mode: string;\n}", - "description": "", - "members": [ - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "" - } ] }, - "StorefrontMutations": { - "filePath": "src/storefront.ts", - "name": "StorefrontMutations", - "description": "Maps all the mutations found in the project to variables and return types.", - "members": [], - "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" - }, - "AutoAddedVariableNames": { - "filePath": "src/storefront.ts", + "DataFunctionValue": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "AutoAddedVariableNames", - "value": "'country' | 'language'", + "name": "DataFunctionValue", + "value": "Response | NonNullable | null", "description": "" }, - "StorefrontCommonExtraParams": { - "filePath": "src/storefront.ts", + "LogoutOptions": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontCommonExtraParams", - "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", + "name": "LogoutOptions", + "value": "{\n postLogoutRedirectUri?: string;\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "displayName", - "value": "string", - "description": "", - "isOptional": true - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "headers", - "value": "HeadersInit", - "description": "", - "isOptional": true - }, - { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "storefrontApiVersion", + "name": "postLogoutRedirectUri", "value": "string", "description": "", "isOptional": true } ] }, - "StorefrontError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontError", - "value": "{\n errors?: StorefrontApiErrors;\n}", + "CustomerAccountQueries": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountQueries", "description": "", - "members": [ - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "errors", - "value": "StorefrontApiErrors", - "description": "", - "isOptional": true - } - ] - }, - "StorefrontApiErrors": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontApiErrors", - "value": "JsonGraphQLError[] | undefined", - "description": "" + "members": [], + "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" }, - "JsonGraphQLError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "JsonGraphQLError", - "value": "ReturnType", + "CustomerAccountMutations": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountMutations", "description": "", - "members": [] - }, - "StorefrontQueries": { - "filePath": "src/storefront.ts", - "name": "StorefrontQueries", - "description": "Maps all the queries found in the project to variables and return types.", "members": [], - "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" - }, - "StorefrontQueryOptions": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontQueryOptions", - "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", - "description": "" - }, - "CachingStrategy": { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CachingStrategy", - "value": "AllCacheOptions", - "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", - "members": [ - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true - } - ] + "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" }, "CartDiscountCodesUpdateFunction": { - "filePath": "src/cart/queries/cartDiscountCodesUpdateDefault.ts", + "filePath": "/cart/queries/cartDiscountCodesUpdateDefault.ts", "name": "CartDiscountCodesUpdateFunction", "description": "", "params": [ @@ -8192,18 +7704,18 @@ "name": "discountCodes", "description": "", "value": "string[]", - "filePath": "src/cart/queries/cartDiscountCodesUpdateDefault.ts" + "filePath": "/cart/queries/cartDiscountCodesUpdateDefault.ts" }, { "name": "optionalParams", "description": "", "value": "CartOptionalInput", "isOptional": true, - "filePath": "src/cart/queries/cartDiscountCodesUpdateDefault.ts" + "filePath": "/cart/queries/cartDiscountCodesUpdateDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartDiscountCodesUpdateDefault.ts", + "filePath": "/cart/queries/cartDiscountCodesUpdateDefault.ts", "description": "", "name": "Promise", "value": "Promise" @@ -8211,14 +7723,14 @@ "value": "export type CartDiscountCodesUpdateFunction = (\n discountCodes: string[],\n optionalParams?: CartOptionalInput,\n) => Promise;" }, "CartOptionalInput": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartOptionalInput", "value": "{\n /**\n * The cart id.\n * @default cart.getCartId();\n */\n cartId?: Scalars['ID']['input'];\n /**\n * The country code.\n * @default storefront.i18n.country\n */\n country?: CountryCode;\n /**\n * The language code.\n * @default storefront.i18n.language\n */\n language?: LanguageCode;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cartId", "value": "string", @@ -8227,7 +7739,7 @@ "defaultValue": "cart.getCartId();" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "country", "value": "CountryCode", @@ -8236,7 +7748,7 @@ "defaultValue": "storefront.i18n.country" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "language", "value": "LanguageCode", @@ -8247,31 +7759,31 @@ ] }, "CartQueryDataReturn": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryDataReturn", "value": "CartQueryData & {\n errors?: StorefrontApiErrors;\n}", "description": "" }, "CartQueryData": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryData", "value": "{\n cart: Cart;\n userErrors?:\n | CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[];\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cart", "value": "Cart", "description": "" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "userErrors", - "value": "| CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[]", + "value": "CartUserError[] | MetafieldsSetUserError[] | MetafieldDeleteUserError[]", "description": "", "isOptional": true } @@ -8337,7 +7849,7 @@ "type": "CartGetDefaultGeneratedType", "typeDefinitions": { "CartGetDefaultGeneratedType": { - "filePath": "src/cart/queries/cartGetDefault.ts", + "filePath": "/cart/queries/cartGetDefault.ts", "name": "CartGetDefaultGeneratedType", "description": "", "params": [ @@ -8345,11 +7857,11 @@ "name": "input1", "description": "", "value": "CartGetOptions", - "filePath": "src/cart/queries/cartGetDefault.ts" + "filePath": "/cart/queries/cartGetDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartGetDefault.ts", + "filePath": "/cart/queries/cartGetDefault.ts", "description": "", "name": "CartGetFunction", "value": "CartGetFunction" @@ -8357,21 +7869,35 @@ "value": "export function cartGetDefault({\n storefront,\n customerAccount,\n getCartId,\n cartFragment,\n}: CartGetOptions): CartGetFunction {\n return async (cartInput?: CartGetProps) => {\n const cartId = getCartId();\n\n if (!cartId) return null;\n\n const [isCustomerLoggedIn, {cart, errors}] = await Promise.all([\n customerAccount ? customerAccount.isLoggedIn() : false,\n storefront.query<{cart: Cart | null}>(CART_QUERY(cartFragment), {\n variables: {cartId, ...cartInput},\n cache: storefront.CacheNone(),\n }),\n ]);\n\n if (isCustomerLoggedIn && cart?.checkoutUrl) {\n const finalCheckoutUrl = new URL(cart.checkoutUrl);\n finalCheckoutUrl.searchParams.set('logged_in', 'true');\n cart.checkoutUrl = finalCheckoutUrl.toString();\n }\n\n return cart || errors ? formatAPIResult(cart, errors) : null;\n };\n}" }, "CartGetOptions": { - "filePath": "src/cart/queries/cartGetDefault.ts", + "filePath": "/cart/queries/cartGetDefault.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartGetOptions", "value": "CartQueryOptions & {\n /**\n * The customer account client instance created by [`createCustomerAccountClient`](docs/api/hydrogen/latest/utilities/createcustomeraccountclient).\n */\n customerAccount?: CustomerAccount;\n}", "description": "" }, "CartQueryOptions": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryOptions", "value": "{\n /**\n * The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient).\n */\n storefront: Storefront;\n /**\n * A function that returns the cart ID.\n */\n getCartId: () => string | undefined;\n /**\n * The cart fragment to override the one used in this query.\n */\n cartFragment?: string;\n /**\n * The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).\n */\n customerAccount?: CustomerAccount;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "storefront", + "value": "Storefront", + "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." + }, + { + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "getCartId", + "value": "() => string", + "description": "A function that returns the cart ID." + }, + { + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cartFragment", "value": "string", @@ -8379,581 +7905,457 @@ "isOptional": true }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "customerAccount", "value": "CustomerAccount", "description": "The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).", "isOptional": true - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "getCartId", - "value": "() => string", - "description": "A function that returns the cart ID." - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "storefront", - "value": "Storefront", - "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." } ] }, - "CustomerAccount": { - "filePath": "src/customer/types.ts", + "Storefront": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAccount", - "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", - "description": "", + "name": "Storefront", + "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", + "description": "Interface to interact with the Storefront API.", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "authorize", - "value": "() => Promise", - "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getAccessToken", - "value": "() => Promise", - "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "() => string", - "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." + "name": "cache", + "value": "Cache", + "description": "", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "handleAuthStatus", - "value": "() => void | DataFunctionValue", - "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." + "name": "CacheNone", + "value": "() => NoStoreStrategy", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "isLoggedIn", - "value": "() => Promise", - "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." + "name": "CacheLong", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "login", - "value": "(options?: LoginOptions) => Promise", - "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" + "name": "CacheShort", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "logout", - "value": "(options?: LogoutOptions) => Promise", - "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." + "name": "CacheCustom", + "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." + "name": "generateCacheControlHeader", + "value": "(cacheOptions: AllCacheOptions) => string", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." + "name": "getPublicTokenHeaders", + "value": "(props?: Partial> & Pick) => Record", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_getBuyer", - "value": "() => Promise>", - "description": "UNSTABLE feature. Get buyer token and company location id from session." + "name": "getPrivateTokenHeaders", + "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_setBuyer", - "value": "(buyer: Partial) => void", - "description": "UNSTABLE feature. Set buyer information into session." + "name": "getShopifyDomain", + "value": "(props?: Partial>) => string", + "description": "" + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "getApiUrl", + "value": "(props?: Partial>) => string", + "description": "" + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "i18n", + "value": "TI18n", + "description": "" } ] }, - "DataFunctionValue": { - "filePath": "src/customer/types.ts", + "StorefrontQueries": { + "filePath": "/storefront.ts", + "name": "StorefrontQueries", + "description": "Maps all the queries found in the project to variables and return types.", + "members": [], + "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + }, + "AutoAddedVariableNames": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "DataFunctionValue", - "value": "Response | NonNullable | null", + "name": "AutoAddedVariableNames", + "value": "'country' | 'language'", "description": "" }, - "LoginOptions": { - "filePath": "src/customer/types.ts", + "StorefrontCommonExtraParams": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "LoginOptions", - "value": "{\n uiLocales?: LanguageCode;\n}", + "name": "StorefrontCommonExtraParams", + "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", "description": "", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "uiLocales", - "value": "LanguageCode", + "name": "headers", + "value": "HeadersInit", "description": "", "isOptional": true - } - ] - }, - "LogoutOptions": { - "filePath": "src/customer/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "LogoutOptions", - "value": "{\n postLogoutRedirectUri?: string;\n}", - "description": "", - "members": [ + }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "postLogoutRedirectUri", + "name": "storefrontApiVersion", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "displayName", "value": "string", "description": "", "isOptional": true } ] }, - "CustomerAccountMutations": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountMutations", - "description": "", - "members": [], - "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + "StorefrontQueryOptions": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontQueryOptions", + "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", + "description": "" }, - "CustomerAPIResponse": { - "filePath": "src/customer/types.ts", + "CachingStrategy": { + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAPIResponse", - "value": "{\n data: ReturnType;\n errors: Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>;\n extensions: {\n cost: {\n requestQueryCost: number;\n actualQueryCakes: number;\n throttleStatus: {\n maximumAvailable: number;\n currentAvailable: number;\n restoreRate: number;\n };\n };\n };\n}", - "description": "", + "name": "CachingStrategy", + "value": "AllCacheOptions", + "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "data", - "value": "ReturnType", - "description": "" + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "errors", - "value": "Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>", - "description": "" + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "extensions", - "value": "{ cost: { requestQueryCost: number; actualQueryCakes: number; throttleStatus: { maximumAvailable: number; currentAvailable: number; restoreRate: number; }; }; }", - "description": "" + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", + "isOptional": true } ] }, - "GraphQLError": { - "filePath": "src/utils/graphql.ts", - "name": "GraphQLError", + "StorefrontError": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontError", + "value": "{\n errors?: StorefrontApiErrors;\n}", "description": "", "members": [ { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "locations", - "value": "{ line: number; column: number; }[]", - "description": "If an error can be associated to a particular point in the requested GraphQL document, it should contain a list of locations." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "path", - "value": "(string | number)[]", - "description": "If an error can be associated to a particular field in the GraphQL result, it _must_ contain an entry with the key `path` that details the path of the response field which experienced the error. This allows clients to identify whether a null result is intentional or caused by a runtime error." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "extensions", - "value": "{ [key: string]: unknown; }", - "description": "Reserved for implementors to extend the protocol however they see fit, and hence there are no additional restrictions on its contents." - }, + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "errors", + "value": "StorefrontApiErrors", + "description": "", + "isOptional": true + } + ] + }, + "StorefrontApiErrors": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontApiErrors", + "value": "JsonGraphQLError[] | undefined", + "description": "" + }, + "StorefrontMutations": { + "filePath": "/storefront.ts", + "name": "StorefrontMutations", + "description": "Maps all the mutations found in the project to variables and return types.", + "members": [], + "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + }, + "NoStoreStrategy": { + "filePath": "/cache/strategies.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "NoStoreStrategy", + "value": "{\n mode: string;\n}", + "description": "", + "members": [ { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toString", - "value": "() => string", - "description": "Note: `toString()` is internally used by `console.log(...)` / `console.error(...)` when ingesting logs in Oxygen production. Therefore, we want to make sure that the error message is as informative as possible instead of `[object Object]`." - }, + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "" + } + ] + }, + "AllCacheOptions": { + "filePath": "/cache/strategies.ts", + "name": "AllCacheOptions", + "description": "Override options for a cache strategy.", + "members": [ { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toJSON", - "value": "() => Pick", - "description": "Note: toJSON` is internally used by `JSON.stringify(...)`. The most common scenario when this error instance is going to be stringified is when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`. In this situation, we don't want to expose private error information to the browser so we only do it in development." + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "GetAccessor", - "name": "__@toStringTag@690", - "value": "string", - "description": "" + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "name", - "value": "string", - "description": "" + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "message", - "value": "string", - "description": "" + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "stack", - "value": "string", - "description": "", + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", "isOptional": true } ], - "value": "export class GraphQLError extends Error {\n /**\n * If an error can be associated to a particular point in the requested\n * GraphQL document, it should contain a list of locations.\n */\n locations?: Array<{line: number; column: number}>;\n /**\n * If an error can be associated to a particular field in the GraphQL result,\n * it _must_ contain an entry with the key `path` that details the path of\n * the response field which experienced the error. This allows clients to\n * identify whether a null result is intentional or caused by a runtime error.\n */\n path?: Array;\n /**\n * Reserved for implementors to extend the protocol however they see fit,\n * and hence there are no additional restrictions on its contents.\n */\n extensions?: {[key: string]: unknown};\n\n constructor(\n message?: string,\n options: Pick<\n GraphQLError,\n 'locations' | 'path' | 'extensions' | 'stack' | 'cause'\n > & {\n query?: string;\n queryVariables?: GenericVariables;\n requestId?: string | null;\n clientOperation?: string;\n } = {},\n ) {\n const h2Prefix = options.clientOperation\n ? `[h2:error:${options.clientOperation}] `\n : '';\n\n const enhancedMessage =\n h2Prefix +\n message +\n (options.requestId ? ` - Request ID: ${options.requestId}` : '');\n\n super(enhancedMessage);\n this.name = 'GraphQLError';\n this.extensions = options.extensions;\n this.locations = options.locations;\n this.path = options.path;\n this.stack = options.stack || undefined;\n\n try {\n this.cause = JSON.stringify({\n ...(typeof options.cause === 'object' ? options.cause : {}),\n requestId: options.requestId,\n ...(process.env.NODE_ENV === 'development' && {\n path: options.path,\n extensions: options.extensions,\n graphql: h2Prefix &&\n options.query && {\n query: options.query,\n variables: JSON.stringify(options.queryVariables),\n },\n }),\n });\n } catch {\n if (options.cause) this.cause = options.cause;\n }\n }\n\n get [Symbol.toStringTag]() {\n return this.name;\n }\n\n /**\n * Note: `toString()` is internally used by `console.log(...)` / `console.error(...)`\n * when ingesting logs in Oxygen production. Therefore, we want to make sure that\n * the error message is as informative as possible instead of `[object Object]`.\n */\n override toString() {\n let result = `${this.name}: ${this.message}`;\n\n if (this.path) {\n try {\n result += ` | path: ${JSON.stringify(this.path)}`;\n } catch {}\n }\n\n if (this.extensions) {\n try {\n result += ` | extensions: ${JSON.stringify(this.extensions)}`;\n } catch {}\n }\n\n result += '\\n';\n\n if (this.stack) {\n // Remove the message line from the stack.\n result += `${this.stack.slice(this.stack.indexOf('\\n') + 1)}\\n`;\n }\n\n return result;\n }\n\n /**\n * Note: toJSON` is internally used by `JSON.stringify(...)`.\n * The most common scenario when this error instance is going to be stringified is\n * when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`.\n * In this situation, we don't want to expose private error information to the browser so we only\n * do it in development.\n */\n toJSON() {\n const formatted: Pick<\n GraphQLError,\n 'name' | 'message' | 'path' | 'extensions' | 'locations' | 'stack'\n > = {name: 'Error', message: ''};\n\n if (process.env.NODE_ENV === 'development') {\n formatted.name = this.name;\n formatted.message = 'Development: ' + this.message;\n if (this.path) formatted.path = this.path;\n if (this.locations) formatted.locations = this.locations;\n if (this.extensions) formatted.extensions = this.extensions;\n // Skip stack on purpose because we don't want to expose it to the browser.\n }\n\n return formatted;\n }\n}" - }, - "CustomerAccountQueries": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountQueries", - "description": "", - "members": [], - "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" }, - "Storefront": { - "filePath": "src/storefront.ts", + "CustomerAccount": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "Storefront", - "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", - "description": "Interface to interact with the Storefront API.", + "name": "CustomerAccount", + "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", + "description": "", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "cache", - "value": "Cache", - "description": "", - "isOptional": true + "name": "login", + "value": "(options?: LoginOptions) => Promise", + "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "CacheCustom", - "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "authorize", + "value": "() => Promise", + "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "CacheLong", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "isLoggedIn", + "value": "() => Promise", + "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "CacheNone", - "value": "() => NoStoreStrategy", - "description": "" + "name": "handleAuthStatus", + "value": "() => void | DataFunctionValue", + "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "CacheShort", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "getAccessToken", + "value": "() => Promise", + "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "generateCacheControlHeader", - "value": "(cacheOptions: AllCacheOptions) => string", - "description": "" + "name": "getApiUrl", + "value": "() => string", + "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "(props?: Partial>) => string", - "description": "" + "name": "logout", + "value": "(options?: LogoutOptions) => Promise", + "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getPrivateTokenHeaders", - "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", - "description": "" + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getPublicTokenHeaders", - "value": "(props?: Partial> & Pick) => Record", - "description": "" + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getShopifyDomain", - "value": "(props?: Partial>) => string", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "i18n", - "value": "TI18n", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", - "description": "" + "name": "UNSTABLE_setBuyer", + "value": "(buyer: Partial) => void", + "description": "UNSTABLE feature. Set buyer information into session." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", - "description": "" + "name": "UNSTABLE_getBuyer", + "value": "() => Promise>", + "description": "UNSTABLE feature. Get buyer token and company location id from session." } ] }, - "AllCacheOptions": { - "filePath": "src/cache/strategies.ts", - "name": "AllCacheOptions", - "description": "Override options for a cache strategy.", - "members": [ - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true - } - ], - "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" - }, - "NoStoreStrategy": { - "filePath": "src/cache/strategies.ts", + "LoginOptions": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "NoStoreStrategy", - "value": "{\n mode: string;\n}", + "name": "LoginOptions", + "value": "{\n uiLocales?: LanguageCode;\n}", "description": "", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "" + "name": "uiLocales", + "value": "LanguageCode", + "description": "", + "isOptional": true } ] }, - "StorefrontMutations": { - "filePath": "src/storefront.ts", - "name": "StorefrontMutations", - "description": "Maps all the mutations found in the project to variables and return types.", - "members": [], - "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" - }, - "AutoAddedVariableNames": { - "filePath": "src/storefront.ts", + "DataFunctionValue": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "AutoAddedVariableNames", - "value": "'country' | 'language'", + "name": "DataFunctionValue", + "value": "Response | NonNullable | null", "description": "" }, - "StorefrontCommonExtraParams": { - "filePath": "src/storefront.ts", + "LogoutOptions": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontCommonExtraParams", - "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", + "name": "LogoutOptions", + "value": "{\n postLogoutRedirectUri?: string;\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "displayName", - "value": "string", - "description": "", - "isOptional": true - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "headers", - "value": "HeadersInit", - "description": "", - "isOptional": true - }, - { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "storefrontApiVersion", + "name": "postLogoutRedirectUri", "value": "string", "description": "", "isOptional": true } ] }, - "StorefrontError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontError", - "value": "{\n errors?: StorefrontApiErrors;\n}", + "CustomerAccountQueries": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountQueries", "description": "", - "members": [ - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "errors", - "value": "StorefrontApiErrors", - "description": "", - "isOptional": true - } - ] - }, - "StorefrontApiErrors": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontApiErrors", - "value": "JsonGraphQLError[] | undefined", - "description": "" + "members": [], + "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" }, - "JsonGraphQLError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "JsonGraphQLError", - "value": "ReturnType", + "CustomerAccountMutations": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountMutations", "description": "", - "members": [] - }, - "StorefrontQueries": { - "filePath": "src/storefront.ts", - "name": "StorefrontQueries", - "description": "Maps all the queries found in the project to variables and return types.", "members": [], - "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" - }, - "StorefrontQueryOptions": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontQueryOptions", - "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", - "description": "" - }, - "CachingStrategy": { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CachingStrategy", - "value": "AllCacheOptions", - "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", - "members": [ - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true - } - ] + "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" }, "CartGetFunction": { - "filePath": "src/cart/queries/cartGetDefault.ts", + "filePath": "/cart/queries/cartGetDefault.ts", "name": "CartGetFunction", "description": "", "params": [ @@ -8962,11 +8364,11 @@ "description": "", "value": "CartGetProps", "isOptional": true, - "filePath": "src/cart/queries/cartGetDefault.ts" + "filePath": "/cart/queries/cartGetDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartGetDefault.ts", + "filePath": "/cart/queries/cartGetDefault.ts", "description": "", "name": "Promise", "value": "Promise" @@ -8974,14 +8376,14 @@ "value": "export type CartGetFunction = (\n cartInput?: CartGetProps,\n) => Promise;" }, "CartGetProps": { - "filePath": "src/cart/queries/cartGetDefault.ts", + "filePath": "/cart/queries/cartGetDefault.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartGetProps", "value": "{\n /**\n * The cart ID.\n * @default cart.getCartId();\n */\n cartId?: string;\n /**\n * The country code.\n * @default storefront.i18n.country\n */\n country?: CountryCode;\n /**\n * The language code.\n * @default storefront.i18n.language\n */\n language?: LanguageCode;\n /**\n * The number of cart lines to be returned.\n * @default 100\n */\n numCartLines?: number;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cartGetDefault.ts", + "filePath": "/cart/queries/cartGetDefault.ts", "syntaxKind": "PropertySignature", "name": "cartId", "value": "string", @@ -8990,7 +8392,7 @@ "defaultValue": "cart.getCartId();" }, { - "filePath": "src/cart/queries/cartGetDefault.ts", + "filePath": "/cart/queries/cartGetDefault.ts", "syntaxKind": "PropertySignature", "name": "country", "value": "CountryCode", @@ -8999,7 +8401,7 @@ "defaultValue": "storefront.i18n.country" }, { - "filePath": "src/cart/queries/cartGetDefault.ts", + "filePath": "/cart/queries/cartGetDefault.ts", "syntaxKind": "PropertySignature", "name": "language", "value": "LanguageCode", @@ -9008,7 +8410,7 @@ "defaultValue": "storefront.i18n.language" }, { - "filePath": "src/cart/queries/cartGetDefault.ts", + "filePath": "/cart/queries/cartGetDefault.ts", "syntaxKind": "PropertySignature", "name": "numCartLines", "value": "number", @@ -9019,7 +8421,7 @@ ] }, "CartReturn": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartReturn", "value": "Cart & {\n errors?: StorefrontApiErrors;\n}", @@ -9064,7 +8466,7 @@ "type": "CartLinesAddDefaultGeneratedType", "typeDefinitions": { "CartLinesAddDefaultGeneratedType": { - "filePath": "src/cart/queries/cartLinesAddDefault.ts", + "filePath": "/cart/queries/cartLinesAddDefault.ts", "name": "CartLinesAddDefaultGeneratedType", "description": "", "params": [ @@ -9072,11 +8474,11 @@ "name": "options", "description": "", "value": "CartQueryOptions", - "filePath": "src/cart/queries/cartLinesAddDefault.ts" + "filePath": "/cart/queries/cartLinesAddDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartLinesAddDefault.ts", + "filePath": "/cart/queries/cartLinesAddDefault.ts", "description": "", "name": "CartLinesAddFunction", "value": "CartLinesAddFunction" @@ -9084,14 +8486,28 @@ "value": "export function cartLinesAddDefault(\n options: CartQueryOptions,\n): CartLinesAddFunction {\n return async (lines, optionalParams) => {\n const {cartLinesAdd, errors} = await options.storefront.mutate<{\n cartLinesAdd: CartQueryData;\n errors: StorefrontApiErrors;\n }>(CART_LINES_ADD_MUTATION(options.cartFragment), {\n variables: {\n cartId: options.getCartId(),\n lines,\n ...optionalParams,\n },\n });\n\n return formatAPIResult(cartLinesAdd, errors);\n };\n}" }, "CartQueryOptions": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryOptions", "value": "{\n /**\n * The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient).\n */\n storefront: Storefront;\n /**\n * A function that returns the cart ID.\n */\n getCartId: () => string | undefined;\n /**\n * The cart fragment to override the one used in this query.\n */\n cartFragment?: string;\n /**\n * The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).\n */\n customerAccount?: CustomerAccount;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "storefront", + "value": "Storefront", + "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." + }, + { + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "getCartId", + "value": "() => string", + "description": "A function that returns the cart ID." + }, + { + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cartFragment", "value": "string", @@ -9099,581 +8515,457 @@ "isOptional": true }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "customerAccount", "value": "CustomerAccount", "description": "The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).", "isOptional": true - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "getCartId", - "value": "() => string", - "description": "A function that returns the cart ID." - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "storefront", - "value": "Storefront", - "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." } ] }, - "CustomerAccount": { - "filePath": "src/customer/types.ts", + "Storefront": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAccount", - "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", - "description": "", + "name": "Storefront", + "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", + "description": "Interface to interact with the Storefront API.", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "authorize", - "value": "() => Promise", - "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getAccessToken", - "value": "() => Promise", - "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "() => string", - "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." + "name": "cache", + "value": "Cache", + "description": "", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "handleAuthStatus", - "value": "() => void | DataFunctionValue", - "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." + "name": "CacheNone", + "value": "() => NoStoreStrategy", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "isLoggedIn", - "value": "() => Promise", - "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." + "name": "CacheLong", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "login", - "value": "(options?: LoginOptions) => Promise", - "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" + "name": "CacheShort", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "logout", - "value": "(options?: LogoutOptions) => Promise", - "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." + "name": "CacheCustom", + "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." + "name": "generateCacheControlHeader", + "value": "(cacheOptions: AllCacheOptions) => string", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." + "name": "getPublicTokenHeaders", + "value": "(props?: Partial> & Pick) => Record", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_getBuyer", - "value": "() => Promise>", - "description": "UNSTABLE feature. Get buyer token and company location id from session." + "name": "getPrivateTokenHeaders", + "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_setBuyer", - "value": "(buyer: Partial) => void", - "description": "UNSTABLE feature. Set buyer information into session." + "name": "getShopifyDomain", + "value": "(props?: Partial>) => string", + "description": "" + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "getApiUrl", + "value": "(props?: Partial>) => string", + "description": "" + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "i18n", + "value": "TI18n", + "description": "" } ] }, - "DataFunctionValue": { - "filePath": "src/customer/types.ts", + "StorefrontQueries": { + "filePath": "/storefront.ts", + "name": "StorefrontQueries", + "description": "Maps all the queries found in the project to variables and return types.", + "members": [], + "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + }, + "AutoAddedVariableNames": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "DataFunctionValue", - "value": "Response | NonNullable | null", + "name": "AutoAddedVariableNames", + "value": "'country' | 'language'", "description": "" }, - "LoginOptions": { - "filePath": "src/customer/types.ts", + "StorefrontCommonExtraParams": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "LoginOptions", - "value": "{\n uiLocales?: LanguageCode;\n}", + "name": "StorefrontCommonExtraParams", + "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", "description": "", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "uiLocales", - "value": "LanguageCode", + "name": "headers", + "value": "HeadersInit", "description": "", "isOptional": true - } - ] - }, - "LogoutOptions": { - "filePath": "src/customer/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "LogoutOptions", - "value": "{\n postLogoutRedirectUri?: string;\n}", - "description": "", - "members": [ + }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "postLogoutRedirectUri", + "name": "storefrontApiVersion", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "displayName", "value": "string", "description": "", "isOptional": true } ] }, - "CustomerAccountMutations": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountMutations", - "description": "", - "members": [], - "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + "StorefrontQueryOptions": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontQueryOptions", + "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", + "description": "" }, - "CustomerAPIResponse": { - "filePath": "src/customer/types.ts", + "CachingStrategy": { + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAPIResponse", - "value": "{\n data: ReturnType;\n errors: Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>;\n extensions: {\n cost: {\n requestQueryCost: number;\n actualQueryCakes: number;\n throttleStatus: {\n maximumAvailable: number;\n currentAvailable: number;\n restoreRate: number;\n };\n };\n };\n}", - "description": "", + "name": "CachingStrategy", + "value": "AllCacheOptions", + "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "data", - "value": "ReturnType", - "description": "" + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "errors", - "value": "Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>", - "description": "" + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "extensions", - "value": "{ cost: { requestQueryCost: number; actualQueryCakes: number; throttleStatus: { maximumAvailable: number; currentAvailable: number; restoreRate: number; }; }; }", - "description": "" + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", + "isOptional": true } ] }, - "GraphQLError": { - "filePath": "src/utils/graphql.ts", - "name": "GraphQLError", + "StorefrontError": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontError", + "value": "{\n errors?: StorefrontApiErrors;\n}", "description": "", "members": [ { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "locations", - "value": "{ line: number; column: number; }[]", - "description": "If an error can be associated to a particular point in the requested GraphQL document, it should contain a list of locations." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "path", - "value": "(string | number)[]", - "description": "If an error can be associated to a particular field in the GraphQL result, it _must_ contain an entry with the key `path` that details the path of the response field which experienced the error. This allows clients to identify whether a null result is intentional or caused by a runtime error." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "extensions", - "value": "{ [key: string]: unknown; }", - "description": "Reserved for implementors to extend the protocol however they see fit, and hence there are no additional restrictions on its contents." - }, + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "errors", + "value": "StorefrontApiErrors", + "description": "", + "isOptional": true + } + ] + }, + "StorefrontApiErrors": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontApiErrors", + "value": "JsonGraphQLError[] | undefined", + "description": "" + }, + "StorefrontMutations": { + "filePath": "/storefront.ts", + "name": "StorefrontMutations", + "description": "Maps all the mutations found in the project to variables and return types.", + "members": [], + "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + }, + "NoStoreStrategy": { + "filePath": "/cache/strategies.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "NoStoreStrategy", + "value": "{\n mode: string;\n}", + "description": "", + "members": [ { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toString", - "value": "() => string", - "description": "Note: `toString()` is internally used by `console.log(...)` / `console.error(...)` when ingesting logs in Oxygen production. Therefore, we want to make sure that the error message is as informative as possible instead of `[object Object]`." - }, + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "" + } + ] + }, + "AllCacheOptions": { + "filePath": "/cache/strategies.ts", + "name": "AllCacheOptions", + "description": "Override options for a cache strategy.", + "members": [ { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toJSON", - "value": "() => Pick", - "description": "Note: toJSON` is internally used by `JSON.stringify(...)`. The most common scenario when this error instance is going to be stringified is when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`. In this situation, we don't want to expose private error information to the browser so we only do it in development." + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "GetAccessor", - "name": "__@toStringTag@690", - "value": "string", - "description": "" + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "name", - "value": "string", - "description": "" + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "message", - "value": "string", - "description": "" + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "stack", - "value": "string", - "description": "", + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", "isOptional": true } ], - "value": "export class GraphQLError extends Error {\n /**\n * If an error can be associated to a particular point in the requested\n * GraphQL document, it should contain a list of locations.\n */\n locations?: Array<{line: number; column: number}>;\n /**\n * If an error can be associated to a particular field in the GraphQL result,\n * it _must_ contain an entry with the key `path` that details the path of\n * the response field which experienced the error. This allows clients to\n * identify whether a null result is intentional or caused by a runtime error.\n */\n path?: Array;\n /**\n * Reserved for implementors to extend the protocol however they see fit,\n * and hence there are no additional restrictions on its contents.\n */\n extensions?: {[key: string]: unknown};\n\n constructor(\n message?: string,\n options: Pick<\n GraphQLError,\n 'locations' | 'path' | 'extensions' | 'stack' | 'cause'\n > & {\n query?: string;\n queryVariables?: GenericVariables;\n requestId?: string | null;\n clientOperation?: string;\n } = {},\n ) {\n const h2Prefix = options.clientOperation\n ? `[h2:error:${options.clientOperation}] `\n : '';\n\n const enhancedMessage =\n h2Prefix +\n message +\n (options.requestId ? ` - Request ID: ${options.requestId}` : '');\n\n super(enhancedMessage);\n this.name = 'GraphQLError';\n this.extensions = options.extensions;\n this.locations = options.locations;\n this.path = options.path;\n this.stack = options.stack || undefined;\n\n try {\n this.cause = JSON.stringify({\n ...(typeof options.cause === 'object' ? options.cause : {}),\n requestId: options.requestId,\n ...(process.env.NODE_ENV === 'development' && {\n path: options.path,\n extensions: options.extensions,\n graphql: h2Prefix &&\n options.query && {\n query: options.query,\n variables: JSON.stringify(options.queryVariables),\n },\n }),\n });\n } catch {\n if (options.cause) this.cause = options.cause;\n }\n }\n\n get [Symbol.toStringTag]() {\n return this.name;\n }\n\n /**\n * Note: `toString()` is internally used by `console.log(...)` / `console.error(...)`\n * when ingesting logs in Oxygen production. Therefore, we want to make sure that\n * the error message is as informative as possible instead of `[object Object]`.\n */\n override toString() {\n let result = `${this.name}: ${this.message}`;\n\n if (this.path) {\n try {\n result += ` | path: ${JSON.stringify(this.path)}`;\n } catch {}\n }\n\n if (this.extensions) {\n try {\n result += ` | extensions: ${JSON.stringify(this.extensions)}`;\n } catch {}\n }\n\n result += '\\n';\n\n if (this.stack) {\n // Remove the message line from the stack.\n result += `${this.stack.slice(this.stack.indexOf('\\n') + 1)}\\n`;\n }\n\n return result;\n }\n\n /**\n * Note: toJSON` is internally used by `JSON.stringify(...)`.\n * The most common scenario when this error instance is going to be stringified is\n * when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`.\n * In this situation, we don't want to expose private error information to the browser so we only\n * do it in development.\n */\n toJSON() {\n const formatted: Pick<\n GraphQLError,\n 'name' | 'message' | 'path' | 'extensions' | 'locations' | 'stack'\n > = {name: 'Error', message: ''};\n\n if (process.env.NODE_ENV === 'development') {\n formatted.name = this.name;\n formatted.message = 'Development: ' + this.message;\n if (this.path) formatted.path = this.path;\n if (this.locations) formatted.locations = this.locations;\n if (this.extensions) formatted.extensions = this.extensions;\n // Skip stack on purpose because we don't want to expose it to the browser.\n }\n\n return formatted;\n }\n}" - }, - "CustomerAccountQueries": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountQueries", - "description": "", - "members": [], - "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" }, - "Storefront": { - "filePath": "src/storefront.ts", + "CustomerAccount": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "Storefront", - "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", - "description": "Interface to interact with the Storefront API.", + "name": "CustomerAccount", + "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", + "description": "", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "cache", - "value": "Cache", - "description": "", - "isOptional": true + "name": "login", + "value": "(options?: LoginOptions) => Promise", + "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "CacheCustom", - "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "authorize", + "value": "() => Promise", + "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "CacheLong", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "isLoggedIn", + "value": "() => Promise", + "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "CacheNone", - "value": "() => NoStoreStrategy", - "description": "" + "name": "handleAuthStatus", + "value": "() => void | DataFunctionValue", + "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "CacheShort", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "generateCacheControlHeader", - "value": "(cacheOptions: AllCacheOptions) => string", - "description": "" + "name": "getAccessToken", + "value": "() => Promise", + "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", "name": "getApiUrl", - "value": "(props?: Partial>) => string", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "getPrivateTokenHeaders", - "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "getPublicTokenHeaders", - "value": "(props?: Partial> & Pick) => Record", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "getShopifyDomain", - "value": "(props?: Partial>) => string", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "i18n", - "value": "TI18n", - "description": "" + "value": "() => string", + "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", - "description": "" + "name": "logout", + "value": "(options?: LogoutOptions) => Promise", + "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", - "description": "" - } - ] - }, - "AllCacheOptions": { - "filePath": "src/cache/strategies.ts", - "name": "AllCacheOptions", - "description": "Override options for a cache strategy.", - "members": [ - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", - "isOptional": true + "name": "UNSTABLE_setBuyer", + "value": "(buyer: Partial) => void", + "description": "UNSTABLE feature. Set buyer information into session." }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true + "name": "UNSTABLE_getBuyer", + "value": "() => Promise>", + "description": "UNSTABLE feature. Get buyer token and company location id from session." } - ], - "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" + ] }, - "NoStoreStrategy": { - "filePath": "src/cache/strategies.ts", + "LoginOptions": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "NoStoreStrategy", - "value": "{\n mode: string;\n}", + "name": "LoginOptions", + "value": "{\n uiLocales?: LanguageCode;\n}", "description": "", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "" + "name": "uiLocales", + "value": "LanguageCode", + "description": "", + "isOptional": true } ] }, - "StorefrontMutations": { - "filePath": "src/storefront.ts", - "name": "StorefrontMutations", - "description": "Maps all the mutations found in the project to variables and return types.", - "members": [], - "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" - }, - "AutoAddedVariableNames": { - "filePath": "src/storefront.ts", + "DataFunctionValue": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "AutoAddedVariableNames", - "value": "'country' | 'language'", + "name": "DataFunctionValue", + "value": "Response | NonNullable | null", "description": "" }, - "StorefrontCommonExtraParams": { - "filePath": "src/storefront.ts", + "LogoutOptions": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontCommonExtraParams", - "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", + "name": "LogoutOptions", + "value": "{\n postLogoutRedirectUri?: string;\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "displayName", - "value": "string", - "description": "", - "isOptional": true - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "headers", - "value": "HeadersInit", - "description": "", - "isOptional": true - }, - { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "storefrontApiVersion", + "name": "postLogoutRedirectUri", "value": "string", "description": "", "isOptional": true } ] }, - "StorefrontError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontError", - "value": "{\n errors?: StorefrontApiErrors;\n}", + "CustomerAccountQueries": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountQueries", "description": "", - "members": [ - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "errors", - "value": "StorefrontApiErrors", - "description": "", - "isOptional": true - } - ] - }, - "StorefrontApiErrors": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontApiErrors", - "value": "JsonGraphQLError[] | undefined", - "description": "" + "members": [], + "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" }, - "JsonGraphQLError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "JsonGraphQLError", - "value": "ReturnType", + "CustomerAccountMutations": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountMutations", "description": "", - "members": [] - }, - "StorefrontQueries": { - "filePath": "src/storefront.ts", - "name": "StorefrontQueries", - "description": "Maps all the queries found in the project to variables and return types.", "members": [], - "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" - }, - "StorefrontQueryOptions": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontQueryOptions", - "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", - "description": "" - }, - "CachingStrategy": { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CachingStrategy", - "value": "AllCacheOptions", - "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", - "members": [ - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true - } - ] + "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" }, "CartLinesAddFunction": { - "filePath": "src/cart/queries/cartLinesAddDefault.ts", + "filePath": "/cart/queries/cartLinesAddDefault.ts", "name": "CartLinesAddFunction", "description": "", "params": [ @@ -9681,18 +8973,18 @@ "name": "lines", "description": "", "value": "CartLineInput[]", - "filePath": "src/cart/queries/cartLinesAddDefault.ts" + "filePath": "/cart/queries/cartLinesAddDefault.ts" }, { "name": "optionalParams", "description": "", "value": "CartOptionalInput", "isOptional": true, - "filePath": "src/cart/queries/cartLinesAddDefault.ts" + "filePath": "/cart/queries/cartLinesAddDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartLinesAddDefault.ts", + "filePath": "/cart/queries/cartLinesAddDefault.ts", "description": "", "name": "Promise", "value": "Promise" @@ -9707,14 +8999,14 @@ "override": "[CartLineInput](/docs/api/storefront/2024-07/input-objects/CartLineInput) - Storefront API type" }, "CartOptionalInput": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartOptionalInput", "value": "{\n /**\n * The cart id.\n * @default cart.getCartId();\n */\n cartId?: Scalars['ID']['input'];\n /**\n * The country code.\n * @default storefront.i18n.country\n */\n country?: CountryCode;\n /**\n * The language code.\n * @default storefront.i18n.language\n */\n language?: LanguageCode;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cartId", "value": "string", @@ -9723,7 +9015,7 @@ "defaultValue": "cart.getCartId();" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "country", "value": "CountryCode", @@ -9732,7 +9024,7 @@ "defaultValue": "storefront.i18n.country" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "language", "value": "LanguageCode", @@ -9743,31 +9035,31 @@ ] }, "CartQueryDataReturn": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryDataReturn", "value": "CartQueryData & {\n errors?: StorefrontApiErrors;\n}", "description": "" }, "CartQueryData": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryData", "value": "{\n cart: Cart;\n userErrors?:\n | CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[];\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cart", "value": "Cart", "description": "" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "userErrors", - "value": "| CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[]", + "value": "CartUserError[] | MetafieldsSetUserError[] | MetafieldDeleteUserError[]", "description": "", "isOptional": true } @@ -9833,7 +9125,7 @@ "type": "CartLinesRemoveDefaultGeneratedType", "typeDefinitions": { "CartLinesRemoveDefaultGeneratedType": { - "filePath": "src/cart/queries/cartLinesRemoveDefault.ts", + "filePath": "/cart/queries/cartLinesRemoveDefault.ts", "name": "CartLinesRemoveDefaultGeneratedType", "description": "", "params": [ @@ -9841,11 +9133,11 @@ "name": "options", "description": "", "value": "CartQueryOptions", - "filePath": "src/cart/queries/cartLinesRemoveDefault.ts" + "filePath": "/cart/queries/cartLinesRemoveDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartLinesRemoveDefault.ts", + "filePath": "/cart/queries/cartLinesRemoveDefault.ts", "description": "", "name": "CartLinesRemoveFunction", "value": "CartLinesRemoveFunction" @@ -9853,14 +9145,28 @@ "value": "export function cartLinesRemoveDefault(\n options: CartQueryOptions,\n): CartLinesRemoveFunction {\n return async (lineIds, optionalParams) => {\n throwIfLinesAreOptimistic('removeLines', lineIds);\n\n const {cartLinesRemove, errors} = await options.storefront.mutate<{\n cartLinesRemove: CartQueryData;\n errors: StorefrontApiErrors;\n }>(CART_LINES_REMOVE_MUTATION(options.cartFragment), {\n variables: {\n cartId: options.getCartId(),\n lineIds,\n ...optionalParams,\n },\n });\n return formatAPIResult(cartLinesRemove, errors);\n };\n}" }, "CartQueryOptions": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryOptions", "value": "{\n /**\n * The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient).\n */\n storefront: Storefront;\n /**\n * A function that returns the cart ID.\n */\n getCartId: () => string | undefined;\n /**\n * The cart fragment to override the one used in this query.\n */\n cartFragment?: string;\n /**\n * The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).\n */\n customerAccount?: CustomerAccount;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "storefront", + "value": "Storefront", + "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." + }, + { + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "getCartId", + "value": "() => string", + "description": "A function that returns the cart ID." + }, + { + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cartFragment", "value": "string", @@ -9868,581 +9174,457 @@ "isOptional": true }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "customerAccount", "value": "CustomerAccount", "description": "The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).", "isOptional": true - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "getCartId", - "value": "() => string", - "description": "A function that returns the cart ID." - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "storefront", - "value": "Storefront", - "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." } ] }, - "CustomerAccount": { - "filePath": "src/customer/types.ts", + "Storefront": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAccount", - "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", - "description": "", + "name": "Storefront", + "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", + "description": "Interface to interact with the Storefront API.", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "authorize", - "value": "() => Promise", - "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getAccessToken", - "value": "() => Promise", - "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "() => string", - "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." + "name": "cache", + "value": "Cache", + "description": "", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "handleAuthStatus", - "value": "() => void | DataFunctionValue", - "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." + "name": "CacheNone", + "value": "() => NoStoreStrategy", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "isLoggedIn", - "value": "() => Promise", - "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." + "name": "CacheLong", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "login", - "value": "(options?: LoginOptions) => Promise", - "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" + "name": "CacheShort", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "logout", - "value": "(options?: LogoutOptions) => Promise", - "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." + "name": "CacheCustom", + "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." + "name": "generateCacheControlHeader", + "value": "(cacheOptions: AllCacheOptions) => string", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." + "name": "getPublicTokenHeaders", + "value": "(props?: Partial> & Pick) => Record", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_getBuyer", - "value": "() => Promise>", - "description": "UNSTABLE feature. Get buyer token and company location id from session." + "name": "getPrivateTokenHeaders", + "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_setBuyer", - "value": "(buyer: Partial) => void", - "description": "UNSTABLE feature. Set buyer information into session." + "name": "getShopifyDomain", + "value": "(props?: Partial>) => string", + "description": "" + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "getApiUrl", + "value": "(props?: Partial>) => string", + "description": "" + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "i18n", + "value": "TI18n", + "description": "" } ] }, - "DataFunctionValue": { - "filePath": "src/customer/types.ts", + "StorefrontQueries": { + "filePath": "/storefront.ts", + "name": "StorefrontQueries", + "description": "Maps all the queries found in the project to variables and return types.", + "members": [], + "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + }, + "AutoAddedVariableNames": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "DataFunctionValue", - "value": "Response | NonNullable | null", + "name": "AutoAddedVariableNames", + "value": "'country' | 'language'", "description": "" }, - "LoginOptions": { - "filePath": "src/customer/types.ts", + "StorefrontCommonExtraParams": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "LoginOptions", - "value": "{\n uiLocales?: LanguageCode;\n}", + "name": "StorefrontCommonExtraParams", + "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", "description": "", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "uiLocales", - "value": "LanguageCode", + "name": "headers", + "value": "HeadersInit", "description": "", "isOptional": true - } - ] - }, - "LogoutOptions": { - "filePath": "src/customer/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "LogoutOptions", - "value": "{\n postLogoutRedirectUri?: string;\n}", - "description": "", - "members": [ + }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "postLogoutRedirectUri", + "name": "storefrontApiVersion", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "displayName", "value": "string", "description": "", "isOptional": true } ] }, - "CustomerAccountMutations": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountMutations", - "description": "", - "members": [], - "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + "StorefrontQueryOptions": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontQueryOptions", + "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", + "description": "" }, - "CustomerAPIResponse": { - "filePath": "src/customer/types.ts", + "CachingStrategy": { + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAPIResponse", - "value": "{\n data: ReturnType;\n errors: Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>;\n extensions: {\n cost: {\n requestQueryCost: number;\n actualQueryCakes: number;\n throttleStatus: {\n maximumAvailable: number;\n currentAvailable: number;\n restoreRate: number;\n };\n };\n };\n}", - "description": "", + "name": "CachingStrategy", + "value": "AllCacheOptions", + "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "data", - "value": "ReturnType", - "description": "" + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "errors", - "value": "Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>", - "description": "" + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "extensions", - "value": "{ cost: { requestQueryCost: number; actualQueryCakes: number; throttleStatus: { maximumAvailable: number; currentAvailable: number; restoreRate: number; }; }; }", - "description": "" - } - ] - }, - "GraphQLError": { - "filePath": "src/utils/graphql.ts", - "name": "GraphQLError", - "description": "", - "members": [ - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "locations", - "value": "{ line: number; column: number; }[]", - "description": "If an error can be associated to a particular point in the requested GraphQL document, it should contain a list of locations." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "path", - "value": "(string | number)[]", - "description": "If an error can be associated to a particular field in the GraphQL result, it _must_ contain an entry with the key `path` that details the path of the response field which experienced the error. This allows clients to identify whether a null result is intentional or caused by a runtime error." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "extensions", - "value": "{ [key: string]: unknown; }", - "description": "Reserved for implementors to extend the protocol however they see fit, and hence there are no additional restrictions on its contents." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toString", - "value": "() => string", - "description": "Note: `toString()` is internally used by `console.log(...)` / `console.error(...)` when ingesting logs in Oxygen production. Therefore, we want to make sure that the error message is as informative as possible instead of `[object Object]`." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toJSON", - "value": "() => Pick", - "description": "Note: toJSON` is internally used by `JSON.stringify(...)`. The most common scenario when this error instance is going to be stringified is when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`. In this situation, we don't want to expose private error information to the browser so we only do it in development." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "GetAccessor", - "name": "__@toStringTag@690", - "value": "string", - "description": "" + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "name", - "value": "string", - "description": "" + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "message", - "value": "string", - "description": "" - }, + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", + "isOptional": true + } + ] + }, + "StorefrontError": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontError", + "value": "{\n errors?: StorefrontApiErrors;\n}", + "description": "", + "members": [ { - "filePath": "src/utils/graphql.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "stack", - "value": "string", + "name": "errors", + "value": "StorefrontApiErrors", "description": "", "isOptional": true } - ], - "value": "export class GraphQLError extends Error {\n /**\n * If an error can be associated to a particular point in the requested\n * GraphQL document, it should contain a list of locations.\n */\n locations?: Array<{line: number; column: number}>;\n /**\n * If an error can be associated to a particular field in the GraphQL result,\n * it _must_ contain an entry with the key `path` that details the path of\n * the response field which experienced the error. This allows clients to\n * identify whether a null result is intentional or caused by a runtime error.\n */\n path?: Array;\n /**\n * Reserved for implementors to extend the protocol however they see fit,\n * and hence there are no additional restrictions on its contents.\n */\n extensions?: {[key: string]: unknown};\n\n constructor(\n message?: string,\n options: Pick<\n GraphQLError,\n 'locations' | 'path' | 'extensions' | 'stack' | 'cause'\n > & {\n query?: string;\n queryVariables?: GenericVariables;\n requestId?: string | null;\n clientOperation?: string;\n } = {},\n ) {\n const h2Prefix = options.clientOperation\n ? `[h2:error:${options.clientOperation}] `\n : '';\n\n const enhancedMessage =\n h2Prefix +\n message +\n (options.requestId ? ` - Request ID: ${options.requestId}` : '');\n\n super(enhancedMessage);\n this.name = 'GraphQLError';\n this.extensions = options.extensions;\n this.locations = options.locations;\n this.path = options.path;\n this.stack = options.stack || undefined;\n\n try {\n this.cause = JSON.stringify({\n ...(typeof options.cause === 'object' ? options.cause : {}),\n requestId: options.requestId,\n ...(process.env.NODE_ENV === 'development' && {\n path: options.path,\n extensions: options.extensions,\n graphql: h2Prefix &&\n options.query && {\n query: options.query,\n variables: JSON.stringify(options.queryVariables),\n },\n }),\n });\n } catch {\n if (options.cause) this.cause = options.cause;\n }\n }\n\n get [Symbol.toStringTag]() {\n return this.name;\n }\n\n /**\n * Note: `toString()` is internally used by `console.log(...)` / `console.error(...)`\n * when ingesting logs in Oxygen production. Therefore, we want to make sure that\n * the error message is as informative as possible instead of `[object Object]`.\n */\n override toString() {\n let result = `${this.name}: ${this.message}`;\n\n if (this.path) {\n try {\n result += ` | path: ${JSON.stringify(this.path)}`;\n } catch {}\n }\n\n if (this.extensions) {\n try {\n result += ` | extensions: ${JSON.stringify(this.extensions)}`;\n } catch {}\n }\n\n result += '\\n';\n\n if (this.stack) {\n // Remove the message line from the stack.\n result += `${this.stack.slice(this.stack.indexOf('\\n') + 1)}\\n`;\n }\n\n return result;\n }\n\n /**\n * Note: toJSON` is internally used by `JSON.stringify(...)`.\n * The most common scenario when this error instance is going to be stringified is\n * when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`.\n * In this situation, we don't want to expose private error information to the browser so we only\n * do it in development.\n */\n toJSON() {\n const formatted: Pick<\n GraphQLError,\n 'name' | 'message' | 'path' | 'extensions' | 'locations' | 'stack'\n > = {name: 'Error', message: ''};\n\n if (process.env.NODE_ENV === 'development') {\n formatted.name = this.name;\n formatted.message = 'Development: ' + this.message;\n if (this.path) formatted.path = this.path;\n if (this.locations) formatted.locations = this.locations;\n if (this.extensions) formatted.extensions = this.extensions;\n // Skip stack on purpose because we don't want to expose it to the browser.\n }\n\n return formatted;\n }\n}" + ] }, - "CustomerAccountQueries": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountQueries", - "description": "", + "StorefrontApiErrors": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontApiErrors", + "value": "JsonGraphQLError[] | undefined", + "description": "" + }, + "StorefrontMutations": { + "filePath": "/storefront.ts", + "name": "StorefrontMutations", + "description": "Maps all the mutations found in the project to variables and return types.", "members": [], - "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" }, - "Storefront": { - "filePath": "src/storefront.ts", + "NoStoreStrategy": { + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "Storefront", - "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", - "description": "Interface to interact with the Storefront API.", + "name": "NoStoreStrategy", + "value": "{\n mode: string;\n}", + "description": "", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "cache", - "value": "Cache", - "description": "", - "isOptional": true - }, + "name": "mode", + "value": "string", + "description": "" + } + ] + }, + "AllCacheOptions": { + "filePath": "/cache/strategies.ts", + "name": "AllCacheOptions", + "description": "Override options for a cache strategy.", + "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "CacheCustom", - "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "CacheLong", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "CacheNone", - "value": "() => NoStoreStrategy", - "description": "" + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "CacheShort", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "generateCacheControlHeader", - "value": "(cacheOptions: AllCacheOptions) => string", - "description": "" - }, + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", + "isOptional": true + } + ], + "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" + }, + "CustomerAccount": { + "filePath": "/customer/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "CustomerAccount", + "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", + "description": "", + "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "(props?: Partial>) => string", - "description": "" + "name": "login", + "value": "(options?: LoginOptions) => Promise", + "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getPrivateTokenHeaders", - "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", - "description": "" + "name": "authorize", + "value": "() => Promise", + "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getPublicTokenHeaders", - "value": "(props?: Partial> & Pick) => Record", - "description": "" + "name": "isLoggedIn", + "value": "() => Promise", + "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getShopifyDomain", - "value": "(props?: Partial>) => string", - "description": "" + "name": "handleAuthStatus", + "value": "() => void | DataFunctionValue", + "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "i18n", - "value": "TI18n", - "description": "" + "name": "getAccessToken", + "value": "() => Promise", + "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", - "description": "" + "name": "getApiUrl", + "value": "() => string", + "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." }, { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", - "description": "" - } - ] - }, - "AllCacheOptions": { - "filePath": "src/cache/strategies.ts", - "name": "AllCacheOptions", - "description": "Override options for a cache strategy.", - "members": [ - { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", - "isOptional": true + "name": "logout", + "value": "(options?: LogoutOptions) => Promise", + "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", - "isOptional": true + "name": "UNSTABLE_setBuyer", + "value": "(buyer: Partial) => void", + "description": "UNSTABLE feature. Set buyer information into session." }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true + "name": "UNSTABLE_getBuyer", + "value": "() => Promise>", + "description": "UNSTABLE feature. Get buyer token and company location id from session." } - ], - "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" + ] }, - "NoStoreStrategy": { - "filePath": "src/cache/strategies.ts", + "LoginOptions": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "NoStoreStrategy", - "value": "{\n mode: string;\n}", + "name": "LoginOptions", + "value": "{\n uiLocales?: LanguageCode;\n}", "description": "", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "" + "name": "uiLocales", + "value": "LanguageCode", + "description": "", + "isOptional": true } ] }, - "StorefrontMutations": { - "filePath": "src/storefront.ts", - "name": "StorefrontMutations", - "description": "Maps all the mutations found in the project to variables and return types.", - "members": [], - "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" - }, - "AutoAddedVariableNames": { - "filePath": "src/storefront.ts", + "DataFunctionValue": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "AutoAddedVariableNames", - "value": "'country' | 'language'", + "name": "DataFunctionValue", + "value": "Response | NonNullable | null", "description": "" }, - "StorefrontCommonExtraParams": { - "filePath": "src/storefront.ts", + "LogoutOptions": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontCommonExtraParams", - "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", + "name": "LogoutOptions", + "value": "{\n postLogoutRedirectUri?: string;\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "displayName", - "value": "string", - "description": "", - "isOptional": true - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "headers", - "value": "HeadersInit", - "description": "", - "isOptional": true - }, - { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "storefrontApiVersion", + "name": "postLogoutRedirectUri", "value": "string", "description": "", "isOptional": true } ] }, - "StorefrontError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontError", - "value": "{\n errors?: StorefrontApiErrors;\n}", + "CustomerAccountQueries": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountQueries", "description": "", - "members": [ - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "errors", - "value": "StorefrontApiErrors", - "description": "", - "isOptional": true - } - ] - }, - "StorefrontApiErrors": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontApiErrors", - "value": "JsonGraphQLError[] | undefined", - "description": "" + "members": [], + "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" }, - "JsonGraphQLError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "JsonGraphQLError", - "value": "ReturnType", + "CustomerAccountMutations": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountMutations", "description": "", - "members": [] - }, - "StorefrontQueries": { - "filePath": "src/storefront.ts", - "name": "StorefrontQueries", - "description": "Maps all the queries found in the project to variables and return types.", "members": [], - "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" - }, - "StorefrontQueryOptions": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontQueryOptions", - "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", - "description": "" - }, - "CachingStrategy": { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CachingStrategy", - "value": "AllCacheOptions", - "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", - "members": [ - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true - } - ] + "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" }, "CartLinesRemoveFunction": { - "filePath": "src/cart/queries/cartLinesRemoveDefault.ts", + "filePath": "/cart/queries/cartLinesRemoveDefault.ts", "name": "CartLinesRemoveFunction", "description": "", "params": [ @@ -10450,18 +9632,18 @@ "name": "lineIds", "description": "", "value": "string[]", - "filePath": "src/cart/queries/cartLinesRemoveDefault.ts" + "filePath": "/cart/queries/cartLinesRemoveDefault.ts" }, { "name": "optionalParams", "description": "", "value": "CartOptionalInput", "isOptional": true, - "filePath": "src/cart/queries/cartLinesRemoveDefault.ts" + "filePath": "/cart/queries/cartLinesRemoveDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartLinesRemoveDefault.ts", + "filePath": "/cart/queries/cartLinesRemoveDefault.ts", "description": "", "name": "Promise", "value": "Promise" @@ -10469,14 +9651,14 @@ "value": "export type CartLinesRemoveFunction = (\n lineIds: string[],\n optionalParams?: CartOptionalInput,\n) => Promise;" }, "CartOptionalInput": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartOptionalInput", "value": "{\n /**\n * The cart id.\n * @default cart.getCartId();\n */\n cartId?: Scalars['ID']['input'];\n /**\n * The country code.\n * @default storefront.i18n.country\n */\n country?: CountryCode;\n /**\n * The language code.\n * @default storefront.i18n.language\n */\n language?: LanguageCode;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cartId", "value": "string", @@ -10485,7 +9667,7 @@ "defaultValue": "cart.getCartId();" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "country", "value": "CountryCode", @@ -10494,7 +9676,7 @@ "defaultValue": "storefront.i18n.country" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "language", "value": "LanguageCode", @@ -10505,31 +9687,31 @@ ] }, "CartQueryDataReturn": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryDataReturn", "value": "CartQueryData & {\n errors?: StorefrontApiErrors;\n}", "description": "" }, "CartQueryData": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryData", "value": "{\n cart: Cart;\n userErrors?:\n | CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[];\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cart", "value": "Cart", "description": "" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "userErrors", - "value": "| CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[]", + "value": "CartUserError[] | MetafieldsSetUserError[] | MetafieldDeleteUserError[]", "description": "", "isOptional": true } @@ -10595,7 +9777,7 @@ "type": "CartLinesUpdateDefaultGeneratedType", "typeDefinitions": { "CartLinesUpdateDefaultGeneratedType": { - "filePath": "src/cart/queries/cartLinesUpdateDefault.ts", + "filePath": "/cart/queries/cartLinesUpdateDefault.ts", "name": "CartLinesUpdateDefaultGeneratedType", "description": "", "params": [ @@ -10603,11 +9785,11 @@ "name": "options", "description": "", "value": "CartQueryOptions", - "filePath": "src/cart/queries/cartLinesUpdateDefault.ts" + "filePath": "/cart/queries/cartLinesUpdateDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartLinesUpdateDefault.ts", + "filePath": "/cart/queries/cartLinesUpdateDefault.ts", "description": "", "name": "CartLinesUpdateFunction", "value": "CartLinesUpdateFunction" @@ -10615,14 +9797,28 @@ "value": "export function cartLinesUpdateDefault(\n options: CartQueryOptions,\n): CartLinesUpdateFunction {\n return async (lines, optionalParams) => {\n throwIfLinesAreOptimistic('updateLines', lines);\n\n const {cartLinesUpdate, errors} = await options.storefront.mutate<{\n cartLinesUpdate: CartQueryData;\n errors: StorefrontApiErrors;\n }>(CART_LINES_UPDATE_MUTATION(options.cartFragment), {\n variables: {\n cartId: options.getCartId(),\n lines,\n ...optionalParams,\n },\n });\n return formatAPIResult(cartLinesUpdate, errors);\n };\n}" }, "CartQueryOptions": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryOptions", "value": "{\n /**\n * The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient).\n */\n storefront: Storefront;\n /**\n * A function that returns the cart ID.\n */\n getCartId: () => string | undefined;\n /**\n * The cart fragment to override the one used in this query.\n */\n cartFragment?: string;\n /**\n * The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).\n */\n customerAccount?: CustomerAccount;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "storefront", + "value": "Storefront", + "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." + }, + { + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "getCartId", + "value": "() => string", + "description": "A function that returns the cart ID." + }, + { + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cartFragment", "value": "string", @@ -10630,675 +9826,551 @@ "isOptional": true }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "customerAccount", "value": "CustomerAccount", "description": "The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).", "isOptional": true - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "getCartId", - "value": "() => string", - "description": "A function that returns the cart ID." - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "storefront", - "value": "Storefront", - "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." } ] }, - "CustomerAccount": { - "filePath": "src/customer/types.ts", + "Storefront": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAccount", - "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", - "description": "", + "name": "Storefront", + "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", + "description": "Interface to interact with the Storefront API.", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "authorize", - "value": "() => Promise", - "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getAccessToken", - "value": "() => Promise", - "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "() => string", - "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." + "name": "cache", + "value": "Cache", + "description": "", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "handleAuthStatus", - "value": "() => void | DataFunctionValue", - "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." + "name": "CacheNone", + "value": "() => NoStoreStrategy", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "isLoggedIn", - "value": "() => Promise", - "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." + "name": "CacheLong", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "login", - "value": "(options?: LoginOptions) => Promise", - "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" + "name": "CacheShort", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "logout", - "value": "(options?: LogoutOptions) => Promise", - "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." + "name": "CacheCustom", + "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." + "name": "generateCacheControlHeader", + "value": "(cacheOptions: AllCacheOptions) => string", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." + "name": "getPublicTokenHeaders", + "value": "(props?: Partial> & Pick) => Record", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_getBuyer", - "value": "() => Promise>", - "description": "UNSTABLE feature. Get buyer token and company location id from session." + "name": "getPrivateTokenHeaders", + "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_setBuyer", - "value": "(buyer: Partial) => void", - "description": "UNSTABLE feature. Set buyer information into session." + "name": "getShopifyDomain", + "value": "(props?: Partial>) => string", + "description": "" + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "getApiUrl", + "value": "(props?: Partial>) => string", + "description": "" + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "i18n", + "value": "TI18n", + "description": "" } ] }, - "DataFunctionValue": { - "filePath": "src/customer/types.ts", + "StorefrontQueries": { + "filePath": "/storefront.ts", + "name": "StorefrontQueries", + "description": "Maps all the queries found in the project to variables and return types.", + "members": [], + "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + }, + "AutoAddedVariableNames": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "DataFunctionValue", - "value": "Response | NonNullable | null", + "name": "AutoAddedVariableNames", + "value": "'country' | 'language'", "description": "" }, - "LoginOptions": { - "filePath": "src/customer/types.ts", + "StorefrontCommonExtraParams": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "LoginOptions", - "value": "{\n uiLocales?: LanguageCode;\n}", + "name": "StorefrontCommonExtraParams", + "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", "description": "", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "uiLocales", - "value": "LanguageCode", + "name": "headers", + "value": "HeadersInit", "description": "", "isOptional": true - } - ] - }, - "LogoutOptions": { - "filePath": "src/customer/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "LogoutOptions", - "value": "{\n postLogoutRedirectUri?: string;\n}", - "description": "", - "members": [ + }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "postLogoutRedirectUri", + "name": "storefrontApiVersion", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "displayName", "value": "string", "description": "", "isOptional": true } ] }, - "CustomerAccountMutations": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountMutations", - "description": "", - "members": [], - "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + "StorefrontQueryOptions": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontQueryOptions", + "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", + "description": "" }, - "CustomerAPIResponse": { - "filePath": "src/customer/types.ts", + "CachingStrategy": { + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAPIResponse", - "value": "{\n data: ReturnType;\n errors: Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>;\n extensions: {\n cost: {\n requestQueryCost: number;\n actualQueryCakes: number;\n throttleStatus: {\n maximumAvailable: number;\n currentAvailable: number;\n restoreRate: number;\n };\n };\n };\n}", - "description": "", + "name": "CachingStrategy", + "value": "AllCacheOptions", + "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "data", - "value": "ReturnType", - "description": "" + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "errors", - "value": "Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>", - "description": "" + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "extensions", - "value": "{ cost: { requestQueryCost: number; actualQueryCakes: number; throttleStatus: { maximumAvailable: number; currentAvailable: number; restoreRate: number; }; }; }", - "description": "" - } - ] - }, - "GraphQLError": { - "filePath": "src/utils/graphql.ts", - "name": "GraphQLError", - "description": "", - "members": [ - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "locations", - "value": "{ line: number; column: number; }[]", - "description": "If an error can be associated to a particular point in the requested GraphQL document, it should contain a list of locations." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "path", - "value": "(string | number)[]", - "description": "If an error can be associated to a particular field in the GraphQL result, it _must_ contain an entry with the key `path` that details the path of the response field which experienced the error. This allows clients to identify whether a null result is intentional or caused by a runtime error." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "extensions", - "value": "{ [key: string]: unknown; }", - "description": "Reserved for implementors to extend the protocol however they see fit, and hence there are no additional restrictions on its contents." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toString", - "value": "() => string", - "description": "Note: `toString()` is internally used by `console.log(...)` / `console.error(...)` when ingesting logs in Oxygen production. Therefore, we want to make sure that the error message is as informative as possible instead of `[object Object]`." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toJSON", - "value": "() => Pick", - "description": "Note: toJSON` is internally used by `JSON.stringify(...)`. The most common scenario when this error instance is going to be stringified is when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`. In this situation, we don't want to expose private error information to the browser so we only do it in development." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "GetAccessor", - "name": "__@toStringTag@690", - "value": "string", - "description": "" + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "name", - "value": "string", - "description": "" + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "message", - "value": "string", - "description": "" - }, + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", + "isOptional": true + } + ] + }, + "StorefrontError": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontError", + "value": "{\n errors?: StorefrontApiErrors;\n}", + "description": "", + "members": [ { - "filePath": "src/utils/graphql.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "stack", - "value": "string", + "name": "errors", + "value": "StorefrontApiErrors", "description": "", "isOptional": true } - ], - "value": "export class GraphQLError extends Error {\n /**\n * If an error can be associated to a particular point in the requested\n * GraphQL document, it should contain a list of locations.\n */\n locations?: Array<{line: number; column: number}>;\n /**\n * If an error can be associated to a particular field in the GraphQL result,\n * it _must_ contain an entry with the key `path` that details the path of\n * the response field which experienced the error. This allows clients to\n * identify whether a null result is intentional or caused by a runtime error.\n */\n path?: Array;\n /**\n * Reserved for implementors to extend the protocol however they see fit,\n * and hence there are no additional restrictions on its contents.\n */\n extensions?: {[key: string]: unknown};\n\n constructor(\n message?: string,\n options: Pick<\n GraphQLError,\n 'locations' | 'path' | 'extensions' | 'stack' | 'cause'\n > & {\n query?: string;\n queryVariables?: GenericVariables;\n requestId?: string | null;\n clientOperation?: string;\n } = {},\n ) {\n const h2Prefix = options.clientOperation\n ? `[h2:error:${options.clientOperation}] `\n : '';\n\n const enhancedMessage =\n h2Prefix +\n message +\n (options.requestId ? ` - Request ID: ${options.requestId}` : '');\n\n super(enhancedMessage);\n this.name = 'GraphQLError';\n this.extensions = options.extensions;\n this.locations = options.locations;\n this.path = options.path;\n this.stack = options.stack || undefined;\n\n try {\n this.cause = JSON.stringify({\n ...(typeof options.cause === 'object' ? options.cause : {}),\n requestId: options.requestId,\n ...(process.env.NODE_ENV === 'development' && {\n path: options.path,\n extensions: options.extensions,\n graphql: h2Prefix &&\n options.query && {\n query: options.query,\n variables: JSON.stringify(options.queryVariables),\n },\n }),\n });\n } catch {\n if (options.cause) this.cause = options.cause;\n }\n }\n\n get [Symbol.toStringTag]() {\n return this.name;\n }\n\n /**\n * Note: `toString()` is internally used by `console.log(...)` / `console.error(...)`\n * when ingesting logs in Oxygen production. Therefore, we want to make sure that\n * the error message is as informative as possible instead of `[object Object]`.\n */\n override toString() {\n let result = `${this.name}: ${this.message}`;\n\n if (this.path) {\n try {\n result += ` | path: ${JSON.stringify(this.path)}`;\n } catch {}\n }\n\n if (this.extensions) {\n try {\n result += ` | extensions: ${JSON.stringify(this.extensions)}`;\n } catch {}\n }\n\n result += '\\n';\n\n if (this.stack) {\n // Remove the message line from the stack.\n result += `${this.stack.slice(this.stack.indexOf('\\n') + 1)}\\n`;\n }\n\n return result;\n }\n\n /**\n * Note: toJSON` is internally used by `JSON.stringify(...)`.\n * The most common scenario when this error instance is going to be stringified is\n * when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`.\n * In this situation, we don't want to expose private error information to the browser so we only\n * do it in development.\n */\n toJSON() {\n const formatted: Pick<\n GraphQLError,\n 'name' | 'message' | 'path' | 'extensions' | 'locations' | 'stack'\n > = {name: 'Error', message: ''};\n\n if (process.env.NODE_ENV === 'development') {\n formatted.name = this.name;\n formatted.message = 'Development: ' + this.message;\n if (this.path) formatted.path = this.path;\n if (this.locations) formatted.locations = this.locations;\n if (this.extensions) formatted.extensions = this.extensions;\n // Skip stack on purpose because we don't want to expose it to the browser.\n }\n\n return formatted;\n }\n}" + ] }, - "CustomerAccountQueries": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountQueries", - "description": "", + "StorefrontApiErrors": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontApiErrors", + "value": "JsonGraphQLError[] | undefined", + "description": "" + }, + "StorefrontMutations": { + "filePath": "/storefront.ts", + "name": "StorefrontMutations", + "description": "Maps all the mutations found in the project to variables and return types.", "members": [], - "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" }, - "Storefront": { - "filePath": "src/storefront.ts", + "NoStoreStrategy": { + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "Storefront", - "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", - "description": "Interface to interact with the Storefront API.", + "name": "NoStoreStrategy", + "value": "{\n mode: string;\n}", + "description": "", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "cache", - "value": "Cache", - "description": "", - "isOptional": true - }, + "name": "mode", + "value": "string", + "description": "" + } + ] + }, + "AllCacheOptions": { + "filePath": "/cache/strategies.ts", + "name": "AllCacheOptions", + "description": "Override options for a cache strategy.", + "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "CacheCustom", - "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "CacheLong", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "CacheNone", - "value": "() => NoStoreStrategy", - "description": "" + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "CacheShort", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "generateCacheControlHeader", - "value": "(cacheOptions: AllCacheOptions) => string", - "description": "" - }, + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", + "isOptional": true + } + ], + "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" + }, + "CustomerAccount": { + "filePath": "/customer/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "CustomerAccount", + "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", + "description": "", + "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "(props?: Partial>) => string", - "description": "" + "name": "login", + "value": "(options?: LoginOptions) => Promise", + "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getPrivateTokenHeaders", - "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", - "description": "" + "name": "authorize", + "value": "() => Promise", + "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getPublicTokenHeaders", - "value": "(props?: Partial> & Pick) => Record", - "description": "" + "name": "isLoggedIn", + "value": "() => Promise", + "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getShopifyDomain", - "value": "(props?: Partial>) => string", - "description": "" + "name": "handleAuthStatus", + "value": "() => void | DataFunctionValue", + "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "i18n", - "value": "TI18n", - "description": "" + "name": "getAccessToken", + "value": "() => Promise", + "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", - "description": "" + "name": "getApiUrl", + "value": "() => string", + "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", - "description": "" - } - ] - }, - "AllCacheOptions": { - "filePath": "src/cache/strategies.ts", - "name": "AllCacheOptions", - "description": "Override options for a cache strategy.", - "members": [ - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", - "isOptional": true + "name": "logout", + "value": "(options?: LogoutOptions) => Promise", + "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", - "isOptional": true + "name": "UNSTABLE_setBuyer", + "value": "(buyer: Partial) => void", + "description": "UNSTABLE feature. Set buyer information into session." }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true + "name": "UNSTABLE_getBuyer", + "value": "() => Promise>", + "description": "UNSTABLE feature. Get buyer token and company location id from session." } - ], - "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" + ] }, - "NoStoreStrategy": { - "filePath": "src/cache/strategies.ts", + "LoginOptions": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "NoStoreStrategy", - "value": "{\n mode: string;\n}", + "name": "LoginOptions", + "value": "{\n uiLocales?: LanguageCode;\n}", "description": "", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "" + "name": "uiLocales", + "value": "LanguageCode", + "description": "", + "isOptional": true } ] }, - "StorefrontMutations": { - "filePath": "src/storefront.ts", - "name": "StorefrontMutations", - "description": "Maps all the mutations found in the project to variables and return types.", - "members": [], - "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" - }, - "AutoAddedVariableNames": { - "filePath": "src/storefront.ts", + "DataFunctionValue": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "AutoAddedVariableNames", - "value": "'country' | 'language'", + "name": "DataFunctionValue", + "value": "Response | NonNullable | null", "description": "" }, - "StorefrontCommonExtraParams": { - "filePath": "src/storefront.ts", + "LogoutOptions": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontCommonExtraParams", - "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", + "name": "LogoutOptions", + "value": "{\n postLogoutRedirectUri?: string;\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "displayName", + "name": "postLogoutRedirectUri", "value": "string", "description": "", "isOptional": true - }, + } + ] + }, + "CustomerAccountQueries": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountQueries", + "description": "", + "members": [], + "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + }, + "CustomerAccountMutations": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountMutations", + "description": "", + "members": [], + "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + }, + "CartLinesUpdateFunction": { + "filePath": "/cart/queries/cartLinesUpdateDefault.ts", + "name": "CartLinesUpdateFunction", + "description": "", + "params": [ { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "headers", - "value": "HeadersInit", + "name": "lines", "description": "", - "isOptional": true + "value": "CartLineUpdateInput[]", + "filePath": "/cart/queries/cartLinesUpdateDefault.ts" }, { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "storefrontApiVersion", - "value": "string", + "name": "optionalParams", "description": "", - "isOptional": true + "value": "CartOptionalInput", + "isOptional": true, + "filePath": "/cart/queries/cartLinesUpdateDefault.ts" } - ] + ], + "returns": { + "filePath": "/cart/queries/cartLinesUpdateDefault.ts", + "description": "", + "name": "Promise", + "value": "Promise" + }, + "value": "export type CartLinesUpdateFunction = (\n lines: CartLineUpdateInput[],\n optionalParams?: CartOptionalInput,\n) => Promise;" }, - "StorefrontError": { - "filePath": "src/storefront.ts", + "CartLineUpdateInput": { + "description": "", + "name": "CartLineUpdateInput", + "value": "CartLineUpdateInput", + "members": [], + "override": "[CartLineUpdateInput](/docs/api/storefront/2024-07/input-objects/CartLineUpdateInput) - Storefront API type" + }, + "CartOptionalInput": { + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontError", - "value": "{\n errors?: StorefrontApiErrors;\n}", + "name": "CartOptionalInput", + "value": "{\n /**\n * The cart id.\n * @default cart.getCartId();\n */\n cartId?: Scalars['ID']['input'];\n /**\n * The country code.\n * @default storefront.i18n.country\n */\n country?: CountryCode;\n /**\n * The language code.\n * @default storefront.i18n.language\n */\n language?: LanguageCode;\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", - "name": "errors", - "value": "StorefrontApiErrors", - "description": "", - "isOptional": true + "name": "cartId", + "value": "string", + "description": "The cart id.", + "isOptional": true, + "defaultValue": "cart.getCartId();" + }, + { + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "country", + "value": "CountryCode", + "description": "The country code.", + "isOptional": true, + "defaultValue": "storefront.i18n.country" + }, + { + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "language", + "value": "LanguageCode", + "description": "The language code.", + "isOptional": true, + "defaultValue": "storefront.i18n.language" } ] }, - "StorefrontApiErrors": { - "filePath": "src/storefront.ts", + "CartQueryDataReturn": { + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontApiErrors", - "value": "JsonGraphQLError[] | undefined", + "name": "CartQueryDataReturn", + "value": "CartQueryData & {\n errors?: StorefrontApiErrors;\n}", "description": "" }, - "JsonGraphQLError": { - "filePath": "src/storefront.ts", + "CartQueryData": { + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "JsonGraphQLError", - "value": "ReturnType", - "description": "", - "members": [] - }, - "StorefrontQueries": { - "filePath": "src/storefront.ts", - "name": "StorefrontQueries", - "description": "Maps all the queries found in the project to variables and return types.", - "members": [], - "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" - }, - "StorefrontQueryOptions": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontQueryOptions", - "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", - "description": "" - }, - "CachingStrategy": { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CachingStrategy", - "value": "AllCacheOptions", - "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", - "members": [ - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true - } - ] - }, - "CartLinesUpdateFunction": { - "filePath": "src/cart/queries/cartLinesUpdateDefault.ts", - "name": "CartLinesUpdateFunction", - "description": "", - "params": [ - { - "name": "lines", - "description": "", - "value": "CartLineUpdateInput[]", - "filePath": "src/cart/queries/cartLinesUpdateDefault.ts" - }, - { - "name": "optionalParams", - "description": "", - "value": "CartOptionalInput", - "isOptional": true, - "filePath": "src/cart/queries/cartLinesUpdateDefault.ts" - } - ], - "returns": { - "filePath": "src/cart/queries/cartLinesUpdateDefault.ts", - "description": "", - "name": "Promise", - "value": "Promise" - }, - "value": "export type CartLinesUpdateFunction = (\n lines: CartLineUpdateInput[],\n optionalParams?: CartOptionalInput,\n) => Promise;" - }, - "CartLineUpdateInput": { - "description": "", - "name": "CartLineUpdateInput", - "value": "CartLineUpdateInput", - "members": [], - "override": "[CartLineUpdateInput](/docs/api/storefront/2024-07/input-objects/CartLineUpdateInput) - Storefront API type" - }, - "CartOptionalInput": { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CartOptionalInput", - "value": "{\n /**\n * The cart id.\n * @default cart.getCartId();\n */\n cartId?: Scalars['ID']['input'];\n /**\n * The country code.\n * @default storefront.i18n.country\n */\n country?: CountryCode;\n /**\n * The language code.\n * @default storefront.i18n.language\n */\n language?: LanguageCode;\n}", - "description": "", - "members": [ - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "cartId", - "value": "string", - "description": "The cart id.", - "isOptional": true, - "defaultValue": "cart.getCartId();" - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "country", - "value": "CountryCode", - "description": "The country code.", - "isOptional": true, - "defaultValue": "storefront.i18n.country" - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "language", - "value": "LanguageCode", - "description": "The language code.", - "isOptional": true, - "defaultValue": "storefront.i18n.language" - } - ] - }, - "CartQueryDataReturn": { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CartQueryDataReturn", - "value": "CartQueryData & {\n errors?: StorefrontApiErrors;\n}", - "description": "" - }, - "CartQueryData": { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CartQueryData", - "value": "{\n cart: Cart;\n userErrors?:\n | CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[];\n}", + "name": "CartQueryData", + "value": "{\n cart: Cart;\n userErrors?:\n | CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[];\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cart", "value": "Cart", "description": "" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "userErrors", - "value": "| CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[]", + "value": "CartUserError[] | MetafieldsSetUserError[] | MetafieldDeleteUserError[]", "description": "", "isOptional": true } @@ -11364,7 +10436,7 @@ "type": "CartMetafieldDeleteDefaultGeneratedType", "typeDefinitions": { "CartMetafieldDeleteDefaultGeneratedType": { - "filePath": "src/cart/queries/cartMetafieldDeleteDefault.ts", + "filePath": "/cart/queries/cartMetafieldDeleteDefault.ts", "name": "CartMetafieldDeleteDefaultGeneratedType", "description": "", "params": [ @@ -11372,11 +10444,11 @@ "name": "options", "description": "", "value": "CartQueryOptions", - "filePath": "src/cart/queries/cartMetafieldDeleteDefault.ts" + "filePath": "/cart/queries/cartMetafieldDeleteDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartMetafieldDeleteDefault.ts", + "filePath": "/cart/queries/cartMetafieldDeleteDefault.ts", "description": "", "name": "CartMetafieldDeleteFunction", "value": "CartMetafieldDeleteFunction" @@ -11384,14 +10456,28 @@ "value": "export function cartMetafieldDeleteDefault(\n options: CartQueryOptions,\n): CartMetafieldDeleteFunction {\n return async (key, optionalParams) => {\n const ownerId = optionalParams?.cartId || options.getCartId();\n const {cartMetafieldDelete, errors} = await options.storefront.mutate<{\n cartMetafieldDelete: {\n userErrors: MetafieldDeleteUserError[];\n };\n errors: StorefrontApiErrors;\n }>(CART_METAFIELD_DELETE_MUTATION(), {\n variables: {\n input: {\n ownerId,\n key,\n },\n },\n });\n return formatAPIResult(\n {\n cart: {\n id: ownerId,\n } as Cart,\n ...cartMetafieldDelete,\n },\n errors,\n );\n };\n}" }, "CartQueryOptions": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryOptions", "value": "{\n /**\n * The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient).\n */\n storefront: Storefront;\n /**\n * A function that returns the cart ID.\n */\n getCartId: () => string | undefined;\n /**\n * The cart fragment to override the one used in this query.\n */\n cartFragment?: string;\n /**\n * The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).\n */\n customerAccount?: CustomerAccount;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "storefront", + "value": "Storefront", + "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." + }, + { + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "getCartId", + "value": "() => string", + "description": "A function that returns the cart ID." + }, + { + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cartFragment", "value": "string", @@ -11399,581 +10485,457 @@ "isOptional": true }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "customerAccount", "value": "CustomerAccount", "description": "The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).", "isOptional": true - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "getCartId", - "value": "() => string", - "description": "A function that returns the cart ID." - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "storefront", - "value": "Storefront", - "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." } ] }, - "CustomerAccount": { - "filePath": "src/customer/types.ts", + "Storefront": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAccount", - "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", - "description": "", + "name": "Storefront", + "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", + "description": "Interface to interact with the Storefront API.", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "authorize", - "value": "() => Promise", - "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getAccessToken", - "value": "() => Promise", - "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "() => string", - "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." + "name": "cache", + "value": "Cache", + "description": "", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "handleAuthStatus", - "value": "() => void | DataFunctionValue", - "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." + "name": "CacheNone", + "value": "() => NoStoreStrategy", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "isLoggedIn", - "value": "() => Promise", - "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." + "name": "CacheLong", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "login", - "value": "(options?: LoginOptions) => Promise", - "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" + "name": "CacheShort", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "logout", - "value": "(options?: LogoutOptions) => Promise", - "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." + "name": "CacheCustom", + "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." + "name": "generateCacheControlHeader", + "value": "(cacheOptions: AllCacheOptions) => string", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." + "name": "getPublicTokenHeaders", + "value": "(props?: Partial> & Pick) => Record", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_getBuyer", - "value": "() => Promise>", - "description": "UNSTABLE feature. Get buyer token and company location id from session." + "name": "getPrivateTokenHeaders", + "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_setBuyer", - "value": "(buyer: Partial) => void", - "description": "UNSTABLE feature. Set buyer information into session." + "name": "getShopifyDomain", + "value": "(props?: Partial>) => string", + "description": "" + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "getApiUrl", + "value": "(props?: Partial>) => string", + "description": "" + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "i18n", + "value": "TI18n", + "description": "" } ] }, - "DataFunctionValue": { - "filePath": "src/customer/types.ts", + "StorefrontQueries": { + "filePath": "/storefront.ts", + "name": "StorefrontQueries", + "description": "Maps all the queries found in the project to variables and return types.", + "members": [], + "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + }, + "AutoAddedVariableNames": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "DataFunctionValue", - "value": "Response | NonNullable | null", + "name": "AutoAddedVariableNames", + "value": "'country' | 'language'", "description": "" }, - "LoginOptions": { - "filePath": "src/customer/types.ts", + "StorefrontCommonExtraParams": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "LoginOptions", - "value": "{\n uiLocales?: LanguageCode;\n}", + "name": "StorefrontCommonExtraParams", + "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", "description": "", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "uiLocales", - "value": "LanguageCode", + "name": "headers", + "value": "HeadersInit", "description": "", "isOptional": true - } - ] - }, - "LogoutOptions": { - "filePath": "src/customer/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "LogoutOptions", - "value": "{\n postLogoutRedirectUri?: string;\n}", - "description": "", - "members": [ + }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "postLogoutRedirectUri", + "name": "storefrontApiVersion", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "displayName", "value": "string", "description": "", "isOptional": true } ] }, - "CustomerAccountMutations": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountMutations", - "description": "", - "members": [], - "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + "StorefrontQueryOptions": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontQueryOptions", + "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", + "description": "" }, - "CustomerAPIResponse": { - "filePath": "src/customer/types.ts", + "CachingStrategy": { + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAPIResponse", - "value": "{\n data: ReturnType;\n errors: Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>;\n extensions: {\n cost: {\n requestQueryCost: number;\n actualQueryCakes: number;\n throttleStatus: {\n maximumAvailable: number;\n currentAvailable: number;\n restoreRate: number;\n };\n };\n };\n}", - "description": "", + "name": "CachingStrategy", + "value": "AllCacheOptions", + "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "data", - "value": "ReturnType", - "description": "" + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "errors", - "value": "Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>", - "description": "" + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "extensions", - "value": "{ cost: { requestQueryCost: number; actualQueryCakes: number; throttleStatus: { maximumAvailable: number; currentAvailable: number; restoreRate: number; }; }; }", - "description": "" + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", + "isOptional": true } ] }, - "GraphQLError": { - "filePath": "src/utils/graphql.ts", - "name": "GraphQLError", + "StorefrontError": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontError", + "value": "{\n errors?: StorefrontApiErrors;\n}", "description": "", "members": [ { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "locations", - "value": "{ line: number; column: number; }[]", - "description": "If an error can be associated to a particular point in the requested GraphQL document, it should contain a list of locations." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "path", - "value": "(string | number)[]", - "description": "If an error can be associated to a particular field in the GraphQL result, it _must_ contain an entry with the key `path` that details the path of the response field which experienced the error. This allows clients to identify whether a null result is intentional or caused by a runtime error." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "extensions", - "value": "{ [key: string]: unknown; }", - "description": "Reserved for implementors to extend the protocol however they see fit, and hence there are no additional restrictions on its contents." - }, + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "errors", + "value": "StorefrontApiErrors", + "description": "", + "isOptional": true + } + ] + }, + "StorefrontApiErrors": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontApiErrors", + "value": "JsonGraphQLError[] | undefined", + "description": "" + }, + "StorefrontMutations": { + "filePath": "/storefront.ts", + "name": "StorefrontMutations", + "description": "Maps all the mutations found in the project to variables and return types.", + "members": [], + "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + }, + "NoStoreStrategy": { + "filePath": "/cache/strategies.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "NoStoreStrategy", + "value": "{\n mode: string;\n}", + "description": "", + "members": [ { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toString", - "value": "() => string", - "description": "Note: `toString()` is internally used by `console.log(...)` / `console.error(...)` when ingesting logs in Oxygen production. Therefore, we want to make sure that the error message is as informative as possible instead of `[object Object]`." - }, + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "" + } + ] + }, + "AllCacheOptions": { + "filePath": "/cache/strategies.ts", + "name": "AllCacheOptions", + "description": "Override options for a cache strategy.", + "members": [ { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toJSON", - "value": "() => Pick", - "description": "Note: toJSON` is internally used by `JSON.stringify(...)`. The most common scenario when this error instance is going to be stringified is when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`. In this situation, we don't want to expose private error information to the browser so we only do it in development." + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "GetAccessor", - "name": "__@toStringTag@690", - "value": "string", - "description": "" + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "name", - "value": "string", - "description": "" + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "message", - "value": "string", - "description": "" + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "stack", - "value": "string", - "description": "", + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", "isOptional": true } ], - "value": "export class GraphQLError extends Error {\n /**\n * If an error can be associated to a particular point in the requested\n * GraphQL document, it should contain a list of locations.\n */\n locations?: Array<{line: number; column: number}>;\n /**\n * If an error can be associated to a particular field in the GraphQL result,\n * it _must_ contain an entry with the key `path` that details the path of\n * the response field which experienced the error. This allows clients to\n * identify whether a null result is intentional or caused by a runtime error.\n */\n path?: Array;\n /**\n * Reserved for implementors to extend the protocol however they see fit,\n * and hence there are no additional restrictions on its contents.\n */\n extensions?: {[key: string]: unknown};\n\n constructor(\n message?: string,\n options: Pick<\n GraphQLError,\n 'locations' | 'path' | 'extensions' | 'stack' | 'cause'\n > & {\n query?: string;\n queryVariables?: GenericVariables;\n requestId?: string | null;\n clientOperation?: string;\n } = {},\n ) {\n const h2Prefix = options.clientOperation\n ? `[h2:error:${options.clientOperation}] `\n : '';\n\n const enhancedMessage =\n h2Prefix +\n message +\n (options.requestId ? ` - Request ID: ${options.requestId}` : '');\n\n super(enhancedMessage);\n this.name = 'GraphQLError';\n this.extensions = options.extensions;\n this.locations = options.locations;\n this.path = options.path;\n this.stack = options.stack || undefined;\n\n try {\n this.cause = JSON.stringify({\n ...(typeof options.cause === 'object' ? options.cause : {}),\n requestId: options.requestId,\n ...(process.env.NODE_ENV === 'development' && {\n path: options.path,\n extensions: options.extensions,\n graphql: h2Prefix &&\n options.query && {\n query: options.query,\n variables: JSON.stringify(options.queryVariables),\n },\n }),\n });\n } catch {\n if (options.cause) this.cause = options.cause;\n }\n }\n\n get [Symbol.toStringTag]() {\n return this.name;\n }\n\n /**\n * Note: `toString()` is internally used by `console.log(...)` / `console.error(...)`\n * when ingesting logs in Oxygen production. Therefore, we want to make sure that\n * the error message is as informative as possible instead of `[object Object]`.\n */\n override toString() {\n let result = `${this.name}: ${this.message}`;\n\n if (this.path) {\n try {\n result += ` | path: ${JSON.stringify(this.path)}`;\n } catch {}\n }\n\n if (this.extensions) {\n try {\n result += ` | extensions: ${JSON.stringify(this.extensions)}`;\n } catch {}\n }\n\n result += '\\n';\n\n if (this.stack) {\n // Remove the message line from the stack.\n result += `${this.stack.slice(this.stack.indexOf('\\n') + 1)}\\n`;\n }\n\n return result;\n }\n\n /**\n * Note: toJSON` is internally used by `JSON.stringify(...)`.\n * The most common scenario when this error instance is going to be stringified is\n * when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`.\n * In this situation, we don't want to expose private error information to the browser so we only\n * do it in development.\n */\n toJSON() {\n const formatted: Pick<\n GraphQLError,\n 'name' | 'message' | 'path' | 'extensions' | 'locations' | 'stack'\n > = {name: 'Error', message: ''};\n\n if (process.env.NODE_ENV === 'development') {\n formatted.name = this.name;\n formatted.message = 'Development: ' + this.message;\n if (this.path) formatted.path = this.path;\n if (this.locations) formatted.locations = this.locations;\n if (this.extensions) formatted.extensions = this.extensions;\n // Skip stack on purpose because we don't want to expose it to the browser.\n }\n\n return formatted;\n }\n}" - }, - "CustomerAccountQueries": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountQueries", - "description": "", - "members": [], - "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" }, - "Storefront": { - "filePath": "src/storefront.ts", + "CustomerAccount": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "Storefront", - "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", - "description": "Interface to interact with the Storefront API.", + "name": "CustomerAccount", + "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", + "description": "", "members": [ { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "cache", - "value": "Cache", - "description": "", - "isOptional": true - }, - { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "CacheCustom", - "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "login", + "value": "(options?: LoginOptions) => Promise", + "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "CacheLong", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "authorize", + "value": "() => Promise", + "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "CacheNone", - "value": "() => NoStoreStrategy", - "description": "" + "name": "isLoggedIn", + "value": "() => Promise", + "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "CacheShort", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "handleAuthStatus", + "value": "() => void | DataFunctionValue", + "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "generateCacheControlHeader", - "value": "(cacheOptions: AllCacheOptions) => string", - "description": "" + "name": "getAccessToken", + "value": "() => Promise", + "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", "name": "getApiUrl", - "value": "(props?: Partial>) => string", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "getPrivateTokenHeaders", - "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", - "description": "" + "value": "() => string", + "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getPublicTokenHeaders", - "value": "(props?: Partial> & Pick) => Record", - "description": "" + "name": "logout", + "value": "(options?: LogoutOptions) => Promise", + "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getShopifyDomain", - "value": "(props?: Partial>) => string", - "description": "" + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "i18n", - "value": "TI18n", - "description": "" + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", - "description": "" + "name": "UNSTABLE_setBuyer", + "value": "(buyer: Partial) => void", + "description": "UNSTABLE feature. Set buyer information into session." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", - "description": "" + "name": "UNSTABLE_getBuyer", + "value": "() => Promise>", + "description": "UNSTABLE feature. Get buyer token and company location id from session." } ] }, - "AllCacheOptions": { - "filePath": "src/cache/strategies.ts", - "name": "AllCacheOptions", - "description": "Override options for a cache strategy.", + "LoginOptions": { + "filePath": "/customer/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "LoginOptions", + "value": "{\n uiLocales?: LanguageCode;\n}", + "description": "", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "name": "uiLocales", + "value": "LanguageCode", + "description": "", "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true - } - ], - "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" - }, - "NoStoreStrategy": { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "NoStoreStrategy", - "value": "{\n mode: string;\n}", - "description": "", - "members": [ - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "" } ] }, - "StorefrontMutations": { - "filePath": "src/storefront.ts", - "name": "StorefrontMutations", - "description": "Maps all the mutations found in the project to variables and return types.", - "members": [], - "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" - }, - "AutoAddedVariableNames": { - "filePath": "src/storefront.ts", + "DataFunctionValue": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "AutoAddedVariableNames", - "value": "'country' | 'language'", + "name": "DataFunctionValue", + "value": "Response | NonNullable | null", "description": "" }, - "StorefrontCommonExtraParams": { - "filePath": "src/storefront.ts", + "LogoutOptions": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontCommonExtraParams", - "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", + "name": "LogoutOptions", + "value": "{\n postLogoutRedirectUri?: string;\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "displayName", - "value": "string", - "description": "", - "isOptional": true - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "headers", - "value": "HeadersInit", - "description": "", - "isOptional": true - }, - { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "storefrontApiVersion", + "name": "postLogoutRedirectUri", "value": "string", "description": "", "isOptional": true } ] }, - "StorefrontError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontError", - "value": "{\n errors?: StorefrontApiErrors;\n}", + "CustomerAccountQueries": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountQueries", "description": "", - "members": [ - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "errors", - "value": "StorefrontApiErrors", - "description": "", - "isOptional": true - } - ] - }, - "StorefrontApiErrors": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontApiErrors", - "value": "JsonGraphQLError[] | undefined", - "description": "" + "members": [], + "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" }, - "JsonGraphQLError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "JsonGraphQLError", - "value": "ReturnType", + "CustomerAccountMutations": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountMutations", "description": "", - "members": [] - }, - "StorefrontQueries": { - "filePath": "src/storefront.ts", - "name": "StorefrontQueries", - "description": "Maps all the queries found in the project to variables and return types.", "members": [], - "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" - }, - "StorefrontQueryOptions": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontQueryOptions", - "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", - "description": "" - }, - "CachingStrategy": { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CachingStrategy", - "value": "AllCacheOptions", - "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", - "members": [ - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true - } - ] + "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" }, "CartMetafieldDeleteFunction": { - "filePath": "src/cart/queries/cartMetafieldDeleteDefault.ts", + "filePath": "/cart/queries/cartMetafieldDeleteDefault.ts", "name": "CartMetafieldDeleteFunction", "description": "", "params": [ @@ -11981,18 +10943,18 @@ "name": "key", "description": "", "value": "string", - "filePath": "src/cart/queries/cartMetafieldDeleteDefault.ts" + "filePath": "/cart/queries/cartMetafieldDeleteDefault.ts" }, { "name": "optionalParams", "description": "", "value": "CartOptionalInput", "isOptional": true, - "filePath": "src/cart/queries/cartMetafieldDeleteDefault.ts" + "filePath": "/cart/queries/cartMetafieldDeleteDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartMetafieldDeleteDefault.ts", + "filePath": "/cart/queries/cartMetafieldDeleteDefault.ts", "description": "", "name": "Promise", "value": "Promise" @@ -12000,14 +10962,14 @@ "value": "export type CartMetafieldDeleteFunction = (\n key: Scalars['String']['input'],\n optionalParams?: CartOptionalInput,\n) => Promise;" }, "CartOptionalInput": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartOptionalInput", "value": "{\n /**\n * The cart id.\n * @default cart.getCartId();\n */\n cartId?: Scalars['ID']['input'];\n /**\n * The country code.\n * @default storefront.i18n.country\n */\n country?: CountryCode;\n /**\n * The language code.\n * @default storefront.i18n.language\n */\n language?: LanguageCode;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cartId", "value": "string", @@ -12016,7 +10978,7 @@ "defaultValue": "cart.getCartId();" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "country", "value": "CountryCode", @@ -12025,7 +10987,7 @@ "defaultValue": "storefront.i18n.country" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "language", "value": "LanguageCode", @@ -12036,31 +10998,31 @@ ] }, "CartQueryDataReturn": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryDataReturn", "value": "CartQueryData & {\n errors?: StorefrontApiErrors;\n}", "description": "" }, "CartQueryData": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryData", "value": "{\n cart: Cart;\n userErrors?:\n | CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[];\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cart", "value": "Cart", "description": "" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "userErrors", - "value": "| CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[]", + "value": "CartUserError[] | MetafieldsSetUserError[] | MetafieldDeleteUserError[]", "description": "", "isOptional": true } @@ -12126,7 +11088,7 @@ "type": "CartMetafieldsSetDefaultGeneratedType", "typeDefinitions": { "CartMetafieldsSetDefaultGeneratedType": { - "filePath": "src/cart/queries/cartMetafieldsSetDefault.ts", + "filePath": "/cart/queries/cartMetafieldsSetDefault.ts", "name": "CartMetafieldsSetDefaultGeneratedType", "description": "", "params": [ @@ -12134,11 +11096,11 @@ "name": "options", "description": "", "value": "CartQueryOptions", - "filePath": "src/cart/queries/cartMetafieldsSetDefault.ts" + "filePath": "/cart/queries/cartMetafieldsSetDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartMetafieldsSetDefault.ts", + "filePath": "/cart/queries/cartMetafieldsSetDefault.ts", "description": "", "name": "CartMetafieldsSetFunction", "value": "CartMetafieldsSetFunction" @@ -12146,14 +11108,28 @@ "value": "export function cartMetafieldsSetDefault(\n options: CartQueryOptions,\n): CartMetafieldsSetFunction {\n return async (metafields, optionalParams) => {\n const ownerId = optionalParams?.cartId || options.getCartId();\n const metafieldsWithOwnerId = metafields.map(\n (metafield: MetafieldWithoutOwnerId) => ({\n ...metafield,\n ownerId,\n }),\n );\n const {cartMetafieldsSet, errors} = await options.storefront.mutate<{\n cartMetafieldsSet: {\n userErrors: MetafieldsSetUserError[];\n };\n errors: StorefrontApiErrors;\n }>(CART_METAFIELD_SET_MUTATION(), {\n variables: {metafields: metafieldsWithOwnerId},\n });\n\n return formatAPIResult(\n {\n cart: {\n id: ownerId,\n } as Cart,\n ...cartMetafieldsSet,\n },\n errors,\n );\n };\n}" }, "CartQueryOptions": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryOptions", "value": "{\n /**\n * The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient).\n */\n storefront: Storefront;\n /**\n * A function that returns the cart ID.\n */\n getCartId: () => string | undefined;\n /**\n * The cart fragment to override the one used in this query.\n */\n cartFragment?: string;\n /**\n * The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).\n */\n customerAccount?: CustomerAccount;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "storefront", + "value": "Storefront", + "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." + }, + { + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "getCartId", + "value": "() => string", + "description": "A function that returns the cart ID." + }, + { + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cartFragment", "value": "string", @@ -12161,380 +11137,281 @@ "isOptional": true }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "customerAccount", "value": "CustomerAccount", "description": "The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).", "isOptional": true - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "getCartId", - "value": "() => string", - "description": "A function that returns the cart ID." - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "storefront", - "value": "Storefront", - "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." } ] }, - "CustomerAccount": { - "filePath": "src/customer/types.ts", + "Storefront": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAccount", - "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", - "description": "", + "name": "Storefront", + "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", + "description": "Interface to interact with the Storefront API.", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "authorize", - "value": "() => Promise", - "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getAccessToken", - "value": "() => Promise", - "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "() => string", - "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." + "name": "cache", + "value": "Cache", + "description": "", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "handleAuthStatus", - "value": "() => void | DataFunctionValue", - "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." + "name": "CacheNone", + "value": "() => NoStoreStrategy", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "isLoggedIn", - "value": "() => Promise", - "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." + "name": "CacheLong", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "login", - "value": "(options?: LoginOptions) => Promise", - "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" + "name": "CacheShort", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "logout", - "value": "(options?: LogoutOptions) => Promise", - "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." + "name": "CacheCustom", + "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." + "name": "generateCacheControlHeader", + "value": "(cacheOptions: AllCacheOptions) => string", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." + "name": "getPublicTokenHeaders", + "value": "(props?: Partial> & Pick) => Record", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_getBuyer", - "value": "() => Promise>", - "description": "UNSTABLE feature. Get buyer token and company location id from session." + "name": "getPrivateTokenHeaders", + "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_setBuyer", - "value": "(buyer: Partial) => void", - "description": "UNSTABLE feature. Set buyer information into session." - } - ] - }, - "DataFunctionValue": { - "filePath": "src/customer/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "DataFunctionValue", - "value": "Response | NonNullable | null", - "description": "" - }, - "LoginOptions": { - "filePath": "src/customer/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "LoginOptions", - "value": "{\n uiLocales?: LanguageCode;\n}", - "description": "", - "members": [ - { - "filePath": "src/customer/types.ts", - "syntaxKind": "PropertySignature", - "name": "uiLocales", - "value": "LanguageCode", - "description": "", - "isOptional": true - } - ] - }, - "LogoutOptions": { - "filePath": "src/customer/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "LogoutOptions", - "value": "{\n postLogoutRedirectUri?: string;\n}", - "description": "", - "members": [ - { - "filePath": "src/customer/types.ts", - "syntaxKind": "PropertySignature", - "name": "postLogoutRedirectUri", - "value": "string", - "description": "", - "isOptional": true - } - ] - }, - "CustomerAccountMutations": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountMutations", - "description": "", - "members": [], - "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" - }, - "CustomerAPIResponse": { - "filePath": "src/customer/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAPIResponse", - "value": "{\n data: ReturnType;\n errors: Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>;\n extensions: {\n cost: {\n requestQueryCost: number;\n actualQueryCakes: number;\n throttleStatus: {\n maximumAvailable: number;\n currentAvailable: number;\n restoreRate: number;\n };\n };\n };\n}", - "description": "", - "members": [ - { - "filePath": "src/customer/types.ts", - "syntaxKind": "PropertySignature", - "name": "data", - "value": "ReturnType", + "name": "getShopifyDomain", + "value": "(props?: Partial>) => string", "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "errors", - "value": "Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>", + "name": "getApiUrl", + "value": "(props?: Partial>) => string", "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "extensions", - "value": "{ cost: { requestQueryCost: number; actualQueryCakes: number; throttleStatus: { maximumAvailable: number; currentAvailable: number; restoreRate: number; }; }; }", + "name": "i18n", + "value": "TI18n", "description": "" } ] }, - "GraphQLError": { - "filePath": "src/utils/graphql.ts", - "name": "GraphQLError", + "StorefrontQueries": { + "filePath": "/storefront.ts", + "name": "StorefrontQueries", + "description": "Maps all the queries found in the project to variables and return types.", + "members": [], + "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + }, + "AutoAddedVariableNames": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "AutoAddedVariableNames", + "value": "'country' | 'language'", + "description": "" + }, + "StorefrontCommonExtraParams": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontCommonExtraParams", + "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", "description": "", "members": [ { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "locations", - "value": "{ line: number; column: number; }[]", - "description": "If an error can be associated to a particular point in the requested GraphQL document, it should contain a list of locations." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "path", - "value": "(string | number)[]", - "description": "If an error can be associated to a particular field in the GraphQL result, it _must_ contain an entry with the key `path` that details the path of the response field which experienced the error. This allows clients to identify whether a null result is intentional or caused by a runtime error." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "extensions", - "value": "{ [key: string]: unknown; }", - "description": "Reserved for implementors to extend the protocol however they see fit, and hence there are no additional restrictions on its contents." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toString", - "value": "() => string", - "description": "Note: `toString()` is internally used by `console.log(...)` / `console.error(...)` when ingesting logs in Oxygen production. Therefore, we want to make sure that the error message is as informative as possible instead of `[object Object]`." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toJSON", - "value": "() => Pick", - "description": "Note: toJSON` is internally used by `JSON.stringify(...)`. The most common scenario when this error instance is going to be stringified is when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`. In this situation, we don't want to expose private error information to the browser so we only do it in development." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "GetAccessor", - "name": "__@toStringTag@690", - "value": "string", - "description": "" - }, - { - "filePath": "src/utils/graphql.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "name", - "value": "string", - "description": "" + "name": "headers", + "value": "HeadersInit", + "description": "", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "message", + "name": "storefrontApiVersion", "value": "string", - "description": "" + "description": "", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "stack", + "name": "displayName", "value": "string", "description": "", "isOptional": true } - ], - "value": "export class GraphQLError extends Error {\n /**\n * If an error can be associated to a particular point in the requested\n * GraphQL document, it should contain a list of locations.\n */\n locations?: Array<{line: number; column: number}>;\n /**\n * If an error can be associated to a particular field in the GraphQL result,\n * it _must_ contain an entry with the key `path` that details the path of\n * the response field which experienced the error. This allows clients to\n * identify whether a null result is intentional or caused by a runtime error.\n */\n path?: Array;\n /**\n * Reserved for implementors to extend the protocol however they see fit,\n * and hence there are no additional restrictions on its contents.\n */\n extensions?: {[key: string]: unknown};\n\n constructor(\n message?: string,\n options: Pick<\n GraphQLError,\n 'locations' | 'path' | 'extensions' | 'stack' | 'cause'\n > & {\n query?: string;\n queryVariables?: GenericVariables;\n requestId?: string | null;\n clientOperation?: string;\n } = {},\n ) {\n const h2Prefix = options.clientOperation\n ? `[h2:error:${options.clientOperation}] `\n : '';\n\n const enhancedMessage =\n h2Prefix +\n message +\n (options.requestId ? ` - Request ID: ${options.requestId}` : '');\n\n super(enhancedMessage);\n this.name = 'GraphQLError';\n this.extensions = options.extensions;\n this.locations = options.locations;\n this.path = options.path;\n this.stack = options.stack || undefined;\n\n try {\n this.cause = JSON.stringify({\n ...(typeof options.cause === 'object' ? options.cause : {}),\n requestId: options.requestId,\n ...(process.env.NODE_ENV === 'development' && {\n path: options.path,\n extensions: options.extensions,\n graphql: h2Prefix &&\n options.query && {\n query: options.query,\n variables: JSON.stringify(options.queryVariables),\n },\n }),\n });\n } catch {\n if (options.cause) this.cause = options.cause;\n }\n }\n\n get [Symbol.toStringTag]() {\n return this.name;\n }\n\n /**\n * Note: `toString()` is internally used by `console.log(...)` / `console.error(...)`\n * when ingesting logs in Oxygen production. Therefore, we want to make sure that\n * the error message is as informative as possible instead of `[object Object]`.\n */\n override toString() {\n let result = `${this.name}: ${this.message}`;\n\n if (this.path) {\n try {\n result += ` | path: ${JSON.stringify(this.path)}`;\n } catch {}\n }\n\n if (this.extensions) {\n try {\n result += ` | extensions: ${JSON.stringify(this.extensions)}`;\n } catch {}\n }\n\n result += '\\n';\n\n if (this.stack) {\n // Remove the message line from the stack.\n result += `${this.stack.slice(this.stack.indexOf('\\n') + 1)}\\n`;\n }\n\n return result;\n }\n\n /**\n * Note: toJSON` is internally used by `JSON.stringify(...)`.\n * The most common scenario when this error instance is going to be stringified is\n * when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`.\n * In this situation, we don't want to expose private error information to the browser so we only\n * do it in development.\n */\n toJSON() {\n const formatted: Pick<\n GraphQLError,\n 'name' | 'message' | 'path' | 'extensions' | 'locations' | 'stack'\n > = {name: 'Error', message: ''};\n\n if (process.env.NODE_ENV === 'development') {\n formatted.name = this.name;\n formatted.message = 'Development: ' + this.message;\n if (this.path) formatted.path = this.path;\n if (this.locations) formatted.locations = this.locations;\n if (this.extensions) formatted.extensions = this.extensions;\n // Skip stack on purpose because we don't want to expose it to the browser.\n }\n\n return formatted;\n }\n}" + ] }, - "CustomerAccountQueries": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountQueries", - "description": "", - "members": [], - "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + "StorefrontQueryOptions": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontQueryOptions", + "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", + "description": "" }, - "Storefront": { - "filePath": "src/storefront.ts", + "CachingStrategy": { + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "Storefront", - "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", - "description": "Interface to interact with the Storefront API.", + "name": "CachingStrategy", + "value": "AllCacheOptions", + "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "cache", - "value": "Cache", - "description": "", + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", "isOptional": true }, { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "CacheCustom", - "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "CacheLong", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "CacheNone", - "value": "() => NoStoreStrategy", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "CacheShort", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "generateCacheControlHeader", - "value": "(cacheOptions: AllCacheOptions) => string", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "(props?: Partial>) => string", - "description": "" - }, - { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "getPrivateTokenHeaders", - "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", - "description": "" + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "getPublicTokenHeaders", - "value": "(props?: Partial> & Pick) => Record", - "description": "" + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "getShopifyDomain", - "value": "(props?: Partial>) => string", - "description": "" + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "i18n", - "value": "TI18n", - "description": "" - }, + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", + "isOptional": true + } + ] + }, + "StorefrontError": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontError", + "value": "{\n errors?: StorefrontApiErrors;\n}", + "description": "", + "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", - "description": "" - }, + "name": "errors", + "value": "StorefrontApiErrors", + "description": "", + "isOptional": true + } + ] + }, + "StorefrontApiErrors": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontApiErrors", + "value": "JsonGraphQLError[] | undefined", + "description": "" + }, + "StorefrontMutations": { + "filePath": "/storefront.ts", + "name": "StorefrontMutations", + "description": "Maps all the mutations found in the project to variables and return types.", + "members": [], + "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + }, + "NoStoreStrategy": { + "filePath": "/cache/strategies.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "NoStoreStrategy", + "value": "{\n mode: string;\n}", + "description": "", + "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "name": "mode", + "value": "string", "description": "" } ] }, "AllCacheOptions": { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "name": "AllCacheOptions", "description": "Override options for a cache strategy.", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "maxAge", "value": "number", @@ -12542,15 +11419,15 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "sMaxAge", "value": "number", @@ -12558,184 +11435,159 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "staleIfError", "value": "number", "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true } ], "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" }, - "NoStoreStrategy": { - "filePath": "src/cache/strategies.ts", + "CustomerAccount": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "NoStoreStrategy", - "value": "{\n mode: string;\n}", + "name": "CustomerAccount", + "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", "description": "", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "" - } - ] - }, - "StorefrontMutations": { - "filePath": "src/storefront.ts", - "name": "StorefrontMutations", - "description": "Maps all the mutations found in the project to variables and return types.", - "members": [], - "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" - }, - "AutoAddedVariableNames": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "AutoAddedVariableNames", - "value": "'country' | 'language'", - "description": "" - }, - "StorefrontCommonExtraParams": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontCommonExtraParams", - "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", - "description": "", - "members": [ + "name": "login", + "value": "(options?: LoginOptions) => Promise", + "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" + }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "displayName", - "value": "string", - "description": "", - "isOptional": true + "name": "authorize", + "value": "() => Promise", + "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "headers", - "value": "HeadersInit", - "description": "", - "isOptional": true + "name": "isLoggedIn", + "value": "() => Promise", + "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "storefrontApiVersion", - "value": "string", - "description": "", - "isOptional": true + "name": "handleAuthStatus", + "value": "() => void | DataFunctionValue", + "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "getAccessToken", + "value": "() => Promise", + "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "getApiUrl", + "value": "() => string", + "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "logout", + "value": "(options?: LogoutOptions) => Promise", + "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "UNSTABLE_setBuyer", + "value": "(buyer: Partial) => void", + "description": "UNSTABLE feature. Set buyer information into session." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "UNSTABLE_getBuyer", + "value": "() => Promise>", + "description": "UNSTABLE feature. Get buyer token and company location id from session." } ] }, - "StorefrontError": { - "filePath": "src/storefront.ts", + "LoginOptions": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontError", - "value": "{\n errors?: StorefrontApiErrors;\n}", + "name": "LoginOptions", + "value": "{\n uiLocales?: LanguageCode;\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "errors", - "value": "StorefrontApiErrors", + "name": "uiLocales", + "value": "LanguageCode", "description": "", "isOptional": true } ] }, - "StorefrontApiErrors": { - "filePath": "src/storefront.ts", + "DataFunctionValue": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontApiErrors", - "value": "JsonGraphQLError[] | undefined", + "name": "DataFunctionValue", + "value": "Response | NonNullable | null", "description": "" }, - "JsonGraphQLError": { - "filePath": "src/storefront.ts", + "LogoutOptions": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "JsonGraphQLError", - "value": "ReturnType", + "name": "LogoutOptions", + "value": "{\n postLogoutRedirectUri?: string;\n}", "description": "", - "members": [] - }, - "StorefrontQueries": { - "filePath": "src/storefront.ts", - "name": "StorefrontQueries", - "description": "Maps all the queries found in the project to variables and return types.", - "members": [], - "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" - }, - "StorefrontQueryOptions": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontQueryOptions", - "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", - "description": "" - }, - "CachingStrategy": { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CachingStrategy", - "value": "AllCacheOptions", - "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", "members": [ { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "mode", + "name": "postLogoutRedirectUri", "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "description": "", "isOptional": true } ] }, + "CustomerAccountQueries": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountQueries", + "description": "", + "members": [], + "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + }, + "CustomerAccountMutations": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountMutations", + "description": "", + "members": [], + "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + }, "CartMetafieldsSetFunction": { - "filePath": "src/cart/queries/cartMetafieldsSetDefault.ts", + "filePath": "/cart/queries/cartMetafieldsSetDefault.ts", "name": "CartMetafieldsSetFunction", "description": "", "params": [ @@ -12743,18 +11595,18 @@ "name": "metafields", "description": "", "value": "MetafieldWithoutOwnerId[]", - "filePath": "src/cart/queries/cartMetafieldsSetDefault.ts" + "filePath": "/cart/queries/cartMetafieldsSetDefault.ts" }, { "name": "optionalParams", "description": "", "value": "CartOptionalInput", "isOptional": true, - "filePath": "src/cart/queries/cartMetafieldsSetDefault.ts" + "filePath": "/cart/queries/cartMetafieldsSetDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartMetafieldsSetDefault.ts", + "filePath": "/cart/queries/cartMetafieldsSetDefault.ts", "description": "", "name": "Promise", "value": "Promise" @@ -12769,14 +11621,14 @@ "override": "Same as [CartMetafieldsSetInput](https://shopify.dev/docs/api/storefront/2024-07/input-objects/CartMetafieldsSetInput) Storefront API type but without `ownerId`. `ownerId` is always set to the cart id." }, "CartOptionalInput": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartOptionalInput", "value": "{\n /**\n * The cart id.\n * @default cart.getCartId();\n */\n cartId?: Scalars['ID']['input'];\n /**\n * The country code.\n * @default storefront.i18n.country\n */\n country?: CountryCode;\n /**\n * The language code.\n * @default storefront.i18n.language\n */\n language?: LanguageCode;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cartId", "value": "string", @@ -12785,7 +11637,7 @@ "defaultValue": "cart.getCartId();" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "country", "value": "CountryCode", @@ -12794,7 +11646,7 @@ "defaultValue": "storefront.i18n.country" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "language", "value": "LanguageCode", @@ -12805,31 +11657,31 @@ ] }, "CartQueryDataReturn": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryDataReturn", "value": "CartQueryData & {\n errors?: StorefrontApiErrors;\n}", "description": "" }, "CartQueryData": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryData", "value": "{\n cart: Cart;\n userErrors?:\n | CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[];\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cart", "value": "Cart", "description": "" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "userErrors", - "value": "| CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[]", + "value": "CartUserError[] | MetafieldsSetUserError[] | MetafieldDeleteUserError[]", "description": "", "isOptional": true } @@ -12895,7 +11747,7 @@ "type": "CartNoteUpdateDefaultGeneratedType", "typeDefinitions": { "CartNoteUpdateDefaultGeneratedType": { - "filePath": "src/cart/queries/cartNoteUpdateDefault.ts", + "filePath": "/cart/queries/cartNoteUpdateDefault.ts", "name": "CartNoteUpdateDefaultGeneratedType", "description": "", "params": [ @@ -12903,11 +11755,11 @@ "name": "options", "description": "", "value": "CartQueryOptions", - "filePath": "src/cart/queries/cartNoteUpdateDefault.ts" + "filePath": "/cart/queries/cartNoteUpdateDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartNoteUpdateDefault.ts", + "filePath": "/cart/queries/cartNoteUpdateDefault.ts", "description": "", "name": "CartNoteUpdateFunction", "value": "CartNoteUpdateFunction" @@ -12915,14 +11767,28 @@ "value": "export function cartNoteUpdateDefault(\n options: CartQueryOptions,\n): CartNoteUpdateFunction {\n return async (note, optionalParams) => {\n const {cartNoteUpdate, errors} = await options.storefront.mutate<{\n cartNoteUpdate: CartQueryData;\n errors: StorefrontApiErrors;\n }>(CART_NOTE_UPDATE_MUTATION(options.cartFragment), {\n variables: {\n cartId: options.getCartId(),\n note,\n ...optionalParams,\n },\n });\n return formatAPIResult(cartNoteUpdate, errors);\n };\n}" }, "CartQueryOptions": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryOptions", "value": "{\n /**\n * The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient).\n */\n storefront: Storefront;\n /**\n * A function that returns the cart ID.\n */\n getCartId: () => string | undefined;\n /**\n * The cart fragment to override the one used in this query.\n */\n cartFragment?: string;\n /**\n * The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).\n */\n customerAccount?: CustomerAccount;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "storefront", + "value": "Storefront", + "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." + }, + { + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "getCartId", + "value": "() => string", + "description": "A function that returns the cart ID." + }, + { + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cartFragment", "value": "string", @@ -12930,581 +11796,457 @@ "isOptional": true }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "customerAccount", "value": "CustomerAccount", "description": "The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).", "isOptional": true - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "getCartId", - "value": "() => string", - "description": "A function that returns the cart ID." - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "storefront", - "value": "Storefront", - "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." } ] }, - "CustomerAccount": { - "filePath": "src/customer/types.ts", + "Storefront": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAccount", - "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", - "description": "", + "name": "Storefront", + "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", + "description": "Interface to interact with the Storefront API.", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "authorize", - "value": "() => Promise", - "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getAccessToken", - "value": "() => Promise", - "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "() => string", - "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." + "name": "cache", + "value": "Cache", + "description": "", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "handleAuthStatus", - "value": "() => void | DataFunctionValue", - "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." + "name": "CacheNone", + "value": "() => NoStoreStrategy", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "isLoggedIn", - "value": "() => Promise", - "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." + "name": "CacheLong", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "login", - "value": "(options?: LoginOptions) => Promise", - "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" + "name": "CacheShort", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "logout", - "value": "(options?: LogoutOptions) => Promise", - "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." + "name": "CacheCustom", + "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." + "name": "generateCacheControlHeader", + "value": "(cacheOptions: AllCacheOptions) => string", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." + "name": "getPublicTokenHeaders", + "value": "(props?: Partial> & Pick) => Record", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_getBuyer", - "value": "() => Promise>", - "description": "UNSTABLE feature. Get buyer token and company location id from session." + "name": "getPrivateTokenHeaders", + "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", + "description": "" }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_setBuyer", - "value": "(buyer: Partial) => void", - "description": "UNSTABLE feature. Set buyer information into session." + "name": "getShopifyDomain", + "value": "(props?: Partial>) => string", + "description": "" + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "getApiUrl", + "value": "(props?: Partial>) => string", + "description": "" + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "i18n", + "value": "TI18n", + "description": "" } ] }, - "DataFunctionValue": { - "filePath": "src/customer/types.ts", + "StorefrontQueries": { + "filePath": "/storefront.ts", + "name": "StorefrontQueries", + "description": "Maps all the queries found in the project to variables and return types.", + "members": [], + "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + }, + "AutoAddedVariableNames": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "DataFunctionValue", - "value": "Response | NonNullable | null", + "name": "AutoAddedVariableNames", + "value": "'country' | 'language'", "description": "" }, - "LoginOptions": { - "filePath": "src/customer/types.ts", + "StorefrontCommonExtraParams": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "LoginOptions", - "value": "{\n uiLocales?: LanguageCode;\n}", + "name": "StorefrontCommonExtraParams", + "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", "description": "", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "uiLocales", - "value": "LanguageCode", + "name": "headers", + "value": "HeadersInit", "description": "", "isOptional": true - } - ] - }, - "LogoutOptions": { - "filePath": "src/customer/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "LogoutOptions", - "value": "{\n postLogoutRedirectUri?: string;\n}", - "description": "", - "members": [ + }, { - "filePath": "src/customer/types.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "postLogoutRedirectUri", + "name": "storefrontApiVersion", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "displayName", "value": "string", "description": "", "isOptional": true } ] }, - "CustomerAccountMutations": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountMutations", - "description": "", - "members": [], - "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + "StorefrontQueryOptions": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontQueryOptions", + "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", + "description": "" }, - "CustomerAPIResponse": { - "filePath": "src/customer/types.ts", + "CachingStrategy": { + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAPIResponse", - "value": "{\n data: ReturnType;\n errors: Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>;\n extensions: {\n cost: {\n requestQueryCost: number;\n actualQueryCakes: number;\n throttleStatus: {\n maximumAvailable: number;\n currentAvailable: number;\n restoreRate: number;\n };\n };\n };\n}", - "description": "", + "name": "CachingStrategy", + "value": "AllCacheOptions", + "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "data", - "value": "ReturnType", - "description": "" + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "errors", - "value": "Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>", - "description": "" + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "extensions", - "value": "{ cost: { requestQueryCost: number; actualQueryCakes: number; throttleStatus: { maximumAvailable: number; currentAvailable: number; restoreRate: number; }; }; }", - "description": "" + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", + "isOptional": true } ] }, - "GraphQLError": { - "filePath": "src/utils/graphql.ts", - "name": "GraphQLError", + "StorefrontError": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontError", + "value": "{\n errors?: StorefrontApiErrors;\n}", "description": "", "members": [ { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "locations", - "value": "{ line: number; column: number; }[]", - "description": "If an error can be associated to a particular point in the requested GraphQL document, it should contain a list of locations." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "path", - "value": "(string | number)[]", - "description": "If an error can be associated to a particular field in the GraphQL result, it _must_ contain an entry with the key `path` that details the path of the response field which experienced the error. This allows clients to identify whether a null result is intentional or caused by a runtime error." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "extensions", - "value": "{ [key: string]: unknown; }", - "description": "Reserved for implementors to extend the protocol however they see fit, and hence there are no additional restrictions on its contents." - }, + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "errors", + "value": "StorefrontApiErrors", + "description": "", + "isOptional": true + } + ] + }, + "StorefrontApiErrors": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontApiErrors", + "value": "JsonGraphQLError[] | undefined", + "description": "" + }, + "StorefrontMutations": { + "filePath": "/storefront.ts", + "name": "StorefrontMutations", + "description": "Maps all the mutations found in the project to variables and return types.", + "members": [], + "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + }, + "NoStoreStrategy": { + "filePath": "/cache/strategies.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "NoStoreStrategy", + "value": "{\n mode: string;\n}", + "description": "", + "members": [ { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toString", - "value": "() => string", - "description": "Note: `toString()` is internally used by `console.log(...)` / `console.error(...)` when ingesting logs in Oxygen production. Therefore, we want to make sure that the error message is as informative as possible instead of `[object Object]`." - }, + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "" + } + ] + }, + "AllCacheOptions": { + "filePath": "/cache/strategies.ts", + "name": "AllCacheOptions", + "description": "Override options for a cache strategy.", + "members": [ { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toJSON", - "value": "() => Pick", - "description": "Note: toJSON` is internally used by `JSON.stringify(...)`. The most common scenario when this error instance is going to be stringified is when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`. In this situation, we don't want to expose private error information to the browser so we only do it in development." + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "GetAccessor", - "name": "__@toStringTag@690", - "value": "string", - "description": "" + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "name", - "value": "string", - "description": "" + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "message", - "value": "string", - "description": "" + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "stack", - "value": "string", - "description": "", + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", "isOptional": true } ], - "value": "export class GraphQLError extends Error {\n /**\n * If an error can be associated to a particular point in the requested\n * GraphQL document, it should contain a list of locations.\n */\n locations?: Array<{line: number; column: number}>;\n /**\n * If an error can be associated to a particular field in the GraphQL result,\n * it _must_ contain an entry with the key `path` that details the path of\n * the response field which experienced the error. This allows clients to\n * identify whether a null result is intentional or caused by a runtime error.\n */\n path?: Array;\n /**\n * Reserved for implementors to extend the protocol however they see fit,\n * and hence there are no additional restrictions on its contents.\n */\n extensions?: {[key: string]: unknown};\n\n constructor(\n message?: string,\n options: Pick<\n GraphQLError,\n 'locations' | 'path' | 'extensions' | 'stack' | 'cause'\n > & {\n query?: string;\n queryVariables?: GenericVariables;\n requestId?: string | null;\n clientOperation?: string;\n } = {},\n ) {\n const h2Prefix = options.clientOperation\n ? `[h2:error:${options.clientOperation}] `\n : '';\n\n const enhancedMessage =\n h2Prefix +\n message +\n (options.requestId ? ` - Request ID: ${options.requestId}` : '');\n\n super(enhancedMessage);\n this.name = 'GraphQLError';\n this.extensions = options.extensions;\n this.locations = options.locations;\n this.path = options.path;\n this.stack = options.stack || undefined;\n\n try {\n this.cause = JSON.stringify({\n ...(typeof options.cause === 'object' ? options.cause : {}),\n requestId: options.requestId,\n ...(process.env.NODE_ENV === 'development' && {\n path: options.path,\n extensions: options.extensions,\n graphql: h2Prefix &&\n options.query && {\n query: options.query,\n variables: JSON.stringify(options.queryVariables),\n },\n }),\n });\n } catch {\n if (options.cause) this.cause = options.cause;\n }\n }\n\n get [Symbol.toStringTag]() {\n return this.name;\n }\n\n /**\n * Note: `toString()` is internally used by `console.log(...)` / `console.error(...)`\n * when ingesting logs in Oxygen production. Therefore, we want to make sure that\n * the error message is as informative as possible instead of `[object Object]`.\n */\n override toString() {\n let result = `${this.name}: ${this.message}`;\n\n if (this.path) {\n try {\n result += ` | path: ${JSON.stringify(this.path)}`;\n } catch {}\n }\n\n if (this.extensions) {\n try {\n result += ` | extensions: ${JSON.stringify(this.extensions)}`;\n } catch {}\n }\n\n result += '\\n';\n\n if (this.stack) {\n // Remove the message line from the stack.\n result += `${this.stack.slice(this.stack.indexOf('\\n') + 1)}\\n`;\n }\n\n return result;\n }\n\n /**\n * Note: toJSON` is internally used by `JSON.stringify(...)`.\n * The most common scenario when this error instance is going to be stringified is\n * when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`.\n * In this situation, we don't want to expose private error information to the browser so we only\n * do it in development.\n */\n toJSON() {\n const formatted: Pick<\n GraphQLError,\n 'name' | 'message' | 'path' | 'extensions' | 'locations' | 'stack'\n > = {name: 'Error', message: ''};\n\n if (process.env.NODE_ENV === 'development') {\n formatted.name = this.name;\n formatted.message = 'Development: ' + this.message;\n if (this.path) formatted.path = this.path;\n if (this.locations) formatted.locations = this.locations;\n if (this.extensions) formatted.extensions = this.extensions;\n // Skip stack on purpose because we don't want to expose it to the browser.\n }\n\n return formatted;\n }\n}" - }, - "CustomerAccountQueries": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountQueries", - "description": "", - "members": [], - "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" }, - "Storefront": { - "filePath": "src/storefront.ts", + "CustomerAccount": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "Storefront", - "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", - "description": "Interface to interact with the Storefront API.", + "name": "CustomerAccount", + "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", + "description": "", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "cache", - "value": "Cache", - "description": "", - "isOptional": true + "name": "login", + "value": "(options?: LoginOptions) => Promise", + "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "CacheCustom", - "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "authorize", + "value": "() => Promise", + "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "CacheLong", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "isLoggedIn", + "value": "() => Promise", + "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "CacheNone", - "value": "() => NoStoreStrategy", - "description": "" + "name": "handleAuthStatus", + "value": "() => void | DataFunctionValue", + "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "CacheShort", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "getAccessToken", + "value": "() => Promise", + "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "generateCacheControlHeader", - "value": "(cacheOptions: AllCacheOptions) => string", - "description": "" + "name": "getApiUrl", + "value": "() => string", + "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." }, { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "(props?: Partial>) => string", - "description": "" + "name": "logout", + "value": "(options?: LogoutOptions) => Promise", + "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." }, { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "getPrivateTokenHeaders", - "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "getPublicTokenHeaders", - "value": "(props?: Partial> & Pick) => Record", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "getShopifyDomain", - "value": "(props?: Partial>) => string", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "i18n", - "value": "TI18n", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", - "description": "" - }, - { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", - "description": "" - } - ] - }, - "AllCacheOptions": { - "filePath": "src/cache/strategies.ts", - "name": "AllCacheOptions", - "description": "Override options for a cache strategy.", - "members": [ - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", - "isOptional": true + "name": "UNSTABLE_setBuyer", + "value": "(buyer: Partial) => void", + "description": "UNSTABLE feature. Set buyer information into session." }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true + "name": "UNSTABLE_getBuyer", + "value": "() => Promise>", + "description": "UNSTABLE feature. Get buyer token and company location id from session." } - ], - "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" + ] }, - "NoStoreStrategy": { - "filePath": "src/cache/strategies.ts", + "LoginOptions": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "NoStoreStrategy", - "value": "{\n mode: string;\n}", + "name": "LoginOptions", + "value": "{\n uiLocales?: LanguageCode;\n}", "description": "", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "" + "name": "uiLocales", + "value": "LanguageCode", + "description": "", + "isOptional": true } ] }, - "StorefrontMutations": { - "filePath": "src/storefront.ts", - "name": "StorefrontMutations", - "description": "Maps all the mutations found in the project to variables and return types.", - "members": [], - "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" - }, - "AutoAddedVariableNames": { - "filePath": "src/storefront.ts", + "DataFunctionValue": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "AutoAddedVariableNames", - "value": "'country' | 'language'", + "name": "DataFunctionValue", + "value": "Response | NonNullable | null", "description": "" }, - "StorefrontCommonExtraParams": { - "filePath": "src/storefront.ts", + "LogoutOptions": { + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontCommonExtraParams", - "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", + "name": "LogoutOptions", + "value": "{\n postLogoutRedirectUri?: string;\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "displayName", - "value": "string", - "description": "", - "isOptional": true - }, - { - "filePath": "src/storefront.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "headers", - "value": "HeadersInit", - "description": "", - "isOptional": true - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "storefrontApiVersion", + "name": "postLogoutRedirectUri", "value": "string", "description": "", "isOptional": true } ] }, - "StorefrontError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontError", - "value": "{\n errors?: StorefrontApiErrors;\n}", + "CustomerAccountQueries": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountQueries", "description": "", - "members": [ - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "errors", - "value": "StorefrontApiErrors", - "description": "", - "isOptional": true - } - ] - }, - "StorefrontApiErrors": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontApiErrors", - "value": "JsonGraphQLError[] | undefined", - "description": "" + "members": [], + "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" }, - "JsonGraphQLError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "JsonGraphQLError", - "value": "ReturnType", + "CustomerAccountMutations": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountMutations", "description": "", - "members": [] - }, - "StorefrontQueries": { - "filePath": "src/storefront.ts", - "name": "StorefrontQueries", - "description": "Maps all the queries found in the project to variables and return types.", "members": [], - "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" - }, - "StorefrontQueryOptions": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontQueryOptions", - "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", - "description": "" - }, - "CachingStrategy": { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CachingStrategy", - "value": "AllCacheOptions", - "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", - "members": [ - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true - } - ] + "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" }, "CartNoteUpdateFunction": { - "filePath": "src/cart/queries/cartNoteUpdateDefault.ts", + "filePath": "/cart/queries/cartNoteUpdateDefault.ts", "name": "CartNoteUpdateFunction", "description": "", "params": [ @@ -13512,18 +12254,18 @@ "name": "note", "description": "", "value": "string", - "filePath": "src/cart/queries/cartNoteUpdateDefault.ts" + "filePath": "/cart/queries/cartNoteUpdateDefault.ts" }, { "name": "optionalParams", "description": "", "value": "CartOptionalInput", "isOptional": true, - "filePath": "src/cart/queries/cartNoteUpdateDefault.ts" + "filePath": "/cart/queries/cartNoteUpdateDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartNoteUpdateDefault.ts", + "filePath": "/cart/queries/cartNoteUpdateDefault.ts", "description": "", "name": "Promise", "value": "Promise" @@ -13531,654 +12273,403 @@ "value": "export type CartNoteUpdateFunction = (\n note: string,\n optionalParams?: CartOptionalInput,\n) => Promise;" }, "CartOptionalInput": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartOptionalInput", "value": "{\n /**\n * The cart id.\n * @default cart.getCartId();\n */\n cartId?: Scalars['ID']['input'];\n /**\n * The country code.\n * @default storefront.i18n.country\n */\n country?: CountryCode;\n /**\n * The language code.\n * @default storefront.i18n.language\n */\n language?: LanguageCode;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cartId", "value": "string", "description": "The cart id.", "isOptional": true, - "defaultValue": "cart.getCartId();" - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "country", - "value": "CountryCode", - "description": "The country code.", - "isOptional": true, - "defaultValue": "storefront.i18n.country" - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "language", - "value": "LanguageCode", - "description": "The language code.", - "isOptional": true, - "defaultValue": "storefront.i18n.language" - } - ] - }, - "CartQueryDataReturn": { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CartQueryDataReturn", - "value": "CartQueryData & {\n errors?: StorefrontApiErrors;\n}", - "description": "" - }, - "CartQueryData": { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CartQueryData", - "value": "{\n cart: Cart;\n userErrors?:\n | CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[];\n}", - "description": "", - "members": [ - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "cart", - "value": "Cart", - "description": "" - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "userErrors", - "value": "| CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[]", - "description": "", - "isOptional": true - } - ] - }, - "Cart": { - "description": "", - "name": "Cart", - "value": "Cart", - "members": [], - "override": "[Cart](/docs/api/storefront/2024-07/objects/Cart) - Storefront API type" - }, - "CartUserError": { - "description": "", - "name": "CartUserError", - "value": "CartUserError", - "members": [], - "override": "[CartUserError](/docs/api/storefront/2024-07/objects/CartUserError) - Storefront API type" - }, - "MetafieldsSetUserError": { - "description": "", - "name": "MetafieldsSetUserError", - "value": "MetafieldsSetUserError", - "members": [], - "override": "[MetafieldsSetUserError](/docs/api/storefront/2024-07/objects/MetafieldsSetUserError) - Storefront API type" - }, - "MetafieldDeleteUserError": { - "description": "", - "name": "MetafieldDeleteUserError", - "value": "MetafieldDeleteUserError", - "members": [], - "override": "[MetafieldDeleteUserError](/docs/api/storefront/2024-07/objects/MetafieldDeleteUserError) - Storefront API type" - } - } - } - ] - }, - { - "name": "cartSelectedDeliveryOptionsUpdateDefault", - "category": "utilities", - "subCategory": "cart", - "isVisualComponent": false, - "related": [], - "description": "Creates a function that accepts an object of [CartSelectedDeliveryOptionInput](/docs/api/storefront/2024-07/input-objects/CartSelectedDeliveryOptionInput) and updates the selected delivery option of a cart", - "type": "utility", - "defaultExample": { - "description": "This is the default example", - "codeblock": { - "tabs": [ - { - "title": "JavaScript", - "code": "import {cartSelectedDeliveryOptionsUpdateDefault} from '@shopify/hydrogen';\n\nconst cartDeliveryOption = cartSelectedDeliveryOptionsUpdateDefault({\n storefront,\n getCartId,\n});\n\nconst result = await cartDeliveryOption([\n {\n deliveryGroupId: '123',\n deliveryOptionHandle: 'Canada Post',\n },\n]);\n", - "language": "js" - } - ], - "title": "example" - } - }, - "definitions": [ - { - "title": "cartSelectedDeliveryOptionsUpdateDefault", - "description": "", - "type": "CartSelectedDeliveryOptionsUpdateDefaultGeneratedType", - "typeDefinitions": { - "CartSelectedDeliveryOptionsUpdateDefaultGeneratedType": { - "filePath": "src/cart/queries/cartSelectedDeliveryOptionsUpdateDefault.ts", - "name": "CartSelectedDeliveryOptionsUpdateDefaultGeneratedType", - "description": "", - "params": [ - { - "name": "options", - "description": "", - "value": "CartQueryOptions", - "filePath": "src/cart/queries/cartSelectedDeliveryOptionsUpdateDefault.ts" - } - ], - "returns": { - "filePath": "src/cart/queries/cartSelectedDeliveryOptionsUpdateDefault.ts", - "description": "", - "name": "CartSelectedDeliveryOptionsUpdateFunction", - "value": "CartSelectedDeliveryOptionsUpdateFunction" - }, - "value": "export function cartSelectedDeliveryOptionsUpdateDefault(\n options: CartQueryOptions,\n): CartSelectedDeliveryOptionsUpdateFunction {\n return async (selectedDeliveryOptions, optionalParams) => {\n const {cartSelectedDeliveryOptionsUpdate, errors} =\n await options.storefront.mutate<{\n cartSelectedDeliveryOptionsUpdate: CartQueryData;\n errors: StorefrontApiErrors;\n }>(CART_SELECTED_DELIVERY_OPTIONS_UPDATE_MUTATION(options.cartFragment), {\n variables: {\n cartId: options.getCartId(),\n selectedDeliveryOptions,\n ...optionalParams,\n },\n });\n return formatAPIResult(cartSelectedDeliveryOptionsUpdate, errors);\n };\n}" - }, - "CartQueryOptions": { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CartQueryOptions", - "value": "{\n /**\n * The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient).\n */\n storefront: Storefront;\n /**\n * A function that returns the cart ID.\n */\n getCartId: () => string | undefined;\n /**\n * The cart fragment to override the one used in this query.\n */\n cartFragment?: string;\n /**\n * The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).\n */\n customerAccount?: CustomerAccount;\n}", - "description": "", - "members": [ - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "cartFragment", - "value": "string", - "description": "The cart fragment to override the one used in this query.", - "isOptional": true - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "customerAccount", - "value": "CustomerAccount", - "description": "The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).", - "isOptional": true - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "getCartId", - "value": "() => string", - "description": "A function that returns the cart ID." - }, - { - "filePath": "src/cart/queries/cart-types.ts", - "syntaxKind": "PropertySignature", - "name": "storefront", - "value": "Storefront", - "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." - } - ] - }, - "CustomerAccount": { - "filePath": "src/customer/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAccount", - "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", - "description": "", - "members": [ - { - "filePath": "src/customer/types.ts", - "syntaxKind": "PropertySignature", - "name": "authorize", - "value": "() => Promise", - "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." - }, - { - "filePath": "src/customer/types.ts", - "syntaxKind": "PropertySignature", - "name": "getAccessToken", - "value": "() => Promise", - "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." - }, - { - "filePath": "src/customer/types.ts", - "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "() => string", - "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." - }, - { - "filePath": "src/customer/types.ts", - "syntaxKind": "PropertySignature", - "name": "handleAuthStatus", - "value": "() => void | DataFunctionValue", - "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." - }, - { - "filePath": "src/customer/types.ts", - "syntaxKind": "PropertySignature", - "name": "isLoggedIn", - "value": "() => Promise", - "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." - }, - { - "filePath": "src/customer/types.ts", - "syntaxKind": "PropertySignature", - "name": "login", - "value": "(options?: LoginOptions) => Promise", - "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" - }, - { - "filePath": "src/customer/types.ts", - "syntaxKind": "PropertySignature", - "name": "logout", - "value": "(options?: LogoutOptions) => Promise", - "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." - }, - { - "filePath": "src/customer/types.ts", - "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." - }, - { - "filePath": "src/customer/types.ts", - "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", - "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." + "defaultValue": "cart.getCartId();" }, { - "filePath": "src/customer/types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_getBuyer", - "value": "() => Promise>", - "description": "UNSTABLE feature. Get buyer token and company location id from session." + "name": "country", + "value": "CountryCode", + "description": "The country code.", + "isOptional": true, + "defaultValue": "storefront.i18n.country" }, { - "filePath": "src/customer/types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", - "name": "UNSTABLE_setBuyer", - "value": "(buyer: Partial) => void", - "description": "UNSTABLE feature. Set buyer information into session." + "name": "language", + "value": "LanguageCode", + "description": "The language code.", + "isOptional": true, + "defaultValue": "storefront.i18n.language" } ] }, - "DataFunctionValue": { - "filePath": "src/customer/types.ts", + "CartQueryDataReturn": { + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "DataFunctionValue", - "value": "Response | NonNullable | null", + "name": "CartQueryDataReturn", + "value": "CartQueryData & {\n errors?: StorefrontApiErrors;\n}", "description": "" }, - "LoginOptions": { - "filePath": "src/customer/types.ts", + "CartQueryData": { + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "LoginOptions", - "value": "{\n uiLocales?: LanguageCode;\n}", + "name": "CartQueryData", + "value": "{\n cart: Cart;\n userErrors?:\n | CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[];\n}", "description": "", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", - "name": "uiLocales", - "value": "LanguageCode", - "description": "", - "isOptional": true - } - ] - }, - "LogoutOptions": { - "filePath": "src/customer/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "LogoutOptions", - "value": "{\n postLogoutRedirectUri?: string;\n}", - "description": "", - "members": [ + "name": "cart", + "value": "Cart", + "description": "" + }, { - "filePath": "src/customer/types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", - "name": "postLogoutRedirectUri", - "value": "string", + "name": "userErrors", + "value": "CartUserError[] | MetafieldsSetUserError[] | MetafieldDeleteUserError[]", "description": "", "isOptional": true } ] }, - "CustomerAccountMutations": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountMutations", + "Cart": { "description": "", + "name": "Cart", + "value": "Cart", "members": [], - "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + "override": "[Cart](/docs/api/storefront/2024-07/objects/Cart) - Storefront API type" }, - "CustomerAPIResponse": { - "filePath": "src/customer/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CustomerAPIResponse", - "value": "{\n data: ReturnType;\n errors: Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>;\n extensions: {\n cost: {\n requestQueryCost: number;\n actualQueryCakes: number;\n throttleStatus: {\n maximumAvailable: number;\n currentAvailable: number;\n restoreRate: number;\n };\n };\n };\n}", + "CartUserError": { "description": "", - "members": [ - { - "filePath": "src/customer/types.ts", - "syntaxKind": "PropertySignature", - "name": "data", - "value": "ReturnType", - "description": "" - }, - { - "filePath": "src/customer/types.ts", - "syntaxKind": "PropertySignature", - "name": "errors", - "value": "Array<{\n message: string;\n locations?: Array<{line: number; column: number}>;\n path?: Array;\n extensions: {code: string};\n }>", - "description": "" - }, + "name": "CartUserError", + "value": "CartUserError", + "members": [], + "override": "[CartUserError](/docs/api/storefront/2024-07/objects/CartUserError) - Storefront API type" + }, + "MetafieldsSetUserError": { + "description": "", + "name": "MetafieldsSetUserError", + "value": "MetafieldsSetUserError", + "members": [], + "override": "[MetafieldsSetUserError](/docs/api/storefront/2024-07/objects/MetafieldsSetUserError) - Storefront API type" + }, + "MetafieldDeleteUserError": { + "description": "", + "name": "MetafieldDeleteUserError", + "value": "MetafieldDeleteUserError", + "members": [], + "override": "[MetafieldDeleteUserError](/docs/api/storefront/2024-07/objects/MetafieldDeleteUserError) - Storefront API type" + } + } + } + ] + }, + { + "name": "cartSelectedDeliveryOptionsUpdateDefault", + "category": "utilities", + "subCategory": "cart", + "isVisualComponent": false, + "related": [], + "description": "Creates a function that accepts an object of [CartSelectedDeliveryOptionInput](/docs/api/storefront/2024-07/input-objects/CartSelectedDeliveryOptionInput) and updates the selected delivery option of a cart", + "type": "utility", + "defaultExample": { + "description": "This is the default example", + "codeblock": { + "tabs": [ + { + "title": "JavaScript", + "code": "import {cartSelectedDeliveryOptionsUpdateDefault} from '@shopify/hydrogen';\n\nconst cartDeliveryOption = cartSelectedDeliveryOptionsUpdateDefault({\n storefront,\n getCartId,\n});\n\nconst result = await cartDeliveryOption([\n {\n deliveryGroupId: '123',\n deliveryOptionHandle: 'Canada Post',\n },\n]);\n", + "language": "js" + } + ], + "title": "example" + } + }, + "definitions": [ + { + "title": "cartSelectedDeliveryOptionsUpdateDefault", + "description": "", + "type": "CartSelectedDeliveryOptionsUpdateDefaultGeneratedType", + "typeDefinitions": { + "CartSelectedDeliveryOptionsUpdateDefaultGeneratedType": { + "filePath": "/cart/queries/cartSelectedDeliveryOptionsUpdateDefault.ts", + "name": "CartSelectedDeliveryOptionsUpdateDefaultGeneratedType", + "description": "", + "params": [ { - "filePath": "src/customer/types.ts", - "syntaxKind": "PropertySignature", - "name": "extensions", - "value": "{ cost: { requestQueryCost: number; actualQueryCakes: number; throttleStatus: { maximumAvailable: number; currentAvailable: number; restoreRate: number; }; }; }", - "description": "" + "name": "options", + "description": "", + "value": "CartQueryOptions", + "filePath": "/cart/queries/cartSelectedDeliveryOptionsUpdateDefault.ts" } - ] + ], + "returns": { + "filePath": "/cart/queries/cartSelectedDeliveryOptionsUpdateDefault.ts", + "description": "", + "name": "CartSelectedDeliveryOptionsUpdateFunction", + "value": "CartSelectedDeliveryOptionsUpdateFunction" + }, + "value": "export function cartSelectedDeliveryOptionsUpdateDefault(\n options: CartQueryOptions,\n): CartSelectedDeliveryOptionsUpdateFunction {\n return async (selectedDeliveryOptions, optionalParams) => {\n const {cartSelectedDeliveryOptionsUpdate, errors} =\n await options.storefront.mutate<{\n cartSelectedDeliveryOptionsUpdate: CartQueryData;\n errors: StorefrontApiErrors;\n }>(CART_SELECTED_DELIVERY_OPTIONS_UPDATE_MUTATION(options.cartFragment), {\n variables: {\n cartId: options.getCartId(),\n selectedDeliveryOptions,\n ...optionalParams,\n },\n });\n return formatAPIResult(cartSelectedDeliveryOptionsUpdate, errors);\n };\n}" }, - "GraphQLError": { - "filePath": "src/utils/graphql.ts", - "name": "GraphQLError", + "CartQueryOptions": { + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "CartQueryOptions", + "value": "{\n /**\n * The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient).\n */\n storefront: Storefront;\n /**\n * A function that returns the cart ID.\n */\n getCartId: () => string | undefined;\n /**\n * The cart fragment to override the one used in this query.\n */\n cartFragment?: string;\n /**\n * The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).\n */\n customerAccount?: CustomerAccount;\n}", "description": "", "members": [ { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "locations", - "value": "{ line: number; column: number; }[]", - "description": "If an error can be associated to a particular point in the requested GraphQL document, it should contain a list of locations." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "path", - "value": "(string | number)[]", - "description": "If an error can be associated to a particular field in the GraphQL result, it _must_ contain an entry with the key `path` that details the path of the response field which experienced the error. This allows clients to identify whether a null result is intentional or caused by a runtime error." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "PropertyDeclaration", - "name": "extensions", - "value": "{ [key: string]: unknown; }", - "description": "Reserved for implementors to extend the protocol however they see fit, and hence there are no additional restrictions on its contents." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toString", - "value": "() => string", - "description": "Note: `toString()` is internally used by `console.log(...)` / `console.error(...)` when ingesting logs in Oxygen production. Therefore, we want to make sure that the error message is as informative as possible instead of `[object Object]`." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "MethodDeclaration", - "name": "toJSON", - "value": "() => Pick", - "description": "Note: toJSON` is internally used by `JSON.stringify(...)`. The most common scenario when this error instance is going to be stringified is when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`. In this situation, we don't want to expose private error information to the browser so we only do it in development." - }, - { - "filePath": "src/utils/graphql.ts", - "syntaxKind": "GetAccessor", - "name": "__@toStringTag@690", - "value": "string", - "description": "" + "filePath": "/cart/queries/cart-types.ts", + "syntaxKind": "PropertySignature", + "name": "storefront", + "value": "Storefront", + "description": "The storefront client instance created by [`createStorefrontClient`](docs/api/hydrogen/latest/utilities/createstorefrontclient)." }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", - "name": "name", - "value": "string", - "description": "" + "name": "getCartId", + "value": "() => string", + "description": "A function that returns the cart ID." }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", - "name": "message", + "name": "cartFragment", "value": "string", - "description": "" + "description": "The cart fragment to override the one used in this query.", + "isOptional": true }, { - "filePath": "src/utils/graphql.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", - "name": "stack", - "value": "string", - "description": "", + "name": "customerAccount", + "value": "CustomerAccount", + "description": "The customer account instance created by [`createCustomerAccount`](docs/api/hydrogen/latest/customer/createcustomeraccount).", "isOptional": true } - ], - "value": "export class GraphQLError extends Error {\n /**\n * If an error can be associated to a particular point in the requested\n * GraphQL document, it should contain a list of locations.\n */\n locations?: Array<{line: number; column: number}>;\n /**\n * If an error can be associated to a particular field in the GraphQL result,\n * it _must_ contain an entry with the key `path` that details the path of\n * the response field which experienced the error. This allows clients to\n * identify whether a null result is intentional or caused by a runtime error.\n */\n path?: Array;\n /**\n * Reserved for implementors to extend the protocol however they see fit,\n * and hence there are no additional restrictions on its contents.\n */\n extensions?: {[key: string]: unknown};\n\n constructor(\n message?: string,\n options: Pick<\n GraphQLError,\n 'locations' | 'path' | 'extensions' | 'stack' | 'cause'\n > & {\n query?: string;\n queryVariables?: GenericVariables;\n requestId?: string | null;\n clientOperation?: string;\n } = {},\n ) {\n const h2Prefix = options.clientOperation\n ? `[h2:error:${options.clientOperation}] `\n : '';\n\n const enhancedMessage =\n h2Prefix +\n message +\n (options.requestId ? ` - Request ID: ${options.requestId}` : '');\n\n super(enhancedMessage);\n this.name = 'GraphQLError';\n this.extensions = options.extensions;\n this.locations = options.locations;\n this.path = options.path;\n this.stack = options.stack || undefined;\n\n try {\n this.cause = JSON.stringify({\n ...(typeof options.cause === 'object' ? options.cause : {}),\n requestId: options.requestId,\n ...(process.env.NODE_ENV === 'development' && {\n path: options.path,\n extensions: options.extensions,\n graphql: h2Prefix &&\n options.query && {\n query: options.query,\n variables: JSON.stringify(options.queryVariables),\n },\n }),\n });\n } catch {\n if (options.cause) this.cause = options.cause;\n }\n }\n\n get [Symbol.toStringTag]() {\n return this.name;\n }\n\n /**\n * Note: `toString()` is internally used by `console.log(...)` / `console.error(...)`\n * when ingesting logs in Oxygen production. Therefore, we want to make sure that\n * the error message is as informative as possible instead of `[object Object]`.\n */\n override toString() {\n let result = `${this.name}: ${this.message}`;\n\n if (this.path) {\n try {\n result += ` | path: ${JSON.stringify(this.path)}`;\n } catch {}\n }\n\n if (this.extensions) {\n try {\n result += ` | extensions: ${JSON.stringify(this.extensions)}`;\n } catch {}\n }\n\n result += '\\n';\n\n if (this.stack) {\n // Remove the message line from the stack.\n result += `${this.stack.slice(this.stack.indexOf('\\n') + 1)}\\n`;\n }\n\n return result;\n }\n\n /**\n * Note: toJSON` is internally used by `JSON.stringify(...)`.\n * The most common scenario when this error instance is going to be stringified is\n * when it's passed to Remix' `json` and `defer` functions: e.g. `defer({promise: storefront.query(...)})`.\n * In this situation, we don't want to expose private error information to the browser so we only\n * do it in development.\n */\n toJSON() {\n const formatted: Pick<\n GraphQLError,\n 'name' | 'message' | 'path' | 'extensions' | 'locations' | 'stack'\n > = {name: 'Error', message: ''};\n\n if (process.env.NODE_ENV === 'development') {\n formatted.name = this.name;\n formatted.message = 'Development: ' + this.message;\n if (this.path) formatted.path = this.path;\n if (this.locations) formatted.locations = this.locations;\n if (this.extensions) formatted.extensions = this.extensions;\n // Skip stack on purpose because we don't want to expose it to the browser.\n }\n\n return formatted;\n }\n}" - }, - "CustomerAccountQueries": { - "filePath": "src/customer/types.ts", - "name": "CustomerAccountQueries", - "description": "", - "members": [], - "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + ] }, "Storefront": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "Storefront", "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", "description": "Interface to interact with the Storefront API.", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "cache", - "value": "Cache", - "description": "", - "isOptional": true + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "CacheCustom", - "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "CacheLong", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "cache", + "value": "Cache", + "description": "", + "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", "name": "CacheNone", "value": "() => NoStoreStrategy", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "CacheShort", + "name": "CacheLong", "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "generateCacheControlHeader", - "value": "(cacheOptions: AllCacheOptions) => string", + "name": "CacheShort", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "(props?: Partial>) => string", + "name": "CacheCustom", + "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getPrivateTokenHeaders", - "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", + "name": "generateCacheControlHeader", + "value": "(cacheOptions: AllCacheOptions) => string", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", "name": "getPublicTokenHeaders", "value": "(props?: Partial> & Pick) => Record", "description": "" }, { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "getShopifyDomain", - "value": "(props?: Partial>) => string", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "i18n", - "value": "TI18n", - "description": "" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", - "description": "" - }, - { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "name": "getPrivateTokenHeaders", + "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", "description": "" - } - ] - }, - "AllCacheOptions": { - "filePath": "src/cache/strategies.ts", - "name": "AllCacheOptions", - "description": "Override options for a cache strategy.", - "members": [ - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true + "name": "getShopifyDomain", + "value": "(props?: Partial>) => string", + "description": "" }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", - "isOptional": true + "name": "getApiUrl", + "value": "(props?: Partial>) => string", + "description": "" }, { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true - } - ], - "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" - }, - "NoStoreStrategy": { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "NoStoreStrategy", - "value": "{\n mode: string;\n}", - "description": "", - "members": [ - { - "filePath": "src/cache/strategies.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", + "name": "i18n", + "value": "TI18n", "description": "" } ] }, - "StorefrontMutations": { - "filePath": "src/storefront.ts", - "name": "StorefrontMutations", - "description": "Maps all the mutations found in the project to variables and return types.", + "StorefrontQueries": { + "filePath": "/storefront.ts", + "name": "StorefrontQueries", + "description": "Maps all the queries found in the project to variables and return types.", "members": [], - "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" }, "AutoAddedVariableNames": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "AutoAddedVariableNames", "value": "'country' | 'language'", "description": "" }, "StorefrontCommonExtraParams": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "StorefrontCommonExtraParams", "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "displayName", - "value": "string", + "name": "headers", + "value": "HeadersInit", "description": "", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "headers", - "value": "HeadersInit", + "name": "storefrontApiVersion", + "value": "string", "description": "", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "storefrontApiVersion", + "name": "displayName", "value": "string", "description": "", "isOptional": true } ] }, + "StorefrontQueryOptions": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontQueryOptions", + "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", + "description": "" + }, + "CachingStrategy": { + "filePath": "/cache/strategies.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "CachingStrategy", + "value": "AllCacheOptions", + "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", + "members": [ + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", + "isOptional": true + } + ] + }, "StorefrontError": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "StorefrontError", "value": "{\n errors?: StorefrontApiErrors;\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", "name": "errors", "value": "StorefrontApiErrors", @@ -14188,43 +12679,50 @@ ] }, "StorefrontApiErrors": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "StorefrontApiErrors", "value": "JsonGraphQLError[] | undefined", "description": "" }, - "JsonGraphQLError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "JsonGraphQLError", - "value": "ReturnType", - "description": "", - "members": [] - }, - "StorefrontQueries": { - "filePath": "src/storefront.ts", - "name": "StorefrontQueries", - "description": "Maps all the queries found in the project to variables and return types.", + "StorefrontMutations": { + "filePath": "/storefront.ts", + "name": "StorefrontMutations", + "description": "Maps all the mutations found in the project to variables and return types.", "members": [], - "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" }, - "StorefrontQueryOptions": { - "filePath": "src/storefront.ts", + "NoStoreStrategy": { + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontQueryOptions", - "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", - "description": "" + "name": "NoStoreStrategy", + "value": "{\n mode: string;\n}", + "description": "", + "members": [ + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "" + } + ] }, - "CachingStrategy": { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CachingStrategy", - "value": "AllCacheOptions", - "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", + "AllCacheOptions": { + "filePath": "/cache/strategies.ts", + "name": "AllCacheOptions", + "description": "Override options for a cache strategy.", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "maxAge", "value": "number", @@ -14232,15 +12730,15 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "sMaxAge", "value": "number", @@ -14248,25 +12746,159 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "staleIfError", "value": "number", "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", "isOptional": true + } + ], + "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" + }, + "CustomerAccount": { + "filePath": "/customer/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "CustomerAccount", + "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountQueries,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n CustomerAccountMutations,\n RawGqlString\n >\n ) => Promise<\n Omit<\n CustomerAPIResponse<\n ClientReturn\n >,\n 'errors'\n > & {errors?: JsonGraphQLError[]}\n >;\n /** UNSTABLE feature. Set buyer information into session.*/\n UNSTABLE_setBuyer: (buyer: Buyer) => void;\n /** UNSTABLE feature. Get buyer token and company location id from session.*/\n UNSTABLE_getBuyer: () => Promise;\n}", + "description": "", + "members": [ + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "login", + "value": "(options?: LoginOptions) => Promise", + "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)" }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "name": "authorize", + "value": "() => Promise", + "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "isLoggedIn", + "value": "() => Promise", + "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "handleAuthStatus", + "value": "() => void | DataFunctionValue", + "description": "Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "getAccessToken", + "value": "() => Promise", + "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "getApiUrl", + "value": "() => string", + "description": "Creates the fully-qualified URL to your store's GraphQL endpoint." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "logout", + "value": "(options?: LogoutOptions) => Promise", + "description": "Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountQueries[RawGqlString][\"variables\"] as Filter>]: CustomerAccountQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [({} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [{} & ClientVariables>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof CustomerAccountMutations[RawGqlString][\"variables\"] as Filter>]: CustomerAccountMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise>, \"errors\"> & { errors?: Pick[]; }>", + "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "UNSTABLE_setBuyer", + "value": "(buyer: Partial) => void", + "description": "UNSTABLE feature. Set buyer information into session." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "UNSTABLE_getBuyer", + "value": "() => Promise>", + "description": "UNSTABLE feature. Get buyer token and company location id from session." + } + ] + }, + "LoginOptions": { + "filePath": "/customer/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "LoginOptions", + "value": "{\n uiLocales?: LanguageCode;\n}", + "description": "", + "members": [ + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "uiLocales", + "value": "LanguageCode", + "description": "", + "isOptional": true + } + ] + }, + "DataFunctionValue": { + "filePath": "/customer/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "DataFunctionValue", + "value": "Response | NonNullable | null", + "description": "" + }, + "LogoutOptions": { + "filePath": "/customer/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "LogoutOptions", + "value": "{\n postLogoutRedirectUri?: string;\n}", + "description": "", + "members": [ + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "postLogoutRedirectUri", + "value": "string", + "description": "", "isOptional": true } ] }, + "CustomerAccountQueries": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountQueries", + "description": "", + "members": [], + "value": "export interface CustomerAccountQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + }, + "CustomerAccountMutations": { + "filePath": "/customer/types.ts", + "name": "CustomerAccountMutations", + "description": "", + "members": [], + "value": "export interface CustomerAccountMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" + }, "CartSelectedDeliveryOptionsUpdateFunction": { - "filePath": "src/cart/queries/cartSelectedDeliveryOptionsUpdateDefault.ts", + "filePath": "/cart/queries/cartSelectedDeliveryOptionsUpdateDefault.ts", "name": "CartSelectedDeliveryOptionsUpdateFunction", "description": "", "params": [ @@ -14274,18 +12906,18 @@ "name": "selectedDeliveryOptions", "description": "", "value": "CartSelectedDeliveryOptionInput[]", - "filePath": "src/cart/queries/cartSelectedDeliveryOptionsUpdateDefault.ts" + "filePath": "/cart/queries/cartSelectedDeliveryOptionsUpdateDefault.ts" }, { "name": "optionalParams", "description": "", "value": "CartOptionalInput", "isOptional": true, - "filePath": "src/cart/queries/cartSelectedDeliveryOptionsUpdateDefault.ts" + "filePath": "/cart/queries/cartSelectedDeliveryOptionsUpdateDefault.ts" } ], "returns": { - "filePath": "src/cart/queries/cartSelectedDeliveryOptionsUpdateDefault.ts", + "filePath": "/cart/queries/cartSelectedDeliveryOptionsUpdateDefault.ts", "description": "", "name": "Promise", "value": "Promise" @@ -14300,14 +12932,14 @@ "override": "[CartSelectedDeliveryOptionInput](/docs/api/storefront/2024-07/input-objects/CartSelectedDeliveryOptionInput) - Storefront API type" }, "CartOptionalInput": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartOptionalInput", "value": "{\n /**\n * The cart id.\n * @default cart.getCartId();\n */\n cartId?: Scalars['ID']['input'];\n /**\n * The country code.\n * @default storefront.i18n.country\n */\n country?: CountryCode;\n /**\n * The language code.\n * @default storefront.i18n.language\n */\n language?: LanguageCode;\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cartId", "value": "string", @@ -14316,7 +12948,7 @@ "defaultValue": "cart.getCartId();" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "country", "value": "CountryCode", @@ -14325,7 +12957,7 @@ "defaultValue": "storefront.i18n.country" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "language", "value": "LanguageCode", @@ -14336,31 +12968,31 @@ ] }, "CartQueryDataReturn": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryDataReturn", "value": "CartQueryData & {\n errors?: StorefrontApiErrors;\n}", "description": "" }, "CartQueryData": { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CartQueryData", "value": "{\n cart: Cart;\n userErrors?:\n | CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[];\n}", "description": "", "members": [ { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "cart", "value": "Cart", "description": "" }, { - "filePath": "src/cart/queries/cart-types.ts", + "filePath": "/cart/queries/cart-types.ts", "syntaxKind": "PropertySignature", "name": "userErrors", - "value": "| CartUserError[]\n | MetafieldsSetUserError[]\n | MetafieldDeleteUserError[]", + "value": "CartUserError[] | MetafieldsSetUserError[] | MetafieldDeleteUserError[]", "description": "", "isOptional": true } @@ -14456,103 +13088,103 @@ "type": "CreateStorefrontClientOptions", "typeDefinitions": { "CreateStorefrontClientOptions": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CreateStorefrontClientOptions", "value": "HydrogenClientProps & StorefrontClientProps", "description": "" }, "HydrogenClientProps": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "HydrogenClientProps", "value": "{\n /** Storefront API headers. If on Oxygen, use `getStorefrontHeaders()` */\n storefrontHeaders?: StorefrontHeaders;\n /** An instance that implements the [Cache API](https://developer.mozilla.org/en-US/docs/Web/API/Cache) */\n cache?: Cache;\n /** The globally unique identifier for the Shop */\n storefrontId?: string;\n /** The `waitUntil` function is used to keep the current request/response lifecycle alive even after a response has been sent. It should be provided by your platform. */\n waitUntil?: WaitUntil;\n /** An object containing a country code and language code */\n i18n?: TI18n;\n /** Whether it should print GraphQL errors automatically. Defaults to true */\n logErrors?: boolean | ((error?: Error) => boolean);\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "cache", - "value": "Cache", - "description": "An instance that implements the [Cache API](https://developer.mozilla.org/en-US/docs/Web/API/Cache)", + "name": "storefrontHeaders", + "value": "StorefrontHeaders", + "description": "Storefront API headers. If on Oxygen, use `getStorefrontHeaders()`", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "i18n", - "value": "TI18n", - "description": "An object containing a country code and language code", + "name": "cache", + "value": "Cache", + "description": "An instance that implements the [Cache API](https://developer.mozilla.org/en-US/docs/Web/API/Cache)", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "logErrors", - "value": "boolean | ((error?: Error) => boolean)", - "description": "Whether it should print GraphQL errors automatically. Defaults to true", + "name": "storefrontId", + "value": "string", + "description": "The globally unique identifier for the Shop", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "storefrontHeaders", - "value": "StorefrontHeaders", - "description": "Storefront API headers. If on Oxygen, use `getStorefrontHeaders()`", + "name": "waitUntil", + "value": "WaitUntil", + "description": "The `waitUntil` function is used to keep the current request/response lifecycle alive even after a response has been sent. It should be provided by your platform.", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "storefrontId", - "value": "string", - "description": "The globally unique identifier for the Shop", + "name": "i18n", + "value": "TI18n", + "description": "An object containing a country code and language code", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "waitUntil", - "value": "WaitUntil", - "description": "The `waitUntil` function is used to keep the current request/response lifecycle alive even after a response has been sent. It should be provided by your platform.", + "name": "logErrors", + "value": "boolean | ((error?: Error) => boolean)", + "description": "Whether it should print GraphQL errors automatically. Defaults to true", "isOptional": true } ] }, "StorefrontHeaders": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "StorefrontHeaders", "value": "{\n /** A unique ID that correlates all sub-requests together. */\n requestGroupId: string | null;\n /** The IP address of the client. */\n buyerIp: string | null;\n /** The cookie header from the client */\n cookie: string | null;\n /** The purpose header value for debugging */\n purpose: string | null;\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", + "syntaxKind": "PropertySignature", + "name": "requestGroupId", + "value": "string", + "description": "A unique ID that correlates all sub-requests together." + }, + { + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", "name": "buyerIp", - "value": "string | null", + "value": "string", "description": "The IP address of the client." }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", "name": "cookie", - "value": "string | null", + "value": "string", "description": "The cookie header from the client" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", "name": "purpose", - "value": "string | null", + "value": "string", "description": "The purpose header value for debugging" - }, - { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "requestGroupId", - "value": "string | null", - "description": "A unique ID that correlates all sub-requests together." } ] } @@ -14564,14 +13196,14 @@ "type": "CreateStorefrontClientForDocs", "typeDefinitions": { "CreateStorefrontClientForDocs": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CreateStorefrontClientForDocs", "value": "{\n storefront?: StorefrontForDoc;\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", "name": "storefront", "value": "StorefrontForDoc", @@ -14581,38 +13213,38 @@ ] }, "StorefrontForDoc": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "StorefrontForDoc", "value": "{\n /** The function to run a query on Storefront API. */\n query?: (\n query: string,\n options: StorefrontQueryOptionsForDocs,\n ) => Promise;\n /** The function to run a mutation on Storefront API. */\n mutate?: (\n mutation: string,\n options: StorefrontMutationOptionsForDocs,\n ) => Promise;\n /** The cache instance passed in from the `createStorefrontClient` argument. */\n cache?: Cache;\n /** Re-export of [`CacheNone`](/docs/api/hydrogen/2024-07/utilities/cachenone). */\n CacheNone?: typeof CacheNone;\n /** Re-export of [`CacheLong`](/docs/api/hydrogen/2024-07/utilities/cachelong). */\n CacheLong?: typeof CacheLong;\n /** Re-export of [`CacheShort`](/docs/api/hydrogen/2024-07/utilities/cacheshort). */\n CacheShort?: typeof CacheShort;\n /** Re-export of [`CacheCustom`](/docs/api/hydrogen/2024-07/utilities/cachecustom). */\n CacheCustom?: typeof CacheCustom;\n /** Re-export of [`generateCacheControlHeader`](/docs/api/hydrogen/2024-07/utilities/generatecachecontrolheader). */\n generateCacheControlHeader?: typeof generateCacheControlHeader;\n /** Returns an object that contains headers that are needed for each query to Storefront API GraphQL endpoint. See [`getPublicTokenHeaders` in Hydrogen React](/docs/api/hydrogen-react/2024-07/utilities/createstorefrontclient#:~:text=%27graphql%27.-,getPublicTokenHeaders,-(props%3F%3A) for more details. */\n getPublicTokenHeaders?: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n /** Returns an object that contains headers that are needed for each query to Storefront API GraphQL endpoint for API calls made from a server. See [`getPrivateTokenHeaders` in Hydrogen React](/docs/api/hydrogen-react/2024-07/utilities/createstorefrontclient#:~:text=storefrontApiVersion-,getPrivateTokenHeaders,-(props%3F%3A) for more details.*/\n getPrivateTokenHeaders?: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n /** Creates the fully-qualified URL to your myshopify.com domain. See [`getShopifyDomain` in Hydrogen React](/docs/api/hydrogen-react/2024-07/utilities/createstorefrontclient#:~:text=StorefrontClientReturn-,getShopifyDomain,-(props%3F%3A) for more details. */\n getShopifyDomain?: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n /** Creates the fully-qualified URL to your store's GraphQL endpoint. See [`getStorefrontApiUrl` in Hydrogen React](/docs/api/hydrogen-react/2024-07/utilities/createstorefrontclient#:~:text=storeDomain-,getStorefrontApiUrl,-(props%3F%3A) for more details.*/\n getApiUrl?: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n /** The `i18n` object passed in from the `createStorefrontClient` argument. */\n i18n?: TI18n;\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "cache", - "value": "Cache", - "description": "The cache instance passed in from the `createStorefrontClient` argument.", + "name": "query", + "value": "(query: string, options: StorefrontQueryOptionsForDocs) => Promise", + "description": "The function to run a query on Storefront API.", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "CacheCustom", - "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", - "description": "Re-export of [`CacheCustom`](/docs/api/hydrogen/2024-07/utilities/cachecustom).", + "name": "mutate", + "value": "(mutation: string, options: StorefrontMutationOptionsForDocs) => Promise", + "description": "The function to run a mutation on Storefront API.", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "CacheLong", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "Re-export of [`CacheLong`](/docs/api/hydrogen/2024-07/utilities/cachelong).", + "name": "cache", + "value": "Cache", + "description": "The cache instance passed in from the `createStorefrontClient` argument.", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", "name": "CacheNone", "value": "() => NoStoreStrategy", @@ -14620,39 +13252,39 @@ "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "CacheShort", + "name": "CacheLong", "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "Re-export of [`CacheShort`](/docs/api/hydrogen/2024-07/utilities/cacheshort).", + "description": "Re-export of [`CacheLong`](/docs/api/hydrogen/2024-07/utilities/cachelong).", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "generateCacheControlHeader", - "value": "(cacheOptions: AllCacheOptions) => string", - "description": "Re-export of [`generateCacheControlHeader`](/docs/api/hydrogen/2024-07/utilities/generatecachecontrolheader).", + "name": "CacheShort", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", + "description": "Re-export of [`CacheShort`](/docs/api/hydrogen/2024-07/utilities/cacheshort).", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "(props?: Partial>) => string", - "description": "Creates the fully-qualified URL to your store's GraphQL endpoint. See [`getStorefrontApiUrl` in Hydrogen React](/docs/api/hydrogen-react/2024-07/utilities/createstorefrontclient#:~:text=storeDomain-,getStorefrontApiUrl,-(props%3F%3A) for more details.", + "name": "CacheCustom", + "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", + "description": "Re-export of [`CacheCustom`](/docs/api/hydrogen/2024-07/utilities/cachecustom).", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getPrivateTokenHeaders", - "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", - "description": "Returns an object that contains headers that are needed for each query to Storefront API GraphQL endpoint for API calls made from a server. See [`getPrivateTokenHeaders` in Hydrogen React](/docs/api/hydrogen-react/2024-07/utilities/createstorefrontclient#:~:text=storefrontApiVersion-,getPrivateTokenHeaders,-(props%3F%3A) for more details.", + "name": "generateCacheControlHeader", + "value": "(cacheOptions: AllCacheOptions) => string", + "description": "Re-export of [`generateCacheControlHeader`](/docs/api/hydrogen/2024-07/utilities/generatecachecontrolheader).", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", "name": "getPublicTokenHeaders", "value": "(props?: Partial> & Pick) => Record", @@ -14660,153 +13292,146 @@ "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getShopifyDomain", - "value": "(props?: Partial>) => string", - "description": "Creates the fully-qualified URL to your myshopify.com domain. See [`getShopifyDomain` in Hydrogen React](/docs/api/hydrogen-react/2024-07/utilities/createstorefrontclient#:~:text=StorefrontClientReturn-,getShopifyDomain,-(props%3F%3A) for more details.", + "name": "getPrivateTokenHeaders", + "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", + "description": "Returns an object that contains headers that are needed for each query to Storefront API GraphQL endpoint for API calls made from a server. See [`getPrivateTokenHeaders` in Hydrogen React](/docs/api/hydrogen-react/2024-07/utilities/createstorefrontclient#:~:text=storefrontApiVersion-,getPrivateTokenHeaders,-(props%3F%3A) for more details.", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "i18n", - "value": "TI18n", - "description": "The `i18n` object passed in from the `createStorefrontClient` argument.", + "name": "getShopifyDomain", + "value": "(props?: Partial>) => string", + "description": "Creates the fully-qualified URL to your myshopify.com domain. See [`getShopifyDomain` in Hydrogen React](/docs/api/hydrogen-react/2024-07/utilities/createstorefrontclient#:~:text=StorefrontClientReturn-,getShopifyDomain,-(props%3F%3A) for more details.", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: string, options: StorefrontMutationOptionsForDocs) => Promise", - "description": "The function to run a mutation on Storefront API.", + "name": "getApiUrl", + "value": "(props?: Partial>) => string", + "description": "Creates the fully-qualified URL to your store's GraphQL endpoint. See [`getStorefrontApiUrl` in Hydrogen React](/docs/api/hydrogen-react/2024-07/utilities/createstorefrontclient#:~:text=storeDomain-,getStorefrontApiUrl,-(props%3F%3A) for more details.", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: string, options: StorefrontQueryOptionsForDocs) => Promise", - "description": "The function to run a query on Storefront API.", + "name": "i18n", + "value": "TI18n", + "description": "The `i18n` object passed in from the `createStorefrontClient` argument.", "isOptional": true } ] }, - "AllCacheOptions": { - "filePath": "src/cache/strategies.ts", - "name": "AllCacheOptions", - "description": "Override options for a cache strategy.", + "StorefrontQueryOptionsForDocs": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontQueryOptionsForDocs", + "value": "{\n /** The variables for the GraphQL query statement. */\n variables?: Record;\n /** The cache strategy for this query. Default to max-age=1, stale-while-revalidate=86399. */\n cache?: CachingStrategy;\n /** Additional headers for this query. */\n headers?: HeadersInit;\n /** Override the Storefront API version for this query. */\n storefrontApiVersion?: string;\n /** The name of the query for debugging in the Subrequest Profiler. */\n displayName?: string;\n}", + "description": "", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "name": "variables", + "value": "Record", + "description": "The variables for the GraphQL query statement.", "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "name": "cache", + "value": "CachingStrategy", + "description": "The cache strategy for this query. Default to max-age=1, stale-while-revalidate=86399.", "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "name": "headers", + "value": "HeadersInit", + "description": "Additional headers for this query.", "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", + "name": "storefrontApiVersion", + "value": "string", + "description": "Override the Storefront API version for this query.", "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "name": "displayName", + "value": "string", + "description": "The name of the query for debugging in the Subrequest Profiler.", "isOptional": true } - ], - "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" + ] }, - "NoStoreStrategy": { - "filePath": "src/cache/strategies.ts", + "CachingStrategy": { + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "NoStoreStrategy", - "value": "{\n mode: string;\n}", - "description": "", + "name": "CachingStrategy", + "value": "AllCacheOptions", + "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "mode", "value": "string", - "description": "" - } - ] - }, - "StorefrontMutationOptionsForDocs": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontMutationOptionsForDocs", - "value": "{\n /** The variables for the GraphQL mutation statement. */\n variables?: Record;\n /** Additional headers for this query. */\n headers?: HeadersInit;\n /** Override the Storefront API version for this query. */\n storefrontApiVersion?: string;\n /** The name of the query for debugging in the Subrequest Profiler. */\n displayName?: string;\n}", - "description": "", - "members": [ + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true + }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "displayName", - "value": "string", - "description": "The name of the query for debugging in the Subrequest Profiler.", + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "headers", - "value": "HeadersInit", - "description": "Additional headers for this query.", + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "storefrontApiVersion", - "value": "string", - "description": "Override the Storefront API version for this query.", + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "variables", - "value": "Record", - "description": "The variables for the GraphQL mutation statement.", + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", "isOptional": true } ] }, "StorefrontError": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "StorefrontError", "value": "{\n errors?: StorefrontApiErrors;\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", "name": "errors", "value": "StorefrontApiErrors", @@ -14816,45 +13441,29 @@ ] }, "StorefrontApiErrors": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "StorefrontApiErrors", "value": "JsonGraphQLError[] | undefined", "description": "" }, - "JsonGraphQLError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "JsonGraphQLError", - "value": "ReturnType", - "description": "", - "members": [] - }, - "StorefrontQueryOptionsForDocs": { - "filePath": "src/storefront.ts", + "StorefrontMutationOptionsForDocs": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontQueryOptionsForDocs", - "value": "{\n /** The variables for the GraphQL query statement. */\n variables?: Record;\n /** The cache strategy for this query. Default to max-age=1, stale-while-revalidate=86399. */\n cache?: CachingStrategy;\n /** Additional headers for this query. */\n headers?: HeadersInit;\n /** Override the Storefront API version for this query. */\n storefrontApiVersion?: string;\n /** The name of the query for debugging in the Subrequest Profiler. */\n displayName?: string;\n}", + "name": "StorefrontMutationOptionsForDocs", + "value": "{\n /** The variables for the GraphQL mutation statement. */\n variables?: Record;\n /** Additional headers for this query. */\n headers?: HeadersInit;\n /** Override the Storefront API version for this query. */\n storefrontApiVersion?: string;\n /** The name of the query for debugging in the Subrequest Profiler. */\n displayName?: string;\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", - "syntaxKind": "PropertySignature", - "name": "cache", - "value": "CachingStrategy", - "description": "The cache strategy for this query. Default to max-age=1, stale-while-revalidate=86399.", - "isOptional": true - }, - { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "displayName", - "value": "string", - "description": "The name of the query for debugging in the Subrequest Profiler.", + "name": "variables", + "value": "Record", + "description": "The variables for the GraphQL mutation statement.", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", "name": "headers", "value": "HeadersInit", @@ -14862,7 +13471,7 @@ "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", "name": "storefrontApiVersion", "value": "string", @@ -14870,24 +13479,46 @@ "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "variables", - "value": "Record", - "description": "The variables for the GraphQL query statement.", + "name": "displayName", + "value": "string", + "description": "The name of the query for debugging in the Subrequest Profiler.", "isOptional": true } ] }, - "CachingStrategy": { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CachingStrategy", - "value": "AllCacheOptions", - "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", + "NoStoreStrategy": { + "filePath": "/cache/strategies.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "NoStoreStrategy", + "value": "{\n mode: string;\n}", + "description": "", + "members": [ + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "" + } + ] + }, + "AllCacheOptions": { + "filePath": "/cache/strategies.ts", + "name": "AllCacheOptions", + "description": "Override options for a cache strategy.", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "maxAge", "value": "number", @@ -14895,15 +13526,15 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "sMaxAge", "value": "number", @@ -14911,22 +13542,15 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "staleIfError", "value": "number", "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true } - ] + ], + "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" } } } @@ -14975,7 +13599,7 @@ "type": "ScriptProps", "typeDefinitions": { "ScriptProps": { - "filePath": "src/csp/Script.tsx", + "filePath": "/csp/Script.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "ScriptProps", "value": "JSX.IntrinsicElements['script']", @@ -15028,7 +13652,7 @@ "type": "CreateContentSecurityPolicyGeneratedType", "typeDefinitions": { "CreateContentSecurityPolicyGeneratedType": { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "name": "CreateContentSecurityPolicyGeneratedType", "description": "", "params": [ @@ -15037,11 +13661,11 @@ "description": "", "value": "CreateContentSecurityPolicy & ShopProp", "isOptional": true, - "filePath": "src/csp/csp.ts" + "filePath": "/csp/csp.ts" } ], "returns": { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "description": "", "name": "ContentSecurityPolicy", "value": "ContentSecurityPolicy" @@ -15049,190 +13673,190 @@ "value": "export function createContentSecurityPolicy(\n props?: CreateContentSecurityPolicy & ShopProp,\n): ContentSecurityPolicy {\n const nonce = generateNonce();\n const header = createCSPHeader(nonce, props);\n\n const Provider = ({children}: {children: ReactNode}) => {\n return createElement(NonceProvider, {value: nonce}, children);\n };\n\n return {\n nonce,\n header,\n NonceProvider: Provider,\n };\n}" }, "CreateContentSecurityPolicy": { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CreateContentSecurityPolicy", "value": "{\n defaultSrc?: DirectiveValues;\n scriptSrc?: DirectiveValues;\n scriptSrcElem?: DirectiveValues;\n styleSrc?: DirectiveValues;\n imgSrc?: DirectiveValues;\n connectSrc?: DirectiveValues;\n fontSrc?: DirectiveValues;\n objectSrc?: DirectiveValues;\n mediaSrc?: DirectiveValues;\n frameSrc?: DirectiveValues;\n sandbox?: DirectiveValues;\n reportUri?: DirectiveValues;\n childSrc?: DirectiveValues;\n formAction?: DirectiveValues;\n frameAncestors?: DirectiveValues;\n pluginTypes?: DirectiveValues;\n baseUri?: DirectiveValues;\n reportTo?: DirectiveValues;\n workerSrc?: DirectiveValues;\n manifestSrc?: DirectiveValues;\n prefetchSrc?: DirectiveValues;\n navigateTo?: DirectiveValues;\n upgradeInsecureRequests?: boolean;\n blockAllMixedContent?: boolean;\n}", "description": "", "members": [ { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "baseUri", + "name": "defaultSrc", "value": "DirectiveValues", "description": "", "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "blockAllMixedContent", - "value": "boolean", + "name": "scriptSrc", + "value": "DirectiveValues", "description": "", "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "childSrc", + "name": "scriptSrcElem", "value": "DirectiveValues", "description": "", "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "connectSrc", + "name": "styleSrc", "value": "DirectiveValues", "description": "", "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "defaultSrc", + "name": "imgSrc", "value": "DirectiveValues", "description": "", "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "fontSrc", + "name": "connectSrc", "value": "DirectiveValues", "description": "", "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "formAction", + "name": "fontSrc", "value": "DirectiveValues", "description": "", "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "frameAncestors", + "name": "objectSrc", "value": "DirectiveValues", "description": "", "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "frameSrc", + "name": "mediaSrc", "value": "DirectiveValues", "description": "", "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "imgSrc", + "name": "frameSrc", "value": "DirectiveValues", "description": "", "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "manifestSrc", + "name": "sandbox", "value": "DirectiveValues", "description": "", "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "mediaSrc", + "name": "reportUri", "value": "DirectiveValues", "description": "", "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "navigateTo", + "name": "childSrc", "value": "DirectiveValues", "description": "", "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "objectSrc", + "name": "formAction", "value": "DirectiveValues", "description": "", "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "pluginTypes", + "name": "frameAncestors", "value": "DirectiveValues", "description": "", "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "prefetchSrc", + "name": "pluginTypes", "value": "DirectiveValues", "description": "", "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "reportTo", + "name": "baseUri", "value": "DirectiveValues", "description": "", "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "reportUri", + "name": "reportTo", "value": "DirectiveValues", "description": "", "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "sandbox", + "name": "workerSrc", "value": "DirectiveValues", "description": "", "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "scriptSrc", + "name": "manifestSrc", "value": "DirectiveValues", "description": "", "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "scriptSrcElem", + "name": "prefetchSrc", "value": "DirectiveValues", "description": "", "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "styleSrc", + "name": "navigateTo", "value": "DirectiveValues", "description": "", "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", "name": "upgradeInsecureRequests", "value": "boolean", @@ -15240,31 +13864,31 @@ "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "workerSrc", - "value": "DirectiveValues", + "name": "blockAllMixedContent", + "value": "boolean", "description": "", "isOptional": true } ] }, "DirectiveValues": { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "TypeAliasDeclaration", "name": "DirectiveValues", "value": "string[] | string | boolean", "description": "" }, "ShopProp": { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "TypeAliasDeclaration", "name": "ShopProp", "value": "{\n /** Shop specific configurations */\n shop?: ShopifyDomains;\n}", "description": "", "members": [ { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", "name": "shop", "value": "ShopifyDomains", @@ -15274,14 +13898,14 @@ ] }, "ShopifyDomains": { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "TypeAliasDeclaration", "name": "ShopifyDomains", "value": "{\n /** The production shop checkout domain url. */\n checkoutDomain?: string;\n /** The production shop domain url. */\n storeDomain?: string;\n}", "description": "", "members": [ { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", "name": "checkoutDomain", "value": "string", @@ -15289,7 +13913,7 @@ "isOptional": true }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", "name": "storeDomain", "value": "string", @@ -15299,28 +13923,28 @@ ] }, "ContentSecurityPolicy": { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "TypeAliasDeclaration", "name": "ContentSecurityPolicy", "value": "{\n /** A randomly generated nonce string that should be passed to any custom `script` element */\n nonce: string;\n /** The content security policy header */\n header: string;\n NonceProvider: ComponentType<{children: ReactNode}>;\n}", "description": "", "members": [ { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "header", + "name": "nonce", "value": "string", - "description": "The content security policy header" + "description": "A randomly generated nonce string that should be passed to any custom `script` element" }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", - "name": "nonce", + "name": "header", "value": "string", - "description": "A randomly generated nonce string that should be passed to any custom `script` element" + "description": "The content security policy header" }, { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "syntaxKind": "PropertySignature", "name": "NonceProvider", "value": "ComponentType<{children: ReactNode}>", @@ -15375,12 +13999,12 @@ "type": "UseNonceGeneratedType", "typeDefinitions": { "UseNonceGeneratedType": { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "name": "UseNonceGeneratedType", "description": "", "params": [], "returns": { - "filePath": "src/csp/csp.ts", + "filePath": "/csp/csp.ts", "description": "", "name": "", "value": "" @@ -15423,7 +14047,7 @@ "type": "UseCustomerPrivacyGeneratedType", "typeDefinitions": { "UseCustomerPrivacyGeneratedType": { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "name": "UseCustomerPrivacyGeneratedType", "description": "", "params": [ @@ -15431,11 +14055,11 @@ "name": "props", "description": "", "value": "CustomerPrivacyApiProps", - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx" + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx" } ], "returns": { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "description": "", "name": "", "value": "" @@ -15443,29 +14067,36 @@ "value": "export function useCustomerPrivacy(props: CustomerPrivacyApiProps) {\n const {\n withPrivacyBanner = true,\n onVisitorConsentCollected,\n onReady,\n ...consentConfig\n } = props;\n const loadedEvent = useRef(false);\n const scriptStatus = useLoadScript(\n withPrivacyBanner ? CONSENT_API_WITH_BANNER : CONSENT_API,\n {\n attributes: {\n id: 'customer-privacy-api',\n },\n },\n );\n\n useEffect(() => {\n const consentCollectedHandler = (\n event: CustomEvent,\n ) => {\n if (onVisitorConsentCollected) {\n onVisitorConsentCollected(event.detail);\n }\n };\n\n document.addEventListener(\n 'visitorConsentCollected',\n consentCollectedHandler,\n );\n\n return () => {\n document.removeEventListener(\n 'visitorConsentCollected',\n consentCollectedHandler,\n );\n };\n }, [onVisitorConsentCollected]);\n\n useEffect(() => {\n if (scriptStatus !== 'done' || loadedEvent.current) return;\n loadedEvent.current = true;\n\n const {checkoutDomain, storefrontAccessToken} = consentConfig;\n if (!checkoutDomain) logMissingConfig('checkoutDomain');\n if (!storefrontAccessToken) logMissingConfig('storefrontAccessToken');\n\n // validate that the storefront access token is not a server API token\n if (\n storefrontAccessToken.startsWith('shpat_') ||\n storefrontAccessToken.length !== 32\n ) {\n // eslint-disable-next-line no-console\n console.error(\n `[h2:error:useCustomerPrivacy] It looks like you passed a private access token, make sure to use the public token`,\n );\n }\n\n const config: CustomerPrivacyConsentConfig = {\n checkoutRootDomain: checkoutDomain,\n storefrontAccessToken,\n };\n\n if (checkoutDomain) {\n let storefrontRootDomain = window.document.location.host;\n const checkoutDomainParts = checkoutDomain.split('.').reverse();\n const currentDomainParts = storefrontRootDomain.split('.').reverse();\n const sameDomainParts: Array = [];\n checkoutDomainParts.forEach((part, index) => {\n if (part === currentDomainParts[index]) {\n sameDomainParts.push(part);\n }\n });\n\n storefrontRootDomain = sameDomainParts.reverse().join('.');\n\n if (storefrontRootDomain) {\n config.storefrontRootDomain = storefrontRootDomain;\n }\n }\n\n if (withPrivacyBanner && window?.privacyBanner) {\n window.privacyBanner?.loadBanner(config);\n }\n\n if (!window.Shopify?.customerPrivacy) return;\n\n // Override the setTrackingConsent method to include the headless storefront configuration\n const originalSetTrackingConsent =\n window.Shopify.customerPrivacy.setTrackingConsent;\n\n function overrideSetTrackingConsent(\n consent: VisitorConsent,\n callback: (data: {error: string} | undefined) => void,\n ) {\n originalSetTrackingConsent(\n {\n ...consent,\n headlessStorefront: true,\n ...config,\n },\n callback,\n );\n }\n\n window.Shopify.customerPrivacy.setTrackingConsent =\n overrideSetTrackingConsent;\n\n onReady && onReady();\n }, [scriptStatus, withPrivacyBanner, consentConfig]);\n\n return;\n}" }, "CustomerPrivacyApiProps": { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "CustomerPrivacyApiProps", "value": "{\n /** The production shop checkout domain url. */\n checkoutDomain: string;\n /** The storefront access token for the shop. */\n storefrontAccessToken: string;\n /** Whether to load the Shopify privacy banner as configured in Shopify admin. Defaults to true. */\n withPrivacyBanner?: boolean;\n /** Callback to be called when visitor consent is collected. */\n onVisitorConsentCollected?: (consent: VisitorConsentCollected) => void;\n /** Callback to be call when customer privacy api is ready. */\n onReady?: () => void;\n}", "description": "", "members": [ { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", "name": "checkoutDomain", "value": "string", "description": "The production shop checkout domain url." }, { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", - "name": "onReady", - "value": "() => void", - "description": "Callback to be call when customer privacy api is ready.", + "name": "storefrontAccessToken", + "value": "string", + "description": "The storefront access token for the shop." + }, + { + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", + "syntaxKind": "PropertySignature", + "name": "withPrivacyBanner", + "value": "boolean", + "description": "Whether to load the Shopify privacy banner as configured in Shopify admin. Defaults to true.", "isOptional": true }, { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", "name": "onVisitorConsentCollected", "value": "(consent: VisitorConsentCollected) => void", @@ -15473,66 +14104,59 @@ "isOptional": true }, { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", - "name": "storefrontAccessToken", - "value": "string", - "description": "The storefront access token for the shop." - }, - { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", - "syntaxKind": "PropertySignature", - "name": "withPrivacyBanner", - "value": "boolean", - "description": "Whether to load the Shopify privacy banner as configured in Shopify admin. Defaults to true.", + "name": "onReady", + "value": "() => void", + "description": "Callback to be call when customer privacy api is ready.", "isOptional": true } ] }, "VisitorConsentCollected": { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "VisitorConsentCollected", "value": "{\n analyticsAllowed: boolean;\n firstPartyMarketingAllowed: boolean;\n marketingAllowed: boolean;\n preferencesAllowed: boolean;\n saleOfDataAllowed: boolean;\n thirdPartyMarketingAllowed: boolean;\n}", "description": "", "members": [ { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", "name": "analyticsAllowed", "value": "boolean", "description": "" }, { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", "name": "firstPartyMarketingAllowed", "value": "boolean", "description": "" }, { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", "name": "marketingAllowed", "value": "boolean", "description": "" }, { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", "name": "preferencesAllowed", "value": "boolean", "description": "" }, { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", "name": "saleOfDataAllowed", "value": "boolean", "description": "" }, { - "filePath": "src/customer-privacy/ShopifyCustomerPrivacy.tsx", + "filePath": "/customer-privacy/ShopifyCustomerPrivacy.tsx", "syntaxKind": "PropertySignature", "name": "thirdPartyMarketingAllowed", "value": "boolean", @@ -15605,44 +14229,35 @@ "type": "CustomerAccountOptions", "typeDefinitions": { "CustomerAccountOptions": { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CustomerAccountOptions", "value": "{\n /** The client requires a session to persist the auth and refresh token. By default Hydrogen ships with cookie session storage, but you can use [another session storage](https://remix.run/docs/en/main/utils/sessions) implementation. */\n session: HydrogenSession;\n /** Unique UUID prefixed with `shp_` associated with the application, this should be visible in the customer account api settings in the Hydrogen admin channel. Mock.shop doesn't automatically supply customerAccountId. Use `npx shopify hydrogen env pull` to link your store credentials. */\n customerAccountId: string;\n /** The account URL associated with the application, this should be visible in the customer account api settings in the Hydrogen admin channel. Mock.shop doesn't automatically supply customerAccountUrl. Use `npx shopify hydrogen env pull` to link your store credentials. */\n customerAccountUrl: string;\n /** Override the version of the API */\n customerApiVersion?: string;\n /** The object for the current Request. It should be provided by your platform. */\n request: CrossRuntimeRequest;\n /** The waitUntil function is used to keep the current request/response lifecycle alive even after a response has been sent. It should be provided by your platform. */\n waitUntil?: WaitUntil;\n /** This is the route in your app that authorizes the customer after logging in. Make sure to call `customer.authorize()` within the loader on this route. It defaults to `/account/authorize`. */\n authUrl?: string;\n /** Use this method to overwrite the default logged-out redirect behavior. The default handler [throws a redirect](https://remix.run/docs/en/main/utils/redirect#:~:text=!session) to `/account/login` with current path as `return_to` query param. */\n customAuthStatusHandler?: () => DataFunctionValue;\n /** Whether it should print GraphQL errors automatically. Defaults to true */\n logErrors?: boolean | ((error?: Error) => boolean);\n /** UNSTABLE feature, this will eventually goes away. If true then we will exchange customerAccessToken for storefrontCustomerAccessToken. */\n unstableB2b?: boolean;\n}", "description": "", "members": [ { - "filePath": "src/customer/types.ts", - "syntaxKind": "PropertySignature", - "name": "authUrl", - "value": "string", - "description": "This is the route in your app that authorizes the customer after logging in. Make sure to call `customer.authorize()` within the loader on this route. It defaults to `/account/authorize`.", - "isOptional": true - }, - { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "customAuthStatusHandler", - "value": "() => DataFunctionValue", - "description": "Use this method to overwrite the default logged-out redirect behavior. The default handler [throws a redirect](https://remix.run/docs/en/main/utils/redirect#:~:text=!session) to `/account/login` with current path as `return_to` query param.", - "isOptional": true + "name": "session", + "value": "HydrogenSession", + "description": "The client requires a session to persist the auth and refresh token. By default Hydrogen ships with cookie session storage, but you can use [another session storage](https://remix.run/docs/en/main/utils/sessions) implementation." }, { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", "name": "customerAccountId", "value": "string", "description": "Unique UUID prefixed with `shp_` associated with the application, this should be visible in the customer account api settings in the Hydrogen admin channel. Mock.shop doesn't automatically supply customerAccountId. Use `npx shopify hydrogen env pull` to link your store credentials." }, { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", "name": "customerAccountUrl", "value": "string", "description": "The account URL associated with the application, this should be visible in the customer account api settings in the Hydrogen admin channel. Mock.shop doesn't automatically supply customerAccountUrl. Use `npx shopify hydrogen env pull` to link your store credentials." }, { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", "name": "customerApiVersion", "value": "string", @@ -15650,68 +14265,71 @@ "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "logErrors", - "value": "boolean | ((error?: Error) => boolean)", - "description": "Whether it should print GraphQL errors automatically. Defaults to true", + "name": "request", + "value": "CrossRuntimeRequest", + "description": "The object for the current Request. It should be provided by your platform." + }, + { + "filePath": "/customer/types.ts", + "syntaxKind": "PropertySignature", + "name": "waitUntil", + "value": "WaitUntil", + "description": "The waitUntil function is used to keep the current request/response lifecycle alive even after a response has been sent. It should be provided by your platform.", "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "request", - "value": "CrossRuntimeRequest", - "description": "The object for the current Request. It should be provided by your platform." + "name": "authUrl", + "value": "string", + "description": "This is the route in your app that authorizes the customer after logging in. Make sure to call `customer.authorize()` within the loader on this route. It defaults to `/account/authorize`.", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "session", - "value": "HydrogenSession", - "description": "The client requires a session to persist the auth and refresh token. By default Hydrogen ships with cookie session storage, but you can use [another session storage](https://remix.run/docs/en/main/utils/sessions) implementation." + "name": "customAuthStatusHandler", + "value": "() => DataFunctionValue", + "description": "Use this method to overwrite the default logged-out redirect behavior. The default handler [throws a redirect](https://remix.run/docs/en/main/utils/redirect#:~:text=!session) to `/account/login` with current path as `return_to` query param.", + "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "unstableB2b", - "value": "boolean", - "description": "UNSTABLE feature, this will eventually goes away. If true then we will exchange customerAccessToken for storefrontCustomerAccessToken.", + "name": "logErrors", + "value": "boolean | ((error?: Error) => boolean)", + "description": "Whether it should print GraphQL errors automatically. Defaults to true", "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "waitUntil", - "value": "WaitUntil", - "description": "The waitUntil function is used to keep the current request/response lifecycle alive even after a response has been sent. It should be provided by your platform.", + "name": "unstableB2b", + "value": "boolean", + "description": "UNSTABLE feature, this will eventually goes away. If true then we will exchange customerAccessToken for storefrontCustomerAccessToken.", "isOptional": true } ] }, - "DataFunctionValue": { - "filePath": "src/customer/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "DataFunctionValue", - "value": "Response | NonNullable | null", - "description": "" - }, "CrossRuntimeRequest": { - "filePath": "src/utils/request.ts", + "filePath": "/utils/request.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CrossRuntimeRequest", "value": "{\n url?: string;\n method?: string;\n headers: {\n get?: (key: string) => string | null | undefined;\n [key: string]: any;\n };\n}", "description": "", "members": [ { - "filePath": "src/utils/request.ts", + "filePath": "/utils/request.ts", "syntaxKind": "PropertySignature", - "name": "headers", - "value": "{ [key: string]: any; get?: (key: string) => string; }", - "description": "" + "name": "url", + "value": "string", + "description": "", + "isOptional": true }, { - "filePath": "src/utils/request.ts", + "filePath": "/utils/request.ts", "syntaxKind": "PropertySignature", "name": "method", "value": "string", @@ -15719,14 +14337,20 @@ "isOptional": true }, { - "filePath": "src/utils/request.ts", + "filePath": "/utils/request.ts", "syntaxKind": "PropertySignature", - "name": "url", - "value": "string", - "description": "", - "isOptional": true + "name": "headers", + "value": "{ [key: string]: any; get?: (key: string) => string; }", + "description": "" } ] + }, + "DataFunctionValue": { + "filePath": "/customer/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "DataFunctionValue", + "value": "Response | NonNullable | null", + "description": "" } } }, @@ -15736,38 +14360,38 @@ "type": "CustomerAccountForDocs", "typeDefinitions": { "CustomerAccountForDocs": { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CustomerAccountForDocs", "value": "{\n /** Start the OAuth login flow. This function should be called and returned from a Remix action.\n * It redirects the customer to a Shopify login domain. It also defined the final path the customer\n * lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is\n * automatically setup unless `customAuthStatusHandler` option is in use)\n *\n * @param options.uiLocales - The displayed language of the login page. Only support for the following languages:\n * `en`, `fr`, `cs`, `da`, `de`, `es`, `fi`, `it`, `ja`, `ko`, `nb`, `nl`, `pl`, `pt-BR`, `pt-PT`,\n * `sv`, `th`, `tr`, `vi`, `zh-CN`, `zh-TW`. If supplied any other language code, it will default to `en`.\n * */\n login?: (options?: LoginOptions) => Promise;\n /** On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin. */\n authorize?: () => Promise;\n /** Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed. */\n isLoggedIn?: () => Promise;\n /** Check for a not logged in customer and redirect customer to login page. The redirect can be overwritten with `customAuthStatusHandler` option. */\n handleAuthStatus?: () => void | DataFunctionValue;\n /** Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed. */\n getAccessToken?: () => Promise;\n /** Creates the fully-qualified URL to your store's GraphQL endpoint.*/\n getApiUrl?: () => string;\n /** Logout the customer by clearing the session and redirecting to the login domain. It should be called and returned from a Remix action. The path app should redirect to after logout can be setup in Customer Account API settings in admin.\n *\n * @param options.postLogoutRedirectUri - The url to redirect customer to after logout, should be a relative URL. This url will need to included in Customer Account API's application setup for logout URI. The default value is current app origin, which is automatically setup in admin when using `--customer-account-push` flag with dev.\n * */\n logout?: (options?: LogoutOptions) => Promise;\n /** Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query. */\n query?: (\n query: string,\n options: CustomerAccountQueryOptionsForDocs,\n ) => Promise;\n /** Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation. */\n mutate?: (\n mutation: string,\n options: CustomerAccountQueryOptionsForDocs,\n ) => Promise;\n}", "description": "Below are types meant for documentation only. Ensure it stay in sync with the type above.", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "authorize", - "value": "() => Promise", - "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin.", + "name": "login", + "value": "(options?: LoginOptions) => Promise", + "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)", "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getAccessToken", - "value": "() => Promise", - "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed.", + "name": "authorize", + "value": "() => Promise", + "description": "On successful login, the customer redirects back to your app. This function validates the OAuth response and exchanges the authorization code for an access token and refresh token. It also persists the tokens on your session. This function should be called and returned from the Remix loader configured as the redirect URI within the Customer Account API settings in admin.", "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "() => string", - "description": "Creates the fully-qualified URL to your store's GraphQL endpoint.", + "name": "isLoggedIn", + "value": "() => Promise", + "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed.", "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", "name": "handleAuthStatus", "value": "() => void | DataFunctionValue", @@ -15775,23 +14399,23 @@ "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "isLoggedIn", - "value": "() => Promise", - "description": "Returns if the customer is logged in. It also checks if the access token is expired and refreshes it if needed.", + "name": "getAccessToken", + "value": "() => Promise", + "description": "Returns CustomerAccessToken if the customer is logged in. It also run a expiry check and does a token refresh if needed.", "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "login", - "value": "(options?: LoginOptions) => Promise", - "description": "Start the OAuth login flow. This function should be called and returned from a Remix action. It redirects the customer to a Shopify login domain. It also defined the final path the customer lands on at the end of the oAuth flow with the value of the `return_to` query param. (This is automatically setup unless `customAuthStatusHandler` option is in use)", + "name": "getApiUrl", + "value": "() => string", + "description": "Creates the fully-qualified URL to your store's GraphQL endpoint.", "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", "name": "logout", "value": "(options?: LogoutOptions) => Promise", @@ -15799,39 +14423,32 @@ "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: string, options: CustomerAccountQueryOptionsForDocs) => Promise", - "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation.", + "name": "query", + "value": "(query: string, options: CustomerAccountQueryOptionsForDocs) => Promise", + "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query.", "isOptional": true }, { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: string, options: CustomerAccountQueryOptionsForDocs) => Promise", - "description": "Execute a GraphQL query against the Customer Account API. This method execute `handleAuthStatus()` ahead of query.", + "name": "mutate", + "value": "(mutation: string, options: CustomerAccountQueryOptionsForDocs) => Promise", + "description": "Execute a GraphQL mutation against the Customer Account API. This method execute `handleAuthStatus()` ahead of mutation.", "isOptional": true } ] }, - "DataFunctionValue": { - "filePath": "src/customer/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "DataFunctionValue", - "value": "Response | NonNullable | null", - "description": "" - }, "LoginOptions": { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "LoginOptions", "value": "{\n uiLocales?: LanguageCode;\n}", "description": "", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", "name": "uiLocales", "value": "LanguageCode", @@ -15840,15 +14457,22 @@ } ] }, + "DataFunctionValue": { + "filePath": "/customer/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "DataFunctionValue", + "value": "Response | NonNullable | null", + "description": "" + }, "LogoutOptions": { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "LogoutOptions", "value": "{\n postLogoutRedirectUri?: string;\n}", "description": "", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", "name": "postLogoutRedirectUri", "value": "string", @@ -15858,14 +14482,14 @@ ] }, "CustomerAccountQueryOptionsForDocs": { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "CustomerAccountQueryOptionsForDocs", "value": "{\n /** The variables for the GraphQL statement. */\n variables?: Record;\n}", "description": "", "members": [ { - "filePath": "src/customer/types.ts", + "filePath": "/customer/types.ts", "syntaxKind": "PropertySignature", "name": "variables", "value": "Record", @@ -15961,25 +14585,25 @@ "type": "OptimisticInputProps", "typeDefinitions": { "OptimisticInputProps": { - "filePath": "src/optimistic-ui/optimistic-ui.tsx", + "filePath": "/optimistic-ui/optimistic-ui.tsx", "syntaxKind": "TypeAliasDeclaration", "name": "OptimisticInputProps", "value": "{\n /**\n * A unique identifier for the optimistic input. Use the same identifier in `useOptimisticData`\n * to retrieve the optimistic data from actions.\n */\n id: string;\n /**\n * The data to be stored in the optimistic input. Use for creating an optimistic successful state\n * of this form action.\n */\n data: Record;\n}", "description": "", "members": [ { - "filePath": "src/optimistic-ui/optimistic-ui.tsx", - "syntaxKind": "PropertySignature", - "name": "data", - "value": "Record", - "description": "The data to be stored in the optimistic input. Use for creating an optimistic successful state of this form action." - }, - { - "filePath": "src/optimistic-ui/optimistic-ui.tsx", + "filePath": "/optimistic-ui/optimistic-ui.tsx", "syntaxKind": "PropertySignature", "name": "id", "value": "string", "description": "A unique identifier for the optimistic input. Use the same identifier in `useOptimisticData` to retrieve the optimistic data from actions." + }, + { + "filePath": "/optimistic-ui/optimistic-ui.tsx", + "syntaxKind": "PropertySignature", + "name": "data", + "value": "Record", + "description": "The data to be stored in the optimistic input. Use for creating an optimistic successful state of this form action." } ] } @@ -16019,7 +14643,7 @@ "type": "UseOptimisticDataGeneratedType", "typeDefinitions": { "UseOptimisticDataGeneratedType": { - "filePath": "src/optimistic-ui/optimistic-ui.tsx", + "filePath": "/optimistic-ui/optimistic-ui.tsx", "name": "UseOptimisticDataGeneratedType", "description": "", "params": [ @@ -16027,11 +14651,11 @@ "name": "identifier", "description": "", "value": "string", - "filePath": "src/optimistic-ui/optimistic-ui.tsx" + "filePath": "/optimistic-ui/optimistic-ui.tsx" } ], "returns": { - "filePath": "src/optimistic-ui/optimistic-ui.tsx", + "filePath": "/optimistic-ui/optimistic-ui.tsx", "description": "", "name": "", "value": "" @@ -16080,75 +14704,146 @@ "type": "PaginationProps", "typeDefinitions": { "PaginationProps": { - "filePath": "src/pagination/Pagination.ts", + "filePath": "/pagination/Pagination.ts", "syntaxKind": "TypeAliasDeclaration", "name": "PaginationProps", "value": "{\n /** The response from `storefront.query` for a paginated request. Make sure the query is passed pagination variables and that the query has `pageInfo` with `hasPreviousPage`, `hasNextpage`, `startCursor`, and `endCursor` defined. */\n connection: Connection;\n /** A render prop that includes pagination data and helpers. */\n children: PaginationRenderProp;\n}", "description": "", "members": [ { - "filePath": "src/pagination/Pagination.ts", - "syntaxKind": "PropertySignature", - "name": "children", - "value": "PaginationRenderProp", - "description": "A render prop that includes pagination data and helpers." - }, - { - "filePath": "src/pagination/Pagination.ts", + "filePath": "/pagination/Pagination.ts", "syntaxKind": "PropertySignature", "name": "connection", "value": "Connection", "description": "The response from `storefront.query` for a paginated request. Make sure the query is passed pagination variables and that the query has `pageInfo` with `hasPreviousPage`, `hasNextpage`, `startCursor`, and `endCursor` defined." + }, + { + "filePath": "/pagination/Pagination.ts", + "syntaxKind": "PropertySignature", + "name": "children", + "value": "PaginationRenderProp", + "description": "A render prop that includes pagination data and helpers." } ] }, + "Connection": { + "filePath": "/pagination/Pagination.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "Connection", + "value": "{\n nodes: Array;\n pageInfo: PageInfo;\n } | {\n edges: Array<{\n node: NodesType;\n }>;\n pageInfo: PageInfo;\n }", + "description": "" + }, "PaginationRenderProp": { - "filePath": "src/pagination/Pagination.ts", + "filePath": "/pagination/Pagination.ts", "syntaxKind": "TypeAliasDeclaration", "name": "PaginationRenderProp", "value": "FC>", "description": "", "members": [ { - "filePath": "src/pagination/Pagination.ts", + "filePath": "/pagination/Pagination.ts", "syntaxKind": "PropertySignature", - "name": "contextTypes", - "value": "ValidationMap | undefined", + "name": "propTypes", + "value": "WeakValidationMap>", "description": "", "isOptional": true }, { - "filePath": "src/pagination/Pagination.ts", + "filePath": "/pagination/Pagination.ts", "syntaxKind": "PropertySignature", - "name": "defaultProps", - "value": "Partial

| undefined", + "name": "contextTypes", + "value": "ValidationMap", "description": "", "isOptional": true }, { - "filePath": "src/pagination/Pagination.ts", + "filePath": "/pagination/Pagination.ts", "syntaxKind": "PropertySignature", - "name": "displayName", - "value": "string | undefined", + "name": "defaultProps", + "value": "Partial>", "description": "", "isOptional": true }, { - "filePath": "src/pagination/Pagination.ts", + "filePath": "/pagination/Pagination.ts", "syntaxKind": "PropertySignature", - "name": "propTypes", - "value": "WeakValidationMap

| undefined", + "name": "displayName", + "value": "string", "description": "", "isOptional": true } ] }, - "Connection": { - "filePath": "src/pagination/Pagination.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "Connection", - "value": "{\n nodes: Array;\n pageInfo: PageInfo;\n } | {\n edges: Array<{\n node: NodesType;\n }>;\n pageInfo: PageInfo;\n }", - "description": "" + "PaginationInfo": { + "filePath": "/pagination/Pagination.ts", + "name": "PaginationInfo", + "description": "", + "members": [ + { + "filePath": "/pagination/Pagination.ts", + "syntaxKind": "PropertySignature", + "name": "nodes", + "value": "Array", + "description": "The paginated array of nodes. You should map over and render this array." + }, + { + "filePath": "/pagination/Pagination.ts", + "syntaxKind": "PropertySignature", + "name": "NextLink", + "value": "FC & {ref?: Ref}>", + "description": "The `` is a helper component that makes it easy to navigate to the next page of paginated data. Alternatively you can build your own `` component: ``" + }, + { + "filePath": "/pagination/Pagination.ts", + "syntaxKind": "PropertySignature", + "name": "PreviousLink", + "value": "FC & {ref?: Ref}>", + "description": "The `` is a helper component that makes it easy to navigate to the previous page of paginated data. Alternatively you can build your own `` component: ``" + }, + { + "filePath": "/pagination/Pagination.ts", + "syntaxKind": "PropertySignature", + "name": "previousPageUrl", + "value": "string", + "description": "The URL to the previous page of paginated data. Use this prop to build your own `` component." + }, + { + "filePath": "/pagination/Pagination.ts", + "syntaxKind": "PropertySignature", + "name": "nextPageUrl", + "value": "string", + "description": "The URL to the next page of paginated data. Use this prop to build your own `` component." + }, + { + "filePath": "/pagination/Pagination.ts", + "syntaxKind": "PropertySignature", + "name": "hasNextPage", + "value": "boolean", + "description": "True if the cursor has next paginated data" + }, + { + "filePath": "/pagination/Pagination.ts", + "syntaxKind": "PropertySignature", + "name": "hasPreviousPage", + "value": "boolean", + "description": "True if the cursor has previous paginated data" + }, + { + "filePath": "/pagination/Pagination.ts", + "syntaxKind": "PropertySignature", + "name": "isLoading", + "value": "boolean", + "description": "True if we are in the process of fetching another page of data" + }, + { + "filePath": "/pagination/Pagination.ts", + "syntaxKind": "PropertySignature", + "name": "state", + "value": "{ nodes: NodesType[]; pageInfo: { endCursor: string; startCursor: string; hasPreviousPage: boolean; }; }", + "description": "The `state` property is important to use when building your own `` component if you want paginated data to continuously append to the page. This means that every time the user clicks \"Next page\", the next page of data will be apppended inline with the previous page. If you want the whole page to re-render with only the next page results, do not pass the `state` prop to the Remix `` component." + } + ], + "value": "interface PaginationInfo {\n /** The paginated array of nodes. You should map over and render this array. */\n nodes: Array;\n /** The `` is a helper component that makes it easy to navigate to the next page of paginated data. Alternatively you can build your own `` component: `` */\n NextLink: FC & {ref?: Ref}>;\n /** The `` is a helper component that makes it easy to navigate to the previous page of paginated data. Alternatively you can build your own `` component: `` */\n PreviousLink: FC & {ref?: Ref}>;\n /** The URL to the previous page of paginated data. Use this prop to build your own `` component. */\n previousPageUrl: string;\n /** The URL to the next page of paginated data. Use this prop to build your own `` component. */\n nextPageUrl: string;\n /** True if the cursor has next paginated data */\n hasNextPage: boolean;\n /** True if the cursor has previous paginated data */\n hasPreviousPage: boolean;\n /** True if we are in the process of fetching another page of data */\n isLoading: boolean;\n /** The `state` property is important to use when building your own `` component if you want paginated data to continuously append to the page. This means that every time the user clicks \"Next page\", the next page of data will be apppended inline with the previous page. If you want the whole page to re-render with only the next page results, do not pass the `state` prop to the Remix `` component. */\n state: {\n nodes: Array;\n pageInfo: {\n endCursor: Maybe | undefined;\n startCursor: Maybe | undefined;\n hasPreviousPage: boolean;\n };\n };\n}" } } } @@ -16192,7 +14887,7 @@ "type": "GetPaginationVariablesGeneratedType", "typeDefinitions": { "GetPaginationVariablesGeneratedType": { - "filePath": "src/pagination/Pagination.ts", + "filePath": "/pagination/Pagination.ts", "name": "GetPaginationVariablesGeneratedType", "description": "", "params": [ @@ -16200,7 +14895,7 @@ "name": "request", "description": "The request object passed to your Remix loader function.", "value": "Request", - "filePath": "src/pagination/Pagination.ts" + "filePath": "/pagination/Pagination.ts" }, { "name": "options", @@ -16208,11 +14903,11 @@ "value": "{ pageBy: number; }", "isOptional": true, "defaultValue": "{pageBy: 20}", - "filePath": "src/pagination/Pagination.ts" + "filePath": "/pagination/Pagination.ts" } ], "returns": { - "filePath": "src/pagination/Pagination.ts", + "filePath": "/pagination/Pagination.ts", "description": "Variables to be used with the `storefront.query` function", "name": "", "value": "" @@ -16261,75 +14956,75 @@ "type": "VariantSelectorProps", "typeDefinitions": { "VariantSelectorProps": { - "filePath": "src/product/VariantSelector.ts", + "filePath": "/product/VariantSelector.ts", "syntaxKind": "TypeAliasDeclaration", "name": "VariantSelectorProps", "value": "{\n /** The product handle for all of the variants */\n handle: string;\n /** Product options from the [Storefront API](/docs/api/storefront/2024-07/objects/ProductOption). Make sure both `name` and `values` are apart of your query. */\n options: Array> | undefined;\n /** Product variants from the [Storefront API](/docs/api/storefront/2024-07/objects/ProductVariant). You only need to pass this prop if you want to show product availability. If a product option combination is not found within `variants`, it is assumed to be available. Make sure to include `availableForSale` and `selectedOptions.name` and `selectedOptions.value`. */\n variants?:\n | PartialDeep\n | Array>;\n /** By default all products are under /products. Use this prop to provide a custom path. */\n productPath?: string;\n /** Should the VariantSelector wait to update until after the browser navigates to a variant. */\n waitForNavigation?: boolean;\n children: ({option}: {option: VariantOption}) => ReactNode;\n}", "description": "", "members": [ { - "filePath": "src/product/VariantSelector.ts", - "syntaxKind": "PropertySignature", - "name": "children", - "value": "({ option }: { option: VariantOption; }) => ReactNode", - "description": "" - }, - { - "filePath": "src/product/VariantSelector.ts", + "filePath": "/product/VariantSelector.ts", "syntaxKind": "PropertySignature", "name": "handle", "value": "string", "description": "The product handle for all of the variants" }, { - "filePath": "src/product/VariantSelector.ts", + "filePath": "/product/VariantSelector.ts", "syntaxKind": "PropertySignature", "name": "options", - "value": "Array> | undefined", + "value": "PartialObjectDeep[]", "description": "Product options from the [Storefront API](/docs/api/storefront/2024-07/objects/ProductOption). Make sure both `name` and `values` are apart of your query." }, { - "filePath": "src/product/VariantSelector.ts", + "filePath": "/product/VariantSelector.ts", "syntaxKind": "PropertySignature", - "name": "productPath", - "value": "string", - "description": "By default all products are under /products. Use this prop to provide a custom path.", + "name": "variants", + "value": "PartialObjectDeep | PartialObjectDeep[]", + "description": "Product variants from the [Storefront API](/docs/api/storefront/2024-07/objects/ProductVariant). You only need to pass this prop if you want to show product availability. If a product option combination is not found within `variants`, it is assumed to be available. Make sure to include `availableForSale` and `selectedOptions.name` and `selectedOptions.value`.", "isOptional": true }, { - "filePath": "src/product/VariantSelector.ts", + "filePath": "/product/VariantSelector.ts", "syntaxKind": "PropertySignature", - "name": "variants", - "value": "| PartialDeep\n | Array>", - "description": "Product variants from the [Storefront API](/docs/api/storefront/2024-07/objects/ProductVariant). You only need to pass this prop if you want to show product availability. If a product option combination is not found within `variants`, it is assumed to be available. Make sure to include `availableForSale` and `selectedOptions.name` and `selectedOptions.value`.", + "name": "productPath", + "value": "string", + "description": "By default all products are under /products. Use this prop to provide a custom path.", "isOptional": true }, { - "filePath": "src/product/VariantSelector.ts", + "filePath": "/product/VariantSelector.ts", "syntaxKind": "PropertySignature", "name": "waitForNavigation", "value": "boolean", "description": "Should the VariantSelector wait to update until after the browser navigates to a variant.", "isOptional": true + }, + { + "filePath": "/product/VariantSelector.ts", + "syntaxKind": "PropertySignature", + "name": "children", + "value": "({ option }: { option: VariantOption; }) => ReactNode", + "description": "" } ] }, "VariantOption": { - "filePath": "src/product/VariantSelector.ts", + "filePath": "/product/VariantSelector.ts", "syntaxKind": "TypeAliasDeclaration", "name": "VariantOption", "value": "{\n name: string;\n value?: string;\n values: Array;\n}", "description": "", "members": [ { - "filePath": "src/product/VariantSelector.ts", + "filePath": "/product/VariantSelector.ts", "syntaxKind": "PropertySignature", "name": "name", "value": "string", "description": "" }, { - "filePath": "src/product/VariantSelector.ts", + "filePath": "/product/VariantSelector.ts", "syntaxKind": "PropertySignature", "name": "value", "value": "string", @@ -16337,7 +15032,7 @@ "isOptional": true }, { - "filePath": "src/product/VariantSelector.ts", + "filePath": "/product/VariantSelector.ts", "syntaxKind": "PropertySignature", "name": "values", "value": "Array", @@ -16346,49 +15041,49 @@ ] }, "VariantOptionValue": { - "filePath": "src/product/VariantSelector.ts", + "filePath": "/product/VariantSelector.ts", "syntaxKind": "TypeAliasDeclaration", "name": "VariantOptionValue", "value": "{\n value: string;\n isAvailable: boolean;\n to: string;\n search: string;\n isActive: boolean;\n variant?: PartialDeep;\n}", "description": "", "members": [ { - "filePath": "src/product/VariantSelector.ts", + "filePath": "/product/VariantSelector.ts", "syntaxKind": "PropertySignature", - "name": "isActive", - "value": "boolean", + "name": "value", + "value": "string", "description": "" }, { - "filePath": "src/product/VariantSelector.ts", + "filePath": "/product/VariantSelector.ts", "syntaxKind": "PropertySignature", "name": "isAvailable", "value": "boolean", "description": "" }, { - "filePath": "src/product/VariantSelector.ts", + "filePath": "/product/VariantSelector.ts", "syntaxKind": "PropertySignature", - "name": "search", + "name": "to", "value": "string", "description": "" }, { - "filePath": "src/product/VariantSelector.ts", + "filePath": "/product/VariantSelector.ts", "syntaxKind": "PropertySignature", - "name": "to", + "name": "search", "value": "string", "description": "" }, { - "filePath": "src/product/VariantSelector.ts", + "filePath": "/product/VariantSelector.ts", "syntaxKind": "PropertySignature", - "name": "value", - "value": "string", + "name": "isActive", + "value": "boolean", "description": "" }, { - "filePath": "src/product/VariantSelector.ts", + "filePath": "/product/VariantSelector.ts", "syntaxKind": "PropertySignature", "name": "variant", "value": "PartialDeep", @@ -16439,7 +15134,7 @@ "type": "GetSelectedProductOptions", "typeDefinitions": { "GetSelectedProductOptions": { - "filePath": "src/product/VariantSelector.ts", + "filePath": "/product/VariantSelector.ts", "name": "GetSelectedProductOptions", "description": "", "params": [ @@ -16447,11 +15142,11 @@ "name": "request", "description": "", "value": "Request", - "filePath": "src/product/VariantSelector.ts" + "filePath": "/product/VariantSelector.ts" } ], "returns": { - "filePath": "src/product/VariantSelector.ts", + "filePath": "/product/VariantSelector.ts", "description": "", "name": "SelectedOptionInput[]", "value": "SelectedOptionInput[]" @@ -16505,7 +15200,7 @@ "type": "UseOptimisticVariantGeneratedType", "typeDefinitions": { "UseOptimisticVariantGeneratedType": { - "filePath": "src/product/useOptimisticVariant.ts", + "filePath": "/product/useOptimisticVariant.ts", "name": "UseOptimisticVariantGeneratedType", "description": "", "params": [ @@ -16513,17 +15208,17 @@ "name": "selectedVariant", "description": "The `selectedVariant` field queried with `variantBySelectedOptions`.", "value": "SelectedVariant", - "filePath": "src/product/useOptimisticVariant.ts" + "filePath": "/product/useOptimisticVariant.ts" }, { "name": "variants", "description": "The available product variants for the product. This can be an array of variants, a promise that resolves to an array of variants, or an object with a `product` key that contains the variants.", "value": "Variants", - "filePath": "src/product/useOptimisticVariant.ts" + "filePath": "/product/useOptimisticVariant.ts" } ], "returns": { - "filePath": "src/product/useOptimisticVariant.ts", + "filePath": "/product/useOptimisticVariant.ts", "description": "A new product object where the `selectedVariant` property is set to the variant that matches the current URL search params. If no variant is found, the original product object is returned. The `isOptimistic` property is set to `true` if the `selectedVariant` has been optimistically changed.", "name": "OptimisticVariant", "value": "OptimisticVariant" @@ -16531,14 +15226,14 @@ "value": "export function useOptimisticVariant<\n SelectedVariant = OptimisticVariantInput,\n Variants = OptimisticProductVariants,\n>(\n selectedVariant: SelectedVariant,\n variants: Variants,\n): OptimisticVariant {\n const navigation = useNavigation();\n const [resolvedVariants, setResolvedVariants] = useState<\n Array>\n >([]);\n\n useEffect(() => {\n Promise.resolve(variants)\n .then((productWithVariants) => {\n if (productWithVariants) {\n setResolvedVariants(\n productWithVariants instanceof Array\n ? productWithVariants\n : (productWithVariants as PartialDeep).product\n ?.variants?.nodes || [],\n );\n }\n })\n .catch((error) => {\n reportError(\n new Error(\n '[h2:error:useOptimisticVariant] An error occurred while resolving the variants for the optimistic product hook.',\n {\n cause: error,\n },\n ),\n );\n });\n }, [variants]);\n\n if (navigation.state === 'loading') {\n const queryParams = new URLSearchParams(navigation.location.search);\n let reportedError = false;\n\n // Find matching variant\n const matchingVariant = resolvedVariants.find((variant) => {\n if (!variant.selectedOptions) {\n if (!reportedError) {\n reportedError = true;\n reportError(\n new Error(\n '[h2:error:useOptimisticVariant] The optimistic product hook requires your product query to include variants with the selectedOptions field.',\n ),\n );\n }\n return false;\n }\n\n return variant.selectedOptions.every((option) => {\n return queryParams.get(option.name) === option.value;\n });\n });\n\n if (matchingVariant) {\n return {\n ...matchingVariant,\n isOptimistic: true,\n } as OptimisticVariant;\n }\n }\n\n return selectedVariant as OptimisticVariant;\n}" }, "OptimisticVariant": { - "filePath": "src/product/useOptimisticVariant.ts", + "filePath": "/product/useOptimisticVariant.ts", "syntaxKind": "TypeAliasDeclaration", "name": "OptimisticVariant", "value": "T & {\n isOptimistic?: boolean;\n}", "description": "" }, "OptimisticVariantInput": { - "filePath": "src/product/useOptimisticVariant.ts", + "filePath": "/product/useOptimisticVariant.ts", "syntaxKind": "TypeAliasDeclaration", "name": "OptimisticVariantInput", "value": "PartialDeep", @@ -16581,7 +15276,7 @@ "type": "GraphiQLLoader", "typeDefinitions": { "GraphiQLLoader": { - "filePath": "src/routing/graphiql.ts", + "filePath": "/routing/graphiql.ts", "name": "GraphiQLLoader", "description": "", "params": [ @@ -16589,11 +15284,11 @@ "name": "args", "description": "", "value": "LoaderFunctionArgs", - "filePath": "src/routing/graphiql.ts" + "filePath": "/routing/graphiql.ts" } ], "returns": { - "filePath": "src/routing/graphiql.ts", + "filePath": "/routing/graphiql.ts", "description": "", "name": "Promise", "value": "Promise" @@ -16636,7 +15331,7 @@ "type": "StorefrontRedirectGeneratedType", "typeDefinitions": { "StorefrontRedirectGeneratedType": { - "filePath": "src/routing/redirect.ts", + "filePath": "/routing/redirect.ts", "name": "StorefrontRedirectGeneratedType", "description": "Queries the Storefront API to see if there is any redirect created for the current route and performs it. Otherwise, it returns the response passed in the parameters. Useful for conditionally redirecting after a 404 response.", "params": [ @@ -16644,11 +15339,11 @@ "name": "options", "description": "", "value": "StorefrontRedirect", - "filePath": "src/routing/redirect.ts" + "filePath": "/routing/redirect.ts" } ], "returns": { - "filePath": "src/routing/redirect.ts", + "filePath": "/routing/redirect.ts", "description": "", "name": "Promise", "value": "Promise" @@ -16656,37 +15351,28 @@ "value": "export async function storefrontRedirect(\n options: StorefrontRedirect,\n): Promise {\n const {\n storefront,\n request,\n noAdminRedirect,\n matchQueryParams,\n response = new Response('Not Found', {status: 404}),\n } = options;\n\n const url = new URL(request.url);\n const {pathname, searchParams} = url;\n const isSoftNavigation = searchParams.has('_data');\n\n searchParams.delete('redirect');\n searchParams.delete('return_to');\n searchParams.delete('_data');\n\n const redirectFrom = (\n matchQueryParams ? url.toString().replace(url.origin, '') : pathname\n ).toLowerCase();\n\n if (url.pathname === '/admin' && !noAdminRedirect) {\n return createRedirectResponse(\n `${storefront.getShopifyDomain()}/admin`,\n isSoftNavigation,\n searchParams,\n matchQueryParams,\n );\n }\n\n try {\n const {urlRedirects} = await storefront.query<{\n urlRedirects: UrlRedirectConnection;\n }>(REDIRECT_QUERY, {\n // The admin doesn't allow redirects to have a\n // trailing slash, so strip them all off\n variables: {query: 'path:' + redirectFrom.replace(/\\/+$/, '')},\n });\n\n const location = urlRedirects?.edges?.[0]?.node?.target;\n\n if (location) {\n return createRedirectResponse(\n location,\n isSoftNavigation,\n searchParams,\n matchQueryParams,\n );\n }\n\n const redirectTo = getRedirectUrl(request.url);\n\n if (redirectTo) {\n return createRedirectResponse(\n redirectTo,\n isSoftNavigation,\n searchParams,\n matchQueryParams,\n );\n }\n } catch (error) {\n console.error(\n `Failed to fetch redirects from Storefront API for route ${redirectFrom}`,\n error,\n );\n }\n\n return response;\n}" }, "StorefrontRedirect": { - "filePath": "src/routing/redirect.ts", + "filePath": "/routing/redirect.ts", "syntaxKind": "TypeAliasDeclaration", "name": "StorefrontRedirect", "value": "{\n /** The [Storefront client](/docs/api/hydrogen/2024-07/utilities/createstorefrontclient) instance */\n storefront: Storefront;\n /** The [MDN Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object that was passed to the `server.ts` request handler. */\n request: Request;\n /** The [MDN Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) object created by `handleRequest` */\n response?: Response;\n /** By default the `/admin` route is redirected to the Shopify Admin page for the current storefront. Disable this redirect by passing `true`. */\n noAdminRedirect?: boolean;\n /** By default, query parameters are not used to match redirects. Set this to `true` if you'd like redirects to be query parameter sensitive */\n matchQueryParams?: boolean;\n}", "description": "", "members": [ { - "filePath": "src/routing/redirect.ts", - "syntaxKind": "PropertySignature", - "name": "matchQueryParams", - "value": "boolean", - "description": "By default, query parameters are not used to match redirects. Set this to `true` if you'd like redirects to be query parameter sensitive", - "isOptional": true - }, - { - "filePath": "src/routing/redirect.ts", + "filePath": "/routing/redirect.ts", "syntaxKind": "PropertySignature", - "name": "noAdminRedirect", - "value": "boolean", - "description": "By default the `/admin` route is redirected to the Shopify Admin page for the current storefront. Disable this redirect by passing `true`.", - "isOptional": true + "name": "storefront", + "value": "Storefront", + "description": "The [Storefront client](/docs/api/hydrogen/2024-07/utilities/createstorefrontclient) instance" }, { - "filePath": "src/routing/redirect.ts", + "filePath": "/routing/redirect.ts", "syntaxKind": "PropertySignature", "name": "request", "value": "Request", "description": "The [MDN Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object that was passed to the `server.ts` request handler." }, { - "filePath": "src/routing/redirect.ts", + "filePath": "/routing/redirect.ts", "syntaxKind": "PropertySignature", "name": "response", "value": "Response", @@ -16694,235 +15380,236 @@ "isOptional": true }, { - "filePath": "src/routing/redirect.ts", + "filePath": "/routing/redirect.ts", "syntaxKind": "PropertySignature", - "name": "storefront", - "value": "Storefront", - "description": "The [Storefront client](/docs/api/hydrogen/2024-07/utilities/createstorefrontclient) instance" + "name": "noAdminRedirect", + "value": "boolean", + "description": "By default the `/admin` route is redirected to the Shopify Admin page for the current storefront. Disable this redirect by passing `true`.", + "isOptional": true + }, + { + "filePath": "/routing/redirect.ts", + "syntaxKind": "PropertySignature", + "name": "matchQueryParams", + "value": "boolean", + "description": "By default, query parameters are not used to match redirects. Set this to `true` if you'd like redirects to be query parameter sensitive", + "isOptional": true } ] }, "Storefront": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "Storefront", "value": "{\n query: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n query: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontQueries,\n RawGqlString,\n StorefrontCommonExtraParams & Pick,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n mutate: <\n OverrideReturnType extends any = never,\n RawGqlString extends string = string,\n >(\n mutation: RawGqlString,\n ...options: ClientVariablesInRestParams<\n StorefrontMutations,\n RawGqlString,\n StorefrontCommonExtraParams,\n AutoAddedVariableNames\n >\n ) => Promise<\n ClientReturn &\n StorefrontError\n >;\n cache?: Cache;\n CacheNone: typeof CacheNone;\n CacheLong: typeof CacheLong;\n CacheShort: typeof CacheShort;\n CacheCustom: typeof CacheCustom;\n generateCacheControlHeader: typeof generateCacheControlHeader;\n getPublicTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPublicTokenHeaders'];\n getPrivateTokenHeaders: ReturnType<\n typeof createStorefrontUtilities\n >['getPrivateTokenHeaders'];\n getShopifyDomain: ReturnType<\n typeof createStorefrontUtilities\n >['getShopifyDomain'];\n getApiUrl: ReturnType<\n typeof createStorefrontUtilities\n >['getStorefrontApiUrl'];\n i18n: TI18n;\n}", "description": "Interface to interact with the Storefront API.", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "cache", - "value": "Cache", - "description": "", - "isOptional": true + "name": "query", + "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "CacheCustom", - "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", + "name": "mutate", + "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "CacheLong", - "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", - "description": "" + "name": "cache", + "value": "Cache", + "description": "", + "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", "name": "CacheNone", "value": "() => NoStoreStrategy", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "CacheShort", + "name": "CacheLong", "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "generateCacheControlHeader", - "value": "(cacheOptions: AllCacheOptions) => string", + "name": "CacheShort", + "value": "(overrideOptions?: AllCacheOptions) => AllCacheOptions", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getApiUrl", - "value": "(props?: Partial>) => string", + "name": "CacheCustom", + "value": "(overrideOptions: AllCacheOptions) => AllCacheOptions", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getPrivateTokenHeaders", - "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", + "name": "generateCacheControlHeader", + "value": "(cacheOptions: AllCacheOptions) => string", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", "name": "getPublicTokenHeaders", "value": "(props?: Partial> & Pick) => Record", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "getShopifyDomain", - "value": "(props?: Partial>) => string", + "name": "getPrivateTokenHeaders", + "value": "(props?: Partial> & Pick & { buyerIp?: string; }) => Record", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "i18n", - "value": "TI18n", + "name": "getShopifyDomain", + "value": "(props?: Partial>) => string", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "mutate", - "value": "(mutation: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & ClientVariables>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontMutations[RawGqlString][\"variables\"] as Filter>]: StorefrontMutations[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "name": "getApiUrl", + "value": "(props?: Partial>) => string", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "query", - "value": "(query: RawGqlString, ...options: IsOptionalVariables> extends true ? [(StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>)?] : [StorefrontCommonExtraParams & Pick & ClientVariables>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }, Record<\"variables\", RawGqlString extends never ? { [KeyType in keyof ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)]: ({ [KeyType in keyof StorefrontQueries[RawGqlString][\"variables\"] as Filter>]: StorefrontQueries[RawGqlString][\"variables\"][KeyType]; } & Partial>>)[KeyType]; } : { readonly [variable: string]: unknown; }>>]) => Promise & StorefrontError>", + "name": "i18n", + "value": "TI18n", "description": "" } ] }, - "AllCacheOptions": { - "filePath": "src/cache/strategies.ts", - "name": "AllCacheOptions", - "description": "Override options for a cache strategy.", + "StorefrontQueries": { + "filePath": "/storefront.ts", + "name": "StorefrontQueries", + "description": "Maps all the queries found in the project to variables and return types.", + "members": [], + "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + }, + "AutoAddedVariableNames": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "AutoAddedVariableNames", + "value": "'country' | 'language'", + "description": "" + }, + "StorefrontCommonExtraParams": { + "filePath": "/storefront.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "StorefrontCommonExtraParams", + "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", + "description": "", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "maxAge", - "value": "number", - "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", + "name": "headers", + "value": "HeadersInit", + "description": "", "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "mode", + "name": "storefrontApiVersion", "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "sMaxAge", - "value": "number", - "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", - "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleIfError", - "value": "number", - "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", + "description": "", "isOptional": true }, { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true - } - ], - "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" - }, - "NoStoreStrategy": { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "NoStoreStrategy", - "value": "{\n mode: string;\n}", - "description": "", - "members": [ - { - "filePath": "src/cache/strategies.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "mode", + "name": "displayName", "value": "string", - "description": "" + "description": "", + "isOptional": true } ] }, - "StorefrontMutations": { - "filePath": "src/storefront.ts", - "name": "StorefrontMutations", - "description": "Maps all the mutations found in the project to variables and return types.", - "members": [], - "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" - }, - "AutoAddedVariableNames": { - "filePath": "src/storefront.ts", + "StorefrontQueryOptions": { + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "AutoAddedVariableNames", - "value": "'country' | 'language'", + "name": "StorefrontQueryOptions", + "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", "description": "" }, - "StorefrontCommonExtraParams": { - "filePath": "src/storefront.ts", + "CachingStrategy": { + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontCommonExtraParams", - "value": "{\n headers?: HeadersInit;\n storefrontApiVersion?: string;\n displayName?: string;\n}", - "description": "", + "name": "CachingStrategy", + "value": "AllCacheOptions", + "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "displayName", + "name": "mode", "value": "string", - "description": "", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "headers", - "value": "HeadersInit", - "description": "", + "name": "maxAge", + "value": "number", + "description": "The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).", "isOptional": true }, { - "filePath": "src/storefront.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "storefrontApiVersion", - "value": "string", - "description": "", + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "sMaxAge", + "value": "number", + "description": "Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "staleIfError", + "value": "number", + "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", "isOptional": true } ] }, "StorefrontError": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "StorefrontError", "value": "{\n errors?: StorefrontApiErrors;\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", "name": "errors", "value": "StorefrontApiErrors", @@ -16932,43 +15619,50 @@ ] }, "StorefrontApiErrors": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "StorefrontApiErrors", "value": "JsonGraphQLError[] | undefined", "description": "" }, - "JsonGraphQLError": { - "filePath": "src/storefront.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "JsonGraphQLError", - "value": "ReturnType", - "description": "", - "members": [] - }, - "StorefrontQueries": { - "filePath": "src/storefront.ts", - "name": "StorefrontQueries", - "description": "Maps all the queries found in the project to variables and return types.", + "StorefrontMutations": { + "filePath": "/storefront.ts", + "name": "StorefrontMutations", + "description": "Maps all the mutations found in the project to variables and return types.", "members": [], - "value": "export interface StorefrontQueries {\n // Example of how a generated query type looks like:\n // '#graphql query q1 {...}': {return: Q1Query; variables: Q1QueryVariables};\n}" + "value": "export interface StorefrontMutations {\n // Example of how a generated mutation type looks like:\n // '#graphql mutation m1 {...}': {return: M1Mutation; variables: M1MutationVariables};\n}" }, - "StorefrontQueryOptions": { - "filePath": "src/storefront.ts", + "NoStoreStrategy": { + "filePath": "/cache/strategies.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "StorefrontQueryOptions", - "value": "StorefrontCommonExtraParams & {\n query: string;\n mutation?: never;\n cache?: CachingStrategy;\n}", - "description": "" + "name": "NoStoreStrategy", + "value": "{\n mode: string;\n}", + "description": "", + "members": [ + { + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "" + } + ] }, - "CachingStrategy": { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "CachingStrategy", - "value": "AllCacheOptions", - "description": "Use the `CachingStrategy` to define a custom caching mechanism for your data. Or use one of the pre-defined caching strategies: CacheNone, CacheShort, CacheLong.", + "AllCacheOptions": { + "filePath": "/cache/strategies.ts", + "name": "AllCacheOptions", + "description": "Override options for a cache strategy.", "members": [ { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", + "syntaxKind": "PropertySignature", + "name": "mode", + "value": "string", + "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "isOptional": true + }, + { + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "maxAge", "value": "number", @@ -16976,15 +15670,15 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", - "name": "mode", - "value": "string", - "description": "The caching mode, generally `public`, `private`, or `no-store`.", + "name": "staleWhileRevalidate", + "value": "number", + "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "sMaxAge", "value": "number", @@ -16992,42 +15686,35 @@ "isOptional": true }, { - "filePath": "src/cache/strategies.ts", + "filePath": "/cache/strategies.ts", "syntaxKind": "PropertySignature", "name": "staleIfError", "value": "number", "description": "Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).", "isOptional": true - }, - { - "filePath": "src/cache/strategies.ts", - "syntaxKind": "PropertySignature", - "name": "staleWhileRevalidate", - "value": "number", - "description": "Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).", - "isOptional": true } - ] + ], + "value": "export interface AllCacheOptions {\n /**\n * The caching mode, generally `public`, `private`, or `no-store`.\n */\n mode?: string;\n /**\n * The maximum amount of time in seconds that a resource will be considered fresh. See `max-age` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#:~:text=Response%20Directives-,max%2Dage,-The%20max%2Dage).\n */\n maxAge?: number;\n /**\n * Indicate that the cache should serve the stale response in the background while revalidating the cache. See `stale-while-revalidate` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-while-revalidate).\n */\n staleWhileRevalidate?: number;\n /**\n * Similar to `maxAge` but specific to shared caches. See `s-maxage` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#s-maxage).\n */\n sMaxAge?: number;\n /**\n * Indicate that the cache should serve the stale response if an error occurs while revalidating the cache. See `stale-if-error` in the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#stale-if-error).\n */\n staleIfError?: number;\n}" }, "I18nBase": { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "TypeAliasDeclaration", "name": "I18nBase", "value": "{\n language: LanguageCode;\n country: CountryCode;\n}", "description": "", "members": [ { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "country", - "value": "CountryCode", + "name": "language", + "value": "LanguageCode", "description": "" }, { - "filePath": "src/storefront.ts", + "filePath": "/storefront.ts", "syntaxKind": "PropertySignature", - "name": "language", - "value": "LanguageCode", + "name": "country", + "value": "CountryCode", "description": "" } ] @@ -17068,14 +15755,14 @@ "type": "GetSeoMetaTypeForDocs", "typeDefinitions": { "GetSeoMetaTypeForDocs": { - "filePath": "src/seo/getSeoMeta.ts", + "filePath": "/seo/getSeoMeta.ts", "syntaxKind": "TypeAliasDeclaration", "name": "GetSeoMetaTypeForDocs", "value": "{\n /** `getSeoMeta` takes an arbitrary number of configuration object parameters. Values in each object are overwritten based on the object order. \\`jsonLd\\` properties are preserved between each configuration object. */\n seoInputs: SeoConfig[];\n}", "description": "", "members": [ { - "filePath": "src/seo/getSeoMeta.ts", + "filePath": "/seo/getSeoMeta.ts", "syntaxKind": "PropertySignature", "name": "seoInputs", "value": "SeoConfig[]", @@ -17084,16 +15771,24 @@ ] }, "SeoConfig": { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", "name": "SeoConfig", "description": "", "members": [ { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", "syntaxKind": "PropertySignature", - "name": "alternates", - "value": "LanguageAlternate | LanguageAlternate[]", - "description": "The `alternates` property is used to specify the language and geographical targeting when you have multiple versions of the same page in different languages. The `url` property tells search engines about these variations and helps them to serve the correct version to their users.", + "name": "title", + "value": "Maybe", + "description": "The `title` HTML element defines the document's title that is shown in a browser's title bar or a page's tab. It only contains text; tags within the element are ignored.", + "isOptional": true + }, + { + "filePath": "/seo/generate-seo-tags.ts", + "syntaxKind": "PropertySignature", + "name": "titleTemplate", + "value": "string", + "description": "Generate the title from a template that includes a `%s` placeholder for the title.", "isOptional": true, "examples": [ { @@ -17101,7 +15796,27 @@ "description": "", "tabs": [ { - "code": "{\n alternates: [\n {\n language: 'en-US',\n url: 'https://hydrogen.shop/en-us',\n default: true,\n },\n {\n language: 'fr-CA',\n url: 'https://hydrogen.shop/fr-ca',\n },\n ]\n}", + "code": "{\n title: 'My Page',\n titleTemplate: 'My Site - %s',\n}", + "title": "Example" + } + ] + } + ] + }, + { + "filePath": "/seo/generate-seo-tags.ts", + "syntaxKind": "PropertySignature", + "name": "media", + "value": "string | Partial | (string | Partial)[]", + "description": "The media associated with the given page (images, videos, etc). If you pass a string, it will be used as the `og:image` meta tag. If you pass an object or an array of objects, that will be used to generate `og:` meta tags. The `url` property should be the URL of the media. The `height` and `width` properties are optional and should be the height and width of the media. The `altText` property is optional and should be a description of the media.", + "isOptional": true, + "examples": [ + { + "title": "Example", + "description": "", + "tabs": [ + { + "code": "{\n media: [\n {\n url: 'https://example.com/image.jpg',\n type: 'image',\n height: '400',\n width: '400',\n altText: 'A custom snowboard with an alpine color pallet.',\n }\n ]\n}", "title": "Example" } ] @@ -17109,7 +15824,7 @@ ] }, { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", "syntaxKind": "PropertySignature", "name": "description", "value": "Maybe", @@ -17117,7 +15832,15 @@ "isOptional": true }, { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", + "syntaxKind": "PropertySignature", + "name": "url", + "value": "Maybe", + "description": "The canonical URL of the page. This is used to tell search engines which URL is the canonical version of a page. This is useful when you have multiple URLs that point to the same page. The value here will be used in the `rel=\"canonical\"` link tag as well as the `og:url` meta tag.", + "isOptional": true + }, + { + "filePath": "/seo/generate-seo-tags.ts", "syntaxKind": "PropertySignature", "name": "handle", "value": "Maybe", @@ -17137,11 +15860,11 @@ ] }, { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", "syntaxKind": "PropertySignature", "name": "jsonLd", "value": "WithContext | WithContext[]", - "description": "The `jsonLd` property is used to generate the `application/ld+json` script tag. This is used to provide structured data to search engines. The value should be an object that conforms to the schema.org spec. The `type` property should be the type of schema you are using. The `type` property is required and should be one of the following:\n\n- `Product`\n- `ItemList`\n- `Organization`\n- `WebSite`\n- `WebPage`\n- `BlogPosting`\n- `Thing`\n\nThe value is validated via [schema-dts](https://www.npmjs.com/package/schema-dts)", + "description": "The `jsonLd` property is used to generate the `application/ld+json` script tag. This is used to provide structured data to search engines. The value should be an object that conforms to the schema.org spec. The `type` property should be the type of schema you are using. The `type` property is required and should be one of the following:\n\n- `Product` - `ItemList` - `Organization` - `WebSite` - `WebPage` - `BlogPosting` - `Thing`\n\nThe value is validated via [schema-dts](https://www.npmjs.com/package/schema-dts)", "isOptional": true, "examples": [ { @@ -17157,11 +15880,11 @@ ] }, { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", "syntaxKind": "PropertySignature", - "name": "media", - "value": "| Maybe\n | Partial\n | (Partial | Maybe)[]", - "description": "The media associated with the given page (images, videos, etc). If you pass a string, it will be used as the `og:image` meta tag. If you pass an object or an array of objects, that will be used to generate `og:` meta tags. The `url` property should be the URL of the media. The `height` and `width` properties are optional and should be the height and width of the media. The `altText` property is optional and should be a description of the media.", + "name": "alternates", + "value": "LanguageAlternate | LanguageAlternate[]", + "description": "The `alternates` property is used to specify the language and geographical targeting when you have multiple versions of the same page in different languages. The `url` property tells search engines about these variations and helps them to serve the correct version to their users.", "isOptional": true, "examples": [ { @@ -17169,7 +15892,7 @@ "description": "", "tabs": [ { - "code": "{\n media: [\n {\n url: 'https://example.com/image.jpg',\n type: 'image',\n height: '400',\n width: '400',\n altText: 'A custom snowboard with an alpine color pallet.',\n }\n ]\n}", + "code": "{\n alternates: [\n {\n language: 'en-US',\n url: 'https://hydrogen.shop/en-us',\n default: true,\n },\n {\n language: 'fr-CA',\n url: 'https://hydrogen.shop/fr-ca',\n },\n ]\n}", "title": "Example" } ] @@ -17177,157 +15900,121 @@ ] }, { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", "syntaxKind": "PropertySignature", "name": "robots", "value": "RobotsOptions", "description": "The `robots` property is used to specify the robots meta tag. This is used to tell search engines which pages should be indexed and which should not.", "isOptional": true - }, - { - "filePath": "src/seo/generate-seo-tags.ts", - "syntaxKind": "PropertySignature", - "name": "title", - "value": "Maybe", - "description": "The `title` HTML element defines the document's title that is shown in a browser's title bar or a page's tab. It only contains text; tags within the element are ignored.", - "isOptional": true - }, - { - "filePath": "src/seo/generate-seo-tags.ts", - "syntaxKind": "PropertySignature", - "name": "titleTemplate", - "value": "Maybe | null", - "description": "Generate the title from a template that includes a `%s` placeholder for the title.", - "isOptional": true, - "examples": [ - { - "title": "Example", - "description": "", - "tabs": [ - { - "code": "{\n title: 'My Page',\n titleTemplate: 'My Site - %s',\n}", - "title": "Example" - } - ] - } - ] - }, - { - "filePath": "src/seo/generate-seo-tags.ts", - "syntaxKind": "PropertySignature", - "name": "url", - "value": "Maybe", - "description": "The canonical URL of the page. This is used to tell search engines which URL is the canonical version of a page. This is useful when you have multiple URLs that point to the same page. The value here will be used in the `rel=\"canonical\"` link tag as well as the `og:url` meta tag.", - "isOptional": true } ], "value": "export interface SeoConfig {\n /**\n * The `title` HTML element defines the document's title that is shown in a browser's title bar or a page's tab. It\n * only contains text; tags within the element are ignored.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title\n */\n title?: Maybe;\n /**\n * Generate the title from a template that includes a `%s` placeholder for the title.\n *\n * @example\n * ```js\n * {\n * title: 'My Page',\n * titleTemplate: 'My Site - %s',\n * }\n * ```\n */\n titleTemplate?: Maybe | null;\n /**\n * The media associated with the given page (images, videos, etc). If you pass a string, it will be used as the\n * `og:image` meta tag. If you pass an object or an array of objects, that will be used to generate `og:` meta tags. The `url` property should be the URL of the media. The `height` and `width` properties are\n * optional and should be the height and width of the media. The `altText` property is optional and should be a\n * description of the media.\n *\n * @example\n * ```js\n * {\n * media: [\n * {\n * url: 'https://example.com/image.jpg',\n * type: 'image',\n * height: '400',\n * width: '400',\n * altText: 'A custom snowboard with an alpine color pallet.',\n * }\n * ]\n * }\n * ```\n *\n */\n media?:\n | Maybe\n | Partial\n | (Partial | Maybe)[];\n /**\n * The description of the page. This is used in the `name=\"description\"` meta tag as well as the `og:description` meta\n * tag.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta\n */\n description?: Maybe;\n /**\n * The canonical URL of the page. This is used to tell search engines which URL is the canonical version of a page.\n * This is useful when you have multiple URLs that point to the same page. The value here will be used in the\n * `rel=\"canonical\"` link tag as well as the `og:url` meta tag.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link\n */\n url?: Maybe;\n /**\n * The handle is used to generate the `twitter:site` and `twitter:creator` meta tags. Include the `@` symbol in the\n * handle.\n *\n * @example\n * ```js\n * {\n * handle: '@shopify'\n * }\n * ```\n */\n handle?: Maybe;\n /**\n * The `jsonLd` property is used to generate the `application/ld+json` script tag. This is used to provide structured\n * data to search engines. The value should be an object that conforms to the schema.org spec. The `type` property\n * should be the type of schema you are using. The `type` property is required and should be one of the following:\n *\n * - `Product`\n * - `ItemList`\n * - `Organization`\n * - `WebSite`\n * - `WebPage`\n * - `BlogPosting`\n * - `Thing`\n *\n * The value is validated via [schema-dts](https://www.npmjs.com/package/schema-dts)\n *\n * @example\n * ```js\n * {\n * jsonLd: {\n * '@context': 'https://schema.org',\n * '@type': 'Product',\n * name: 'My Product',\n * image: 'https://hydrogen.shop/image.jpg',\n * description: 'A product that is great',\n * sku: '12345',\n * mpn: '12345',\n * brand: {\n * '@type': 'Thing',\n * name: 'My Brand',\n * },\n * aggregateRating: {\n * '@type': 'AggregateRating',\n * ratingValue: '4.5',\n * reviewCount: '100',\n * },\n * offers: {\n * '@type': 'Offer',\n * priceCurrency: 'USD',\n * price: '100',\n * priceValidUntil: '2020-11-05',\n * itemCondition: 'https://schema.org/NewCondition',\n * availability: 'https://schema.org/InStock',\n * seller: {\n * '@type': 'Organization',\n * name: 'My Brand',\n * },\n * },\n * }\n * }\n * ```\n *\n * @see https://schema.org/docs/schemas.html\n * @see https://developers.google.com/search/docs/guides/intro-structured-data\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script\n *\n */\n jsonLd?: WithContext | WithContext[];\n /**\n * The `alternates` property is used to specify the language and geographical targeting when you have multiple\n * versions of the same page in different languages. The `url` property tells search engines about these variations\n * and helps them to serve the correct version to their users.\n *\n * @example\n * ```js\n * {\n * alternates: [\n * {\n * language: 'en-US',\n * url: 'https://hydrogen.shop/en-us',\n * default: true,\n * },\n * {\n * language: 'fr-CA',\n * url: 'https://hydrogen.shop/fr-ca',\n * },\n * ]\n * }\n * ```\n *\n * @see https://support.google.com/webmasters/answer/189077?hl=en\n */\n alternates?: LanguageAlternate | LanguageAlternate[];\n /**\n * The `robots` property is used to specify the robots meta tag. This is used to tell search engines which pages\n * should be indexed and which should not.\n *\n * @see https://developers.google.com/search/reference/robots_meta_tag\n */\n robots?: RobotsOptions;\n}" }, - "LanguageAlternate": { - "filePath": "src/seo/generate-seo-tags.ts", - "name": "LanguageAlternate", + "SeoMedia": { + "filePath": "/seo/generate-seo-tags.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "SeoMedia", + "value": "{\n /**\n * Used to generate og: meta tag\n */\n type: 'image' | 'video' | 'audio';\n /**\n * The url value populates both url and secure_url and is used to infer the og::type meta tag.\n */\n url: Maybe | undefined;\n /**\n * The height in pixels of the media. This is used to generate the og::height meta tag.\n */\n height: Maybe | undefined;\n /**\n * The width in pixels of the media. This is used to generate the og::width meta tag.\n */\n width: Maybe | undefined;\n /**\n * The alt text for the media. This is used to generate the og::alt meta tag.\n */\n altText: Maybe | undefined;\n}", "description": "", "members": [ { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", "syntaxKind": "PropertySignature", - "name": "default", - "value": "boolean", - "description": "Whether the alternate page is the default page. This will add the `x-default` attribution to the language code.", - "isOptional": true + "name": "type", + "value": "\"audio\" | \"video\" | \"image\"", + "description": "Used to generate og: meta tag" }, { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", "syntaxKind": "PropertySignature", - "name": "language", + "name": "url", "value": "string", - "description": "Language code for the alternate page. This is used to generate the hreflang meta tag property." + "description": "The url value populates both url and secure_url and is used to infer the og::type meta tag." }, { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", "syntaxKind": "PropertySignature", - "name": "url", + "name": "height", + "value": "number", + "description": "The height in pixels of the media. This is used to generate the og::height meta tag." + }, + { + "filePath": "/seo/generate-seo-tags.ts", + "syntaxKind": "PropertySignature", + "name": "width", + "value": "number", + "description": "The width in pixels of the media. This is used to generate the og::width meta tag." + }, + { + "filePath": "/seo/generate-seo-tags.ts", + "syntaxKind": "PropertySignature", + "name": "altText", "value": "string", - "description": "The url of the alternate page. This is used to generate the hreflang meta tag property." + "description": "The alt text for the media. This is used to generate the og::alt meta tag." } - ], - "value": "export interface LanguageAlternate {\n /**\n * Language code for the alternate page. This is used to generate the hreflang meta tag property.\n */\n language: string;\n /**\n * Whether the alternate page is the default page. This will add the `x-default` attribution to the language code.\n */\n default?: boolean;\n /**\n * The url of the alternate page. This is used to generate the hreflang meta tag property.\n */\n url: string;\n}" + ] }, - "SeoMedia": { - "filePath": "src/seo/generate-seo-tags.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "SeoMedia", - "value": "{\n /**\n * Used to generate og: meta tag\n */\n type: 'image' | 'video' | 'audio';\n /**\n * The url value populates both url and secure_url and is used to infer the og::type meta tag.\n */\n url: Maybe | undefined;\n /**\n * The height in pixels of the media. This is used to generate the og::height meta tag.\n */\n height: Maybe | undefined;\n /**\n * The width in pixels of the media. This is used to generate the og::width meta tag.\n */\n width: Maybe | undefined;\n /**\n * The alt text for the media. This is used to generate the og::alt meta tag.\n */\n altText: Maybe | undefined;\n}", + "LanguageAlternate": { + "filePath": "/seo/generate-seo-tags.ts", + "name": "LanguageAlternate", "description": "", "members": [ { - "filePath": "src/seo/generate-seo-tags.ts", - "syntaxKind": "PropertySignature", - "name": "altText", - "value": "Maybe | undefined", - "description": "The alt text for the media. This is used to generate the og::alt meta tag." - }, - { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", "syntaxKind": "PropertySignature", - "name": "height", - "value": "Maybe | undefined", - "description": "The height in pixels of the media. This is used to generate the og::height meta tag." + "name": "language", + "value": "string", + "description": "Language code for the alternate page. This is used to generate the hreflang meta tag property." }, { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", "syntaxKind": "PropertySignature", - "name": "type", - "value": "'image' | 'video' | 'audio'", - "description": "Used to generate og: meta tag" + "name": "default", + "value": "boolean", + "description": "Whether the alternate page is the default page. This will add the `x-default` attribution to the language code.", + "isOptional": true }, { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", "syntaxKind": "PropertySignature", "name": "url", - "value": "Maybe | undefined", - "description": "The url value populates both url and secure_url and is used to infer the og::type meta tag." - }, - { - "filePath": "src/seo/generate-seo-tags.ts", - "syntaxKind": "PropertySignature", - "name": "width", - "value": "Maybe | undefined", - "description": "The width in pixels of the media. This is used to generate the og::width meta tag." + "value": "string", + "description": "The url of the alternate page. This is used to generate the hreflang meta tag property." } - ] + ], + "value": "export interface LanguageAlternate {\n /**\n * Language code for the alternate page. This is used to generate the hreflang meta tag property.\n */\n language: string;\n /**\n * Whether the alternate page is the default page. This will add the `x-default` attribution to the language code.\n */\n default?: boolean;\n /**\n * The url of the alternate page. This is used to generate the hreflang meta tag property.\n */\n url: string;\n}" }, "RobotsOptions": { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", "name": "RobotsOptions", "description": "", "members": [ { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", "syntaxKind": "PropertySignature", "name": "maxImagePreview", - "value": "'none' | 'standard' | 'large'", - "description": "Set the maximum size of an image preview for this page in a search results Can be one of the following:\n\n- `none` - No image preview is to be shown.\n- `standard` - A default image preview may be shown.\n- `large` - A larger image preview, up to the width of the viewport, may be shown.\n\nIf no value is specified a default image preview size is used.", + "value": "\"none\" | \"standard\" | \"large\"", + "description": "Set the maximum size of an image preview for this page in a search results Can be one of the following:\n\n- `none` - No image preview is to be shown. - `standard` - A default image preview may be shown. - `large` - A larger image preview, up to the width of the viewport, may be shown.\n\nIf no value is specified a default image preview size is used.", "isOptional": true }, { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", "syntaxKind": "PropertySignature", "name": "maxSnippet", "value": "number", - "description": "A number representing the maximum of amount characters to use as a textual snippet for a search result. This value can also be set to one of the following special values:\n\n- 0 - No snippet is to be shown. Equivalent to nosnippet.\n- 1 - The Search engine will choose the snippet length that it believes is most effective to help users discover your content and direct users to your site\n- -1 - No limit on the number of characters that can be shown in the snippet.", + "description": "A number representing the maximum of amount characters to use as a textual snippet for a search result. This value can also be set to one of the following special values:\n\n- 0 - No snippet is to be shown. Equivalent to nosnippet. - 1 - The Search engine will choose the snippet length that it believes is most effective to help users discover your content and direct users to your site - -1 - No limit on the number of characters that can be shown in the snippet.", "isOptional": true }, { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", "syntaxKind": "PropertySignature", "name": "maxVideoPreview", "value": "number", - "description": "The maximum number of seconds for videos on this page to show in search results. This value can also be set to one of the following special values:\n\n- 0 - A static image may be used with the `maxImagePreview` setting.\n- 1 - There is no limit to the size of the video preview.\n\nThis applies to all forms of search results (at Google: web search, Google Images, Google Videos, Discover, Assistant).", + "description": "The maximum number of seconds for videos on this page to show in search results. This value can also be set to one of the following special values:\n\n- 0 - A static image may be used with the `maxImagePreview` setting. - 1 - There is no limit to the size of the video preview.\n\nThis applies to all forms of search results (at Google: web search, Google Images, Google Videos, Discover, Assistant).", "isOptional": true }, { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", "syntaxKind": "PropertySignature", "name": "noArchive", "value": "boolean", @@ -17335,7 +16022,7 @@ "isOptional": true }, { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", "syntaxKind": "PropertySignature", "name": "noFollow", "value": "boolean", @@ -17343,7 +16030,7 @@ "isOptional": true }, { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", "syntaxKind": "PropertySignature", "name": "noImageIndex", "value": "boolean", @@ -17351,7 +16038,7 @@ "isOptional": true }, { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", "syntaxKind": "PropertySignature", "name": "noIndex", "value": "boolean", @@ -17359,7 +16046,7 @@ "isOptional": true }, { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", "syntaxKind": "PropertySignature", "name": "noSnippet", "value": "boolean", @@ -17367,7 +16054,7 @@ "isOptional": true }, { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", "syntaxKind": "PropertySignature", "name": "noTranslate", "value": "boolean", @@ -17375,7 +16062,7 @@ "isOptional": true }, { - "filePath": "src/seo/generate-seo-tags.ts", + "filePath": "/seo/generate-seo-tags.ts", "syntaxKind": "PropertySignature", "name": "unavailableAfter", "value": "string", @@ -17421,12 +16108,12 @@ "type": "SeoProps", "typeDefinitions": { "SeoProps": { - "filePath": "src/seo/seo.ts", + "filePath": "/seo/seo.ts", "name": "SeoProps", "description": "", "members": [ { - "filePath": "src/seo/seo.ts", + "filePath": "/seo/seo.ts", "syntaxKind": "PropertySignature", "name": "debug", "value": "boolean", diff --git a/packages/hydrogen/src/cache/create-with-cache.doc.ts b/packages/hydrogen/src/cache/create-with-cache.doc.ts index 81e2ec43b..565261fe2 100644 --- a/packages/hydrogen/src/cache/create-with-cache.doc.ts +++ b/packages/hydrogen/src/cache/create-with-cache.doc.ts @@ -6,7 +6,7 @@ const data: ReferenceEntityTemplateSchema = { subCategory: 'caching', isVisualComponent: false, related: [], - description: `Creates a utility function that executes an asynchronous operation \n like \`fetch\` and caches the result according to the strategy provided.\nUse this to call any third-party APIs from loaders or actions.`, + description: `Creates a utility function that executes an asynchronous operation \n like \`fetch\` and caches the result according to the strategy provided.\nUse this to call any third-party APIs from loaders or actions.\n > Note:\n > Sometimes a request to a third-party API might fail, so you shouldn't cache the result. To prevent caching, throw when a request fails. If you don't throw, then the result is cached.`, type: 'utility', defaultExample: { description: 'I am the default example', diff --git a/packages/hydrogen/src/cache/create-with-cache.example.js b/packages/hydrogen/src/cache/create-with-cache.example.js index 34a6df2de..927d4090d 100644 --- a/packages/hydrogen/src/cache/create-with-cache.example.js +++ b/packages/hydrogen/src/cache/create-with-cache.example.js @@ -22,7 +22,8 @@ export default { body: query, }); - // Throw if the response is unsuccessful + // Throw if the response is unsuccessful. + // This is important to prevent the results from being cached. if (!response.ok) throw new Error(response.statusText); // Assuming the API returns errors in the body: diff --git a/packages/hydrogen/src/cache/create-with-cache.example.ts b/packages/hydrogen/src/cache/create-with-cache.example.ts index 95aa42896..895d4c3cf 100644 --- a/packages/hydrogen/src/cache/create-with-cache.example.ts +++ b/packages/hydrogen/src/cache/create-with-cache.example.ts @@ -26,7 +26,8 @@ export default { body: query, }); - // Throw if the response is unsuccessful + // Throw if the response is unsuccessful. + // This is important to prevent the results from being cached. if (!response.ok) throw new Error(response.statusText); const {data, error} = (await response.json()) as { diff --git a/packages/hydrogen/src/cache/create-with-cache.ts b/packages/hydrogen/src/cache/create-with-cache.ts index dbea1d21d..cccf4d943 100644 --- a/packages/hydrogen/src/cache/create-with-cache.ts +++ b/packages/hydrogen/src/cache/create-with-cache.ts @@ -22,12 +22,15 @@ type CreateWithCacheOptions = { * like `fetch` and caches the result according to the strategy provided. * Use this to call any third-party APIs from loaders or actions. * + * > Note: + * > Sometimes a request to a third-party API might fail, so you shouldn't cache the result. + * > To prevent caching, throw when a request fails. If you don't throw, then the result is cached. */ -export function createWithCache({ - cache, - waitUntil, - request, -}: CreateWithCacheOptions): CreateWithCacheReturn { +export function createWithCache( + cacheOptions: CreateWithCacheOptions, +): CreateWithCacheReturn { + const {cache, waitUntil, request} = cacheOptions; + return function withCache( cacheKey: CacheKey, strategy: CachingStrategy, From fae3123c9df1d8c363c4576c2addbf0040a7453e Mon Sep 17 00:00:00 2001 From: Bret Little Date: Mon, 29 Jul 2024 12:45:51 -0400 Subject: [PATCH 02/97] Fix the node example to not use the oxygen package (#2354) * Fix the node example to not use the oxygen package * Fix express TS env --- examples/express/app/routes/products.$handle.tsx | 2 +- examples/express/env.d.ts | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/express/app/routes/products.$handle.tsx b/examples/express/app/routes/products.$handle.tsx index de3040032..b50323fd9 100644 --- a/examples/express/app/routes/products.$handle.tsx +++ b/examples/express/app/routes/products.$handle.tsx @@ -1,4 +1,4 @@ -import {json, type LoaderFunctionArgs} from '@shopify/remix-oxygen'; +import {json, type LoaderFunctionArgs} from '@remix-run/node'; import {useLoaderData} from '@remix-run/react'; export async function loader({params, context}: LoaderFunctionArgs) { diff --git a/examples/express/env.d.ts b/examples/express/env.d.ts index fd1019903..862f7beb2 100644 --- a/examples/express/env.d.ts +++ b/examples/express/env.d.ts @@ -1,6 +1,5 @@ /// -/// -/// +/// // Enhance TypeScript's built-in typings. import '@total-typescript/ts-reset'; @@ -34,7 +33,7 @@ declare global { } } -declare module '@shopify/remix-oxygen' { +declare module '@remix-run/node' { /** * Declare local additions to the Remix loader context. */ From bd043234dffc883b0898868eee256af0b273eb61 Mon Sep 17 00:00:00 2001 From: Michelle Chen Date: Mon, 29 Jul 2024 16:04:22 -0400 Subject: [PATCH 03/97] looks like there were 2024-01 links that didnt get updated to 2024-04 and therefore also missed when we did 2024-07 update (#2369) --- packages/hydrogen/src/cache/CacheCustom.doc.ts | 8 ++++---- packages/hydrogen/src/cache/CacheLong.doc.ts | 8 ++++---- packages/hydrogen/src/cache/CacheNone.doc.ts | 8 ++++---- packages/hydrogen/src/cache/CacheShort.doc.ts | 8 ++++---- packages/hydrogen/src/cache/InMemoryCache.doc.ts | 2 +- packages/hydrogen/src/seo/seo.ts | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/hydrogen/src/cache/CacheCustom.doc.ts b/packages/hydrogen/src/cache/CacheCustom.doc.ts index 585c44a0c..68dfc743c 100644 --- a/packages/hydrogen/src/cache/CacheCustom.doc.ts +++ b/packages/hydrogen/src/cache/CacheCustom.doc.ts @@ -9,22 +9,22 @@ const data: ReferenceEntityTemplateSchema = { { name: 'createStorefrontClient', type: 'utilities', - url: '/docs/api/hydrogen/2024-01/utilities/createstorefrontclient', + url: '/docs/api/hydrogen/2024-07/utilities/createstorefrontclient', }, { name: 'CacheNone', type: 'utilities', - url: '/docs/api/hydrogen/2024-01/utilities/cachenone', + url: '/docs/api/hydrogen/2024-07/utilities/cachenone', }, { name: 'CacheShort', type: 'utilities', - url: '/docs/api/hydrogen/2024-01/utilities/cacheshort', + url: '/docs/api/hydrogen/2024-07/utilities/cacheshort', }, { name: 'CacheLong', type: 'utilities', - url: '/docs/api/hydrogen/2024-01/utilities/cachelong', + url: '/docs/api/hydrogen/2024-07/utilities/cachelong', }, ], description: `This allows you to create your own caching strategy, using any of the options available in a \`CachingStrategy\` object. diff --git a/packages/hydrogen/src/cache/CacheLong.doc.ts b/packages/hydrogen/src/cache/CacheLong.doc.ts index f77749c41..797e4e875 100644 --- a/packages/hydrogen/src/cache/CacheLong.doc.ts +++ b/packages/hydrogen/src/cache/CacheLong.doc.ts @@ -9,22 +9,22 @@ const data: ReferenceEntityTemplateSchema = { { name: 'createStorefrontClient', type: 'utilities', - url: '/docs/api/hydrogen/2024-01/utilities/createstorefrontclient', + url: '/docs/api/hydrogen/2024-07/utilities/createstorefrontclient', }, { name: 'CacheNone', type: 'utilities', - url: '/docs/api/hydrogen/2024-01/utilities/cachenone', + url: '/docs/api/hydrogen/2024-07/utilities/cachenone', }, { name: 'CacheShort', type: 'utilities', - url: '/docs/api/hydrogen/2024-01/utilities/cacheshort', + url: '/docs/api/hydrogen/2024-07/utilities/cacheshort', }, { name: 'CacheCustom', type: 'utilities', - url: '/docs/api/hydrogen/2024-01/utilities/cachecustom', + url: '/docs/api/hydrogen/2024-07/utilities/cachecustom', }, ], description: `The \`CacheLong\` strategy instructs caches to store data for 1 hour, and \`staleWhileRevalidate\` data for an additional 23 hours. Note: these time values are subject to change. diff --git a/packages/hydrogen/src/cache/CacheNone.doc.ts b/packages/hydrogen/src/cache/CacheNone.doc.ts index 445816305..c74e8fbde 100644 --- a/packages/hydrogen/src/cache/CacheNone.doc.ts +++ b/packages/hydrogen/src/cache/CacheNone.doc.ts @@ -9,22 +9,22 @@ const data: ReferenceEntityTemplateSchema = { { name: 'createStorefrontClient', type: 'utilities', - url: '/docs/api/hydrogen/2024-01/utilities/createstorefrontclient', + url: '/docs/api/hydrogen/2024-07/utilities/createstorefrontclient', }, { name: 'CacheShort', type: 'utilities', - url: '/docs/api/hydrogen/2024-01/utilities/cacheshort', + url: '/docs/api/hydrogen/2024-07/utilities/cacheshort', }, { name: 'CacheLong', type: 'utilities', - url: '/docs/api/hydrogen/2024-01/utilities/cachelong', + url: '/docs/api/hydrogen/2024-07/utilities/cachelong', }, { name: 'CacheCustom', type: 'utilities', - url: '/docs/api/hydrogen/2024-01/utilities/cachecustom', + url: '/docs/api/hydrogen/2024-07/utilities/cachecustom', }, ], description: `The CacheNone() strategy instructs caches not to store any data. The function accepts no arguments. diff --git a/packages/hydrogen/src/cache/CacheShort.doc.ts b/packages/hydrogen/src/cache/CacheShort.doc.ts index 643dc3f6e..7489b9372 100644 --- a/packages/hydrogen/src/cache/CacheShort.doc.ts +++ b/packages/hydrogen/src/cache/CacheShort.doc.ts @@ -9,22 +9,22 @@ const data: ReferenceEntityTemplateSchema = { { name: 'createStorefrontClient', type: 'utilities', - url: '/docs/api/hydrogen/2024-01/utilities/createstorefrontclient', + url: '/docs/api/hydrogen/2024-07/utilities/createstorefrontclient', }, { name: 'CacheNone', type: 'utilities', - url: '/docs/api/hydrogen/2024-01/utilities/cachenone', + url: '/docs/api/hydrogen/2024-07/utilities/cachenone', }, { name: 'CacheLong', type: 'utilities', - url: '/docs/api/hydrogen/2024-01/utilities/cachelong', + url: '/docs/api/hydrogen/2024-07/utilities/cachelong', }, { name: 'CacheCustom', type: 'utilities', - url: '/docs/api/hydrogen/2024-01/utilities/cachecustom', + url: '/docs/api/hydrogen/2024-07/utilities/cachecustom', }, ], description: `The \`CacheShort\` strategy instructs caches to store data for 1 second, and \`staleWhileRevalidate\` data for an additional 9 seconds. Note: these time values are subject to change. diff --git a/packages/hydrogen/src/cache/InMemoryCache.doc.ts b/packages/hydrogen/src/cache/InMemoryCache.doc.ts index 04a31434d..61c198dd5 100644 --- a/packages/hydrogen/src/cache/InMemoryCache.doc.ts +++ b/packages/hydrogen/src/cache/InMemoryCache.doc.ts @@ -9,7 +9,7 @@ const data: ReferenceEntityTemplateSchema = { { name: 'createStorefrontClient', type: 'utilities', - url: '/docs/api/hydrogen/2024-01/utilities/createstorefrontclient', + url: '/docs/api/hydrogen/2024-07/utilities/createstorefrontclient', }, ], diff --git a/packages/hydrogen/src/seo/seo.ts b/packages/hydrogen/src/seo/seo.ts index a1e0a8766..229b15cb9 100644 --- a/packages/hydrogen/src/seo/seo.ts +++ b/packages/hydrogen/src/seo/seo.ts @@ -40,7 +40,7 @@ export function Seo({debug}: SeoProps) { const location = useLocation(); console.warn( - '[h2:warn:Seo] The `` component is deprecated. Use `getSeoMeta` instead.\nSee: https://shopify.dev/docs/api/hydrogen/2024-01/utilities/getseometa', + '[h2:warn:Seo] The `` component is deprecated. Use `getSeoMeta` instead.\nSee: https://shopify.dev/docs/api/hydrogen/2024-07/utilities/getseometa', ); // Capture the seo and jsonLd configs from the route matches From c7e757075b12de9abdb1aeb95b0b998387c90701 Mon Sep 17 00:00:00 2001 From: Michelle Chen Date: Mon, 29 Jul 2024 16:09:09 -0400 Subject: [PATCH 04/97] refactor pagination pre & next behaviour into a re-usable component (#2375) --- .changeset/brown-news-nail.md | 6 +++ .../components/PaginatedResourceSection.tsx | 42 +++++++++++++++++++ .../app/routes/account.orders._index.tsx | 24 +++-------- .../app/routes/blogs.$blogHandle._index.tsx | 35 +++++----------- .../skeleton/app/routes/blogs._index.tsx | 41 +++++++----------- .../app/routes/collections.$handle.tsx | 42 ++++++------------- .../app/routes/collections._index.tsx | 40 ++++++------------ .../skeleton/app/routes/collections.all.tsx | 40 ++++-------------- 8 files changed, 112 insertions(+), 158 deletions(-) create mode 100644 .changeset/brown-news-nail.md create mode 100644 templates/skeleton/app/components/PaginatedResourceSection.tsx diff --git a/.changeset/brown-news-nail.md b/.changeset/brown-news-nail.md new file mode 100644 index 000000000..eebf1cf5e --- /dev/null +++ b/.changeset/brown-news-nail.md @@ -0,0 +1,6 @@ +--- +'skeleton': patch +'@shopify/create-hydrogen': patch +--- + +Refactor pagination previous & next behaviour into a re-usable component. diff --git a/templates/skeleton/app/components/PaginatedResourceSection.tsx b/templates/skeleton/app/components/PaginatedResourceSection.tsx new file mode 100644 index 000000000..599f1ac8f --- /dev/null +++ b/templates/skeleton/app/components/PaginatedResourceSection.tsx @@ -0,0 +1,42 @@ +import * as React from 'react'; +import {Pagination} from '@shopify/hydrogen'; + +/** + * is a component that encapsulate how the previous and next behaviors throughout your application. + */ + +export function PaginatedResourceSection({ + connection, + children, + resourcesClassName, +}: { + connection: React.ComponentProps>['connection']; + children: React.FunctionComponent<{node: NodesType; index: number}>; + resourcesClassName?: string; +}) { + return ( + + {({nodes, isLoading, PreviousLink, NextLink}) => { + const resoucesMarkup = nodes.map((node, index) => + children({node, index}), + ); + + return ( +

+ + {isLoading ? 'Loading...' : ↑ Load previous} + + {resourcesClassName ? ( +
{resoucesMarkup}
+ ) : ( + resoucesMarkup + )} + + {isLoading ? 'Loading...' : Load more ↓} + +
+ ); + }} + + ); +} diff --git a/templates/skeleton/app/routes/account.orders._index.tsx b/templates/skeleton/app/routes/account.orders._index.tsx index 76ae6a63a..825a6e263 100644 --- a/templates/skeleton/app/routes/account.orders._index.tsx +++ b/templates/skeleton/app/routes/account.orders._index.tsx @@ -1,16 +1,16 @@ import {Link, useLoaderData, type MetaFunction} from '@remix-run/react'; import { Money, - Pagination, getPaginationVariables, flattenConnection, } from '@shopify/hydrogen'; -import {json, redirect, type LoaderFunctionArgs} from '@shopify/remix-oxygen'; +import {json, type LoaderFunctionArgs} from '@shopify/remix-oxygen'; import {CUSTOMER_ORDERS_QUERY} from '~/graphql/customer-account/CustomerOrdersQuery'; import type { CustomerOrdersFragment, OrderItemFragment, } from 'customer-accountapi.generated'; +import {PaginatedResourceSection} from '~/components/PaginatedResourceSection'; export const meta: MetaFunction = () => { return [{title: 'Orders'}]; @@ -51,23 +51,9 @@ function OrdersTable({orders}: Pick) { return (
{orders?.nodes.length ? ( - - {({nodes, isLoading, PreviousLink, NextLink}) => { - return ( - <> - - {isLoading ? 'Loading...' : ↑ Load previous} - - {nodes.map((order) => { - return ; - })} - - {isLoading ? 'Loading...' : Load more ↓} - - - ); - }} - + + {({node: order}) => } + ) : ( )} diff --git a/templates/skeleton/app/routes/blogs.$blogHandle._index.tsx b/templates/skeleton/app/routes/blogs.$blogHandle._index.tsx index 7641796a4..9d9de5a82 100644 --- a/templates/skeleton/app/routes/blogs.$blogHandle._index.tsx +++ b/templates/skeleton/app/routes/blogs.$blogHandle._index.tsx @@ -1,7 +1,8 @@ import {defer, type LoaderFunctionArgs} from '@shopify/remix-oxygen'; import {Link, useLoaderData, type MetaFunction} from '@remix-run/react'; -import {Image, Pagination, getPaginationVariables} from '@shopify/hydrogen'; +import {Image, getPaginationVariables} from '@shopify/hydrogen'; import type {ArticleItemFragment} from 'storefrontapi.generated'; +import {PaginatedResourceSection} from '~/components/PaginatedResourceSection'; export const meta: MetaFunction = ({data}) => { return [{title: `Hydrogen | ${data?.blog.title ?? ''} blog`}]; @@ -68,29 +69,15 @@ export default function Blog() {

{blog.title}

- - {({nodes, isLoading, PreviousLink, NextLink}) => { - return ( - <> - - {isLoading ? 'Loading...' : ↑ Load previous} - - {nodes.map((article, index) => { - return ( - - ); - })} - - {isLoading ? 'Loading...' : Load more ↓} - - - ); - }} - + + {({node: article, index}) => ( + + )} +
); diff --git a/templates/skeleton/app/routes/blogs._index.tsx b/templates/skeleton/app/routes/blogs._index.tsx index 038002277..e5c9ce8b4 100644 --- a/templates/skeleton/app/routes/blogs._index.tsx +++ b/templates/skeleton/app/routes/blogs._index.tsx @@ -1,6 +1,7 @@ import {defer, type LoaderFunctionArgs} from '@shopify/remix-oxygen'; import {Link, useLoaderData, type MetaFunction} from '@remix-run/react'; -import {Pagination, getPaginationVariables} from '@shopify/hydrogen'; +import {getPaginationVariables} from '@shopify/hydrogen'; +import {PaginatedResourceSection} from '~/components/PaginatedResourceSection'; export const meta: MetaFunction = () => { return [{title: `Hydrogen | Blogs`}]; @@ -53,32 +54,18 @@ export default function Blogs() {

Blogs

- - {({nodes, isLoading, PreviousLink, NextLink}) => { - return ( - <> - - {isLoading ? 'Loading...' : ↑ Load previous} - - {nodes.map((blog) => { - return ( - -

{blog.title}

- - ); - })} - - {isLoading ? 'Loading...' : Load more ↓} - - - ); - }} -
+ + {({node: blog}) => ( + +

{blog.title}

+ + )} +
); diff --git a/templates/skeleton/app/routes/collections.$handle.tsx b/templates/skeleton/app/routes/collections.$handle.tsx index cfb329bdd..f7e4a78bf 100644 --- a/templates/skeleton/app/routes/collections.$handle.tsx +++ b/templates/skeleton/app/routes/collections.$handle.tsx @@ -1,7 +1,6 @@ import {defer, redirect, type LoaderFunctionArgs} from '@shopify/remix-oxygen'; import {useLoaderData, Link, type MetaFunction} from '@remix-run/react'; import { - Pagination, getPaginationVariables, Image, Money, @@ -9,6 +8,7 @@ import { } from '@shopify/hydrogen'; import type {ProductItemFragment} from 'storefrontapi.generated'; import {useVariantUrl} from '~/lib/variants'; +import {PaginatedResourceSection} from '~/components/PaginatedResourceSection'; export const meta: MetaFunction = ({data}) => { return [{title: `Hydrogen | ${data?.collection.title ?? ''} Collection`}]; @@ -77,20 +77,18 @@ export default function Collection() {

{collection.title}

{collection.description}

- - {({nodes, isLoading, PreviousLink, NextLink}) => ( - <> - - {isLoading ? 'Loading...' : ↑ Load previous} - - -
- - {isLoading ? 'Loading...' : Load more ↓} - - + + {({node: product, index}) => ( + )} -
+ - {products.map((product, index) => { - return ( - - ); - })} -
- ); -} - function ProductItem({ product, loading, diff --git a/templates/skeleton/app/routes/collections._index.tsx b/templates/skeleton/app/routes/collections._index.tsx index 529ce8ddc..2d7d7ebe9 100644 --- a/templates/skeleton/app/routes/collections._index.tsx +++ b/templates/skeleton/app/routes/collections._index.tsx @@ -1,7 +1,8 @@ import {useLoaderData, Link} from '@remix-run/react'; import {defer, type LoaderFunctionArgs} from '@shopify/remix-oxygen'; -import {Pagination, getPaginationVariables, Image} from '@shopify/hydrogen'; +import {getPaginationVariables, Image} from '@shopify/hydrogen'; import type {CollectionFragment} from 'storefrontapi.generated'; +import {PaginatedResourceSection} from '~/components/PaginatedResourceSection'; export async function loader(args: LoaderFunctionArgs) { // Start fetching non-critical data without blocking time to first byte @@ -47,33 +48,18 @@ export default function Collections() { return (

Collections

- - {({nodes, isLoading, PreviousLink, NextLink}) => ( -
- - {isLoading ? 'Loading...' : ↑ Load previous} - - - - {isLoading ? 'Loading...' : Load more ↓} - -
+ + {({node: collection, index}) => ( + )} -
-
- ); -} - -function CollectionsGrid({collections}: {collections: CollectionFragment[]}) { - return ( -
- {collections.map((collection, index) => ( - - ))} +
); } diff --git a/templates/skeleton/app/routes/collections.all.tsx b/templates/skeleton/app/routes/collections.all.tsx index 817c513fc..4b5cd0e02 100644 --- a/templates/skeleton/app/routes/collections.all.tsx +++ b/templates/skeleton/app/routes/collections.all.tsx @@ -1,13 +1,9 @@ import {defer, type LoaderFunctionArgs} from '@shopify/remix-oxygen'; import {useLoaderData, Link, type MetaFunction} from '@remix-run/react'; -import { - Pagination, - getPaginationVariables, - Image, - Money, -} from '@shopify/hydrogen'; +import {getPaginationVariables, Image, Money} from '@shopify/hydrogen'; import type {ProductItemFragment} from 'storefrontapi.generated'; import {useVariantUrl} from '~/lib/variants'; +import {PaginatedResourceSection} from '~/components/PaginatedResourceSection'; export const meta: MetaFunction = () => { return [{title: `Hydrogen | Products`}]; @@ -57,36 +53,18 @@ export default function Collection() { return (

Products

- - {({nodes, isLoading, PreviousLink, NextLink}) => ( - <> - - {isLoading ? 'Loading...' : ↑ Load previous} - - -
- - {isLoading ? 'Loading...' : Load more ↓} - - - )} -
-
- ); -} - -function ProductsGrid({products}: {products: ProductItemFragment[]}) { - return ( -
- {products.map((product, index) => { - return ( + + {({node: product, index}) => ( - ); - })} + )} +
); } From cfbfc827e40e7425cf213a099eafb7a581b2885f Mon Sep 17 00:00:00 2001 From: Bret Little Date: Tue, 30 Jul 2024 10:17:05 -0400 Subject: [PATCH 05/97] Improve performance of currency formatting by caching underlying Intl.NumberFormat objects (#2372) --- .changeset/eleven-wasps-mix.md | 5 ++ packages/hydrogen-react/src/useMoney.tsx | 79 ++++++++++++++---------- 2 files changed, 50 insertions(+), 34 deletions(-) create mode 100644 .changeset/eleven-wasps-mix.md diff --git a/.changeset/eleven-wasps-mix.md b/.changeset/eleven-wasps-mix.md new file mode 100644 index 000000000..f3a301d22 --- /dev/null +++ b/.changeset/eleven-wasps-mix.md @@ -0,0 +1,5 @@ +--- +'@shopify/hydrogen-react': patch +--- + +Improve performance of currency formatting diff --git a/packages/hydrogen-react/src/useMoney.tsx b/packages/hydrogen-react/src/useMoney.tsx index 91fb3402c..21d89567b 100644 --- a/packages/hydrogen-react/src/useMoney.tsx +++ b/packages/hydrogen-react/src/useMoney.tsx @@ -115,38 +115,41 @@ export function useMoney(money: MoneyV2): UseMoneyValue { const amount = parseFloat(money.amount); - const options = useMemo( - () => ({ + const { + defaultFormatter, + nameFormatter, + narrowSymbolFormatter, + withoutTrailingZerosFormatter, + withoutCurrencyFormatter, + withoutTrailingZerosOrCurrencyFormatter, + } = useMemo(() => { + const options = { style: 'currency' as const, currency: money.currencyCode, - }), - [money.currencyCode], - ); - - const defaultFormatter = useLazyFormatter(locale, options); - - const nameFormatter = useLazyFormatter(locale, { - ...options, - currencyDisplay: 'name', - }); - - const narrowSymbolFormatter = useLazyFormatter(locale, { - ...options, - currencyDisplay: 'narrowSymbol', - }); - - const withoutTrailingZerosFormatter = useLazyFormatter(locale, { - ...options, - minimumFractionDigits: 0, - maximumFractionDigits: 0, - }); + }; - const withoutCurrencyFormatter = useLazyFormatter(locale); - - const withoutTrailingZerosOrCurrencyFormatter = useLazyFormatter(locale, { - minimumFractionDigits: 0, - maximumFractionDigits: 0, - }); + return { + defaultFormatter: getLazyFormatter(locale, options), + nameFormatter: getLazyFormatter(locale, { + ...options, + currencyDisplay: 'name', + }), + narrowSymbolFormatter: getLazyFormatter(locale, { + ...options, + currencyDisplay: 'narrowSymbol', + }), + withoutTrailingZerosFormatter: getLazyFormatter(locale, { + ...options, + minimumFractionDigits: 0, + maximumFractionDigits: 0, + }), + withoutCurrencyFormatter: getLazyFormatter(locale), + withoutTrailingZerosOrCurrencyFormatter: getLazyFormatter(locale, { + minimumFractionDigits: 0, + maximumFractionDigits: 0, + }), + }; + }, [money.currencyCode, locale]); const isPartCurrency = (part: Intl.NumberFormatPart): boolean => part.type === 'currency'; @@ -219,12 +222,20 @@ export function useMoney(money: MoneyV2): UseMoneyValue { ); } -function useLazyFormatter( +const formatterCache = new Map(); + +function getLazyFormatter( locale: string, options?: Intl.NumberFormatOptions, ): () => Intl.NumberFormat { - return useMemo(() => { - let memoized: Intl.NumberFormat; - return () => (memoized ??= new Intl.NumberFormat(locale, options)); - }, [locale, options]); + const key = JSON.stringify([locale, options]); + + return function (): Intl.NumberFormat { + let formatter = formatterCache.get(key); + if (!formatter) { + formatter = new Intl.NumberFormat(locale, options); + formatterCache.set(key, formatter); + } + return formatter; + }; } From 78bfde1a0f8550c8748088cecc56bf2c6ecaed6b Mon Sep 17 00:00:00 2001 From: Bret Little Date: Tue, 30 Jul 2024 10:19:36 -0400 Subject: [PATCH 06/97] Add a google cache check to hydration (#2334) --- .changeset/witty-planes-tickle.md | 20 ++++++++++++++++++++ templates/skeleton/app/entry.client.tsx | 18 ++++++++++-------- 2 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 .changeset/witty-planes-tickle.md diff --git a/.changeset/witty-planes-tickle.md b/.changeset/witty-planes-tickle.md new file mode 100644 index 000000000..2be5de61f --- /dev/null +++ b/.changeset/witty-planes-tickle.md @@ -0,0 +1,20 @@ +--- +'skeleton': patch +--- + +Add a hydration check for google web cache. This prevents an infinite redirect when viewing the cached version of a hydrogen site on Google. + +Update your entry.server.jsx file to include this check: + +```diff ++ if (!window.location.origin.includes("webcache.googleusercontent.com")) { + startTransition(() => { + hydrateRoot( + document, + + + + ); + }); ++ } +``` diff --git a/templates/skeleton/app/entry.client.tsx b/templates/skeleton/app/entry.client.tsx index ba957c430..725d14603 100644 --- a/templates/skeleton/app/entry.client.tsx +++ b/templates/skeleton/app/entry.client.tsx @@ -2,11 +2,13 @@ import {RemixBrowser} from '@remix-run/react'; import {startTransition, StrictMode} from 'react'; import {hydrateRoot} from 'react-dom/client'; -startTransition(() => { - hydrateRoot( - document, - - - , - ); -}); +if (!window.location.origin.includes('webcache.googleusercontent.com')) { + startTransition(() => { + hydrateRoot( + document, + + + , + ); + }); +} From c0d7d9176c80b996064d8e897876f954807c7640 Mon Sep 17 00:00:00 2001 From: Fran Dios Date: Tue, 30 Jul 2024 19:17:11 +0200 Subject: [PATCH 07/97] Ignore classic Remix config file in Vite projects (#2379) * Ignore remix.config.js in Vite projects and warn about it * Changesets * Change priority for finding configs in Codegen --- .changeset/friendly-cheetahs-teach.md | 5 +++++ packages/cli/src/commands/hydrogen/build.ts | 4 ++-- packages/cli/src/commands/hydrogen/debug/cpu.ts | 9 ++------- packages/cli/src/commands/hydrogen/deploy.ts | 4 ++-- packages/cli/src/commands/hydrogen/dev.ts | 9 ++++++--- packages/cli/src/commands/hydrogen/preview.ts | 10 +++++----- packages/cli/src/lib/codegen.ts | 2 ++ packages/cli/src/lib/remix-config.ts | 12 +++++++++--- packages/cli/src/lib/vite-config.ts | 15 +++++++++++++++ 9 files changed, 48 insertions(+), 22 deletions(-) create mode 100644 .changeset/friendly-cheetahs-teach.md diff --git a/.changeset/friendly-cheetahs-teach.md b/.changeset/friendly-cheetahs-teach.md new file mode 100644 index 000000000..a24fdf015 --- /dev/null +++ b/.changeset/friendly-cheetahs-teach.md @@ -0,0 +1,5 @@ +--- +'@shopify/cli-hydrogen': patch +--- + +Ignore `remix.config.js` file when `vite.config.js` is present, and warn about it. diff --git a/packages/cli/src/commands/hydrogen/build.ts b/packages/cli/src/commands/hydrogen/build.ts index 65f0a2bc5..e1e80eacc 100644 --- a/packages/cli/src/commands/hydrogen/build.ts +++ b/packages/cli/src/commands/hydrogen/build.ts @@ -12,7 +12,7 @@ import {fileSize, removeFile} from '@shopify/cli-kit/node/fs'; import {getPackageManager} from '@shopify/cli-kit/node/node-package-manager'; import {commonFlags, flagsToCamelObject} from '../../lib/flags.js'; import {prepareDiffDirectory} from '../../lib/template-diff.js'; -import {hasViteConfig, getViteConfig} from '../../lib/vite-config.js'; +import {getViteConfig, isViteProject} from '../../lib/vite-config.js'; import {checkLockfileStatus} from '../../lib/check-lockfile.js'; import {findMissingRoutes} from '../../lib/missing-routes.js'; import {runClassicCompilerBuild} from '../../lib/classic-compiler/build.js'; @@ -71,7 +71,7 @@ export default class Build extends Command { directory, }; - const result = (await hasViteConfig(directory)) + const result = (await isViteProject(directory)) ? await runBuild(buildParams) : await runClassicCompilerBuild(buildParams); diff --git a/packages/cli/src/commands/hydrogen/debug/cpu.ts b/packages/cli/src/commands/hydrogen/debug/cpu.ts index c6e5263f7..0e56c1304 100644 --- a/packages/cli/src/commands/hydrogen/debug/cpu.ts +++ b/packages/cli/src/commands/hydrogen/debug/cpu.ts @@ -5,10 +5,7 @@ import {outputInfo} from '@shopify/cli-kit/node/output'; import {writeFile} from '@shopify/cli-kit/node/fs'; import colors from '@shopify/cli-kit/node/colors'; import ansiEscapes from 'ansi-escapes'; -import { - getProjectPaths, - hasRemixConfigFile, -} from '../../../lib/remix-config.js'; +import {getProjectPaths, isClassicProject} from '../../../lib/remix-config.js'; import {muteDevLogs} from '../../../lib/log.js'; import {commonFlags, flagsToCamelObject} from '../../../lib/flags.js'; import {prepareDiffDirectory} from '../../../lib/template-diff.js'; @@ -73,8 +70,6 @@ async function runDebugCpu({directory, entry, output}: RunDebugCpuOptions) { let {buildPath, buildPathWorkerFile} = getProjectPaths(directory); - const isClassicProject = await hasRemixConfigFile(directory); - outputInfo( '⏳️ Starting profiler for CPU startup... Profile will be written to:\n' + colors.dim(output), @@ -110,7 +105,7 @@ async function runDebugCpu({directory, entry, output}: RunDebugCpuOptions) { }, }; - if (isClassicProject) { + if (await isClassicProject(directory)) { return runClassicCompilerDebugCpu({ directory, output, diff --git a/packages/cli/src/commands/hydrogen/deploy.ts b/packages/cli/src/commands/hydrogen/deploy.ts index 7f97ae658..9b9b8cff0 100644 --- a/packages/cli/src/commands/hydrogen/deploy.ts +++ b/packages/cli/src/commands/hydrogen/deploy.ts @@ -47,7 +47,7 @@ import {runClassicCompilerBuild} from '../../lib/classic-compiler/build.js'; import {runBuild} from './build.js'; import {getViteConfig} from '../../lib/vite-config.js'; import {prepareDiffDirectory} from '../../lib/template-diff.js'; -import {hasRemixConfigFile} from '../../lib/remix-config.js'; +import {isClassicProject} from '../../lib/remix-config.js'; import {packageManagers} from '../../lib/package-managers.js'; import {setupResourceCleanup} from '../../lib/resource-cleanup.js'; @@ -449,7 +449,7 @@ export async function runDeploy( let assetsDir = 'dist/client'; let workerDir = 'dist/worker'; - const isClassicCompiler = await hasRemixConfigFile(root); + const isClassicCompiler = await isClassicProject(root); if (!isClassicCompiler) { const viteConfig = await getViteConfig(root, ssrEntry).catch(() => null); diff --git a/packages/cli/src/commands/hydrogen/dev.ts b/packages/cli/src/commands/hydrogen/dev.ts index f2050bfc9..9efd1246f 100644 --- a/packages/cli/src/commands/hydrogen/dev.ts +++ b/packages/cli/src/commands/hydrogen/dev.ts @@ -41,8 +41,11 @@ import { import {getCliCommand} from '../../lib/shell.js'; import {findPort} from '../../lib/find-port.js'; import {logRequestLine} from '../../lib/mini-oxygen/common.js'; -import {findHydrogenPlugin, findOxygenPlugin} from '../../lib/vite-config.js'; -import {hasViteConfig} from '../../lib/vite-config.js'; +import { + findHydrogenPlugin, + findOxygenPlugin, + isViteProject, +} from '../../lib/vite-config.js'; import {runClassicCompilerDev} from '../../lib/classic-compiler/dev.js'; import {importVite} from '../../lib/import-utils.js'; import {createEntryPointErrorHandler} from '../../lib/deps-optimizer.js'; @@ -131,7 +134,7 @@ export default class Dev extends Command { cliConfig: this.config, }; - const {close} = (await hasViteConfig(directory)) + const {close} = (await isViteProject(directory)) ? await runDev(devParams) : await runClassicCompilerDev(devParams); diff --git a/packages/cli/src/commands/hydrogen/preview.ts b/packages/cli/src/commands/hydrogen/preview.ts index 32eece8ea..bac1d0fba 100644 --- a/packages/cli/src/commands/hydrogen/preview.ts +++ b/packages/cli/src/commands/hydrogen/preview.ts @@ -4,7 +4,7 @@ import {AbortError} from '@shopify/cli-kit/node/error'; import {outputInfo} from '@shopify/cli-kit/node/output'; import {joinPath, resolvePath} from '@shopify/cli-kit/node/path'; import {isH2Verbose, muteDevLogs, setH2OVerbose} from '../../lib/log.js'; -import {getProjectPaths, hasRemixConfigFile} from '../../lib/remix-config.js'; +import {getProjectPaths, isClassicProject} from '../../lib/remix-config.js'; import { DEFAULT_APP_PORT, commonFlags, @@ -132,9 +132,9 @@ export async function runPreview({ let {root, buildPath, buildPathWorkerFile, buildPathClient} = getProjectPaths(directory); - const isClassicProject = await hasRemixConfigFile(root); + const useClassicCompiler = await isClassicProject(root); - if (watch && isClassicProject) { + if (watch && useClassicCompiler) { throw new AbortError( 'Preview in watch mode is not supported for classic Remix projects.', 'Please use the dev command instead, which is the equivalent for classic projects.', @@ -156,7 +156,7 @@ export async function runPreview({ }; const buildProcess = shouldBuild - ? isClassicProject + ? useClassicCompiler ? await runClassicCompilerBuild({ ...buildOptions, }).then(projectBuild.resolve) @@ -175,7 +175,7 @@ export async function runPreview({ }) : projectBuild.resolve(); - if (!isClassicProject) { + if (!useClassicCompiler) { const maybeResult = await getViteConfig(root).catch(() => null); buildPathWorkerFile = maybeResult?.serverOutFile ?? joinPath(buildPath, 'server', 'index.js'); diff --git a/packages/cli/src/lib/codegen.ts b/packages/cli/src/lib/codegen.ts index e1dfd6cfd..8ea319db0 100644 --- a/packages/cli/src/lib/codegen.ts +++ b/packages/cli/src/lib/codegen.ts @@ -113,6 +113,8 @@ export function spawnCodegenProcess({ if (/`punycode`/.test(message)) return; if (/\.body\[\d\]/.test(message)) return; if (/console\.time(End)?\(\)/.test(message)) return; + // Skip banners output by ourselves: + if (/─ (warning|info|success) ───/.test(message)) return; console.log(''); renderWarning({headline: message, body: details}); diff --git a/packages/cli/src/lib/remix-config.ts b/packages/cli/src/lib/remix-config.ts index bebbfcd25..2961a2a0f 100644 --- a/packages/cli/src/lib/remix-config.ts +++ b/packages/cli/src/lib/remix-config.ts @@ -1,5 +1,4 @@ import {createRequire} from 'node:module'; -import {fileURLToPath} from 'node:url'; import path from 'node:path'; import {readdir} from 'node:fs/promises'; import type {ServerMode} from '@remix-run/dev/dist/config/serverModes.js'; @@ -10,7 +9,7 @@ import {fileExists} from '@shopify/cli-kit/node/fs'; import {muteRemixLogs} from './log.js'; import {REQUIRED_REMIX_VERSION} from './remix-version-check.js'; import {findFileWithExtension} from './file.js'; -import {getViteConfig} from './vite-config.js'; +import {getViteConfig, isViteProject} from './vite-config.js'; import {importLocal} from './import-utils.js'; import {hydrogenPackagesPath, isHydrogenMonorepo} from './build.js'; @@ -23,6 +22,13 @@ export async function hasRemixConfigFile(root: string) { return !!result.filepath; } +export async function isClassicProject(root: string) { + const isVite = await isViteProject(root); + if (isVite) return false; + + return hasRemixConfigFile(root); +} + const BUILD_DIR = 'dist'; // Hardcoded in Oxygen const CLIENT_SUBDIR = 'client'; const WORKER_SUBDIR = 'worker'; // Hardcoded in Oxygen @@ -65,7 +71,7 @@ export async function getRemixConfig( root: string, mode = process.env.NODE_ENV as ServerMode, ) { - if (!(await hasRemixConfigFile(root))) { + if (await isViteProject(root)) { return (await getViteConfig(root)).remixConfig; } diff --git a/packages/cli/src/lib/vite-config.ts b/packages/cli/src/lib/vite-config.ts index c71de98c5..69fe02d1a 100644 --- a/packages/cli/src/lib/vite-config.ts +++ b/packages/cli/src/lib/vite-config.ts @@ -10,12 +10,27 @@ import {importVite} from './import-utils.js'; // Do not import JS from here, only types import type {HydrogenPlugin} from '~/hydrogen/vite/plugin.js'; import type {OxygenPlugin} from '~/mini-oxygen/vite/plugin.js'; +import {hasRemixConfigFile} from './remix-config.js'; +import {renderWarning} from '@shopify/cli-kit/node/ui'; export async function hasViteConfig(root: string) { const result = await findFileWithExtension(root, 'vite.config'); return !!result.filepath; } +export async function isViteProject(root: string) { + const isVite = await hasViteConfig(root); + + if (isVite && (await hasRemixConfigFile(root))) { + renderWarning({ + headline: 'Both Vite and Remix config files found.', + body: 'The remix.config.js file is not used in Vite projects. Please remove it to avoid conflicts.', + }); + } + + return isVite; +} + export async function getViteConfig(root: string, ssrEntryFlag?: string) { const vite = await importVite(root); From d5636e07c35db9b3181ad2e3ad8d57a5833d0cd3 Mon Sep 17 00:00:00 2001 From: Michelle Chen Date: Tue, 30 Jul 2024 13:19:26 -0400 Subject: [PATCH 08/97] remove refactor changelog and ensure the hydration check update create-hydrogen too (#2382) --- .changeset/brown-news-nail.md | 6 ------ .changeset/witty-planes-tickle.md | 1 + 2 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 .changeset/brown-news-nail.md diff --git a/.changeset/brown-news-nail.md b/.changeset/brown-news-nail.md deleted file mode 100644 index eebf1cf5e..000000000 --- a/.changeset/brown-news-nail.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'skeleton': patch -'@shopify/create-hydrogen': patch ---- - -Refactor pagination previous & next behaviour into a re-usable component. diff --git a/.changeset/witty-planes-tickle.md b/.changeset/witty-planes-tickle.md index 2be5de61f..be55e71ef 100644 --- a/.changeset/witty-planes-tickle.md +++ b/.changeset/witty-planes-tickle.md @@ -1,5 +1,6 @@ --- 'skeleton': patch +'@shopify/create-hydrogen': patch --- Add a hydration check for google web cache. This prevents an infinite redirect when viewing the cached version of a hydrogen site on Google. From 31ea19e8957dbc4487314b014a14920444d37f78 Mon Sep 17 00:00:00 2001 From: Braeden Craig Date: Wed, 31 Jul 2024 09:15:15 -0400 Subject: [PATCH 09/97] Fixing/Adding ShopAnalytics Type Export (#2384) * fix shopAnalytics type export * add changeset --- .changeset/tiny-gorillas-thank.md | 5 +++++ packages/hydrogen/src/index.ts | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/tiny-gorillas-thank.md diff --git a/.changeset/tiny-gorillas-thank.md b/.changeset/tiny-gorillas-thank.md new file mode 100644 index 000000000..0503ffc40 --- /dev/null +++ b/.changeset/tiny-gorillas-thank.md @@ -0,0 +1,5 @@ +--- +'@shopify/hydrogen': patch +--- + +Export `ShopAnalytics` type diff --git a/packages/hydrogen/src/index.ts b/packages/hydrogen/src/index.ts index 7f4a6443f..4e6718fb8 100644 --- a/packages/hydrogen/src/index.ts +++ b/packages/hydrogen/src/index.ts @@ -91,6 +91,7 @@ export { Analytics, useAnalytics, getShopAnalytics, + type ShopAnalytics, } from './analytics-manager/AnalyticsProvider'; export {AnalyticsEvent} from './analytics-manager/events'; export { From dfb9be7721c7d10cf4354fda60db4e666625518e Mon Sep 17 00:00:00 2001 From: Bret Little Date: Wed, 31 Jul 2024 11:04:28 -0400 Subject: [PATCH 10/97] Fix the `OptimisticCart` type to properly retain the generic of line items (#2327) * Fix the `OptimisticCart` type to properly retain the generic of line items * Make `OptimisticCartLine` support both Cart and CartLine as a generic --- .changeset/sour-flowers-do.md | 5 + examples/multipass/app/components/Cart.tsx | 10 +- .../subscriptions/app/components/Cart.tsx | 10 +- .../app/components/CartLineItem.tsx | 7 +- examples/subscriptions/app/lib/fragments.ts | 183 ++++++++++++++++++ .../storefrontapi.generated.d.ts | 6 + .../src/cart/optimistic/useOptimisticCart.tsx | 14 +- .../skeleton/app/components/CartLineItem.tsx | 7 +- .../skeleton/app/components/CartMain.tsx | 4 +- 9 files changed, 229 insertions(+), 17 deletions(-) create mode 100644 .changeset/sour-flowers-do.md create mode 100644 examples/subscriptions/app/lib/fragments.ts diff --git a/.changeset/sour-flowers-do.md b/.changeset/sour-flowers-do.md new file mode 100644 index 000000000..964fdce64 --- /dev/null +++ b/.changeset/sour-flowers-do.md @@ -0,0 +1,5 @@ +--- +'@shopify/hydrogen': patch +--- + +Fix the `OptimisticCart` type to properly retain the generic of line items. The `OptimisticCartLine` type now takes a cart or cart line item generic. diff --git a/examples/multipass/app/components/Cart.tsx b/examples/multipass/app/components/Cart.tsx index eb321a6c3..d456ff3a3 100644 --- a/examples/multipass/app/components/Cart.tsx +++ b/examples/multipass/app/components/Cart.tsx @@ -16,6 +16,8 @@ import {MultipassCheckoutButton} from './MultipassCheckoutButton'; /********** EXAMPLE UPDATE END ************/ /***********************************************/ +type CartLine = OptimisticCartLine; + type CartMainProps = { cart: CartApiQueryFragment | null; layout: 'page' | 'aside'; @@ -65,7 +67,7 @@ function CartLines({ layout, }: { layout: CartMainProps['layout']; - lines: OptimisticCartLine[]; + lines: CartLine[]; }) { if (!lines) return null; @@ -85,7 +87,7 @@ function CartLineItem({ line, }: { layout: CartMainProps['layout']; - line: OptimisticCartLine; + line: CartLine; }) { const {id, merchandise} = line; const {product, title, image, selectedOptions} = merchandise; @@ -199,7 +201,7 @@ function CartLineRemoveButton({ ); } -function CartLineQuantity({line}: {line: OptimisticCartLine}) { +function CartLineQuantity({line}: {line: CartLine}) { if (!line || typeof line?.quantity === 'undefined') return null; const {id: lineId, quantity, isOptimistic} = line; const prevQuantity = Number(Math.max(0, quantity - 1).toFixed(0)); @@ -240,7 +242,7 @@ function CartLinePrice({ priceType = 'regular', ...passthroughProps }: { - line: OptimisticCartLine; + line: CartLine; priceType?: 'regular' | 'compareAt'; [key: string]: any; }) { diff --git a/examples/subscriptions/app/components/Cart.tsx b/examples/subscriptions/app/components/Cart.tsx index 510f99816..b9cae04cc 100644 --- a/examples/subscriptions/app/components/Cart.tsx +++ b/examples/subscriptions/app/components/Cart.tsx @@ -11,6 +11,8 @@ import {Link} from '@remix-run/react'; import type {CartApiQueryFragment} from 'storefrontapi.generated'; import {useVariantUrl} from '~/lib/variants'; +type CartLine = OptimisticCartLine; + type CartMainProps = { cart: CartApiQueryFragment; layout: 'page' | 'aside'; @@ -60,7 +62,7 @@ function CartLines({ layout, }: { layout: CartMainProps['layout']; - lines: OptimisticCartLine[]; + lines: CartLine[]; }) { if (!lines) return null; @@ -80,7 +82,7 @@ function CartLineItem({ line, }: { layout: CartMainProps['layout']; - line: OptimisticCartLine; + line: CartLine; }) { /***********************************************/ /********** EXAMPLE UPDATE STARTS ************/ @@ -208,7 +210,7 @@ function CartLineRemoveButton({ ); } -function CartLineQuantity({line}: {line: OptimisticCartLine}) { +function CartLineQuantity({line}: {line: CartLine}) { if (!line || typeof line?.quantity === 'undefined') return null; const {id: lineId, quantity, isOptimistic} = line; const prevQuantity = Number(Math.max(0, quantity - 1).toFixed(0)); @@ -249,7 +251,7 @@ function CartLinePrice({ priceType = 'regular', ...passthroughProps }: { - line: OptimisticCartLine; + line: CartLine; priceType?: 'regular' | 'compareAt'; [key: string]: any; }) { diff --git a/examples/subscriptions/app/components/CartLineItem.tsx b/examples/subscriptions/app/components/CartLineItem.tsx index bfa83b89b..bb765f01c 100644 --- a/examples/subscriptions/app/components/CartLineItem.tsx +++ b/examples/subscriptions/app/components/CartLineItem.tsx @@ -5,6 +5,9 @@ import {useVariantUrl} from '~/lib/variants'; import {Link} from '@remix-run/react'; import {ProductPrice} from '~/components/ProductPrice'; import {useAside} from '~/components/Aside'; +import type {CartApiQueryFragment} from 'storefrontapi.generated'; + +type CartLine = OptimisticCartLine; /** * A single line item in the cart. It displays the product image, title, price. @@ -15,7 +18,7 @@ export function CartLineItem({ line, }: { layout: CartLayout; - line: OptimisticCartLine; + line: CartLine; }) { /***********************************************/ /********** EXAMPLE UPDATE STARTS ************/ @@ -85,7 +88,7 @@ export function CartLineItem({ * These controls are disabled when the line item is new, and the server * hasn't yet responded that it was successfully added to the cart. */ -function CartLineQuantity({line}: {line: OptimisticCartLine}) { +function CartLineQuantity({line}: {line: CartLine}) { if (!line || typeof line?.quantity === 'undefined') return null; const {id: lineId, quantity, isOptimistic} = line; const prevQuantity = Number(Math.max(0, quantity - 1).toFixed(0)); diff --git a/examples/subscriptions/app/lib/fragments.ts b/examples/subscriptions/app/lib/fragments.ts new file mode 100644 index 000000000..15ebfcba5 --- /dev/null +++ b/examples/subscriptions/app/lib/fragments.ts @@ -0,0 +1,183 @@ +// NOTE: https://shopify.dev/docs/api/storefront/latest/queries/cart +export const CART_QUERY_FRAGMENT = `#graphql + fragment Money on MoneyV2 { + currencyCode + amount + } + fragment CartLine on CartLine { + id + quantity + attributes { + key + value + } + cost { + totalAmount { + ...Money + } + amountPerQuantity { + ...Money + } + compareAtAmountPerQuantity { + ...Money + } + } + #/***********************************************/ + #/********** EXAMPLE UPDATE STARTS ************/ + sellingPlanAllocation { + sellingPlan { + name + } + } + #/***********************************************/ + #/********** EXAMPLE UPDATE ENDS ************/ + merchandise { + ... on ProductVariant { + id + availableForSale + compareAtPrice { + ...Money + } + price { + ...Money + } + requiresShipping + title + image { + id + url + altText + width + height + + } + product { + handle + title + id + vendor + } + selectedOptions { + name + value + } + } + } + } + fragment CartApiQuery on Cart { + updatedAt + id + checkoutUrl + totalQuantity + buyerIdentity { + countryCode + customer { + id + email + firstName + lastName + displayName + } + email + phone + } + lines(first: $numCartLines) { + nodes { + ...CartLine + } + } + cost { + subtotalAmount { + ...Money + } + totalAmount { + ...Money + } + totalDutyAmount { + ...Money + } + totalTaxAmount { + ...Money + } + } + note + attributes { + key + value + } + discountCodes { + code + applicable + } + } +` as const; + +const MENU_FRAGMENT = `#graphql + fragment MenuItem on MenuItem { + id + resourceId + tags + title + type + url + } + fragment ChildMenuItem on MenuItem { + ...MenuItem + } + fragment ParentMenuItem on MenuItem { + ...MenuItem + items { + ...ChildMenuItem + } + } + fragment Menu on Menu { + id + items { + ...ParentMenuItem + } + } +` as const; + +export const HEADER_QUERY = `#graphql + fragment Shop on Shop { + id + name + description + primaryDomain { + url + } + brand { + logo { + image { + url + } + } + } + } + query Header( + $country: CountryCode + $headerMenuHandle: String! + $language: LanguageCode + ) @inContext(language: $language, country: $country) { + shop { + ...Shop + } + menu(handle: $headerMenuHandle) { + ...Menu + } + } + ${MENU_FRAGMENT} +` as const; + +export const FOOTER_QUERY = `#graphql + query Footer( + $country: CountryCode + $footerMenuHandle: String! + $language: LanguageCode + ) @inContext(language: $language, country: $country) { + menu(handle: $footerMenuHandle) { + ...Menu + } + } + ${MENU_FRAGMENT} +` as const; diff --git a/examples/subscriptions/storefrontapi.generated.d.ts b/examples/subscriptions/storefrontapi.generated.d.ts index 249c0a391..3b8b07afc 100644 --- a/examples/subscriptions/storefrontapi.generated.d.ts +++ b/examples/subscriptions/storefrontapi.generated.d.ts @@ -20,6 +20,9 @@ export type CartLineFragment = Pick< Pick >; }; + sellingPlanAllocation?: StorefrontAPI.Maybe<{ + sellingPlan: Pick; + }>; merchandise: Pick< StorefrontAPI.ProductVariant, 'id' | 'availableForSale' | 'requiresShipping' | 'title' @@ -67,6 +70,9 @@ export type CartApiQueryFragment = Pick< Pick >; }; + sellingPlanAllocation?: StorefrontAPI.Maybe<{ + sellingPlan: Pick; + }>; merchandise: Pick< StorefrontAPI.ProductVariant, 'id' | 'availableForSale' | 'requiresShipping' | 'title' diff --git a/packages/hydrogen/src/cart/optimistic/useOptimisticCart.tsx b/packages/hydrogen/src/cart/optimistic/useOptimisticCart.tsx index e57bdefdd..feb667e40 100644 --- a/packages/hydrogen/src/cart/optimistic/useOptimisticCart.tsx +++ b/packages/hydrogen/src/cart/optimistic/useOptimisticCart.tsx @@ -11,7 +11,15 @@ import { import type {PartialDeep} from 'type-fest'; import type {CartReturn} from '../queries/cart-types'; -export type OptimisticCartLine = T & {isOptimistic?: boolean}; +type LikeACart = { + lines: { + nodes: Array; + }; +}; + +export type OptimisticCartLine = T extends LikeACart + ? T['lines']['nodes'][number] & {isOptimistic?: boolean} + : T & {isOptimistic?: boolean}; export type OptimisticCart = T extends undefined | null ? // This is the null/undefined case, where the cart has yet to be created. @@ -25,7 +33,7 @@ export type OptimisticCart = T extends undefined | null : Omit & { isOptimistic?: boolean; lines: { - nodes: Array; + nodes: Array>; }; }; @@ -49,7 +57,7 @@ export function useOptimisticCart< ? (structuredClone(cart) as OptimisticCart) : ({lines: {nodes: []}} as unknown as OptimisticCart); - const cartLines = optimisticCart.lines.nodes; + const cartLines = optimisticCart.lines.nodes as OptimisticCartLine[]; let isOptimistic = false; diff --git a/templates/skeleton/app/components/CartLineItem.tsx b/templates/skeleton/app/components/CartLineItem.tsx index 3230dcbfd..26102b612 100644 --- a/templates/skeleton/app/components/CartLineItem.tsx +++ b/templates/skeleton/app/components/CartLineItem.tsx @@ -5,6 +5,9 @@ import {useVariantUrl} from '~/lib/variants'; import {Link} from '@remix-run/react'; import {ProductPrice} from './ProductPrice'; import {useAside} from './Aside'; +import type {CartApiQueryFragment} from 'storefrontapi.generated'; + +type CartLine = OptimisticCartLine; /** * A single line item in the cart. It displays the product image, title, price. @@ -15,7 +18,7 @@ export function CartLineItem({ line, }: { layout: CartLayout; - line: OptimisticCartLine; + line: CartLine; }) { const {id, merchandise} = line; const {product, title, image, selectedOptions} = merchandise; @@ -70,7 +73,7 @@ export function CartLineItem({ * These controls are disabled when the line item is new, and the server * hasn't yet responded that it was successfully added to the cart. */ -function CartLineQuantity({line}: {line: OptimisticCartLine}) { +function CartLineQuantity({line}: {line: CartLine}) { if (!line || typeof line?.quantity === 'undefined') return null; const {id: lineId, quantity, isOptimistic} = line; const prevQuantity = Number(Math.max(0, quantity - 1).toFixed(0)); diff --git a/templates/skeleton/app/components/CartMain.tsx b/templates/skeleton/app/components/CartMain.tsx index 666edf490..bcecc4737 100644 --- a/templates/skeleton/app/components/CartMain.tsx +++ b/templates/skeleton/app/components/CartMain.tsx @@ -1,4 +1,4 @@ -import {type OptimisticCartLine, useOptimisticCart} from '@shopify/hydrogen'; +import {useOptimisticCart} from '@shopify/hydrogen'; import {Link} from '@remix-run/react'; import type {CartApiQueryFragment} from 'storefrontapi.generated'; import {useAside} from '~/components/Aside'; @@ -34,7 +34,7 @@ export function CartMain({layout, cart: originalCart}: CartMainProps) {
    - {(cart?.lines?.nodes ?? []).map((line: OptimisticCartLine) => ( + {(cart?.lines?.nodes ?? []).map((line) => ( ))}
From 20a8e63b5fd1c8acadda7612c5d4cc411e0c5932 Mon Sep 17 00:00:00 2001 From: Bret Little Date: Wed, 31 Jul 2024 11:43:30 -0400 Subject: [PATCH 11/97] Return a 400 BadRequest for HEAD and GET requests that include a body (#2360) This is necessary because the Remix handler throws, causing a 500 error --- .changeset/nice-dragons-cry.md | 5 +++++ packages/remix-oxygen/src/server.ts | 8 ++++++++ 2 files changed, 13 insertions(+) create mode 100644 .changeset/nice-dragons-cry.md diff --git a/.changeset/nice-dragons-cry.md b/.changeset/nice-dragons-cry.md new file mode 100644 index 000000000..a247d62c7 --- /dev/null +++ b/.changeset/nice-dragons-cry.md @@ -0,0 +1,5 @@ +--- +'@shopify/remix-oxygen': patch +--- + +Return a 400 BadRequest for HEAD and GET requests that include a body diff --git a/packages/remix-oxygen/src/server.ts b/packages/remix-oxygen/src/server.ts index dc2281947..93e20797d 100644 --- a/packages/remix-oxygen/src/server.ts +++ b/packages/remix-oxygen/src/server.ts @@ -25,6 +25,14 @@ export function createRequestHandler({ const handleRequest = createRemixRequestHandler(build, mode); return async (request: Request) => { + const method = request.method; + + if ((method === 'GET' || method === 'HEAD') && request.body) { + return new Response(`${method} requests cannot have a body`, { + status: 400, + }); + } + const context = getLoadContext ? ((await getLoadContext(request)) as AppLoadContext) : undefined; From 7f30f206a2fc5beaaa5c556a8a15a0f338d64cc8 Mon Sep 17 00:00:00 2001 From: Fran Dios Date: Fri, 2 Aug 2024 16:59:25 +0200 Subject: [PATCH 12/97] Minor fix for auth logs (#2393) --- packages/cli/src/lib/log.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/packages/cli/src/lib/log.ts b/packages/cli/src/lib/log.ts index cb3f30f41..ecbda56cc 100644 --- a/packages/cli/src/lib/log.ts +++ b/packages/cli/src/lib/log.ts @@ -282,19 +282,10 @@ export function enhanceAuthLogs(hideInitialLog = false) { return; }, ], - [ - ([first]) => - typeof first === 'string' && - first.includes('Open this link to start the auth process'), - ([first]) => { - // Hide logs - return [first.replace('👉 ', '').replace(': ', ':\n')]; - }, - ], [ ([first]) => typeof first === 'string' && first.includes('Logged in.'), () => { - process.stdout.write(ansiEscapes.eraseLines(hideInitialLog ? 4 : 5)); + process.stdout.write(ansiEscapes.eraseLines(hideInitialLog ? 5 : 6)); return; }, ], From 6e5d8ea71a2639925d5817b662af26a6b2ba3c6d Mon Sep 17 00:00:00 2001 From: Bret Little Date: Fri, 2 Aug 2024 13:04:02 -0400 Subject: [PATCH 13/97] Add a `waitForHydration` prop to the Script component (#2389) * Add a `waitForHydration` prop to the Script component --- .changeset/sharp-planes-judge.md | 7 ++++ packages/hydrogen/src/csp/Script.doc.ts | 2 +- packages/hydrogen/src/csp/Script.example.jsx | 7 ++++ packages/hydrogen/src/csp/Script.example.tsx | 7 ++++ packages/hydrogen/src/csp/Script.test.ts | 29 +++++++++++++- packages/hydrogen/src/csp/Script.tsx | 40 ++++++++++++++++++-- 6 files changed, 87 insertions(+), 5 deletions(-) create mode 100644 .changeset/sharp-planes-judge.md diff --git a/.changeset/sharp-planes-judge.md b/.changeset/sharp-planes-judge.md new file mode 100644 index 000000000..7c165d94a --- /dev/null +++ b/.changeset/sharp-planes-judge.md @@ -0,0 +1,7 @@ +--- +'@shopify/hydrogen': patch +--- + +Add a `waitForHydration` prop to the `Script` component to delay loading until after hydration. This fixes third-party scripts that modify the DOM and cause hydration errors. + +Note: For security, `nonce` is not supported when using `waitForHydration`. Instead you need to add the domain of the script directly to your [Content Securitiy Policy directives](https://shopify.dev/docs/storefronts/headless/hydrogen/content-security-policy#step-3-customize-the-content-security-policy). diff --git a/packages/hydrogen/src/csp/Script.doc.ts b/packages/hydrogen/src/csp/Script.doc.ts index 549049e4e..b0f97a5d7 100644 --- a/packages/hydrogen/src/csp/Script.doc.ts +++ b/packages/hydrogen/src/csp/Script.doc.ts @@ -16,7 +16,7 @@ const data: ReferenceEntityTemplateSchema = { url: '/docs/api/hydrogen/2024-07/hooks/usenonce', }, ], - description: `Use the \`Script\` component to add third-party scripts to your app. It automatically adds a nonce attribute from your [content security policy](/docs/custom-storefronts/hydrogen/content-security-policy).`, + description: `Use the \`Script\` component to add third-party scripts to your app. It automatically adds a nonce attribute from your [content security policy](/docs/custom-storefronts/hydrogen/content-security-policy). If you load a script that directly modifies the DOM, you are likely to have hydration errors. Use the \`waitForHydration\` prop to load the script after the page hydrates.`, type: 'component', defaultExample: { description: 'I am the default example', diff --git a/packages/hydrogen/src/csp/Script.example.jsx b/packages/hydrogen/src/csp/Script.example.jsx index 4e7257fba..cb951c9bf 100644 --- a/packages/hydrogen/src/csp/Script.example.jsx +++ b/packages/hydrogen/src/csp/Script.example.jsx @@ -23,6 +23,13 @@ export default function App() { {/* Note you don't need to pass a nonce to the script component because it's automatically added */} + + `); + }); + it('should load scripts after hydration', () => { const {asFragment} = render( createElement(NonceProvider, { @@ -53,4 +74,20 @@ describe('