From cdb86b2a1fcbe445ae2092cbea4ceda72ceb9107 Mon Sep 17 00:00:00 2001 From: Paulo Margarido <64600052+paulomarg@users.noreply.github.com> Date: Tue, 16 Jan 2024 15:49:43 -0500 Subject: [PATCH] Include shopify-api types in docs --- packages/shopify-app-remix/docs/build-docs.sh | 8 +- .../docs/generated/generated_docs_data.json | 16521 ++++++++++++---- packages/shopify-app-remix/package.json | 2 +- yarn.lock | 23 +- 4 files changed, 12932 insertions(+), 3622 deletions(-) diff --git a/packages/shopify-app-remix/docs/build-docs.sh b/packages/shopify-app-remix/docs/build-docs.sh index 553121febe..1dee19ab41 100644 --- a/packages/shopify-app-remix/docs/build-docs.sh +++ b/packages/shopify-app-remix/docs/build-docs.sh @@ -1,10 +1,10 @@ -COMPILE_DOCS="yarn tsc --project docs/tsconfig.docs.json --types react --moduleResolution node --target esNext --module CommonJS && generate-docs --overridePath ./docs/typeOverride.json --input ./src --output ./docs/generated && find . -name '*.doc.js' -delete" -COMPILE_STATIC_PAGES="yarn tsc docs/staticPages/*.doc.ts --types react --moduleResolution node --target esNext --module CommonJS && generate-docs --isLandingPage --input ./docs/staticPages --output ./docs/generated && rm -rf docs/staticPages/*.doc.js" +COMPILE_DOCS="yarn tsc --project docs/tsconfig.docs.json --types react --moduleResolution node --target esNext --module CommonJS && generate-docs --overridePath ./docs/typeOverride.json --input ./src --declarationPath ../../node_modules/@shopify/shopify-api ../../node_modules/@shopify/polaris/build/ts --output ./docs/generated && find . -name '*.doc.js' -delete" +COMPILE_STATIC_PAGES="yarn tsc docs/staticPages/*.doc.ts --types react --moduleResolution node --target esNext --module CommonJS && generate-docs --isLandingPage --input ./docs/staticPages --declarationPath ../../node_modules/@shopify/shopify-api ../../node_modules/@shopify/polaris/build/ts --output ./docs/generated && rm -rf docs/staticPages/*.doc.js" if [ "$1" = "isTest" ]; then -COMPILE_DOCS="yarn tsc --project docs/tsconfig.docs.json --types react --moduleResolution node --target esNext --module CommonJS && generate-docs --overridePath ./docs/typeOverride.json --input ./src --output ./docs/temp && find . -name '*.doc.js' -delete" -COMPILE_STATIC_PAGES="yarn tsc docs/staticPages/*.doc.ts --types react --moduleResolution node --target esNext --module CommonJS && generate-docs --isLandingPage --input ./docs/staticPages --output ./docs/temp && rm -rf docs/staticPages/*.doc.js" +COMPILE_DOCS="yarn tsc --project docs/tsconfig.docs.json --types react --moduleResolution node --target esNext --module CommonJS && generate-docs --overridePath ./docs/typeOverride.json --input ./src --declarationPath ../../node_modules/@shopify/shopify-api ../../node_modules/@shopify/polaris/build/ts --output ./docs/temp && find . -name '*.doc.js' -delete" +COMPILE_STATIC_PAGES="yarn tsc docs/staticPages/*.doc.ts --types react --moduleResolution node --target esNext --module CommonJS && generate-docs --isLandingPage --input ./docs/staticPages --declarationPath ../../node_modules/@shopify/shopify-api ../../node_modules/@shopify/polaris/build/ts --output ./docs/temp && rm -rf docs/staticPages/*.doc.js" fi eval $COMPILE_DOCS diff --git a/packages/shopify-app-remix/docs/generated/generated_docs_data.json b/packages/shopify-app-remix/docs/generated/generated_docs_data.json index eecf09ad23..7d94cf2021 100644 --- a/packages/shopify-app-remix/docs/generated/generated_docs_data.json +++ b/packages/shopify-app-remix/docs/generated/generated_docs_data.json @@ -12,44 +12,27 @@ "type": "AppProviderProps", "typeDefinitions": { "AppProviderProps": { - "filePath": "/react/components/AppProvider/AppProvider.tsx", + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/components/AppProvider/AppProvider.d.ts", "name": "AppProviderProps", "description": "", "members": [ { - "filePath": "/react/components/AppProvider/AppProvider.tsx", - "syntaxKind": "PropertySignature", - "name": "apiKey", - "value": "string", - "description": "The API key for your Shopify app. This is the `Client ID` from the Partner Dashboard.\n\nWhen using the Shopify CLI, this is the `SHOPIFY_API_KEY` environment variable. If you're using the environment variable, then you need to pass it from the loader to the component." - }, - { - "filePath": "/react/components/AppProvider/AppProvider.tsx", - "syntaxKind": "PropertySignature", - "name": "isEmbeddedApp", - "value": "boolean", - "description": "Whether the app is loaded inside the Shopify Admin. Default is `true`.\n\n\n\n\n", - "isOptional": true - }, - { - "filePath": "/react/components/AppProvider/AppProvider.tsx", + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/components/AppProvider/AppProvider.d.ts", "syntaxKind": "PropertySignature", "name": "i18n", "value": "TranslationDictionary | TranslationDictionary[]", - "description": "The internationalization (i18n) configuration for your Polaris provider.\n\n\n\n\n", - "isOptional": true + "description": "A locale object or array of locale objects that overrides default translations. If specifying an array then your primary language dictionary should come first, followed by your fallback language dictionaries" }, { - "filePath": "/react/components/AppProvider/AppProvider.tsx", + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/components/AppProvider/AppProvider.d.ts", "syntaxKind": "PropertySignature", - "name": "__APP_BRIDGE_URL", - "value": "string", - "description": "Used internally by Shopify. You don't need to set this.", - "isOptional": true, - "isPrivate": true + "name": "linkComponent", + "value": "LinkLikeComponent", + "description": "A custom component to use for all links used by Polaris components", + "isOptional": true }, { - "filePath": "/react/components/AppProvider/AppProvider.tsx", + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/components/AppProvider/AppProvider.d.ts", "syntaxKind": "PropertySignature", "name": "features", "value": "FeaturesConfig", @@ -57,7 +40,7 @@ "isOptional": true }, { - "filePath": "/react/components/AppProvider/AppProvider.tsx", + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/components/AppProvider/AppProvider.d.ts", "syntaxKind": "PropertySignature", "name": "children", "value": "React.ReactNode", @@ -65,7 +48,56 @@ "isOptional": true } ], - "value": "export interface AppProviderProps\n extends Omit {\n /**\n * The API key for your Shopify app. This is the `Client ID` from the Partner Dashboard.\n *\n * When using the Shopify CLI, this is the `SHOPIFY_API_KEY` environment variable. If you're using the environment\n * variable, then you need to pass it from the loader to the component.\n */\n apiKey: string;\n /**\n * Whether the app is loaded inside the Shopify Admin. Default is `true`.\n *\n * {@link https://shopify.dev/docs/apps/admin/embedded-app-home}\n */\n isEmbeddedApp?: boolean;\n /**\n * The internationalization (i18n) configuration for your Polaris provider.\n *\n * {@link https://polaris.shopify.com/components/utilities/app-provider}\n */\n i18n?: PolarisAppProviderProps['i18n'];\n /**\n * Used internally by Shopify. You don't need to set this.\n * @private\n */\n __APP_BRIDGE_URL?: string;\n}" + "value": "export interface AppProviderProps {\n /** A locale object or array of locale objects that overrides default translations. If specifying an array then your primary language dictionary should come first, followed by your fallback language dictionaries */\n i18n: ConstructorParameters[0];\n /** A custom component to use for all links used by Polaris components */\n linkComponent?: LinkLikeComponent;\n /** For toggling features */\n features?: FeaturesConfig;\n /** Inner content of the application */\n children?: React.ReactNode;\n}" + }, + "TranslationDictionary": { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/utilities/i18n/I18n.d.ts", + "name": "TranslationDictionary", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/utilities/i18n/I18n.d.ts", + "name": "[key: string]", + "value": "string | TranslationDictionary" + } + ], + "value": "interface TranslationDictionary {\n [key: string]: string | TranslationDictionary;\n}" + }, + "LinkLikeComponent": { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/utilities/link/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "LinkLikeComponent", + "value": "LinkLikeComponent", + "description": "" + }, + "FeaturesConfig": { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/utilities/features/types.d.ts", + "name": "FeaturesConfig", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/utilities/features/types.d.ts", + "name": "[key: string]", + "value": "boolean | undefined" + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/utilities/features/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "polarisSummerEditions2023", + "value": "boolean", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/utilities/features/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "polarisSummerEditions2023ShadowBevelOptOut", + "value": "boolean", + "description": "", + "isOptional": true + } + ], + "value": "export interface FeaturesConfig {\n polarisSummerEditions2023?: boolean;\n polarisSummerEditions2023ShadowBevelOptOut?: boolean;\n [key: string]: boolean | undefined;\n}" } } } @@ -132,7 +164,7 @@ "type": "AuthenticateAdmin", "typeDefinitions": { "AuthenticateAdmin": { - "filePath": "/server/authenticate/admin/types.ts", + "filePath": "src/server/authenticate/admin/types.ts", "name": "AuthenticateAdmin", "description": "", "params": [ @@ -140,11 +172,11 @@ "name": "request", "description": "", "value": "Request", - "filePath": "/server/authenticate/admin/types.ts" + "filePath": "src/server/authenticate/admin/types.ts" } ], "returns": { - "filePath": "/server/authenticate/admin/types.ts", + "filePath": "src/server/authenticate/admin/types.ts", "description": "", "name": "Promise>", "value": "Promise>" @@ -152,19 +184,19 @@ "value": "export type AuthenticateAdmin<\n Config extends AppConfigArg,\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> = (request: Request) => Promise>;" }, "AdminContext": { - "filePath": "/server/authenticate/admin/types.ts", + "filePath": "src/server/authenticate/admin/types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "AdminContext", "value": "Config['isEmbeddedApp'] extends false\n ? NonEmbeddedAdminContext\n : EmbeddedAdminContext", "description": "" }, "NonEmbeddedAdminContext": { - "filePath": "/server/authenticate/admin/types.ts", + "filePath": "src/server/authenticate/admin/types.ts", "name": "NonEmbeddedAdminContext", "description": "", "members": [ { - "filePath": "/server/authenticate/admin/types.ts", + "filePath": "src/server/authenticate/admin/types.ts", "syntaxKind": "PropertySignature", "name": "session", "value": "Session", @@ -201,21 +233,21 @@ ] }, { - "filePath": "/server/authenticate/admin/types.ts", + "filePath": "src/server/authenticate/admin/types.ts", "syntaxKind": "PropertySignature", "name": "admin", "value": "AdminApiContext", "description": "Methods for interacting with the GraphQL / REST Admin APIs for the store that made the request." }, { - "filePath": "/server/authenticate/admin/types.ts", + "filePath": "src/server/authenticate/admin/types.ts", "syntaxKind": "PropertySignature", "name": "billing", "value": "BillingContext", "description": "Billing methods for this store, based on the plans defined in the `billing` config option.\n\n\n\n\n" }, { - "filePath": "/server/authenticate/admin/types.ts", + "filePath": "src/server/authenticate/admin/types.ts", "syntaxKind": "PropertySignature", "name": "cors", "value": "EnsureCORSFunction", @@ -236,13 +268,252 @@ ], "value": "export interface NonEmbeddedAdminContext<\n Config extends AppConfigArg,\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> extends AdminContextInternal {}" }, + "Session": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "name": "Session", + "description": "Stores App information from logged in merchants so they can make authenticated requests to the Admin API.", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "id", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "shop", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "state", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "isOnline", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "scope", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "expires", + "value": "Date", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "accessToken", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "onlineAccessInfo", + "value": "OnlineAccessInfo", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "isActive", + "value": "(scopes: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "isScopeChanged", + "value": "(scopes: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "isExpired", + "value": "(withinMillisecondsOfExpiry?: number) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toObject", + "value": "() => SessionParams", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "equals", + "value": "(other: Session) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toPropertyArray", + "value": "() => [string, string | number | boolean][]", + "description": "" + } + ], + "value": "export declare class Session {\n static fromPropertyArray(entries: [string, string | number | boolean][]): Session;\n readonly id: string;\n shop: string;\n state: string;\n isOnline: boolean;\n scope?: string;\n expires?: Date;\n accessToken?: string;\n onlineAccessInfo?: OnlineAccessInfo;\n constructor(params: SessionParams);\n isActive(scopes: AuthScopes | string | string[]): boolean;\n isScopeChanged(scopes: AuthScopes | string | string[]): boolean;\n isExpired(withinMillisecondsOfExpiry?: number): boolean;\n toObject(): SessionParams;\n equals(other: Session | undefined): boolean;\n toPropertyArray(): [string, string | number | boolean][];\n}" + }, + "OnlineAccessInfo": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "name": "OnlineAccessInfo", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "expires_in", + "value": "number", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "associated_user_scope", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "associated_user", + "value": "{ id: number; first_name: string; last_name: string; email: string; email_verified: boolean; account_owner: boolean; locale: string; collaborator: boolean; }", + "description": "" + } + ], + "value": "export interface OnlineAccessInfo {\n expires_in: number;\n associated_user_scope: string;\n associated_user: {\n id: number;\n first_name: string;\n last_name: string;\n email: string;\n email_verified: boolean;\n account_owner: boolean;\n locale: string;\n collaborator: boolean;\n };\n}" + }, + "AuthScopes": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "name": "AuthScopes", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "has", + "value": "(scope: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "equals", + "value": "(otherScopes: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toString", + "value": "() => string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toArray", + "value": "() => string[]", + "description": "" + } + ], + "value": "declare class AuthScopes {\n static SCOPE_DELIMITER: string;\n private compressedScopes;\n private expandedScopes;\n constructor(scopes: string | string[] | AuthScopes | undefined);\n has(scope: string | string[] | AuthScopes | undefined): boolean;\n equals(otherScopes: string | string[] | AuthScopes | undefined): boolean;\n toString(): string;\n toArray(): string[];\n private getImpliedScopes;\n}" + }, + "SessionParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "name": "SessionParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "id", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "shop", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "state", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "isOnline", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "scope", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "expires", + "value": "Date", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "accessToken", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "onlineAccessInfo", + "value": "OnlineAccessInfo", + "description": "", + "isOptional": true + } + ], + "value": "export interface SessionParams {\n readonly id: string;\n shop: string;\n state: string;\n isOnline: boolean;\n scope?: string;\n expires?: Date;\n accessToken?: string;\n onlineAccessInfo?: OnlineAccessInfo;\n}" + }, "AdminApiContext": { - "filePath": "/server/clients/admin/types.ts", + "filePath": "src/server/clients/admin/types.ts", "name": "AdminApiContext", "description": "", "members": [ { - "filePath": "/server/clients/admin/types.ts", + "filePath": "src/server/clients/admin/types.ts", "syntaxKind": "PropertySignature", "name": "rest", "value": "RestClientWithResources", @@ -293,7 +564,7 @@ ] }, { - "filePath": "/server/clients/admin/types.ts", + "filePath": "src/server/clients/admin/types.ts", "syntaxKind": "PropertySignature", "name": "graphql", "value": "GraphQLClient", @@ -315,82 +586,328 @@ "value": "export interface AdminApiContext<\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> {\n /**\n * Methods for interacting with the Shopify Admin REST API\n *\n * There are methods for interacting with individual REST resources. You can also make `GET`, `POST`, `PUT` and `DELETE` requests should the REST resources not meet your needs.\n *\n * {@link https://shopify.dev/docs/api/admin-rest}\n *\n * @example\n * Using REST resources.\n * Getting the number of orders in a store using REST resources. Visit the [Admin REST API references](/docs/api/admin-rest) for examples on using each resource. \n *\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * return json(admin.rest.resources.Order.count({ session }));\n * };\n * ```\n *\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-07\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n *\n *\n * @example\n * Performing a GET request to the REST API.\n * Use `admin.rest.get` to make custom requests to make a request to to the `customer/count` endpoint\n *\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * const response = await admin.rest.get({ path: \"/customers/count.json\" });\n * const customers = await response.json();\n * return json({ customers });\n * };\n * ```\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n * @example\n * Performing a POST request to the REST API.\n * Use `admin.rest.post` to make custom requests to make a request to to the `customers.json` endpoint to send a welcome email\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * const response = admin.rest.post({\n * path: \"customers/7392136888625/send_invite.json\",\n * body: {\n * customer_invite: {\n * to: \"new_test_email@shopify.com\",\n * from: \"j.limited@example.com\",\n * bcc: [\"j.limited@example.com\"],\n * subject: \"Welcome to my new shop\",\n * custom_message: \"My awesome new store\",\n * },\n * },\n * });\n * const customerInvite = await response.json();\n * return json({ customerInvite });\n * };\n * ```\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n rest: RestClientWithResources;\n\n /**\n * Methods for interacting with the Shopify Admin GraphQL API\n *\n * {@link https://shopify.dev/docs/api/admin-graphql}\n * {@link https://github.com/Shopify/shopify-api-js/blob/main/packages/shopify-api/docs/reference/clients/Graphql.md}\n *\n * @example\n * Querying the GraphQL API.\n * Use `admin.graphql` to make query / mutation requests.\n * ```ts\n * import { ActionFunctionArgs } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { admin } = await authenticate.admin(request);\n *\n * const response = await admin.graphql(\n * `#graphql\n * mutation populateProduct($input: ProductInput!) {\n * productCreate(input: $input) {\n * product {\n * id\n * }\n * }\n * }`,\n * { variables: { input: { title: \"Product Name\" } } }\n * );\n *\n * const productData = await response.json();\n * return json({ data: productData.data });\n * }\n * ```\n */\n graphql: GraphQLClient;\n}" }, "RestClientWithResources": { - "filePath": "/server/clients/admin/rest.ts", + "filePath": "src/server/clients/admin/rest.ts", "syntaxKind": "TypeAliasDeclaration", "name": "RestClientWithResources", "value": "RemixRestClient & {resources: Resources}", "description": "" }, - "BillingContext": { - "filePath": "/server/authenticate/admin/billing/types.ts", - "name": "BillingContext", + "RemixRestClient": { + "filePath": "src/server/clients/admin/rest.ts", + "name": "RemixRestClient", + "description": "", + "members": [ + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "PropertyDeclaration", + "name": "session", + "value": "Session", + "description": "" + }, + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "get", + "value": "(params: GetRequestParams) => Promise", + "description": "Performs a GET request on the given path." + }, + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "post", + "value": "(params: PostRequestParams) => Promise", + "description": "Performs a POST request on the given path." + }, + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "put", + "value": "(params: PostRequestParams) => Promise", + "description": "Performs a PUT request on the given path." + }, + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "delete", + "value": "(params: GetRequestParams) => Promise", + "description": "Performs a DELETE request on the given path." + } + ], + "value": "class RemixRestClient {\n public session: Session;\n private params: AdminClientOptions['params'];\n private handleClientError: AdminClientOptions['handleClientError'];\n\n constructor({params, session, handleClientError}: AdminClientOptions) {\n this.params = params;\n this.handleClientError = handleClientError;\n this.session = session;\n }\n\n /**\n * Performs a GET request on the given path.\n */\n public async get(params: GetRequestParams) {\n return this.makeRequest({\n method: 'GET' as RequestParams['method'],\n ...params,\n });\n }\n\n /**\n * Performs a POST request on the given path.\n */\n public async post(params: PostRequestParams) {\n return this.makeRequest({\n method: 'POST' as RequestParams['method'],\n ...params,\n });\n }\n\n /**\n * Performs a PUT request on the given path.\n */\n public async put(params: PutRequestParams) {\n return this.makeRequest({\n method: 'PUT' as RequestParams['method'],\n ...params,\n });\n }\n\n /**\n * Performs a DELETE request on the given path.\n */\n public async delete(params: DeleteRequestParams) {\n return this.makeRequest({\n method: 'DELETE' as RequestParams['method'],\n ...params,\n });\n }\n\n protected async makeRequest(params: RequestParams): Promise {\n const originalClient = new this.params.api.clients.Rest({\n session: this.session,\n });\n const originalRequest = Reflect.get(originalClient, 'request');\n\n try {\n const apiResponse = await originalRequest.call(originalClient, params);\n\n // We use a separate client for REST requests and REST resources because we want to override the API library\n // client class to return a Response object instead.\n return new Response(JSON.stringify(apiResponse.body), {\n headers: apiResponse.headers,\n });\n } catch (error) {\n if (this.handleClientError) {\n throw await this.handleClientError({\n error,\n session: this.session,\n params: this.params,\n });\n } else throw new Error(error);\n }\n }\n}" + }, + "GetRequestParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "GetRequestParams", "description": "", "members": [ { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", "syntaxKind": "PropertySignature", - "name": "require", - "value": "(options: RequireBillingOptions) => Promise", - "description": "Checks if the shop has an active payment for any plan defined in the `billing` config option.", - "examples": [ - { - "title": "Requesting billing right away", - "description": "Call `billing.request` in the `onFailure` callback to immediately redirect to the Shopify page to request payment.", - "tabs": [ - { - "code": "import { LoaderFunctionArgs } from \"@remix-run/node\";\nimport { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { billing } = await authenticate.admin(request);\n await billing.require({\n plans: [MONTHLY_PLAN],\n isTest: true,\n onFailure: async () => billing.request({ plan: MONTHLY_PLAN }),\n });\n\n // App logic\n};", - "title": "/app/routes/**\\/*.ts" - }, - { - "code": "import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n\nexport const MONTHLY_PLAN = 'Monthly subscription';\nexport const ANNUAL_PLAN = 'Annual subscription';\n\nconst shopify = shopifyApp({\n // ...etc\n billing: {\n [MONTHLY_PLAN]: {\n amount: 5,\n currencyCode: 'USD',\n interval: BillingInterval.Every30Days,\n },\n [ANNUAL_PLAN]: {\n amount: 50,\n currencyCode: 'USD',\n interval: BillingInterval.Annual,\n },\n }\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "shopify.server.ts" - } - ] - }, - { - "title": "Using a plan selection page", - "description": "When the app has multiple plans, create a page in your App that allows the merchant to select a plan. If a merchant does not have the required plan you can redirect them to page in your app to select one.", - "tabs": [ - { - "code": "import { LoaderFunctionArgs, redirect } from \"@remix-run/node\";\nimport { authenticate, MONTHLY_PLAN, ANNUAL_PLAN } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { billing } = await authenticate.admin(request);\n const billingCheck = await billing.require({\n plans: [MONTHLY_PLAN, ANNUAL_PLAN],\n isTest: true,\n onFailure: () => redirect('/select-plan'),\n });\n\n const subscription = billingCheck.appSubscriptions[0];\n console.log(`Shop is on ${subscription.name} (id ${subscription.id})`);\n\n // App logic\n};", - "title": "/app/routes/**\\/*.ts" - }, - { - "code": "import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n\nexport const MONTHLY_PLAN = 'Monthly subscription';\nexport const ANNUAL_PLAN = 'Annual subscription';\n\nconst shopify = shopifyApp({\n // ...etc\n billing: {\n [MONTHLY_PLAN]: {\n amount: 5,\n currencyCode: 'USD',\n interval: BillingInterval.Every30Days,\n },\n [ANNUAL_PLAN]: {\n amount: 50,\n currencyCode: 'USD',\n interval: BillingInterval.Annual,\n },\n }\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "shopify.server.ts" - } - ] - } - ] + "name": "path", + "value": "string", + "description": "" }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", "syntaxKind": "PropertySignature", - "name": "request", - "value": "(options: RequestBillingOptions) => Promise", - "description": "Requests payment for the plan.", - "examples": [ - { - "title": "Using a custom return URL", - "description": "Change where the merchant is returned to after approving the purchase using the `returnUrl` option.", - "tabs": [ - { - "code": "import { LoaderFunctionArgs } from \"@remix-run/node\";\nimport { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { billing } = await authenticate.admin(request);\n await billing.require({\n plans: [MONTHLY_PLAN],\n onFailure: async () => billing.request({\n plan: MONTHLY_PLAN,\n isTest: true,\n returnUrl: 'https://admin.shopify.com/store/my-store/apps/my-app/billing-page',\n }),\n });\n\n // App logic\n};", - "title": "/app/routes/**\\/*.ts" - }, - { - "code": "import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n\nexport const MONTHLY_PLAN = 'Monthly subscription';\nexport const ANNUAL_PLAN = 'Annual subscription';\n\nconst shopify = shopifyApp({\n // ...etc\n billing: {\n [MONTHLY_PLAN]: {\n amount: 5,\n currencyCode: 'USD',\n interval: BillingInterval.Every30Days,\n },\n [ANNUAL_PLAN]: {\n amount: 50,\n currencyCode: 'USD',\n interval: BillingInterval.Annual,\n },\n }\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "shopify.server.ts" - } - ] - } - ] + "name": "type", + "value": "DataType", + "description": "", + "isOptional": true }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", "syntaxKind": "PropertySignature", - "name": "cancel", - "value": "(options: CancelBillingOptions) => Promise", + "name": "data", + "value": "string | Record", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "query", + "value": "SearchParams", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "extraHeaders", + "value": "HeaderParams", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "tries", + "value": "number", + "description": "", + "isOptional": true + } + ], + "value": "export interface GetRequestParams {\n path: string;\n type?: DataType;\n data?: Record | string;\n query?: SearchParams;\n extraHeaders?: HeaderParams;\n tries?: number;\n}" + }, + "DataType": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "DataType", + "value": "export declare enum DataType {\n JSON = \"application/json\",\n GraphQL = \"application/graphql\",\n URLEncoded = \"application/x-www-form-urlencoded\"\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "JSON", + "value": "application/json" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "GraphQL", + "value": "application/graphql" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "URLEncoded", + "value": "application/x-www-form-urlencoded" + } + ] + }, + "HeaderParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "HeaderParams", + "value": "Record", + "description": "", + "members": [] + }, + "PostRequestParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "PostRequestParams", + "value": "GetRequestParams & {\n data: Record | string;\n}", + "description": "" + }, + "GraphQLClient": { + "filePath": "src/server/clients/types.ts", + "name": "GraphQLClient", + "description": "", + "params": [ + { + "name": "query", + "description": "", + "value": "Operation extends keyof Operations", + "filePath": "src/server/clients/types.ts" + }, + { + "name": "options", + "description": "", + "value": "GraphQLQueryOptions", + "isOptional": true, + "filePath": "src/server/clients/types.ts" + } + ], + "returns": { + "filePath": "src/server/clients/types.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}" + }, + "value": "export type GraphQLClient = <\n Operation extends keyof Operations,\n>(\n query: Operation,\n options?: GraphQLQueryOptions,\n) => Promise<\n ResponseWithType>>\n>;" + }, + "GraphQLQueryOptions": { + "filePath": "src/server/clients/types.ts", + "name": "GraphQLQueryOptions", + "description": "", + "members": [ + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "variables", + "value": "ApiClientRequestOptions[\"variables\"]", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "apiVersion", + "value": "ApiVersion", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "headers", + "value": "{ [key: string]: any; }", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "tries", + "value": "number", + "description": "", + "isOptional": true + } + ], + "value": "export interface GraphQLQueryOptions<\n Operation extends keyof Operations,\n Operations extends AllOperations,\n> {\n variables?: ApiClientRequestOptions['variables'];\n apiVersion?: ApiVersion;\n headers?: {[key: string]: any};\n tries?: number;\n}" + }, + "ApiVersion": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "ApiVersion", + "value": "export declare enum ApiVersion {\n October22 = \"2022-10\",\n January23 = \"2023-01\",\n April23 = \"2023-04\",\n July23 = \"2023-07\",\n October23 = \"2023-10\",\n January24 = \"2024-01\",\n Unstable = \"unstable\"\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "October22", + "value": "2022-10" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "January23", + "value": "2023-01" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "April23", + "value": "2023-04" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "July23", + "value": "2023-07" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "October23", + "value": "2023-10" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "January24", + "value": "2024-01" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Unstable", + "value": "unstable" + } + ] + }, + "BillingContext": { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "name": "BillingContext", + "description": "", + "members": [ + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "require", + "value": "(options: RequireBillingOptions) => Promise", + "description": "Checks if the shop has an active payment for any plan defined in the `billing` config option.", + "examples": [ + { + "title": "Requesting billing right away", + "description": "Call `billing.request` in the `onFailure` callback to immediately redirect to the Shopify page to request payment.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs } from \"@remix-run/node\";\nimport { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { billing } = await authenticate.admin(request);\n await billing.require({\n plans: [MONTHLY_PLAN],\n isTest: true,\n onFailure: async () => billing.request({ plan: MONTHLY_PLAN }),\n });\n\n // App logic\n};", + "title": "/app/routes/**\\/*.ts" + }, + { + "code": "import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n\nexport const MONTHLY_PLAN = 'Monthly subscription';\nexport const ANNUAL_PLAN = 'Annual subscription';\n\nconst shopify = shopifyApp({\n // ...etc\n billing: {\n [MONTHLY_PLAN]: {\n amount: 5,\n currencyCode: 'USD',\n interval: BillingInterval.Every30Days,\n },\n [ANNUAL_PLAN]: {\n amount: 50,\n currencyCode: 'USD',\n interval: BillingInterval.Annual,\n },\n }\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "shopify.server.ts" + } + ] + }, + { + "title": "Using a plan selection page", + "description": "When the app has multiple plans, create a page in your App that allows the merchant to select a plan. If a merchant does not have the required plan you can redirect them to page in your app to select one.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, redirect } from \"@remix-run/node\";\nimport { authenticate, MONTHLY_PLAN, ANNUAL_PLAN } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { billing } = await authenticate.admin(request);\n const billingCheck = await billing.require({\n plans: [MONTHLY_PLAN, ANNUAL_PLAN],\n isTest: true,\n onFailure: () => redirect('/select-plan'),\n });\n\n const subscription = billingCheck.appSubscriptions[0];\n console.log(`Shop is on ${subscription.name} (id ${subscription.id})`);\n\n // App logic\n};", + "title": "/app/routes/**\\/*.ts" + }, + { + "code": "import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n\nexport const MONTHLY_PLAN = 'Monthly subscription';\nexport const ANNUAL_PLAN = 'Annual subscription';\n\nconst shopify = shopifyApp({\n // ...etc\n billing: {\n [MONTHLY_PLAN]: {\n amount: 5,\n currencyCode: 'USD',\n interval: BillingInterval.Every30Days,\n },\n [ANNUAL_PLAN]: {\n amount: 50,\n currencyCode: 'USD',\n interval: BillingInterval.Annual,\n },\n }\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "shopify.server.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "request", + "value": "(options: RequestBillingOptions) => Promise", + "description": "Requests payment for the plan.", + "examples": [ + { + "title": "Using a custom return URL", + "description": "Change where the merchant is returned to after approving the purchase using the `returnUrl` option.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs } from \"@remix-run/node\";\nimport { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { billing } = await authenticate.admin(request);\n await billing.require({\n plans: [MONTHLY_PLAN],\n onFailure: async () => billing.request({\n plan: MONTHLY_PLAN,\n isTest: true,\n returnUrl: 'https://admin.shopify.com/store/my-store/apps/my-app/billing-page',\n }),\n });\n\n // App logic\n};", + "title": "/app/routes/**\\/*.ts" + }, + { + "code": "import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n\nexport const MONTHLY_PLAN = 'Monthly subscription';\nexport const ANNUAL_PLAN = 'Annual subscription';\n\nconst shopify = shopifyApp({\n // ...etc\n billing: {\n [MONTHLY_PLAN]: {\n amount: 5,\n currencyCode: 'USD',\n interval: BillingInterval.Every30Days,\n },\n [ANNUAL_PLAN]: {\n amount: 50,\n currencyCode: 'USD',\n interval: BillingInterval.Annual,\n },\n }\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "shopify.server.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "cancel", + "value": "(options: CancelBillingOptions) => Promise", "description": "Cancels an ongoing subscription, given its ID.", "examples": [ { @@ -413,26 +930,26 @@ "value": "export interface BillingContext {\n /**\n * Checks if the shop has an active payment for any plan defined in the `billing` config option.\n *\n * @returns A promise that resolves to an object containing the active purchases for the shop.\n *\n * @example\n * Requesting billing right away.\n * Call `billing.request` in the `onFailure` callback to immediately redirect to the Shopify page to request payment.\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * await billing.require({\n * plans: [MONTHLY_PLAN],\n * isTest: true,\n * onFailure: async () => billing.request({ plan: MONTHLY_PLAN }),\n * });\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n *\n * @example\n * Using a plan selection page.\n * When the app has multiple plans, create a page in your App that allows the merchant to select a plan. If a merchant does not have the required plan you can redirect them to page in your app to select one.\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, redirect } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN, ANNUAL_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * const billingCheck = await billing.require({\n * plans: [MONTHLY_PLAN, ANNUAL_PLAN],\n * isTest: true,\n * onFailure: () => redirect('/select-plan'),\n * });\n *\n * const subscription = billingCheck.appSubscriptions[0];\n * console.log(`Shop is on ${subscription.name} (id ${subscription.id})`);\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n require: (\n options: RequireBillingOptions,\n ) => Promise;\n\n /**\n * Requests payment for the plan.\n *\n * @returns Redirects to the confirmation URL for the payment.\n *\n * @example\n * Using a custom return URL.\n * Change where the merchant is returned to after approving the purchase using the `returnUrl` option.\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * await billing.require({\n * plans: [MONTHLY_PLAN],\n * onFailure: async () => billing.request({\n * plan: MONTHLY_PLAN,\n * isTest: true,\n * returnUrl: 'https://admin.shopify.com/store/my-store/apps/my-app/billing-page',\n * }),\n * });\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n request: (options: RequestBillingOptions) => Promise;\n\n /**\n * Cancels an ongoing subscription, given its ID.\n *\n * @returns The cancelled subscription.\n *\n * @example\n * Cancelling a subscription.\n * Use the `billing.cancel` function to cancel an active subscription with the id returned from `billing.require`.\n * ```ts\n * // /app/routes/cancel-subscription.ts\n * import { LoaderFunctionArgs } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * const billingCheck = await billing.require({\n * plans: [MONTHLY_PLAN],\n * onFailure: async () => billing.request({ plan: MONTHLY_PLAN }),\n * });\n *\n * const subscription = billingCheck.appSubscriptions[0];\n * const cancelledSubscription = await billing.cancel({\n * subscriptionId: subscription.id,\n * isTest: true,\n * prorate: true,\n * });\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n cancel: (options: CancelBillingOptions) => Promise;\n}" }, "RequireBillingOptions": { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "name": "RequireBillingOptions", "description": "", "members": [ { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "syntaxKind": "PropertySignature", "name": "plans", "value": "(keyof Config[\"billing\"])[]", "description": "The plans to check for. Must be one of the values defined in the `billing` config option." }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "syntaxKind": "PropertySignature", "name": "onFailure", "value": "(error: any) => Promise", "description": "How to handle the request if the shop doesn't have an active payment for any plan." }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "syntaxKind": "PropertySignature", "name": "isTest", "value": "boolean", @@ -442,20 +959,114 @@ ], "value": "export interface RequireBillingOptions\n extends Omit {\n /**\n * The plans to check for. Must be one of the values defined in the `billing` config option.\n */\n plans: (keyof Config['billing'])[];\n /**\n * How to handle the request if the shop doesn't have an active payment for any plan.\n */\n onFailure: (error: any) => Promise;\n}" }, + "BillingCheckResponseObject": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingCheckResponseObject", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "hasActivePayment", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "oneTimePurchases", + "value": "OneTimePurchase[]", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "appSubscriptions", + "value": "AppSubscription[]", + "description": "" + } + ], + "value": "export interface BillingCheckResponseObject {\n hasActivePayment: boolean;\n oneTimePurchases: OneTimePurchase[];\n appSubscriptions: AppSubscription[];\n}" + }, + "OneTimePurchase": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "OneTimePurchase", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "id", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "name", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "test", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "status", + "value": "string", + "description": "" + } + ], + "value": "export interface OneTimePurchase {\n id: string;\n name: string;\n test: boolean;\n status: string;\n}" + }, + "AppSubscription": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "AppSubscription", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "id", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "name", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "test", + "value": "boolean", + "description": "" + } + ], + "value": "export interface AppSubscription {\n id: string;\n name: string;\n test: boolean;\n}" + }, "RequestBillingOptions": { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "name": "RequestBillingOptions", "description": "", "members": [ { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "syntaxKind": "PropertySignature", "name": "plan", "value": "keyof Config[\"billing\"]", "description": "The plan to request. Must be one of the values defined in the `billing` config option." }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "syntaxKind": "PropertySignature", "name": "isTest", "value": "boolean", @@ -463,7 +1074,7 @@ "isOptional": true }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "syntaxKind": "PropertySignature", "name": "returnUrl", "value": "string", @@ -474,19 +1085,19 @@ "value": "export interface RequestBillingOptions\n extends Omit {\n /**\n * The plan to request. Must be one of the values defined in the `billing` config option.\n */\n plan: keyof Config['billing'];\n /**\n * Whether to use the test mode. This prevents the credit card from being charged. Test shops and demo shops cannot be charged.\n */\n isTest?: boolean;\n /**\n * The URL to return to after the merchant approves the payment.\n */\n returnUrl?: string;\n}" }, "CancelBillingOptions": { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "name": "CancelBillingOptions", "description": "", "members": [ { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "syntaxKind": "PropertySignature", "name": "subscriptionId", "value": "string", "description": "The ID of the subscription to cancel." }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "syntaxKind": "PropertySignature", "name": "prorate", "value": "boolean", @@ -494,7 +1105,7 @@ "isOptional": true }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "syntaxKind": "PropertySignature", "name": "isTest", "value": "boolean", @@ -504,13 +1115,20 @@ ], "value": "export interface CancelBillingOptions {\n /**\n * The ID of the subscription to cancel.\n */\n subscriptionId: string;\n /**\n * Whether to prorate the cancellation.\n *\n * {@link https://shopify.dev/docs/apps/billing/subscriptions/cancel-recurring-charges}\n */\n prorate?: boolean;\n /*\n * Whether to use the test mode. This prevents the credit card from being charged. Test shops and demo shops cannot be charged.\n */\n isTest?: boolean;\n}" }, + "EnsureCORSFunction": { + "filePath": "src/server/authenticate/helpers/ensure-cors-headers.ts", + "name": "EnsureCORSFunction", + "description": "", + "members": [], + "value": "export interface EnsureCORSFunction {\n (response: Response): Response;\n}" + }, "EmbeddedAdminContext": { - "filePath": "/server/authenticate/admin/types.ts", + "filePath": "src/server/authenticate/admin/types.ts", "name": "EmbeddedAdminContext", "description": "", "members": [ { - "filePath": "/server/authenticate/admin/types.ts", + "filePath": "src/server/authenticate/admin/types.ts", "syntaxKind": "PropertySignature", "name": "sessionToken", "value": "JwtPayload", @@ -533,7 +1151,7 @@ ] }, { - "filePath": "/server/authenticate/admin/types.ts", + "filePath": "src/server/authenticate/admin/types.ts", "syntaxKind": "PropertySignature", "name": "redirect", "value": "RedirectFunction", @@ -562,7 +1180,7 @@ ] }, { - "filePath": "/server/authenticate/admin/types.ts", + "filePath": "src/server/authenticate/admin/types.ts", "syntaxKind": "PropertySignature", "name": "session", "value": "Session", @@ -599,21 +1217,21 @@ ] }, { - "filePath": "/server/authenticate/admin/types.ts", + "filePath": "src/server/authenticate/admin/types.ts", "syntaxKind": "PropertySignature", "name": "admin", "value": "AdminApiContext", "description": "Methods for interacting with the GraphQL / REST Admin APIs for the store that made the request." }, { - "filePath": "/server/authenticate/admin/types.ts", + "filePath": "src/server/authenticate/admin/types.ts", "syntaxKind": "PropertySignature", "name": "billing", "value": "BillingContext", "description": "Billing methods for this store, based on the plans defined in the `billing` config option.\n\n\n\n\n" }, { - "filePath": "/server/authenticate/admin/types.ts", + "filePath": "src/server/authenticate/admin/types.ts", "syntaxKind": "PropertySignature", "name": "cors", "value": "EnsureCORSFunction", @@ -634,44 +1252,115 @@ ], "value": "export interface EmbeddedAdminContext<\n Config extends AppConfigArg,\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> extends AdminContextInternal {\n /**\n * The decoded and validated session token for the request.\n *\n * Returned only if `isEmbeddedApp` is `true`.\n *\n * {@link https://shopify.dev/docs/apps/auth/oauth/session-tokens#payload}\n *\n * @example\n * Using the decoded session token.\n * Get user-specific data using the `sessionToken` object.\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n *\n * const shopify = shopifyApp({\n * // ...etc\n * useOnlineTokens: true,\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n * import { getMyAppData } from \"~/db/model.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { sessionToken } = await authenticate.public.checkout(\n * request\n * );\n * return json(await getMyAppData({user: sessionToken.sub}));\n * };\n * ```\n */\n sessionToken: JwtPayload;\n\n /**\n * A function that redirects the user to a new page, ensuring that the appropriate parameters are set for embedded\n * apps.\n *\n * Returned only if `isEmbeddedApp` is `true`.\n *\n * @example\n * Redirecting to an app route.\n * Use the `redirect` helper to safely redirect between pages.\n * ```ts\n * // /app/routes/admin/my-route.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { session, redirect } = await authenticate.admin(request);\n * return redirect(\"/\");\n * };\n * ```\n *\n * @example\n * Redirecting outside of Shopify admin.\n * Pass in a `target` option of `_top` or `_parent` to go to an external URL.\n * ```ts\n * // /app/routes/admin/my-route.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { session, redirect } = await authenticate.admin(request);\n * return redirect(\"/\", { target: '_parent' });\n * };\n * ```\n */\n redirect: RedirectFunction;\n}" }, - "RedirectFunction": { - "filePath": "/server/authenticate/admin/helpers/redirect.ts", - "name": "RedirectFunction", + "JwtPayload": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "name": "JwtPayload", "description": "", - "params": [ + "members": [ { - "name": "url", - "description": "", + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "iss", "value": "string", - "filePath": "/server/authenticate/admin/helpers/redirect.ts" + "description": "" }, { - "name": "init", - "description": "", - "value": "RedirectInit", - "isOptional": true, - "filePath": "/server/authenticate/admin/helpers/redirect.ts" - } - ], - "returns": { - "filePath": "/server/authenticate/admin/helpers/redirect.ts", - "description": "", - "name": "TypedResponse", - "value": "TypedResponse" - }, - "value": "export type RedirectFunction = (\n url: string,\n init?: RedirectInit,\n) => TypedResponse;" - }, - "RedirectInit": { - "filePath": "/server/authenticate/admin/helpers/redirect.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "RedirectInit", - "value": "number | (ResponseInit & {target?: RedirectTarget})", - "description": "" - }, - "RedirectTarget": { - "filePath": "/server/authenticate/admin/helpers/redirect.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "RedirectTarget", + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "dest", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "aud", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "sub", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "exp", + "value": "number", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "nbf", + "value": "number", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "iat", + "value": "number", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "jti", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "sid", + "value": "string", + "description": "" + } + ], + "value": "export interface JwtPayload {\n iss: string;\n dest: string;\n aud: string;\n sub: string;\n exp: number;\n nbf: number;\n iat: number;\n jti: string;\n sid: string;\n}" + }, + "RedirectFunction": { + "filePath": "src/server/authenticate/admin/helpers/redirect.ts", + "name": "RedirectFunction", + "description": "", + "params": [ + { + "name": "url", + "description": "", + "value": "string", + "filePath": "src/server/authenticate/admin/helpers/redirect.ts" + }, + { + "name": "init", + "description": "", + "value": "RedirectInit", + "isOptional": true, + "filePath": "src/server/authenticate/admin/helpers/redirect.ts" + } + ], + "returns": { + "filePath": "src/server/authenticate/admin/helpers/redirect.ts", + "description": "", + "name": "TypedResponse", + "value": "TypedResponse" + }, + "value": "export type RedirectFunction = (\n url: string,\n init?: RedirectInit,\n) => TypedResponse;" + }, + "RedirectInit": { + "filePath": "src/server/authenticate/admin/helpers/redirect.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "RedirectInit", + "value": "number | (ResponseInit & {target?: RedirectTarget})", + "description": "" + }, + "RedirectTarget": { + "filePath": "src/server/authenticate/admin/helpers/redirect.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "RedirectTarget", "value": "'_self' | '_parent' | '_top'", "description": "" } @@ -991,12 +1680,12 @@ "type": "BillingContext", "typeDefinitions": { "BillingContext": { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "name": "BillingContext", "description": "", "members": [ { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "syntaxKind": "PropertySignature", "name": "require", "value": "(options: RequireBillingOptions) => Promise", @@ -1033,7 +1722,7 @@ ] }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "syntaxKind": "PropertySignature", "name": "request", "value": "(options: RequestBillingOptions) => Promise", @@ -1056,7 +1745,7 @@ ] }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "syntaxKind": "PropertySignature", "name": "cancel", "value": "(options: CancelBillingOptions) => Promise", @@ -1082,26 +1771,26 @@ "value": "export interface BillingContext {\n /**\n * Checks if the shop has an active payment for any plan defined in the `billing` config option.\n *\n * @returns A promise that resolves to an object containing the active purchases for the shop.\n *\n * @example\n * Requesting billing right away.\n * Call `billing.request` in the `onFailure` callback to immediately redirect to the Shopify page to request payment.\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * await billing.require({\n * plans: [MONTHLY_PLAN],\n * isTest: true,\n * onFailure: async () => billing.request({ plan: MONTHLY_PLAN }),\n * });\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n *\n * @example\n * Using a plan selection page.\n * When the app has multiple plans, create a page in your App that allows the merchant to select a plan. If a merchant does not have the required plan you can redirect them to page in your app to select one.\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, redirect } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN, ANNUAL_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * const billingCheck = await billing.require({\n * plans: [MONTHLY_PLAN, ANNUAL_PLAN],\n * isTest: true,\n * onFailure: () => redirect('/select-plan'),\n * });\n *\n * const subscription = billingCheck.appSubscriptions[0];\n * console.log(`Shop is on ${subscription.name} (id ${subscription.id})`);\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n require: (\n options: RequireBillingOptions,\n ) => Promise;\n\n /**\n * Requests payment for the plan.\n *\n * @returns Redirects to the confirmation URL for the payment.\n *\n * @example\n * Using a custom return URL.\n * Change where the merchant is returned to after approving the purchase using the `returnUrl` option.\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * await billing.require({\n * plans: [MONTHLY_PLAN],\n * onFailure: async () => billing.request({\n * plan: MONTHLY_PLAN,\n * isTest: true,\n * returnUrl: 'https://admin.shopify.com/store/my-store/apps/my-app/billing-page',\n * }),\n * });\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n request: (options: RequestBillingOptions) => Promise;\n\n /**\n * Cancels an ongoing subscription, given its ID.\n *\n * @returns The cancelled subscription.\n *\n * @example\n * Cancelling a subscription.\n * Use the `billing.cancel` function to cancel an active subscription with the id returned from `billing.require`.\n * ```ts\n * // /app/routes/cancel-subscription.ts\n * import { LoaderFunctionArgs } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * const billingCheck = await billing.require({\n * plans: [MONTHLY_PLAN],\n * onFailure: async () => billing.request({ plan: MONTHLY_PLAN }),\n * });\n *\n * const subscription = billingCheck.appSubscriptions[0];\n * const cancelledSubscription = await billing.cancel({\n * subscriptionId: subscription.id,\n * isTest: true,\n * prorate: true,\n * });\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n cancel: (options: CancelBillingOptions) => Promise;\n}" }, "RequireBillingOptions": { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "name": "RequireBillingOptions", "description": "", "members": [ { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "syntaxKind": "PropertySignature", "name": "plans", "value": "(keyof Config[\"billing\"])[]", "description": "The plans to check for. Must be one of the values defined in the `billing` config option." }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "syntaxKind": "PropertySignature", "name": "onFailure", "value": "(error: any) => Promise", "description": "How to handle the request if the shop doesn't have an active payment for any plan." }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "syntaxKind": "PropertySignature", "name": "isTest", "value": "boolean", @@ -1111,20 +1800,114 @@ ], "value": "export interface RequireBillingOptions\n extends Omit {\n /**\n * The plans to check for. Must be one of the values defined in the `billing` config option.\n */\n plans: (keyof Config['billing'])[];\n /**\n * How to handle the request if the shop doesn't have an active payment for any plan.\n */\n onFailure: (error: any) => Promise;\n}" }, + "BillingCheckResponseObject": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingCheckResponseObject", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "hasActivePayment", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "oneTimePurchases", + "value": "OneTimePurchase[]", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "appSubscriptions", + "value": "AppSubscription[]", + "description": "" + } + ], + "value": "export interface BillingCheckResponseObject {\n hasActivePayment: boolean;\n oneTimePurchases: OneTimePurchase[];\n appSubscriptions: AppSubscription[];\n}" + }, + "OneTimePurchase": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "OneTimePurchase", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "id", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "name", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "test", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "status", + "value": "string", + "description": "" + } + ], + "value": "export interface OneTimePurchase {\n id: string;\n name: string;\n test: boolean;\n status: string;\n}" + }, + "AppSubscription": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "AppSubscription", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "id", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "name", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "test", + "value": "boolean", + "description": "" + } + ], + "value": "export interface AppSubscription {\n id: string;\n name: string;\n test: boolean;\n}" + }, "RequestBillingOptions": { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "name": "RequestBillingOptions", "description": "", "members": [ { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "syntaxKind": "PropertySignature", "name": "plan", "value": "keyof Config[\"billing\"]", "description": "The plan to request. Must be one of the values defined in the `billing` config option." }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "syntaxKind": "PropertySignature", "name": "isTest", "value": "boolean", @@ -1132,7 +1915,7 @@ "isOptional": true }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "syntaxKind": "PropertySignature", "name": "returnUrl", "value": "string", @@ -1143,19 +1926,19 @@ "value": "export interface RequestBillingOptions\n extends Omit {\n /**\n * The plan to request. Must be one of the values defined in the `billing` config option.\n */\n plan: keyof Config['billing'];\n /**\n * Whether to use the test mode. This prevents the credit card from being charged. Test shops and demo shops cannot be charged.\n */\n isTest?: boolean;\n /**\n * The URL to return to after the merchant approves the payment.\n */\n returnUrl?: string;\n}" }, "CancelBillingOptions": { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "name": "CancelBillingOptions", "description": "", "members": [ { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "syntaxKind": "PropertySignature", "name": "subscriptionId", "value": "string", "description": "The ID of the subscription to cancel." }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "syntaxKind": "PropertySignature", "name": "prorate", "value": "boolean", @@ -1163,7 +1946,7 @@ "isOptional": true }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/admin/billing/types.ts", "syntaxKind": "PropertySignature", "name": "isTest", "value": "boolean", @@ -1293,7 +2076,7 @@ "type": "AuthenticateAppProxy", "typeDefinitions": { "AuthenticateAppProxy": { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "src/server/authenticate/public/appProxy/types.ts", "name": "AuthenticateAppProxy", "description": "", "params": [ @@ -1301,11 +2084,11 @@ "name": "request", "description": "", "value": "Request", - "filePath": "/server/authenticate/public/appProxy/types.ts" + "filePath": "src/server/authenticate/public/appProxy/types.ts" } ], "returns": { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "src/server/authenticate/public/appProxy/types.ts", "description": "", "name": "Promise", "value": "Promise" @@ -1313,33 +2096,33 @@ "value": "export type AuthenticateAppProxy = (\n request: Request,\n) => Promise;" }, "AppProxyContext": { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "src/server/authenticate/public/appProxy/types.ts", "name": "AppProxyContext", "description": "", "members": [ { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "src/server/authenticate/public/appProxy/types.ts", "syntaxKind": "PropertySignature", "name": "session", "value": "undefined", "description": "No session is available for the shop that made this request.\n\nThis comes from the session storage which `shopifyApp` uses to store sessions in your database of choice." }, { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "src/server/authenticate/public/appProxy/types.ts", "syntaxKind": "PropertySignature", "name": "admin", "value": "undefined", "description": "No session is available for the shop that made this request. Therefore no methods for interacting with the GraphQL / REST Admin APIs are available." }, { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "src/server/authenticate/public/appProxy/types.ts", "syntaxKind": "PropertySignature", "name": "storefront", "value": "undefined", "description": "No session is available for the shop that made this request. Therefore no method for interacting with the Storefront API is available." }, { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "src/server/authenticate/public/appProxy/types.ts", "syntaxKind": "PropertySignature", "name": "liquid", "value": "LiquidResponseFunction", @@ -1361,7 +2144,7 @@ "value": "export interface AppProxyContext extends Context {\n /**\n * No session is available for the shop that made this request.\n *\n * This comes from the session storage which `shopifyApp` uses to store sessions in your database of choice.\n */\n session: undefined;\n\n /**\n * No session is available for the shop that made this request.\n * Therefore no methods for interacting with the GraphQL / REST Admin APIs are available.\n */\n admin: undefined;\n\n /**\n * No session is available for the shop that made this request.\n * Therefore no method for interacting with the Storefront API is available.\n */\n storefront: undefined;\n}" }, "LiquidResponseFunction": { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "src/server/authenticate/public/appProxy/types.ts", "name": "LiquidResponseFunction", "description": "", "params": [ @@ -1369,18 +2152,18 @@ "name": "body", "description": "", "value": "string", - "filePath": "/server/authenticate/public/appProxy/types.ts" + "filePath": "src/server/authenticate/public/appProxy/types.ts" }, { "name": "initAndOptions", "description": "", "value": "number | (ResponseInit & Options)", "isOptional": true, - "filePath": "/server/authenticate/public/appProxy/types.ts" + "filePath": "src/server/authenticate/public/appProxy/types.ts" } ], "returns": { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "src/server/authenticate/public/appProxy/types.ts", "description": "", "name": "Response", "value": "Response" @@ -1388,12 +2171,12 @@ "value": "export type LiquidResponseFunction = (\n body: string,\n initAndOptions?: number | (ResponseInit & Options),\n) => Response;" }, "Options": { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "src/server/authenticate/public/appProxy/types.ts", "name": "Options", "description": "", "members": [ { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "src/server/authenticate/public/appProxy/types.ts", "syntaxKind": "PropertySignature", "name": "layout", "value": "boolean", @@ -1404,12 +2187,12 @@ "value": "interface Options {\n layout?: boolean;\n}" }, "AppProxyContextWithSession": { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "src/server/authenticate/public/appProxy/types.ts", "name": "AppProxyContextWithSession", "description": "", "members": [ { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "src/server/authenticate/public/appProxy/types.ts", "syntaxKind": "PropertySignature", "name": "session", "value": "Session", @@ -1428,7 +2211,7 @@ ] }, { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "src/server/authenticate/public/appProxy/types.ts", "syntaxKind": "PropertySignature", "name": "admin", "value": "AdminApiContext", @@ -1447,7 +2230,7 @@ ] }, { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "src/server/authenticate/public/appProxy/types.ts", "syntaxKind": "PropertySignature", "name": "storefront", "value": "StorefrontContext", @@ -1466,7 +2249,7 @@ ] }, { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "src/server/authenticate/public/appProxy/types.ts", "syntaxKind": "PropertySignature", "name": "liquid", "value": "LiquidResponseFunction", @@ -1487,4115 +2270,11805 @@ ], "value": "export interface AppProxyContextWithSession<\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> extends Context {\n /**\n * The session for the shop that made the request.\n *\n * This comes from the session storage which `shopifyApp` uses to store sessions in your database of choice.\n *\n * Use this to get shop or user-specific data.\n *\n * @example\n * Using the session object.\n * Get the session for the shop that initiated the request to the app proxy.\n * ```ts\n * // app/routes/**\\/.ts\n * import { json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n * import { getMyAppModelData } from \"~/db/model.server\";\n *\n * export const loader = async ({ request }) => {\n * // Get the session for the shop that initiated the request to the app proxy.\n * const { session } = await authenticate.public.appProxy(request);\n *\n * // Use the session data to make to queries to your database or additional requests.\n * return json(await getMyAppModelData({shop: session.shop));\n * };\n * ```\n */\n session: Session;\n\n /**\n * Methods for interacting with the GraphQL / REST Admin APIs for the store that made the request.\n *\n * @example\n * Interacting with the Admin API.\n * Use the `admin` object to interact with the REST or GraphQL APIs.\n * ```ts\n * // app/routes/**\\/.ts\n * import { json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { admin } = await authenticate.public.appProxy(request);\n *\n * const response = await admin.graphql(\n * `#graphql\n * mutation populateProduct($input: ProductInput!) {\n * productCreate(input: $input) {\n * product {\n * id\n * }\n * }\n * }`,\n * { variables: { input: { title: \"Product Name\" } } }\n * );\n *\n * const productData = await response.json();\n * return json({ data: productData.data });\n * }\n * ```\n */\n admin: AdminApiContext;\n\n /**\n * Method for interacting with the Shopify Storefront Graphql API for the store that made the request.\n *\n * @example\n * Interacting with the Storefront API.\n * Use the `storefront` object to interact with the GraphQL API.\n * ```ts\n * // app/routes/**\\/.ts\n * import { json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { storefront } = await authenticate.public.appProxy(request);\n *\n * const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);\n *\n * return json(await response.json());\n * }\n * ```\n */\n storefront: StorefrontContext;\n}" }, - "AdminApiContext": { - "filePath": "/server/clients/admin/types.ts", - "name": "AdminApiContext", - "description": "", + "Session": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "name": "Session", + "description": "Stores App information from logged in merchants so they can make authenticated requests to the Admin API.", "members": [ { - "filePath": "/server/clients/admin/types.ts", - "syntaxKind": "PropertySignature", - "name": "rest", - "value": "RestClientWithResources", - "description": "Methods for interacting with the Shopify Admin REST API\n\nThere are methods for interacting with individual REST resources. You can also make `GET`, `POST`, `PUT` and `DELETE` requests should the REST resources not meet your needs.\n\n\n\n\n", - "examples": [ - { - "title": "Using REST resources", - "description": "Getting the number of orders in a store using REST resources. Visit the [Admin REST API references](/docs/api/admin-rest) for examples on using each resource.", - "tabs": [ - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n return json(admin.rest.resources.Order.count({ session }));\n};", - "title": "/app/routes/**\\/*.ts" - }, - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-07\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "/app/shopify.server.ts" - } - ] - }, - { - "title": "Performing a GET request to the REST API", - "description": "Use `admin.rest.get` to make custom requests to make a request to to the `customer/count` endpoint", - "tabs": [ - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n const response = await admin.rest.get({ path: \"/customers/count.json\" });\n const customers = await response.json();\n return json({ customers });\n};", - "title": "/app/routes/**\\/*.ts" - }, - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "/app/shopify.server.ts" - } - ] - }, - { - "title": "Performing a POST request to the REST API", - "description": "Use `admin.rest.post` to make custom requests to make a request to to the `customers.json` endpoint to send a welcome email", - "tabs": [ - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n const response = admin.rest.post({\n path: \"customers/7392136888625/send_invite.json\",\n body: {\n customer_invite: {\n to: \"new_test_email@shopify.com\",\n from: \"j.limited@example.com\",\n bcc: [\"j.limited@example.com\"],\n subject: \"Welcome to my new shop\",\n custom_message: \"My awesome new store\",\n },\n },\n});\n const customerInvite = await response.json();\n return json({ customerInvite });\n};", - "title": "/app/routes/**\\/*.ts" - }, - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "/app/shopify.server.ts" - } - ] - } - ] + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "id", + "value": "string", + "description": "" }, { - "filePath": "/server/clients/admin/types.ts", - "syntaxKind": "PropertySignature", - "name": "graphql", - "value": "GraphQLClient", - "description": "Methods for interacting with the Shopify Admin GraphQL API\n\n\n\n\n\n\n\n\n\n", - "examples": [ - { - "title": "Querying the GraphQL API", - "description": "Use `admin.graphql` to make query / mutation requests.", - "tabs": [ - { - "code": "import { ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.admin(request);\n\n const response = await admin.graphql(\n `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n { variables: { input: { title: \"Product Name\" } } }\n );\n\n const productData = await response.json();\n return json({ data: productData.data });\n}", - "title": "Example" - } - ] - } - ] + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "shop", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "state", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "isOnline", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "scope", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "expires", + "value": "Date", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "accessToken", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "onlineAccessInfo", + "value": "OnlineAccessInfo", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "isActive", + "value": "(scopes: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "isScopeChanged", + "value": "(scopes: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "isExpired", + "value": "(withinMillisecondsOfExpiry?: number) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toObject", + "value": "() => SessionParams", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "equals", + "value": "(other: Session) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toPropertyArray", + "value": "() => [string, string | number | boolean][]", + "description": "" } ], - "value": "export interface AdminApiContext<\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> {\n /**\n * Methods for interacting with the Shopify Admin REST API\n *\n * There are methods for interacting with individual REST resources. You can also make `GET`, `POST`, `PUT` and `DELETE` requests should the REST resources not meet your needs.\n *\n * {@link https://shopify.dev/docs/api/admin-rest}\n *\n * @example\n * Using REST resources.\n * Getting the number of orders in a store using REST resources. Visit the [Admin REST API references](/docs/api/admin-rest) for examples on using each resource. \n *\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * return json(admin.rest.resources.Order.count({ session }));\n * };\n * ```\n *\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-07\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n *\n *\n * @example\n * Performing a GET request to the REST API.\n * Use `admin.rest.get` to make custom requests to make a request to to the `customer/count` endpoint\n *\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * const response = await admin.rest.get({ path: \"/customers/count.json\" });\n * const customers = await response.json();\n * return json({ customers });\n * };\n * ```\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n * @example\n * Performing a POST request to the REST API.\n * Use `admin.rest.post` to make custom requests to make a request to to the `customers.json` endpoint to send a welcome email\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * const response = admin.rest.post({\n * path: \"customers/7392136888625/send_invite.json\",\n * body: {\n * customer_invite: {\n * to: \"new_test_email@shopify.com\",\n * from: \"j.limited@example.com\",\n * bcc: [\"j.limited@example.com\"],\n * subject: \"Welcome to my new shop\",\n * custom_message: \"My awesome new store\",\n * },\n * },\n * });\n * const customerInvite = await response.json();\n * return json({ customerInvite });\n * };\n * ```\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n rest: RestClientWithResources;\n\n /**\n * Methods for interacting with the Shopify Admin GraphQL API\n *\n * {@link https://shopify.dev/docs/api/admin-graphql}\n * {@link https://github.com/Shopify/shopify-api-js/blob/main/packages/shopify-api/docs/reference/clients/Graphql.md}\n *\n * @example\n * Querying the GraphQL API.\n * Use `admin.graphql` to make query / mutation requests.\n * ```ts\n * import { ActionFunctionArgs } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { admin } = await authenticate.admin(request);\n *\n * const response = await admin.graphql(\n * `#graphql\n * mutation populateProduct($input: ProductInput!) {\n * productCreate(input: $input) {\n * product {\n * id\n * }\n * }\n * }`,\n * { variables: { input: { title: \"Product Name\" } } }\n * );\n *\n * const productData = await response.json();\n * return json({ data: productData.data });\n * }\n * ```\n */\n graphql: GraphQLClient;\n}" - }, - "RestClientWithResources": { - "filePath": "/server/clients/admin/rest.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "RestClientWithResources", - "value": "RemixRestClient & {resources: Resources}", - "description": "" + "value": "export declare class Session {\n static fromPropertyArray(entries: [string, string | number | boolean][]): Session;\n readonly id: string;\n shop: string;\n state: string;\n isOnline: boolean;\n scope?: string;\n expires?: Date;\n accessToken?: string;\n onlineAccessInfo?: OnlineAccessInfo;\n constructor(params: SessionParams);\n isActive(scopes: AuthScopes | string | string[]): boolean;\n isScopeChanged(scopes: AuthScopes | string | string[]): boolean;\n isExpired(withinMillisecondsOfExpiry?: number): boolean;\n toObject(): SessionParams;\n equals(other: Session | undefined): boolean;\n toPropertyArray(): [string, string | number | boolean][];\n}" }, - "StorefrontContext": { - "filePath": "/server/clients/storefront/types.ts", - "name": "StorefrontContext", + "OnlineAccessInfo": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "name": "OnlineAccessInfo", "description": "", "members": [ { - "filePath": "/server/clients/storefront/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", "syntaxKind": "PropertySignature", - "name": "graphql", - "value": "GraphQLClient", - "description": "Method for interacting with the Shopify Storefront GraphQL API\n\nIf you're getting incorrect type hints in the Shopify template, follow [these instructions](https://github.com/Shopify/shopify-app-template-remix/tree/main#incorrect-graphql-hints).\n\n\n\n\n", - "examples": [ - { - "title": "Querying the GraphQL API", - "description": "Use `storefront.graphql` to make query / mutation requests.", - "tabs": [ - { - "code": "import { json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { storefront } = await authenticate.public.appProxy(request);\n\n const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);\n\n return json(await response.json());\n}", - "title": "app/routes/**\\/.ts" - } - ] - } - ] + "name": "expires_in", + "value": "number", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "associated_user_scope", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "associated_user", + "value": "{ id: number; first_name: string; last_name: string; email: string; email_verified: boolean; account_owner: boolean; locale: string; collaborator: boolean; }", + "description": "" } ], - "value": "export interface StorefrontContext {\n /**\n * Method for interacting with the Shopify Storefront GraphQL API\n *\n * If you're getting incorrect type hints in the Shopify template, follow [these instructions](https://github.com/Shopify/shopify-app-template-remix/tree/main#incorrect-graphql-hints).\n *\n * {@link https://shopify.dev/docs/api/storefront}\n *\n * @example\n * Querying the GraphQL API.\n * Use `storefront.graphql` to make query / mutation requests.\n * ```ts\n * // app/routes/**\\/.ts\n * import { json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { storefront } = await authenticate.public.appProxy(request);\n *\n * const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);\n *\n * return json(await response.json());\n * }\n * ```\n */\n graphql: GraphQLClient;\n}" - } - } - } - ], - "jsDocTypeExamples": [ - "AppProxyContextWithSession" - ], - "related": [ - { - "name": "Admin API context", - "subtitle": "Interact with the Admin API.", - "url": "/docs/api/shopify-app-remix/apis/admin-api" - }, - { - "name": "Storefront API context", - "subtitle": "Interact with the Storefront API.", - "url": "/docs/api/shopify-app-remix/apis/storefront-api" - } - ], - "examples": { - "description": "", - "exampleGroups": [ - { - "title": "session", - "examples": [ - { - "description": "Get the session for the shop that initiated the request to the app proxy.", - "codeblock": { - "title": "Using the session object", - "tabs": [ - { - "title": "app/routes/**\\/.ts", - "code": "import { json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppModelData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }) => {\n // Get the session for the shop that initiated the request to the app proxy.\n const { session } = await authenticate.public.appProxy(request);\n\n // Use the session data to make to queries to your database or additional requests.\n return json(await getMyAppModelData({shop: session.shop));\n};", - "language": "typescript" - } - ] - } - } - ] - }, - { - "title": "admin", - "examples": [ - { - "description": "Use the `admin` object to interact with the REST or GraphQL APIs.", - "codeblock": { - "title": "Interacting with the Admin API", - "tabs": [ - { - "title": "app/routes/**\\/.ts", - "code": "import { json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.public.appProxy(request);\n\n const response = await admin.graphql(\n `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n { variables: { input: { title: \"Product Name\" } } }\n );\n\n const productData = await response.json();\n return json({ data: productData.data });\n}", - "language": "typescript" - } - ] - } - } - ] - }, - { - "title": "storefront", - "examples": [ - { - "description": "Use the `storefront` object to interact with the GraphQL API.", - "codeblock": { - "title": "Interacting with the Storefront API", - "tabs": [ - { - "title": "app/routes/**\\/.ts", - "code": "import { json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { storefront } = await authenticate.public.appProxy(request);\n\n const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);\n\n return json(await response.json());\n}", - "language": "typescript" - } - ] - } - } - ] - }, - { - "title": "liquid", - "examples": [ - { - "description": "Use the `liquid` helper to render a `Response` with Liquid content.", - "codeblock": { - "title": "Rendering liquid content", - "tabs": [ - { - "title": "app/routes/**\\/.ts", - "code": "import {authenticate} from \"~/shopify.server\"\n\nexport async function loader({ request }) {\n const {liquid} = await authenticate.public.appProxy(request);\n\n return liquid(\"Hello {{shop.name}}\")\n}", - "language": "typescript" - } - ] - } - } - ] - } - ] - } - }, - { - "name": "Checkout", - "description": "The `authenticate.public.checkout` function ensures that checkout extension requests are coming from Shopify, and returns helpers to respond with the correct headers.", - "category": "Authenticate", - "subCategory": "Public", - "type": "object", - "isVisualComponent": false, - "definitions": [ - { - "title": "authenticate.public.checkout", - "description": "Authenticates requests coming from Shopify checkout extensions.", - "type": "AuthenticateCheckout", - "typeDefinitions": { - "AuthenticateCheckout": { - "filePath": "/server/authenticate/public/checkout/types.ts", - "name": "AuthenticateCheckout", + "value": "export interface OnlineAccessInfo {\n expires_in: number;\n associated_user_scope: string;\n associated_user: {\n id: number;\n first_name: string;\n last_name: string;\n email: string;\n email_verified: boolean;\n account_owner: boolean;\n locale: string;\n collaborator: boolean;\n };\n}" + }, + "AuthScopes": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "name": "AuthScopes", "description": "", - "params": [ + "members": [ { - "name": "request", - "description": "", - "value": "Request", - "filePath": "/server/authenticate/public/checkout/types.ts" + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "has", + "value": "(scope: string | string[] | AuthScopes) => boolean", + "description": "" }, { - "name": "options", - "description": "", - "value": "AuthenticateCheckoutOptions", - "isOptional": true, - "filePath": "/server/authenticate/public/checkout/types.ts" + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "equals", + "value": "(otherScopes: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toString", + "value": "() => string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toArray", + "value": "() => string[]", + "description": "" } ], - "returns": { - "filePath": "/server/authenticate/public/checkout/types.ts", - "description": "", - "name": "Promise", - "value": "Promise" - }, - "value": "export type AuthenticateCheckout = (\n request: Request,\n options?: AuthenticateCheckoutOptions,\n) => Promise;" + "value": "declare class AuthScopes {\n static SCOPE_DELIMITER: string;\n private compressedScopes;\n private expandedScopes;\n constructor(scopes: string | string[] | AuthScopes | undefined);\n has(scope: string | string[] | AuthScopes | undefined): boolean;\n equals(otherScopes: string | string[] | AuthScopes | undefined): boolean;\n toString(): string;\n toArray(): string[];\n private getImpliedScopes;\n}" }, - "AuthenticateCheckoutOptions": { - "filePath": "/server/authenticate/public/checkout/types.ts", - "name": "AuthenticateCheckoutOptions", + "SessionParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "name": "SessionParams", "description": "", "members": [ { - "filePath": "/server/authenticate/public/checkout/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", "syntaxKind": "PropertySignature", - "name": "corsHeaders", - "value": "string[]", + "name": "id", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "shop", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "state", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "isOnline", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "scope", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "expires", + "value": "Date", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "accessToken", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "onlineAccessInfo", + "value": "OnlineAccessInfo", "description": "", "isOptional": true } ], - "value": "export interface AuthenticateCheckoutOptions {\n corsHeaders?: string[];\n}" + "value": "export interface SessionParams {\n readonly id: string;\n shop: string;\n state: string;\n isOnline: boolean;\n scope?: string;\n expires?: Date;\n accessToken?: string;\n onlineAccessInfo?: OnlineAccessInfo;\n}" }, - "CheckoutContext": { - "filePath": "/server/authenticate/public/checkout/types.ts", - "name": "CheckoutContext", - "description": "Authenticated Context for a checkout request", + "AdminApiContext": { + "filePath": "src/server/clients/admin/types.ts", + "name": "AdminApiContext", + "description": "", "members": [ { - "filePath": "/server/authenticate/public/checkout/types.ts", + "filePath": "src/server/clients/admin/types.ts", "syntaxKind": "PropertySignature", - "name": "sessionToken", - "value": "JwtPayload", - "description": "The decoded and validated session token for the request\n\nRefer to the OAuth docs for the [session token payload](https://shopify.dev/docs/apps/auth/oauth/session-tokens#payload).", + "name": "rest", + "value": "RestClientWithResources", + "description": "Methods for interacting with the Shopify Admin REST API\n\nThere are methods for interacting with individual REST resources. You can also make `GET`, `POST`, `PUT` and `DELETE` requests should the REST resources not meet your needs.\n\n\n\n\n", "examples": [ { - "title": "Using the decoded session token", - "description": "Get store-specific data using the `sessionToken` object.", + "title": "Using REST resources", + "description": "Getting the number of orders in a store using REST resources. Visit the [Admin REST API references](/docs/api/admin-rest) for examples on using each resource.", "tabs": [ { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { sessionToken } = await authenticate.public.checkout(\n request\n );\n return json(await getMyAppData({shop: sessionToken.dest}));\n};", - "title": "app/routes/public/my-route.ts" + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n return json(admin.rest.resources.Order.count({ session }));\n};", + "title": "/app/routes/**\\/*.ts" + }, + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-07\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "/app/shopify.server.ts" } ] - } - ] - }, - { - "filePath": "/server/authenticate/public/checkout/types.ts", - "syntaxKind": "PropertySignature", - "name": "cors", - "value": "EnsureCORSFunction", - "description": "A function that ensures the CORS headers are set correctly for the response.", - "examples": [ + }, { - "title": "Setting CORS headers for a public request", - "description": "Use the `cors` helper to ensure your app can respond to checkout extension requests.", + "title": "Performing a GET request to the REST API", + "description": "Use `admin.rest.get` to make custom requests to make a request to to the `customer/count` endpoint", "tabs": [ { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { sessionToken, cors } = await authenticate.public.checkout(\n request,\n { corsHeaders: [\"X-My-Custom-Header\"] }\n );\n const data = await getMyAppData({shop: sessionToken.dest});\n return cors(json(data));\n};", - "title": "app/routes/public/my-route.ts" + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n const response = await admin.rest.get({ path: \"/customers/count.json\" });\n const customers = await response.json();\n return json({ customers });\n};", + "title": "/app/routes/**\\/*.ts" + }, + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "/app/shopify.server.ts" } ] - } - ] - } - ], - "value": "export interface CheckoutContext {\n /**\n * The decoded and validated session token for the request\n *\n * Refer to the OAuth docs for the [session token payload](https://shopify.dev/docs/apps/auth/oauth/session-tokens#payload).\n *\n * @example\n * Using the decoded session token.\n * Get store-specific data using the `sessionToken` object.\n * ```ts\n * // app/routes/public/my-route.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n * import { getMyAppData } from \"~/db/model.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { sessionToken } = await authenticate.public.checkout(\n * request\n * );\n * return json(await getMyAppData({shop: sessionToken.dest}));\n * };\n * ```\n */\n sessionToken: JwtPayload;\n\n /**\n * A function that ensures the CORS headers are set correctly for the response.\n *\n * @example\n * Setting CORS headers for a public request.\n * Use the `cors` helper to ensure your app can respond to checkout extension requests.\n * ```ts\n * // app/routes/public/my-route.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n * import { getMyAppData } from \"~/db/model.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { sessionToken, cors } = await authenticate.public.checkout(\n * request,\n * { corsHeaders: [\"X-My-Custom-Header\"] }\n * );\n * const data = await getMyAppData({shop: sessionToken.dest});\n * return cors(json(data));\n * };\n * ```\n */\n cors: EnsureCORSFunction;\n}" - } - } - } - ], - "jsDocTypeExamples": [ - "CheckoutContext" - ], - "related": [], - "examples": { - "description": "", - "exampleGroups": [ - { - "title": "sessionToken", - "examples": [ - { - "description": "Get store-specific data using the `sessionToken` object.", - "codeblock": { - "title": "Using the decoded session token", - "tabs": [ + }, { - "title": "app/routes/public/my-route.ts", - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { sessionToken } = await authenticate.public.checkout(\n request\n );\n return json(await getMyAppData({shop: sessionToken.dest}));\n};", - "language": "typescript" + "title": "Performing a POST request to the REST API", + "description": "Use `admin.rest.post` to make custom requests to make a request to to the `customers.json` endpoint to send a welcome email", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n const response = admin.rest.post({\n path: \"customers/7392136888625/send_invite.json\",\n body: {\n customer_invite: {\n to: \"new_test_email@shopify.com\",\n from: \"j.limited@example.com\",\n bcc: [\"j.limited@example.com\"],\n subject: \"Welcome to my new shop\",\n custom_message: \"My awesome new store\",\n },\n },\n});\n const customerInvite = await response.json();\n return json({ customerInvite });\n};", + "title": "/app/routes/**\\/*.ts" + }, + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "/app/shopify.server.ts" + } + ] } ] - } - } - ] - }, - { - "title": "cors", - "examples": [ - { - "description": "Use the `cors` helper to ensure your app can respond to checkout extension requests.", - "codeblock": { - "title": "Setting CORS headers for a public request", - "tabs": [ + }, + { + "filePath": "src/server/clients/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "graphql", + "value": "GraphQLClient", + "description": "Methods for interacting with the Shopify Admin GraphQL API\n\n\n\n\n\n\n\n\n\n", + "examples": [ { - "title": "app/routes/public/my-route.ts", - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { sessionToken, cors } = await authenticate.public.checkout(\n request,\n { corsHeaders: [\"X-My-Custom-Header\"] }\n );\n const data = await getMyAppData({shop: sessionToken.dest});\n return cors(json(data));\n};", - "language": "typescript" + "title": "Querying the GraphQL API", + "description": "Use `admin.graphql` to make query / mutation requests.", + "tabs": [ + { + "code": "import { ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.admin(request);\n\n const response = await admin.graphql(\n `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n { variables: { input: { title: \"Product Name\" } } }\n );\n\n const productData = await response.json();\n return json({ data: productData.data });\n}", + "title": "Example" + } + ] } ] } - } - ] - } - ] - } - }, - { - "name": "Webhook", - "description": "Contains functions for verifying Shopify webhooks.\n\n> Note: The format of the `admin` object returned by this function changes with the `v3_webhookAdminContext` future flag. Learn more about [gradual feature adoption](/docs/api/shopify-app-remix/guide-future-flags).", - "category": "Authenticate", - "type": "object", - "isVisualComponent": false, - "definitions": [ - { - "title": "authenticate.webhook", - "description": "Verifies requests coming from Shopify webhooks.", - "type": "AuthenticateWebhook", - "typeDefinitions": { - "AuthenticateWebhook": { - "filePath": "/server/authenticate/webhooks/types.ts", - "name": "AuthenticateWebhook", - "description": "", - "params": [ - { - "name": "request", - "description": "", - "value": "Request", - "filePath": "/server/authenticate/webhooks/types.ts" - } ], - "returns": { - "filePath": "/server/authenticate/webhooks/types.ts", - "description": "", - "name": "Promise>", - "value": "Promise>" - }, - "value": "export type AuthenticateWebhook<\n Future extends FutureFlagOptions,\n Resources extends ShopifyRestResources,\n Topics = string | number | symbol,\n> = (request: Request) => Promise>;" + "value": "export interface AdminApiContext<\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> {\n /**\n * Methods for interacting with the Shopify Admin REST API\n *\n * There are methods for interacting with individual REST resources. You can also make `GET`, `POST`, `PUT` and `DELETE` requests should the REST resources not meet your needs.\n *\n * {@link https://shopify.dev/docs/api/admin-rest}\n *\n * @example\n * Using REST resources.\n * Getting the number of orders in a store using REST resources. Visit the [Admin REST API references](/docs/api/admin-rest) for examples on using each resource. \n *\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * return json(admin.rest.resources.Order.count({ session }));\n * };\n * ```\n *\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-07\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n *\n *\n * @example\n * Performing a GET request to the REST API.\n * Use `admin.rest.get` to make custom requests to make a request to to the `customer/count` endpoint\n *\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * const response = await admin.rest.get({ path: \"/customers/count.json\" });\n * const customers = await response.json();\n * return json({ customers });\n * };\n * ```\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n * @example\n * Performing a POST request to the REST API.\n * Use `admin.rest.post` to make custom requests to make a request to to the `customers.json` endpoint to send a welcome email\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * const response = admin.rest.post({\n * path: \"customers/7392136888625/send_invite.json\",\n * body: {\n * customer_invite: {\n * to: \"new_test_email@shopify.com\",\n * from: \"j.limited@example.com\",\n * bcc: [\"j.limited@example.com\"],\n * subject: \"Welcome to my new shop\",\n * custom_message: \"My awesome new store\",\n * },\n * },\n * });\n * const customerInvite = await response.json();\n * return json({ customerInvite });\n * };\n * ```\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n rest: RestClientWithResources;\n\n /**\n * Methods for interacting with the Shopify Admin GraphQL API\n *\n * {@link https://shopify.dev/docs/api/admin-graphql}\n * {@link https://github.com/Shopify/shopify-api-js/blob/main/packages/shopify-api/docs/reference/clients/Graphql.md}\n *\n * @example\n * Querying the GraphQL API.\n * Use `admin.graphql` to make query / mutation requests.\n * ```ts\n * import { ActionFunctionArgs } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { admin } = await authenticate.admin(request);\n *\n * const response = await admin.graphql(\n * `#graphql\n * mutation populateProduct($input: ProductInput!) {\n * productCreate(input: $input) {\n * product {\n * id\n * }\n * }\n * }`,\n * { variables: { input: { title: \"Product Name\" } } }\n * );\n *\n * const productData = await response.json();\n * return json({ data: productData.data });\n * }\n * ```\n */\n graphql: GraphQLClient;\n}" }, - "WebhookContext": { - "filePath": "/server/authenticate/webhooks/types.ts", + "RestClientWithResources": { + "filePath": "src/server/clients/admin/rest.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "WebhookContext", - "value": "WebhookContextWithoutSession | WebhookContextWithSession", + "name": "RestClientWithResources", + "value": "RemixRestClient & {resources: Resources}", "description": "" }, - "WebhookContextWithoutSession": { - "filePath": "/server/authenticate/webhooks/types.ts", - "name": "WebhookContextWithoutSession", + "RemixRestClient": { + "filePath": "src/server/clients/admin/rest.ts", + "name": "RemixRestClient", "description": "", "members": [ { - "filePath": "/server/authenticate/webhooks/types.ts", - "syntaxKind": "PropertySignature", + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "PropertyDeclaration", "name": "session", - "value": "undefined", + "value": "Session", "description": "" }, { - "filePath": "/server/authenticate/webhooks/types.ts", + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "get", + "value": "(params: GetRequestParams) => Promise", + "description": "Performs a GET request on the given path." + }, + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "post", + "value": "(params: PostRequestParams) => Promise", + "description": "Performs a POST request on the given path." + }, + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "put", + "value": "(params: PostRequestParams) => Promise", + "description": "Performs a PUT request on the given path." + }, + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "delete", + "value": "(params: GetRequestParams) => Promise", + "description": "Performs a DELETE request on the given path." + } + ], + "value": "class RemixRestClient {\n public session: Session;\n private params: AdminClientOptions['params'];\n private handleClientError: AdminClientOptions['handleClientError'];\n\n constructor({params, session, handleClientError}: AdminClientOptions) {\n this.params = params;\n this.handleClientError = handleClientError;\n this.session = session;\n }\n\n /**\n * Performs a GET request on the given path.\n */\n public async get(params: GetRequestParams) {\n return this.makeRequest({\n method: 'GET' as RequestParams['method'],\n ...params,\n });\n }\n\n /**\n * Performs a POST request on the given path.\n */\n public async post(params: PostRequestParams) {\n return this.makeRequest({\n method: 'POST' as RequestParams['method'],\n ...params,\n });\n }\n\n /**\n * Performs a PUT request on the given path.\n */\n public async put(params: PutRequestParams) {\n return this.makeRequest({\n method: 'PUT' as RequestParams['method'],\n ...params,\n });\n }\n\n /**\n * Performs a DELETE request on the given path.\n */\n public async delete(params: DeleteRequestParams) {\n return this.makeRequest({\n method: 'DELETE' as RequestParams['method'],\n ...params,\n });\n }\n\n protected async makeRequest(params: RequestParams): Promise {\n const originalClient = new this.params.api.clients.Rest({\n session: this.session,\n });\n const originalRequest = Reflect.get(originalClient, 'request');\n\n try {\n const apiResponse = await originalRequest.call(originalClient, params);\n\n // We use a separate client for REST requests and REST resources because we want to override the API library\n // client class to return a Response object instead.\n return new Response(JSON.stringify(apiResponse.body), {\n headers: apiResponse.headers,\n });\n } catch (error) {\n if (this.handleClientError) {\n throw await this.handleClientError({\n error,\n session: this.session,\n params: this.params,\n });\n } else throw new Error(error);\n }\n }\n}" + }, + "GetRequestParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "GetRequestParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", "syntaxKind": "PropertySignature", - "name": "admin", - "value": "undefined", + "name": "path", + "value": "string", "description": "" }, { - "filePath": "/server/authenticate/webhooks/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", "syntaxKind": "PropertySignature", - "name": "apiVersion", - "value": "string", - "description": "The API version used for the webhook.", - "examples": [ - { - "title": "Webhook API version", - "description": "Get the API version used for webhook request.", - "tabs": [ - { - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { apiVersion } = await authenticate.webhook(request);\n return new Response();\n};", - "title": "/app/routes/webhooks.tsx" - } - ] - } - ] + "name": "type", + "value": "DataType", + "description": "", + "isOptional": true }, { - "filePath": "/server/authenticate/webhooks/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", "syntaxKind": "PropertySignature", - "name": "shop", - "value": "string", - "description": "The shop where the webhook was triggered.", - "examples": [ - { - "title": "Webhook shop", - "description": "Get the shop that triggered a webhook.", - "tabs": [ - { - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { shop } = await authenticate.webhook(request);\n return new Response();\n};", - "title": "/app/routes/webhooks.tsx" - } - ] - } - ] + "name": "data", + "value": "string | Record", + "description": "", + "isOptional": true }, { - "filePath": "/server/authenticate/webhooks/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", "syntaxKind": "PropertySignature", - "name": "topic", - "value": "Topics", - "description": "The topic of the webhook.", - "examples": [ - { - "title": "Webhook topic", - "description": "Get the event topic for the webhook.", - "tabs": [ - { - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { topic } = await authenticate.webhook(request);\n\n switch (topic) {\n case \"APP_UNINSTALLED\":\n // Do something when the app is uninstalled.\n break;\n }\n\n return new Response();\n};", - "title": "/app/routes/webhooks.tsx" - } - ] - } - ] + "name": "query", + "value": "SearchParams", + "description": "", + "isOptional": true }, { - "filePath": "/server/authenticate/webhooks/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", "syntaxKind": "PropertySignature", - "name": "webhookId", - "value": "string", - "description": "A unique ID for the webhook. Useful to keep track of which events your app has already processed.", - "examples": [ - { - "title": "Webhook ID", - "description": "Get the webhook ID.", - "tabs": [ - { - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { webhookId } = await authenticate.webhook(request);\n return new Response();\n};", - "title": "/app/routes/webhooks.tsx" - } - ] - } - ] + "name": "extraHeaders", + "value": "HeaderParams", + "description": "", + "isOptional": true }, { - "filePath": "/server/authenticate/webhooks/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", "syntaxKind": "PropertySignature", - "name": "payload", - "value": "JSONValue", - "description": "The payload from the webhook request.", - "examples": [ - { - "title": "Webhook payload", - "description": "Get the request's POST payload.", - "tabs": [ - { - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { payload } = await authenticate.webhook(request);\n return new Response();\n};", - "title": "/app/routes/webhooks.tsx" - } - ] - } - ] + "name": "tries", + "value": "number", + "description": "", + "isOptional": true } ], - "value": "export interface WebhookContextWithoutSession\n extends Context {\n session: undefined;\n admin: undefined;\n}" + "value": "export interface GetRequestParams {\n path: string;\n type?: DataType;\n data?: Record | string;\n query?: SearchParams;\n extraHeaders?: HeaderParams;\n tries?: number;\n}" }, - "JSONValue": { - "filePath": "/server/types.ts", + "DataType": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "DataType", + "value": "export declare enum DataType {\n JSON = \"application/json\",\n GraphQL = \"application/graphql\",\n URLEncoded = \"application/x-www-form-urlencoded\"\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "JSON", + "value": "application/json" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "GraphQL", + "value": "application/graphql" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "URLEncoded", + "value": "application/x-www-form-urlencoded" + } + ] + }, + "HeaderParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "JSONValue", - "value": "string | number | boolean | null | JSONObject | JSONArray", + "name": "HeaderParams", + "value": "Record", + "description": "", + "members": [] + }, + "PostRequestParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "PostRequestParams", + "value": "GetRequestParams & {\n data: Record | string;\n}", "description": "" }, - "JSONObject": { - "filePath": "/server/types.ts", - "name": "JSONObject", + "GraphQLClient": { + "filePath": "src/server/clients/types.ts", + "name": "GraphQLClient", "description": "", - "members": [ + "params": [ { - "filePath": "/server/types.ts", - "name": "[x: string]", - "value": "JSONValue" + "name": "query", + "description": "", + "value": "Operation extends keyof Operations", + "filePath": "src/server/clients/types.ts" + }, + { + "name": "options", + "description": "", + "value": "GraphQLQueryOptions", + "isOptional": true, + "filePath": "src/server/clients/types.ts" } ], - "value": "interface JSONObject {\n [x: string]: JSONValue;\n}" + "returns": { + "filePath": "src/server/clients/types.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}" + }, + "value": "export type GraphQLClient = <\n Operation extends keyof Operations,\n>(\n query: Operation,\n options?: GraphQLQueryOptions,\n) => Promise<\n ResponseWithType>>\n>;" }, - "JSONArray": { - "filePath": "/server/types.ts", - "name": "JSONArray", + "GraphQLQueryOptions": { + "filePath": "src/server/clients/types.ts", + "name": "GraphQLQueryOptions", "description": "", "members": [ { - "filePath": "/server/types.ts", + "filePath": "src/server/clients/types.ts", "syntaxKind": "PropertySignature", - "name": "length", - "value": "number", - "description": "Gets or sets the length of the array. This is a number one higher than the highest index in the array." + "name": "variables", + "value": "ApiClientRequestOptions[\"variables\"]", + "description": "", + "isOptional": true }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "toString", - "value": "() => string", - "description": "Returns a string representation of an array." - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "toLocaleString", - "value": "() => string", - "description": "Returns a string representation of an array. The elements are converted to string using their toLocaleString methods." - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "pop", - "value": "() => JSONValue", - "description": "Removes the last element from an array and returns it.\r\nIf the array is empty, undefined is returned and the array is not modified." - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "push", - "value": "(...items: JSONValue[]) => number", - "description": "Appends new elements to the end of an array, and returns the new length of the array." - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "concat", - "value": "{ (...items: ConcatArray[]): JSONValue[]; (...items: (JSONValue | ConcatArray)[]): JSONValue[]; }", - "description": "Combines two or more arrays.\r\nThis method returns a new array without modifying any existing arrays." - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "join", - "value": "(separator?: string) => string", - "description": "Adds all the elements of an array into a string, separated by the specified separator string." - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "reverse", - "value": "() => JSONValue[]", - "description": "Reverses the elements in an array in place.\r\nThis method mutates the array and returns a reference to the same array." - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "shift", - "value": "() => JSONValue", - "description": "Removes the first element from an array and returns it.\r\nIf the array is empty, undefined is returned and the array is not modified." - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "slice", - "value": "(start?: number, end?: number) => JSONValue[]", - "description": "Returns a copy of a section of an array.\r\nFor both start and end, a negative index can be used to indicate an offset from the end of the array.\r\nFor example, -2 refers to the second to last element of the array." - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "sort", - "value": "(compareFn?: (a: JSONValue, b: JSONValue) => number) => JSONArray", - "description": "Sorts an array in place.\r\nThis method mutates the array and returns a reference to the same array." - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "splice", - "value": "{ (start: number, deleteCount?: number): JSONValue[]; (start: number, deleteCount: number, ...items: JSONValue[]): JSONValue[]; }", - "description": "Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements." - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "unshift", - "value": "(...items: JSONValue[]) => number", - "description": "Inserts new elements at the start of an array, and returns the new length of the array." - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "indexOf", - "value": "(searchElement: JSONValue, fromIndex?: number) => number", - "description": "Returns the index of the first occurrence of a value in an array, or -1 if it is not present." - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "lastIndexOf", - "value": "(searchElement: JSONValue, fromIndex?: number) => number", - "description": "Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present." - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "every", - "value": "{ (predicate: (value: JSONValue, index: number, array: JSONValue[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: JSONValue, index: number, array: JSONValue[]) => unknown, thisArg?: any): boolean; }", - "description": "Determines whether all the members of an array satisfy the specified test." - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "some", - "value": "(predicate: (value: JSONValue, index: number, array: JSONValue[]) => unknown, thisArg?: any) => boolean", - "description": "Determines whether the specified callback function returns true for any element of an array." - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "forEach", - "value": "(callbackfn: (value: JSONValue, index: number, array: JSONValue[]) => void, thisArg?: any) => void", - "description": "Performs the specified action for each element in an array." - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "map", - "value": "(callbackfn: (value: JSONValue, index: number, array: JSONValue[]) => U, thisArg?: any) => U[]", - "description": "Calls a defined callback function on each element of an array, and returns an array that contains the results." - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "filter", - "value": "{ (predicate: (value: JSONValue, index: number, array: JSONValue[]) => value is S, thisArg?: any): S[]; (predicate: (value: JSONValue, index: number, array: JSONValue[]) => unknown, thisArg?: any): JSONValue[]; }", - "description": "Returns the elements of an array that meet the condition specified in a callback function." - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "reduce", - "value": "{ (callbackfn: (previousValue: JSONValue, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => JSONValue): JSONValue; (callbackfn: (previousValue: JSONValue, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => JSONValue, initialValue: JSONValue): JSONValue; (callbackfn: (previousValue: U, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => U, initialValue: U): U; }", - "description": "Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function." - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "reduceRight", - "value": "{ (callbackfn: (previousValue: JSONValue, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => JSONValue): JSONValue; (callbackfn: (previousValue: JSONValue, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => JSONValue, initialValue: JSONValue): JSONValue; (callbackfn: (previousValue: U, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => U, initialValue: U): U; }", - "description": "Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function." - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "find", - "value": "{ (predicate: (this: void, value: JSONValue, index: number, obj: JSONValue[]) => value is S, thisArg?: any): S; (predicate: (value: JSONValue, index: number, obj: JSONValue[]) => unknown, thisArg?: any): JSONValue; }", - "description": "Returns the value of the first element in the array where predicate is true, and undefined\r\notherwise." - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "findIndex", - "value": "(predicate: (value: JSONValue, index: number, obj: JSONValue[]) => unknown, thisArg?: any) => number", - "description": "Returns the index of the first element in the array where predicate is true, and -1\r\notherwise." - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "fill", - "value": "(value: JSONValue, start?: number, end?: number) => JSONArray", - "description": "Changes all array elements from `start` to `end` index to a static `value` and returns the modified array" - }, - { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "copyWithin", - "value": "(target: number, start: number, end?: number) => JSONArray", - "description": "Returns the this object after copying a section of the array identified by start and end\r\nto the same array starting at position target" + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "apiVersion", + "value": "ApiVersion", + "description": "", + "isOptional": true }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "entries", - "value": "() => IterableIterator<[number, JSONValue]>", - "description": "Returns an iterable of key, value pairs for every entry in the array" + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "headers", + "value": "{ [key: string]: any; }", + "description": "", + "isOptional": true }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "keys", - "value": "() => IterableIterator", - "description": "Returns an iterable of keys in the array" - }, + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "tries", + "value": "number", + "description": "", + "isOptional": true + } + ], + "value": "export interface GraphQLQueryOptions<\n Operation extends keyof Operations,\n Operations extends AllOperations,\n> {\n variables?: ApiClientRequestOptions['variables'];\n apiVersion?: ApiVersion;\n headers?: {[key: string]: any};\n tries?: number;\n}" + }, + "ApiVersion": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "ApiVersion", + "value": "export declare enum ApiVersion {\n October22 = \"2022-10\",\n January23 = \"2023-01\",\n April23 = \"2023-04\",\n July23 = \"2023-07\",\n October23 = \"2023-10\",\n January24 = \"2024-01\",\n Unstable = \"unstable\"\n}", + "members": [ { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "values", - "value": "() => IterableIterator", - "description": "Returns an iterable of values in the array" + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "October22", + "value": "2022-10" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "includes", - "value": "(searchElement: JSONValue, fromIndex?: number) => boolean", - "description": "Determines whether an array includes a certain element, returning true or false as appropriate." + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "January23", + "value": "2023-01" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "flatMap", - "value": "(callback: (this: This, value: JSONValue, index: number, array: JSONValue[]) => U | readonly U[], thisArg?: This) => U[]", - "description": "Calls a defined callback function on each element of an array. Then, flattens the result into\r\na new array.\r\nThis is identical to a map followed by flat with depth 1." + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "April23", + "value": "2023-04" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "flat", - "value": "(this: A, depth?: D) => FlatArray[]", - "description": "Returns a new array with all sub-array elements concatenated into it recursively up to the\r\nspecified depth." + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "July23", + "value": "2023-07" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "__@iterator@716", - "value": "() => IterableIterator", - "description": "Iterator" + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "October23", + "value": "2023-10" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "__@unscopables@718", - "value": "() => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }", - "description": "Returns an object whose properties have the value 'true'\r\nwhen they will be absent when used in a 'with' statement." + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "January24", + "value": "2024-01" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "at", - "value": "(index: number) => JSONValue", - "description": "Takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array." + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Unstable", + "value": "unstable" } - ], - "value": "interface JSONArray extends Array {}" + ] }, - "WebhookContextWithSession": { - "filePath": "/server/authenticate/webhooks/types.ts", - "name": "WebhookContextWithSession", + "StorefrontContext": { + "filePath": "src/server/clients/storefront/types.ts", + "name": "StorefrontContext", "description": "", "members": [ { - "filePath": "/server/authenticate/webhooks/types.ts", - "syntaxKind": "PropertySignature", - "name": "session", - "value": "Session", - "description": "A session with an offline token for the shop.\n\nReturned only if there is a session for the shop." - }, - { - "filePath": "/server/authenticate/webhooks/types.ts", - "syntaxKind": "PropertySignature", - "name": "admin", - "value": "WebhookAdminContext", - "description": "An admin context for the webhook.\n\nReturned only if there is a session for the shop.", - "examples": [ - { - "title": "[V3] Webhook admin context", - "description": "With the `v3_webhookAdminContext` future flag enabled, use the `admin` object in the context to interact with the Admin API.", - "tabs": [ - { - "code": "import { ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.webhook(request);\n\n const response = await admin?.graphql(\n `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n { variables: { input: { title: \"Product Name\" } } }\n );\n\n const productData = await response.json();\n return json({ data: productData.data });\n}", - "title": "/app/routes/webhooks.tsx" - } - ] - }, - { - "title": "Webhook admin context", - "description": "Use the `admin` object in the context to interact with the Admin API. This format will be removed in V3 of the package.", - "tabs": [ - { - "code": "import { json, ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.webhook(request);\n\n const response = await admin?.graphql.query({\n data: {\n query: `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n variables: { input: { title: \"Product Name\" } },\n },\n });\n\n const productData = response?.body.data;\n return json({ data: productData.data });\n}", - "title": "/app/routes/webhooks.tsx" - } - ] - } - ] - }, - { - "filePath": "/server/authenticate/webhooks/types.ts", + "filePath": "src/server/clients/storefront/types.ts", "syntaxKind": "PropertySignature", - "name": "apiVersion", - "value": "string", - "description": "The API version used for the webhook.", - "examples": [ - { - "title": "Webhook API version", - "description": "Get the API version used for webhook request.", - "tabs": [ - { - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { apiVersion } = await authenticate.webhook(request);\n return new Response();\n};", - "title": "/app/routes/webhooks.tsx" - } - ] - } - ] - }, - { - "filePath": "/server/authenticate/webhooks/types.ts", - "syntaxKind": "PropertySignature", - "name": "shop", - "value": "string", - "description": "The shop where the webhook was triggered.", + "name": "graphql", + "value": "GraphQLClient", + "description": "Method for interacting with the Shopify Storefront GraphQL API\n\nIf you're getting incorrect type hints in the Shopify template, follow [these instructions](https://github.com/Shopify/shopify-app-template-remix/tree/main#incorrect-graphql-hints).\n\n\n\n\n", "examples": [ { - "title": "Webhook shop", - "description": "Get the shop that triggered a webhook.", + "title": "Querying the GraphQL API", + "description": "Use `storefront.graphql` to make query / mutation requests.", "tabs": [ { - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { shop } = await authenticate.webhook(request);\n return new Response();\n};", - "title": "/app/routes/webhooks.tsx" + "code": "import { json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { storefront } = await authenticate.public.appProxy(request);\n\n const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);\n\n return json(await response.json());\n}", + "title": "app/routes/**\\/.ts" } ] } ] - }, - { - "filePath": "/server/authenticate/webhooks/types.ts", - "syntaxKind": "PropertySignature", - "name": "topic", - "value": "Topics", - "description": "The topic of the webhook.", - "examples": [ + } + ], + "value": "export interface StorefrontContext {\n /**\n * Method for interacting with the Shopify Storefront GraphQL API\n *\n * If you're getting incorrect type hints in the Shopify template, follow [these instructions](https://github.com/Shopify/shopify-app-template-remix/tree/main#incorrect-graphql-hints).\n *\n * {@link https://shopify.dev/docs/api/storefront}\n *\n * @example\n * Querying the GraphQL API.\n * Use `storefront.graphql` to make query / mutation requests.\n * ```ts\n * // app/routes/**\\/.ts\n * import { json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { storefront } = await authenticate.public.appProxy(request);\n *\n * const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);\n *\n * return json(await response.json());\n * }\n * ```\n */\n graphql: GraphQLClient;\n}" + } + } + } + ], + "jsDocTypeExamples": [ + "AppProxyContextWithSession" + ], + "related": [ + { + "name": "Admin API context", + "subtitle": "Interact with the Admin API.", + "url": "/docs/api/shopify-app-remix/apis/admin-api" + }, + { + "name": "Storefront API context", + "subtitle": "Interact with the Storefront API.", + "url": "/docs/api/shopify-app-remix/apis/storefront-api" + } + ], + "examples": { + "description": "", + "exampleGroups": [ + { + "title": "session", + "examples": [ + { + "description": "Get the session for the shop that initiated the request to the app proxy.", + "codeblock": { + "title": "Using the session object", + "tabs": [ { - "title": "Webhook topic", - "description": "Get the event topic for the webhook.", - "tabs": [ - { - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { topic } = await authenticate.webhook(request);\n\n switch (topic) {\n case \"APP_UNINSTALLED\":\n // Do something when the app is uninstalled.\n break;\n }\n\n return new Response();\n};", - "title": "/app/routes/webhooks.tsx" - } - ] + "title": "app/routes/**\\/.ts", + "code": "import { json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppModelData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }) => {\n // Get the session for the shop that initiated the request to the app proxy.\n const { session } = await authenticate.public.appProxy(request);\n\n // Use the session data to make to queries to your database or additional requests.\n return json(await getMyAppModelData({shop: session.shop));\n};", + "language": "typescript" } ] - }, - { - "filePath": "/server/authenticate/webhooks/types.ts", - "syntaxKind": "PropertySignature", - "name": "webhookId", - "value": "string", - "description": "A unique ID for the webhook. Useful to keep track of which events your app has already processed.", - "examples": [ + } + } + ] + }, + { + "title": "admin", + "examples": [ + { + "description": "Use the `admin` object to interact with the REST or GraphQL APIs.", + "codeblock": { + "title": "Interacting with the Admin API", + "tabs": [ { - "title": "Webhook ID", - "description": "Get the webhook ID.", - "tabs": [ - { - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { webhookId } = await authenticate.webhook(request);\n return new Response();\n};", - "title": "/app/routes/webhooks.tsx" - } - ] + "title": "app/routes/**\\/.ts", + "code": "import { json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.public.appProxy(request);\n\n const response = await admin.graphql(\n `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n { variables: { input: { title: \"Product Name\" } } }\n );\n\n const productData = await response.json();\n return json({ data: productData.data });\n}", + "language": "typescript" } ] - }, - { - "filePath": "/server/authenticate/webhooks/types.ts", - "syntaxKind": "PropertySignature", - "name": "payload", - "value": "JSONValue", - "description": "The payload from the webhook request.", - "examples": [ + } + } + ] + }, + { + "title": "storefront", + "examples": [ + { + "description": "Use the `storefront` object to interact with the GraphQL API.", + "codeblock": { + "title": "Interacting with the Storefront API", + "tabs": [ { - "title": "Webhook payload", - "description": "Get the request's POST payload.", - "tabs": [ - { - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { payload } = await authenticate.webhook(request);\n return new Response();\n};", - "title": "/app/routes/webhooks.tsx" - } - ] + "title": "app/routes/**\\/.ts", + "code": "import { json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { storefront } = await authenticate.public.appProxy(request);\n\n const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);\n\n return json(await response.json());\n}", + "language": "typescript" } ] } - ], - "value": "export interface WebhookContextWithSession<\n Future extends FutureFlagOptions,\n Resources extends ShopifyRestResources,\n Topics = string | number | symbol,\n> extends Context {\n /**\n * A session with an offline token for the shop.\n *\n * Returned only if there is a session for the shop.\n */\n session: Session;\n\n /**\n * An admin context for the webhook.\n *\n * Returned only if there is a session for the shop.\n *\n * @example\n * [V3] Webhook admin context.\n * With the `v3_webhookAdminContext` future flag enabled, use the `admin` object in the context to interact with the Admin API.\n * ```ts\n * // /app/routes/webhooks.tsx\n * import { ActionFunctionArgs } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { admin } = await authenticate.webhook(request);\n *\n * const response = await admin?.graphql(\n * `#graphql\n * mutation populateProduct($input: ProductInput!) {\n * productCreate(input: $input) {\n * product {\n * id\n * }\n * }\n * }`,\n * { variables: { input: { title: \"Product Name\" } } }\n * );\n *\n * const productData = await response.json();\n * return json({ data: productData.data });\n * }\n * ```\n *\n * @example\n * Webhook admin context.\n * Use the `admin` object in the context to interact with the Admin API. This format will be removed in V3 of the package.\n * ```ts\n * // /app/routes/webhooks.tsx\n * import { json, ActionFunctionArgs } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { admin } = await authenticate.webhook(request);\n *\n * const response = await admin?.graphql.query({\n * data: {\n * query: `#graphql\n * mutation populateProduct($input: ProductInput!) {\n * productCreate(input: $input) {\n * product {\n * id\n * }\n * }\n * }`,\n * variables: { input: { title: \"Product Name\" } },\n * },\n * });\n *\n * const productData = response?.body.data;\n * return json({ data: productData.data });\n * }\n * ```\n */\n admin: WebhookAdminContext;\n}" - }, - "WebhookAdminContext": { - "filePath": "/server/authenticate/webhooks/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "WebhookAdminContext", - "value": "FeatureEnabled extends true\n ? AdminApiContext\n : LegacyWebhookAdminApiContext", - "description": "" - }, - "FeatureEnabled": { - "filePath": "/server/future/flags.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "FeatureEnabled", - "value": "Future extends FutureFlags\n ? Future[Flag] extends true\n ? true\n : false\n : false", - "description": "" - }, - "FutureFlags": { - "filePath": "/server/future/flags.ts", - "name": "FutureFlags", + } + ] + }, + { + "title": "liquid", + "examples": [ + { + "description": "Use the `liquid` helper to render a `Response` with Liquid content.", + "codeblock": { + "title": "Rendering liquid content", + "tabs": [ + { + "title": "app/routes/**\\/.ts", + "code": "import {authenticate} from \"~/shopify.server\"\n\nexport async function loader({ request }) {\n const {liquid} = await authenticate.public.appProxy(request);\n\n return liquid(\"Hello {{shop.name}}\")\n}", + "language": "typescript" + } + ] + } + } + ] + } + ] + } + }, + { + "name": "Checkout", + "description": "The `authenticate.public.checkout` function ensures that checkout extension requests are coming from Shopify, and returns helpers to respond with the correct headers.", + "category": "Authenticate", + "subCategory": "Public", + "type": "object", + "isVisualComponent": false, + "definitions": [ + { + "title": "authenticate.public.checkout", + "description": "Authenticates requests coming from Shopify checkout extensions.", + "type": "AuthenticateCheckout", + "typeDefinitions": { + "AuthenticateCheckout": { + "filePath": "src/server/authenticate/public/checkout/types.ts", + "name": "AuthenticateCheckout", "description": "", - "members": [ + "params": [ { - "filePath": "/server/future/flags.ts", - "syntaxKind": "PropertySignature", - "name": "v3_webhookAdminContext", - "value": "boolean", - "description": "When enabled, returns the same `admin` context (`AdminApiContext`) from `authenticate.webhook` that is returned from `authenticate.admin`.", - "isOptional": true, - "defaultValue": "false" + "name": "request", + "description": "", + "value": "Request", + "filePath": "src/server/authenticate/public/checkout/types.ts" }, { - "filePath": "/server/future/flags.ts", - "syntaxKind": "PropertySignature", - "name": "v3_authenticatePublic", - "value": "boolean", - "description": "When enabled authenticate.public() will not work. Use authenticate.public.checkout() instead.", + "name": "options", + "description": "", + "value": "AuthenticateCheckoutOptions", "isOptional": true, - "defaultValue": "false" + "filePath": "src/server/authenticate/public/checkout/types.ts" } ], - "value": "export interface FutureFlags {\n /**\n * When enabled, returns the same `admin` context (`AdminApiContext`) from `authenticate.webhook` that is returned from `authenticate.admin`.\n *\n * @default false\n */\n v3_webhookAdminContext?: boolean;\n\n /**\n * When enabled authenticate.public() will not work. Use authenticate.public.checkout() instead.\n *\n * @default false\n */\n v3_authenticatePublic?: boolean;\n}" - }, - "AdminContext": { - "filePath": "/server/authenticate/admin/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "AdminContext", - "value": "Config['isEmbeddedApp'] extends false\n ? NonEmbeddedAdminContext\n : EmbeddedAdminContext", - "description": "" + "returns": { + "filePath": "src/server/authenticate/public/checkout/types.ts", + "description": "", + "name": "Promise", + "value": "Promise" + }, + "value": "export type AuthenticateCheckout = (\n request: Request,\n options?: AuthenticateCheckoutOptions,\n) => Promise;" }, - "NonEmbeddedAdminContext": { - "filePath": "/server/authenticate/admin/types.ts", - "name": "NonEmbeddedAdminContext", + "AuthenticateCheckoutOptions": { + "filePath": "src/server/authenticate/public/checkout/types.ts", + "name": "AuthenticateCheckoutOptions", "description": "", "members": [ { - "filePath": "/server/authenticate/admin/types.ts", + "filePath": "src/server/authenticate/public/checkout/types.ts", "syntaxKind": "PropertySignature", - "name": "session", - "value": "Session", - "description": "The session for the user who made the request.\n\nThis comes from the session storage which `shopifyApp` uses to store sessions in your database of choice.\n\nUse this to get shop or user-specific data.", + "name": "corsHeaders", + "value": "string[]", + "description": "", + "isOptional": true + } + ], + "value": "export interface AuthenticateCheckoutOptions {\n corsHeaders?: string[];\n}" + }, + "CheckoutContext": { + "filePath": "src/server/authenticate/public/checkout/types.ts", + "name": "CheckoutContext", + "description": "Authenticated Context for a checkout request", + "members": [ + { + "filePath": "src/server/authenticate/public/checkout/types.ts", + "syntaxKind": "PropertySignature", + "name": "sessionToken", + "value": "JwtPayload", + "description": "The decoded and validated session token for the request\n\nRefer to the OAuth docs for the [session token payload](https://shopify.dev/docs/apps/auth/oauth/session-tokens#payload).", "examples": [ { - "title": "Using offline sessions", - "description": "Get your app's shop-specific data using an offline session.", - "tabs": [ - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "shopify.server.ts" - }, - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session } = await authenticate.admin(request);\n return json(await getMyAppData({shop: session.shop));\n};", - "title": "/app/routes/**\\/*.ts" - } - ] - }, - { - "title": "Using online sessions", - "description": "Get your app's user-specific data using an online session.", + "title": "Using the decoded session token", + "description": "Get store-specific data using the `sessionToken` object.", "tabs": [ { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n useOnlineTokens: true,\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "shopify.server.ts" - }, - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session } = await authenticate.admin(request);\n return json(await getMyAppData({user: session.onlineAccessInfo!.id}));\n};", - "title": "/app/routes/**\\/*.ts" + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { sessionToken } = await authenticate.public.checkout(\n request\n );\n return json(await getMyAppData({shop: sessionToken.dest}));\n};", + "title": "app/routes/public/my-route.ts" } ] } ] }, { - "filePath": "/server/authenticate/admin/types.ts", - "syntaxKind": "PropertySignature", - "name": "admin", - "value": "AdminApiContext", - "description": "Methods for interacting with the GraphQL / REST Admin APIs for the store that made the request." - }, - { - "filePath": "/server/authenticate/admin/types.ts", - "syntaxKind": "PropertySignature", - "name": "billing", - "value": "BillingContext", - "description": "Billing methods for this store, based on the plans defined in the `billing` config option.\n\n\n\n\n" - }, - { - "filePath": "/server/authenticate/admin/types.ts", + "filePath": "src/server/authenticate/public/checkout/types.ts", "syntaxKind": "PropertySignature", "name": "cors", "value": "EnsureCORSFunction", "description": "A function that ensures the CORS headers are set correctly for the response.", "examples": [ { - "title": "Setting CORS headers for a admin request", - "description": "Use the `cors` helper to ensure your app can respond to requests from admin extensions.", + "title": "Setting CORS headers for a public request", + "description": "Use the `cors` helper to ensure your app can respond to checkout extension requests.", "tabs": [ { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session, cors } = await authenticate.admin(request);\n return cors(json(await getMyAppData({user: session.onlineAccessInfo!.id})));\n};", - "title": "/app/routes/admin/my-route.ts" + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { sessionToken, cors } = await authenticate.public.checkout(\n request,\n { corsHeaders: [\"X-My-Custom-Header\"] }\n );\n const data = await getMyAppData({shop: sessionToken.dest});\n return cors(json(data));\n};", + "title": "app/routes/public/my-route.ts" } ] } ] } ], - "value": "export interface NonEmbeddedAdminContext<\n Config extends AppConfigArg,\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> extends AdminContextInternal {}" + "value": "export interface CheckoutContext {\n /**\n * The decoded and validated session token for the request\n *\n * Refer to the OAuth docs for the [session token payload](https://shopify.dev/docs/apps/auth/oauth/session-tokens#payload).\n *\n * @example\n * Using the decoded session token.\n * Get store-specific data using the `sessionToken` object.\n * ```ts\n * // app/routes/public/my-route.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n * import { getMyAppData } from \"~/db/model.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { sessionToken } = await authenticate.public.checkout(\n * request\n * );\n * return json(await getMyAppData({shop: sessionToken.dest}));\n * };\n * ```\n */\n sessionToken: JwtPayload;\n\n /**\n * A function that ensures the CORS headers are set correctly for the response.\n *\n * @example\n * Setting CORS headers for a public request.\n * Use the `cors` helper to ensure your app can respond to checkout extension requests.\n * ```ts\n * // app/routes/public/my-route.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n * import { getMyAppData } from \"~/db/model.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { sessionToken, cors } = await authenticate.public.checkout(\n * request,\n * { corsHeaders: [\"X-My-Custom-Header\"] }\n * );\n * const data = await getMyAppData({shop: sessionToken.dest});\n * return cors(json(data));\n * };\n * ```\n */\n cors: EnsureCORSFunction;\n}" }, - "AdminApiContext": { - "filePath": "/server/clients/admin/types.ts", - "name": "AdminApiContext", + "JwtPayload": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "name": "JwtPayload", "description": "", "members": [ { - "filePath": "/server/clients/admin/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", "syntaxKind": "PropertySignature", - "name": "rest", - "value": "RestClientWithResources", - "description": "Methods for interacting with the Shopify Admin REST API\n\nThere are methods for interacting with individual REST resources. You can also make `GET`, `POST`, `PUT` and `DELETE` requests should the REST resources not meet your needs.\n\n\n\n\n", - "examples": [ - { - "title": "Using REST resources", - "description": "Getting the number of orders in a store using REST resources. Visit the [Admin REST API references](/docs/api/admin-rest) for examples on using each resource.", - "tabs": [ - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n return json(admin.rest.resources.Order.count({ session }));\n};", - "title": "/app/routes/**\\/*.ts" - }, - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-07\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "/app/shopify.server.ts" - } - ] - }, - { - "title": "Performing a GET request to the REST API", - "description": "Use `admin.rest.get` to make custom requests to make a request to to the `customer/count` endpoint", - "tabs": [ - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n const response = await admin.rest.get({ path: \"/customers/count.json\" });\n const customers = await response.json();\n return json({ customers });\n};", - "title": "/app/routes/**\\/*.ts" - }, - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "/app/shopify.server.ts" - } - ] - }, - { - "title": "Performing a POST request to the REST API", - "description": "Use `admin.rest.post` to make custom requests to make a request to to the `customers.json` endpoint to send a welcome email", - "tabs": [ - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n const response = admin.rest.post({\n path: \"customers/7392136888625/send_invite.json\",\n body: {\n customer_invite: {\n to: \"new_test_email@shopify.com\",\n from: \"j.limited@example.com\",\n bcc: [\"j.limited@example.com\"],\n subject: \"Welcome to my new shop\",\n custom_message: \"My awesome new store\",\n },\n },\n});\n const customerInvite = await response.json();\n return json({ customerInvite });\n};", - "title": "/app/routes/**\\/*.ts" - }, - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "/app/shopify.server.ts" - } - ] - } - ] + "name": "iss", + "value": "string", + "description": "" }, { - "filePath": "/server/clients/admin/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", "syntaxKind": "PropertySignature", - "name": "graphql", - "value": "GraphQLClient", - "description": "Methods for interacting with the Shopify Admin GraphQL API\n\n\n\n\n\n\n\n\n\n", - "examples": [ + "name": "dest", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "aud", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "sub", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "exp", + "value": "number", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "nbf", + "value": "number", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "iat", + "value": "number", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "jti", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "sid", + "value": "string", + "description": "" + } + ], + "value": "export interface JwtPayload {\n iss: string;\n dest: string;\n aud: string;\n sub: string;\n exp: number;\n nbf: number;\n iat: number;\n jti: string;\n sid: string;\n}" + }, + "EnsureCORSFunction": { + "filePath": "src/server/authenticate/helpers/ensure-cors-headers.ts", + "name": "EnsureCORSFunction", + "description": "", + "members": [], + "value": "export interface EnsureCORSFunction {\n (response: Response): Response;\n}" + } + } + } + ], + "jsDocTypeExamples": [ + "CheckoutContext" + ], + "related": [], + "examples": { + "description": "", + "exampleGroups": [ + { + "title": "sessionToken", + "examples": [ + { + "description": "Get store-specific data using the `sessionToken` object.", + "codeblock": { + "title": "Using the decoded session token", + "tabs": [ { - "title": "Querying the GraphQL API", - "description": "Use `admin.graphql` to make query / mutation requests.", - "tabs": [ - { - "code": "import { ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.admin(request);\n\n const response = await admin.graphql(\n `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n { variables: { input: { title: \"Product Name\" } } }\n );\n\n const productData = await response.json();\n return json({ data: productData.data });\n}", - "title": "Example" - } - ] + "title": "app/routes/public/my-route.ts", + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { sessionToken } = await authenticate.public.checkout(\n request\n );\n return json(await getMyAppData({shop: sessionToken.dest}));\n};", + "language": "typescript" + } + ] + } + } + ] + }, + { + "title": "cors", + "examples": [ + { + "description": "Use the `cors` helper to ensure your app can respond to checkout extension requests.", + "codeblock": { + "title": "Setting CORS headers for a public request", + "tabs": [ + { + "title": "app/routes/public/my-route.ts", + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { sessionToken, cors } = await authenticate.public.checkout(\n request,\n { corsHeaders: [\"X-My-Custom-Header\"] }\n );\n const data = await getMyAppData({shop: sessionToken.dest});\n return cors(json(data));\n};", + "language": "typescript" } ] } + } + ] + } + ] + } + }, + { + "name": "Webhook", + "description": "Contains functions for verifying Shopify webhooks.\n\n> Note: The format of the `admin` object returned by this function changes with the `v3_webhookAdminContext` future flag. Learn more about [gradual feature adoption](/docs/api/shopify-app-remix/guide-future-flags).", + "category": "Authenticate", + "type": "object", + "isVisualComponent": false, + "definitions": [ + { + "title": "authenticate.webhook", + "description": "Verifies requests coming from Shopify webhooks.", + "type": "AuthenticateWebhook", + "typeDefinitions": { + "AuthenticateWebhook": { + "filePath": "src/server/authenticate/webhooks/types.ts", + "name": "AuthenticateWebhook", + "description": "", + "params": [ + { + "name": "request", + "description": "", + "value": "Request", + "filePath": "src/server/authenticate/webhooks/types.ts" + } ], - "value": "export interface AdminApiContext<\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> {\n /**\n * Methods for interacting with the Shopify Admin REST API\n *\n * There are methods for interacting with individual REST resources. You can also make `GET`, `POST`, `PUT` and `DELETE` requests should the REST resources not meet your needs.\n *\n * {@link https://shopify.dev/docs/api/admin-rest}\n *\n * @example\n * Using REST resources.\n * Getting the number of orders in a store using REST resources. Visit the [Admin REST API references](/docs/api/admin-rest) for examples on using each resource. \n *\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * return json(admin.rest.resources.Order.count({ session }));\n * };\n * ```\n *\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-07\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n *\n *\n * @example\n * Performing a GET request to the REST API.\n * Use `admin.rest.get` to make custom requests to make a request to to the `customer/count` endpoint\n *\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * const response = await admin.rest.get({ path: \"/customers/count.json\" });\n * const customers = await response.json();\n * return json({ customers });\n * };\n * ```\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n * @example\n * Performing a POST request to the REST API.\n * Use `admin.rest.post` to make custom requests to make a request to to the `customers.json` endpoint to send a welcome email\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * const response = admin.rest.post({\n * path: \"customers/7392136888625/send_invite.json\",\n * body: {\n * customer_invite: {\n * to: \"new_test_email@shopify.com\",\n * from: \"j.limited@example.com\",\n * bcc: [\"j.limited@example.com\"],\n * subject: \"Welcome to my new shop\",\n * custom_message: \"My awesome new store\",\n * },\n * },\n * });\n * const customerInvite = await response.json();\n * return json({ customerInvite });\n * };\n * ```\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n rest: RestClientWithResources;\n\n /**\n * Methods for interacting with the Shopify Admin GraphQL API\n *\n * {@link https://shopify.dev/docs/api/admin-graphql}\n * {@link https://github.com/Shopify/shopify-api-js/blob/main/packages/shopify-api/docs/reference/clients/Graphql.md}\n *\n * @example\n * Querying the GraphQL API.\n * Use `admin.graphql` to make query / mutation requests.\n * ```ts\n * import { ActionFunctionArgs } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { admin } = await authenticate.admin(request);\n *\n * const response = await admin.graphql(\n * `#graphql\n * mutation populateProduct($input: ProductInput!) {\n * productCreate(input: $input) {\n * product {\n * id\n * }\n * }\n * }`,\n * { variables: { input: { title: \"Product Name\" } } }\n * );\n *\n * const productData = await response.json();\n * return json({ data: productData.data });\n * }\n * ```\n */\n graphql: GraphQLClient;\n}" + "returns": { + "filePath": "src/server/authenticate/webhooks/types.ts", + "description": "", + "name": "Promise>", + "value": "Promise>" + }, + "value": "export type AuthenticateWebhook<\n Future extends FutureFlagOptions,\n Resources extends ShopifyRestResources,\n Topics = string | number | symbol,\n> = (request: Request) => Promise>;" }, - "RestClientWithResources": { - "filePath": "/server/clients/admin/rest.ts", + "WebhookContext": { + "filePath": "src/server/authenticate/webhooks/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "RestClientWithResources", - "value": "RemixRestClient & {resources: Resources}", + "name": "WebhookContext", + "value": "WebhookContextWithoutSession | WebhookContextWithSession", "description": "" }, - "BillingContext": { - "filePath": "/server/authenticate/admin/billing/types.ts", - "name": "BillingContext", + "WebhookContextWithoutSession": { + "filePath": "src/server/authenticate/webhooks/types.ts", + "name": "WebhookContextWithoutSession", "description": "", "members": [ { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/webhooks/types.ts", "syntaxKind": "PropertySignature", - "name": "require", - "value": "(options: RequireBillingOptions) => Promise", - "description": "Checks if the shop has an active payment for any plan defined in the `billing` config option.", + "name": "session", + "value": "undefined", + "description": "" + }, + { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "PropertySignature", + "name": "admin", + "value": "undefined", + "description": "" + }, + { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "PropertySignature", + "name": "apiVersion", + "value": "string", + "description": "The API version used for the webhook.", "examples": [ { - "title": "Requesting billing right away", - "description": "Call `billing.request` in the `onFailure` callback to immediately redirect to the Shopify page to request payment.", - "tabs": [ - { - "code": "import { LoaderFunctionArgs } from \"@remix-run/node\";\nimport { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { billing } = await authenticate.admin(request);\n await billing.require({\n plans: [MONTHLY_PLAN],\n isTest: true,\n onFailure: async () => billing.request({ plan: MONTHLY_PLAN }),\n });\n\n // App logic\n};", - "title": "/app/routes/**\\/*.ts" - }, - { - "code": "import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n\nexport const MONTHLY_PLAN = 'Monthly subscription';\nexport const ANNUAL_PLAN = 'Annual subscription';\n\nconst shopify = shopifyApp({\n // ...etc\n billing: {\n [MONTHLY_PLAN]: {\n amount: 5,\n currencyCode: 'USD',\n interval: BillingInterval.Every30Days,\n },\n [ANNUAL_PLAN]: {\n amount: 50,\n currencyCode: 'USD',\n interval: BillingInterval.Annual,\n },\n }\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "shopify.server.ts" - } - ] - }, - { - "title": "Using a plan selection page", - "description": "When the app has multiple plans, create a page in your App that allows the merchant to select a plan. If a merchant does not have the required plan you can redirect them to page in your app to select one.", + "title": "Webhook API version", + "description": "Get the API version used for webhook request.", "tabs": [ { - "code": "import { LoaderFunctionArgs, redirect } from \"@remix-run/node\";\nimport { authenticate, MONTHLY_PLAN, ANNUAL_PLAN } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { billing } = await authenticate.admin(request);\n const billingCheck = await billing.require({\n plans: [MONTHLY_PLAN, ANNUAL_PLAN],\n isTest: true,\n onFailure: () => redirect('/select-plan'),\n });\n\n const subscription = billingCheck.appSubscriptions[0];\n console.log(`Shop is on ${subscription.name} (id ${subscription.id})`);\n\n // App logic\n};", - "title": "/app/routes/**\\/*.ts" - }, - { - "code": "import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n\nexport const MONTHLY_PLAN = 'Monthly subscription';\nexport const ANNUAL_PLAN = 'Annual subscription';\n\nconst shopify = shopifyApp({\n // ...etc\n billing: {\n [MONTHLY_PLAN]: {\n amount: 5,\n currencyCode: 'USD',\n interval: BillingInterval.Every30Days,\n },\n [ANNUAL_PLAN]: {\n amount: 50,\n currencyCode: 'USD',\n interval: BillingInterval.Annual,\n },\n }\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "shopify.server.ts" + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { apiVersion } = await authenticate.webhook(request);\n return new Response();\n};", + "title": "/app/routes/webhooks.tsx" } ] } ] }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/webhooks/types.ts", "syntaxKind": "PropertySignature", - "name": "request", - "value": "(options: RequestBillingOptions) => Promise", - "description": "Requests payment for the plan.", + "name": "shop", + "value": "string", + "description": "The shop where the webhook was triggered.", "examples": [ { - "title": "Using a custom return URL", - "description": "Change where the merchant is returned to after approving the purchase using the `returnUrl` option.", + "title": "Webhook shop", + "description": "Get the shop that triggered a webhook.", "tabs": [ { - "code": "import { LoaderFunctionArgs } from \"@remix-run/node\";\nimport { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { billing } = await authenticate.admin(request);\n await billing.require({\n plans: [MONTHLY_PLAN],\n onFailure: async () => billing.request({\n plan: MONTHLY_PLAN,\n isTest: true,\n returnUrl: 'https://admin.shopify.com/store/my-store/apps/my-app/billing-page',\n }),\n });\n\n // App logic\n};", - "title": "/app/routes/**\\/*.ts" - }, - { - "code": "import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n\nexport const MONTHLY_PLAN = 'Monthly subscription';\nexport const ANNUAL_PLAN = 'Annual subscription';\n\nconst shopify = shopifyApp({\n // ...etc\n billing: {\n [MONTHLY_PLAN]: {\n amount: 5,\n currencyCode: 'USD',\n interval: BillingInterval.Every30Days,\n },\n [ANNUAL_PLAN]: {\n amount: 50,\n currencyCode: 'USD',\n interval: BillingInterval.Annual,\n },\n }\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "shopify.server.ts" + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { shop } = await authenticate.webhook(request);\n return new Response();\n};", + "title": "/app/routes/webhooks.tsx" } ] } ] }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/webhooks/types.ts", "syntaxKind": "PropertySignature", - "name": "cancel", - "value": "(options: CancelBillingOptions) => Promise", - "description": "Cancels an ongoing subscription, given its ID.", + "name": "topic", + "value": "Topics", + "description": "The topic of the webhook.", "examples": [ { - "title": "Cancelling a subscription", - "description": "Use the `billing.cancel` function to cancel an active subscription with the id returned from `billing.require`.", + "title": "Webhook topic", + "description": "Get the event topic for the webhook.", "tabs": [ { - "code": "import { LoaderFunctionArgs } from \"@remix-run/node\";\nimport { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { billing } = await authenticate.admin(request);\n const billingCheck = await billing.require({\n plans: [MONTHLY_PLAN],\n onFailure: async () => billing.request({ plan: MONTHLY_PLAN }),\n });\n\n const subscription = billingCheck.appSubscriptions[0];\n const cancelledSubscription = await billing.cancel({\n subscriptionId: subscription.id,\n isTest: true,\n prorate: true,\n });\n\n // App logic\n};", - "title": "/app/routes/cancel-subscription.ts" - }, - { - "code": "import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n\nexport const MONTHLY_PLAN = 'Monthly subscription';\nexport const ANNUAL_PLAN = 'Annual subscription';\n\nconst shopify = shopifyApp({\n // ...etc\n billing: {\n [MONTHLY_PLAN]: {\n amount: 5,\n currencyCode: 'USD',\n interval: BillingInterval.Every30Days,\n },\n [ANNUAL_PLAN]: {\n amount: 50,\n currencyCode: 'USD',\n interval: BillingInterval.Annual,\n },\n }\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "shopify.server.ts" + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { topic } = await authenticate.webhook(request);\n\n switch (topic) {\n case \"APP_UNINSTALLED\":\n // Do something when the app is uninstalled.\n break;\n }\n\n return new Response();\n};", + "title": "/app/routes/webhooks.tsx" } ] } ] - } - ], - "value": "export interface BillingContext {\n /**\n * Checks if the shop has an active payment for any plan defined in the `billing` config option.\n *\n * @returns A promise that resolves to an object containing the active purchases for the shop.\n *\n * @example\n * Requesting billing right away.\n * Call `billing.request` in the `onFailure` callback to immediately redirect to the Shopify page to request payment.\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * await billing.require({\n * plans: [MONTHLY_PLAN],\n * isTest: true,\n * onFailure: async () => billing.request({ plan: MONTHLY_PLAN }),\n * });\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n *\n * @example\n * Using a plan selection page.\n * When the app has multiple plans, create a page in your App that allows the merchant to select a plan. If a merchant does not have the required plan you can redirect them to page in your app to select one.\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, redirect } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN, ANNUAL_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * const billingCheck = await billing.require({\n * plans: [MONTHLY_PLAN, ANNUAL_PLAN],\n * isTest: true,\n * onFailure: () => redirect('/select-plan'),\n * });\n *\n * const subscription = billingCheck.appSubscriptions[0];\n * console.log(`Shop is on ${subscription.name} (id ${subscription.id})`);\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n require: (\n options: RequireBillingOptions,\n ) => Promise;\n\n /**\n * Requests payment for the plan.\n *\n * @returns Redirects to the confirmation URL for the payment.\n *\n * @example\n * Using a custom return URL.\n * Change where the merchant is returned to after approving the purchase using the `returnUrl` option.\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * await billing.require({\n * plans: [MONTHLY_PLAN],\n * onFailure: async () => billing.request({\n * plan: MONTHLY_PLAN,\n * isTest: true,\n * returnUrl: 'https://admin.shopify.com/store/my-store/apps/my-app/billing-page',\n * }),\n * });\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n request: (options: RequestBillingOptions) => Promise;\n\n /**\n * Cancels an ongoing subscription, given its ID.\n *\n * @returns The cancelled subscription.\n *\n * @example\n * Cancelling a subscription.\n * Use the `billing.cancel` function to cancel an active subscription with the id returned from `billing.require`.\n * ```ts\n * // /app/routes/cancel-subscription.ts\n * import { LoaderFunctionArgs } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * const billingCheck = await billing.require({\n * plans: [MONTHLY_PLAN],\n * onFailure: async () => billing.request({ plan: MONTHLY_PLAN }),\n * });\n *\n * const subscription = billingCheck.appSubscriptions[0];\n * const cancelledSubscription = await billing.cancel({\n * subscriptionId: subscription.id,\n * isTest: true,\n * prorate: true,\n * });\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n cancel: (options: CancelBillingOptions) => Promise;\n}" - }, - "RequireBillingOptions": { - "filePath": "/server/authenticate/admin/billing/types.ts", - "name": "RequireBillingOptions", - "description": "", - "members": [ - { - "filePath": "/server/authenticate/admin/billing/types.ts", - "syntaxKind": "PropertySignature", - "name": "plans", - "value": "(keyof Config[\"billing\"])[]", - "description": "The plans to check for. Must be one of the values defined in the `billing` config option." }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/webhooks/types.ts", "syntaxKind": "PropertySignature", - "name": "onFailure", - "value": "(error: any) => Promise", - "description": "How to handle the request if the shop doesn't have an active payment for any plan." + "name": "webhookId", + "value": "string", + "description": "A unique ID for the webhook. Useful to keep track of which events your app has already processed.", + "examples": [ + { + "title": "Webhook ID", + "description": "Get the webhook ID.", + "tabs": [ + { + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { webhookId } = await authenticate.webhook(request);\n return new Response();\n};", + "title": "/app/routes/webhooks.tsx" + } + ] + } + ] }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/authenticate/webhooks/types.ts", "syntaxKind": "PropertySignature", - "name": "isTest", - "value": "boolean", - "description": "", - "isOptional": true + "name": "payload", + "value": "JSONValue", + "description": "The payload from the webhook request.", + "examples": [ + { + "title": "Webhook payload", + "description": "Get the request's POST payload.", + "tabs": [ + { + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { payload } = await authenticate.webhook(request);\n return new Response();\n};", + "title": "/app/routes/webhooks.tsx" + } + ] + } + ] } ], - "value": "export interface RequireBillingOptions\n extends Omit {\n /**\n * The plans to check for. Must be one of the values defined in the `billing` config option.\n */\n plans: (keyof Config['billing'])[];\n /**\n * How to handle the request if the shop doesn't have an active payment for any plan.\n */\n onFailure: (error: any) => Promise;\n}" + "value": "export interface WebhookContextWithoutSession\n extends Context {\n session: undefined;\n admin: undefined;\n}" }, - "RequestBillingOptions": { - "filePath": "/server/authenticate/admin/billing/types.ts", - "name": "RequestBillingOptions", + "JSONValue": { + "filePath": "src/server/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "JSONValue", + "value": "string | number | boolean | null | JSONObject | JSONArray", + "description": "" + }, + "JSONObject": { + "filePath": "src/server/types.ts", + "name": "JSONObject", "description": "", "members": [ { - "filePath": "/server/authenticate/admin/billing/types.ts", - "syntaxKind": "PropertySignature", - "name": "plan", - "value": "keyof Config[\"billing\"]", - "description": "The plan to request. Must be one of the values defined in the `billing` config option." - }, - { - "filePath": "/server/authenticate/admin/billing/types.ts", - "syntaxKind": "PropertySignature", - "name": "isTest", - "value": "boolean", - "description": "Whether to use the test mode. This prevents the credit card from being charged. Test shops and demo shops cannot be charged.", - "isOptional": true - }, - { - "filePath": "/server/authenticate/admin/billing/types.ts", - "syntaxKind": "PropertySignature", - "name": "returnUrl", - "value": "string", - "description": "The URL to return to after the merchant approves the payment.", - "isOptional": true + "filePath": "src/server/types.ts", + "name": "[x: string]", + "value": "JSONValue" } ], - "value": "export interface RequestBillingOptions\n extends Omit {\n /**\n * The plan to request. Must be one of the values defined in the `billing` config option.\n */\n plan: keyof Config['billing'];\n /**\n * Whether to use the test mode. This prevents the credit card from being charged. Test shops and demo shops cannot be charged.\n */\n isTest?: boolean;\n /**\n * The URL to return to after the merchant approves the payment.\n */\n returnUrl?: string;\n}" + "value": "interface JSONObject {\n [x: string]: JSONValue;\n}" }, - "CancelBillingOptions": { - "filePath": "/server/authenticate/admin/billing/types.ts", - "name": "CancelBillingOptions", + "JSONArray": { + "filePath": "src/server/types.ts", + "name": "JSONArray", "description": "", "members": [ { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "src/server/types.ts", "syntaxKind": "PropertySignature", - "name": "subscriptionId", - "value": "string", - "description": "The ID of the subscription to cancel." + "name": "length", + "value": "number", + "description": "Gets or sets the length of the array. This is a number one higher than the highest index in the array." }, { - "filePath": "/server/authenticate/admin/billing/types.ts", - "syntaxKind": "PropertySignature", - "name": "prorate", - "value": "boolean", - "description": "Whether to prorate the cancellation.\n\n\n\n\n", - "isOptional": true + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "toString", + "value": "() => string", + "description": "Returns a string representation of an array." }, { - "filePath": "/server/authenticate/admin/billing/types.ts", - "syntaxKind": "PropertySignature", - "name": "isTest", - "value": "boolean", - "description": "", - "isOptional": true - } - ], - "value": "export interface CancelBillingOptions {\n /**\n * The ID of the subscription to cancel.\n */\n subscriptionId: string;\n /**\n * Whether to prorate the cancellation.\n *\n * {@link https://shopify.dev/docs/apps/billing/subscriptions/cancel-recurring-charges}\n */\n prorate?: boolean;\n /*\n * Whether to use the test mode. This prevents the credit card from being charged. Test shops and demo shops cannot be charged.\n */\n isTest?: boolean;\n}" - }, - "EmbeddedAdminContext": { - "filePath": "/server/authenticate/admin/types.ts", - "name": "EmbeddedAdminContext", - "description": "", - "members": [ + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "toLocaleString", + "value": "() => string", + "description": "Returns a string representation of an array. The elements are converted to string using their toLocaleString methods." + }, { - "filePath": "/server/authenticate/admin/types.ts", - "syntaxKind": "PropertySignature", - "name": "sessionToken", - "value": "JwtPayload", - "description": "The decoded and validated session token for the request.\n\nReturned only if `isEmbeddedApp` is `true`.\n\n\n\n\n", - "examples": [ - { - "title": "Using the decoded session token", - "description": "Get user-specific data using the `sessionToken` object.", - "tabs": [ - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n useOnlineTokens: true,\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "shopify.server.ts" - }, - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { sessionToken } = await authenticate.public.checkout(\n request\n );\n return json(await getMyAppData({user: sessionToken.sub}));\n};", - "title": "/app/routes/**\\/*.ts" - } - ] - } - ] + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "pop", + "value": "() => JSONValue", + "description": "Removes the last element from an array and returns it. If the array is empty, undefined is returned and the array is not modified." }, { - "filePath": "/server/authenticate/admin/types.ts", - "syntaxKind": "PropertySignature", - "name": "redirect", - "value": "RedirectFunction", - "description": "A function that redirects the user to a new page, ensuring that the appropriate parameters are set for embedded apps.\n\nReturned only if `isEmbeddedApp` is `true`.", - "examples": [ - { - "title": "Redirecting to an app route", - "description": "Use the `redirect` helper to safely redirect between pages.", - "tabs": [ - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session, redirect } = await authenticate.admin(request);\n return redirect(\"/\");\n};", - "title": "/app/routes/admin/my-route.ts" - } - ] - }, - { - "title": "Redirecting outside of Shopify admin", - "description": "Pass in a `target` option of `_top` or `_parent` to go to an external URL.", - "tabs": [ - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session, redirect } = await authenticate.admin(request);\n return redirect(\"/\", { target: '_parent' });\n};", - "title": "/app/routes/admin/my-route.ts" - } - ] - } - ] + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "push", + "value": "(...items: JSONValue[]) => number", + "description": "Appends new elements to the end of an array, and returns the new length of the array." }, { - "filePath": "/server/authenticate/admin/types.ts", - "syntaxKind": "PropertySignature", - "name": "session", - "value": "Session", - "description": "The session for the user who made the request.\n\nThis comes from the session storage which `shopifyApp` uses to store sessions in your database of choice.\n\nUse this to get shop or user-specific data.", - "examples": [ - { - "title": "Using offline sessions", - "description": "Get your app's shop-specific data using an offline session.", - "tabs": [ - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "shopify.server.ts" - }, - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session } = await authenticate.admin(request);\n return json(await getMyAppData({shop: session.shop));\n};", - "title": "/app/routes/**\\/*.ts" - } - ] - }, - { - "title": "Using online sessions", - "description": "Get your app's user-specific data using an online session.", - "tabs": [ - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n useOnlineTokens: true,\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "shopify.server.ts" - }, - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session } = await authenticate.admin(request);\n return json(await getMyAppData({user: session.onlineAccessInfo!.id}));\n};", - "title": "/app/routes/**\\/*.ts" - } - ] - } - ] + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "concat", + "value": "{ (...items: ConcatArray[]): JSONValue[]; (...items: (JSONValue | ConcatArray)[]): JSONValue[]; }", + "description": "Combines two or more arrays. This method returns a new array without modifying any existing arrays." }, { - "filePath": "/server/authenticate/admin/types.ts", - "syntaxKind": "PropertySignature", - "name": "admin", - "value": "AdminApiContext", - "description": "Methods for interacting with the GraphQL / REST Admin APIs for the store that made the request." + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "join", + "value": "(separator?: string) => string", + "description": "Adds all the elements of an array into a string, separated by the specified separator string." }, { - "filePath": "/server/authenticate/admin/types.ts", - "syntaxKind": "PropertySignature", - "name": "billing", - "value": "BillingContext", - "description": "Billing methods for this store, based on the plans defined in the `billing` config option.\n\n\n\n\n" + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "reverse", + "value": "() => JSONValue[]", + "description": "Reverses the elements in an array in place. This method mutates the array and returns a reference to the same array." }, { - "filePath": "/server/authenticate/admin/types.ts", - "syntaxKind": "PropertySignature", - "name": "cors", - "value": "EnsureCORSFunction", - "description": "A function that ensures the CORS headers are set correctly for the response.", - "examples": [ - { - "title": "Setting CORS headers for a admin request", - "description": "Use the `cors` helper to ensure your app can respond to requests from admin extensions.", - "tabs": [ - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session, cors } = await authenticate.admin(request);\n return cors(json(await getMyAppData({user: session.onlineAccessInfo!.id})));\n};", - "title": "/app/routes/admin/my-route.ts" - } + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "shift", + "value": "() => JSONValue", + "description": "Removes the first element from an array and returns it. If the array is empty, undefined is returned and the array is not modified." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "slice", + "value": "(start?: number, end?: number) => JSONValue[]", + "description": "Returns a copy of a section of an array. For both start and end, a negative index can be used to indicate an offset from the end of the array. For example, -2 refers to the second to last element of the array." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "sort", + "value": "(compareFn?: (a: JSONValue, b: JSONValue) => number) => JSONArray", + "description": "Sorts an array in place. This method mutates the array and returns a reference to the same array." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "splice", + "value": "{ (start: number, deleteCount?: number): JSONValue[]; (start: number, deleteCount: number, ...items: JSONValue[]): JSONValue[]; }", + "description": "Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "unshift", + "value": "(...items: JSONValue[]) => number", + "description": "Inserts new elements at the start of an array, and returns the new length of the array." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "indexOf", + "value": "(searchElement: JSONValue, fromIndex?: number) => number", + "description": "Returns the index of the first occurrence of a value in an array, or -1 if it is not present." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "lastIndexOf", + "value": "(searchElement: JSONValue, fromIndex?: number) => number", + "description": "Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "every", + "value": "{ (predicate: (value: JSONValue, index: number, array: JSONValue[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: JSONValue, index: number, array: JSONValue[]) => unknown, thisArg?: any): boolean; }", + "description": "Determines whether all the members of an array satisfy the specified test." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "some", + "value": "(predicate: (value: JSONValue, index: number, array: JSONValue[]) => unknown, thisArg?: any) => boolean", + "description": "Determines whether the specified callback function returns true for any element of an array." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "forEach", + "value": "(callbackfn: (value: JSONValue, index: number, array: JSONValue[]) => void, thisArg?: any) => void", + "description": "Performs the specified action for each element in an array." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "map", + "value": "(callbackfn: (value: JSONValue, index: number, array: JSONValue[]) => U, thisArg?: any) => U[]", + "description": "Calls a defined callback function on each element of an array, and returns an array that contains the results." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "filter", + "value": "{ (predicate: (value: JSONValue, index: number, array: JSONValue[]) => value is S, thisArg?: any): S[]; (predicate: (value: JSONValue, index: number, array: JSONValue[]) => unknown, thisArg?: any): JSONValue[]; }", + "description": "Returns the elements of an array that meet the condition specified in a callback function." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "reduce", + "value": "{ (callbackfn: (previousValue: JSONValue, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => JSONValue): JSONValue; (callbackfn: (previousValue: JSONValue, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => JSONValue, initialValue: JSONValue): JSONValue; (callbackfn: (previousValue: U, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => U, initialValue: U): U; }", + "description": "Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "reduceRight", + "value": "{ (callbackfn: (previousValue: JSONValue, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => JSONValue): JSONValue; (callbackfn: (previousValue: JSONValue, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => JSONValue, initialValue: JSONValue): JSONValue; (callbackfn: (previousValue: U, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => U, initialValue: U): U; }", + "description": "Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "find", + "value": "{ (predicate: (value: JSONValue, index: number, obj: JSONValue[]) => value is S, thisArg?: any): S; (predicate: (value: JSONValue, index: number, obj: JSONValue[]) => unknown, thisArg?: any): JSONValue; }", + "description": "Returns the value of the first element in the array where predicate is true, and undefined otherwise." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "findIndex", + "value": "(predicate: (value: JSONValue, index: number, obj: JSONValue[]) => unknown, thisArg?: any) => number", + "description": "Returns the index of the first element in the array where predicate is true, and -1 otherwise." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "fill", + "value": "(value: JSONValue, start?: number, end?: number) => JSONArray", + "description": "Changes all array elements from `start` to `end` index to a static `value` and returns the modified array" + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "copyWithin", + "value": "(target: number, start: number, end?: number) => JSONArray", + "description": "Returns the this object after copying a section of the array identified by start and end to the same array starting at position target" + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "entries", + "value": "() => IterableIterator<[number, JSONValue]>", + "description": "Returns an iterable of key, value pairs for every entry in the array" + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "keys", + "value": "() => IterableIterator", + "description": "Returns an iterable of keys in the array" + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "values", + "value": "() => IterableIterator", + "description": "Returns an iterable of values in the array" + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "includes", + "value": "(searchElement: JSONValue, fromIndex?: number) => boolean", + "description": "Determines whether an array includes a certain element, returning true or false as appropriate." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "flatMap", + "value": "(callback: (this: This, value: JSONValue, index: number, array: JSONValue[]) => U | readonly U[], thisArg?: This) => U[]", + "description": "Calls a defined callback function on each element of an array. Then, flattens the result into a new array. This is identical to a map followed by flat with depth 1." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "flat", + "value": "(this: A, depth?: D) => FlatArray[]", + "description": "Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "__@iterator@1657", + "value": "() => IterableIterator", + "description": "Iterator" + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "PropertySignature", + "name": "__@unscopables@1659", + "value": "{ [x: number]: boolean; length?: boolean; toString?: boolean; toLocaleString?: boolean; pop?: boolean; push?: boolean; concat?: boolean; join?: boolean; reverse?: boolean; shift?: boolean; slice?: boolean; sort?: boolean; splice?: boolean; unshift?: boolean; indexOf?: boolean; lastIndexOf?: boolean; every?: boolean; some?: boolean; forEach?: boolean; map?: boolean; filter?: boolean; reduce?: boolean; reduceRight?: boolean; find?: boolean; findIndex?: boolean; fill?: boolean; copyWithin?: boolean; entries?: boolean; keys?: boolean; values?: boolean; includes?: boolean; flatMap?: boolean; flat?: boolean; [Symbol.iterator]?: boolean; readonly [Symbol.unscopables]?: boolean; at?: boolean; }", + "description": "Is an object whose properties have the value 'true' when they will be absent when used in a 'with' statement." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "at", + "value": "(index: number) => JSONValue", + "description": "Takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array." + } + ], + "value": "interface JSONArray extends Array {}" + }, + "WebhookContextWithSession": { + "filePath": "src/server/authenticate/webhooks/types.ts", + "name": "WebhookContextWithSession", + "description": "", + "members": [ + { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "PropertySignature", + "name": "session", + "value": "Session", + "description": "A session with an offline token for the shop.\n\nReturned only if there is a session for the shop." + }, + { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "PropertySignature", + "name": "admin", + "value": "WebhookAdminContext", + "description": "An admin context for the webhook.\n\nReturned only if there is a session for the shop.", + "examples": [ + { + "title": "[V3] Webhook admin context", + "description": "With the `v3_webhookAdminContext` future flag enabled, use the `admin` object in the context to interact with the Admin API.", + "tabs": [ + { + "code": "import { ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.webhook(request);\n\n const response = await admin?.graphql(\n `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n { variables: { input: { title: \"Product Name\" } } }\n );\n\n const productData = await response.json();\n return json({ data: productData.data });\n}", + "title": "/app/routes/webhooks.tsx" + } + ] + }, + { + "title": "Webhook admin context", + "description": "Use the `admin` object in the context to interact with the Admin API. This format will be removed in V3 of the package.", + "tabs": [ + { + "code": "import { json, ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.webhook(request);\n\n const response = await admin?.graphql.query({\n data: {\n query: `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n variables: { input: { title: \"Product Name\" } },\n },\n });\n\n const productData = response?.body.data;\n return json({ data: productData.data });\n}", + "title": "/app/routes/webhooks.tsx" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "PropertySignature", + "name": "apiVersion", + "value": "string", + "description": "The API version used for the webhook.", + "examples": [ + { + "title": "Webhook API version", + "description": "Get the API version used for webhook request.", + "tabs": [ + { + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { apiVersion } = await authenticate.webhook(request);\n return new Response();\n};", + "title": "/app/routes/webhooks.tsx" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "PropertySignature", + "name": "shop", + "value": "string", + "description": "The shop where the webhook was triggered.", + "examples": [ + { + "title": "Webhook shop", + "description": "Get the shop that triggered a webhook.", + "tabs": [ + { + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { shop } = await authenticate.webhook(request);\n return new Response();\n};", + "title": "/app/routes/webhooks.tsx" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "PropertySignature", + "name": "topic", + "value": "Topics", + "description": "The topic of the webhook.", + "examples": [ + { + "title": "Webhook topic", + "description": "Get the event topic for the webhook.", + "tabs": [ + { + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { topic } = await authenticate.webhook(request);\n\n switch (topic) {\n case \"APP_UNINSTALLED\":\n // Do something when the app is uninstalled.\n break;\n }\n\n return new Response();\n};", + "title": "/app/routes/webhooks.tsx" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "PropertySignature", + "name": "webhookId", + "value": "string", + "description": "A unique ID for the webhook. Useful to keep track of which events your app has already processed.", + "examples": [ + { + "title": "Webhook ID", + "description": "Get the webhook ID.", + "tabs": [ + { + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { webhookId } = await authenticate.webhook(request);\n return new Response();\n};", + "title": "/app/routes/webhooks.tsx" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "PropertySignature", + "name": "payload", + "value": "JSONValue", + "description": "The payload from the webhook request.", + "examples": [ + { + "title": "Webhook payload", + "description": "Get the request's POST payload.", + "tabs": [ + { + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { payload } = await authenticate.webhook(request);\n return new Response();\n};", + "title": "/app/routes/webhooks.tsx" + } + ] + } + ] + } + ], + "value": "export interface WebhookContextWithSession<\n Future extends FutureFlagOptions,\n Resources extends ShopifyRestResources,\n Topics = string | number | symbol,\n> extends Context {\n /**\n * A session with an offline token for the shop.\n *\n * Returned only if there is a session for the shop.\n */\n session: Session;\n\n /**\n * An admin context for the webhook.\n *\n * Returned only if there is a session for the shop.\n *\n * @example\n * [V3] Webhook admin context.\n * With the `v3_webhookAdminContext` future flag enabled, use the `admin` object in the context to interact with the Admin API.\n * ```ts\n * // /app/routes/webhooks.tsx\n * import { ActionFunctionArgs } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { admin } = await authenticate.webhook(request);\n *\n * const response = await admin?.graphql(\n * `#graphql\n * mutation populateProduct($input: ProductInput!) {\n * productCreate(input: $input) {\n * product {\n * id\n * }\n * }\n * }`,\n * { variables: { input: { title: \"Product Name\" } } }\n * );\n *\n * const productData = await response.json();\n * return json({ data: productData.data });\n * }\n * ```\n *\n * @example\n * Webhook admin context.\n * Use the `admin` object in the context to interact with the Admin API. This format will be removed in V3 of the package.\n * ```ts\n * // /app/routes/webhooks.tsx\n * import { json, ActionFunctionArgs } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { admin } = await authenticate.webhook(request);\n *\n * const response = await admin?.graphql.query({\n * data: {\n * query: `#graphql\n * mutation populateProduct($input: ProductInput!) {\n * productCreate(input: $input) {\n * product {\n * id\n * }\n * }\n * }`,\n * variables: { input: { title: \"Product Name\" } },\n * },\n * });\n *\n * const productData = response?.body.data;\n * return json({ data: productData.data });\n * }\n * ```\n */\n admin: WebhookAdminContext;\n}" + }, + "Session": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "name": "Session", + "description": "Stores App information from logged in merchants so they can make authenticated requests to the Admin API.", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "id", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "shop", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "state", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "isOnline", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "scope", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "expires", + "value": "Date", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "accessToken", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "onlineAccessInfo", + "value": "OnlineAccessInfo", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "isActive", + "value": "(scopes: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "isScopeChanged", + "value": "(scopes: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "isExpired", + "value": "(withinMillisecondsOfExpiry?: number) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toObject", + "value": "() => SessionParams", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "equals", + "value": "(other: Session) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toPropertyArray", + "value": "() => [string, string | number | boolean][]", + "description": "" + } + ], + "value": "export declare class Session {\n static fromPropertyArray(entries: [string, string | number | boolean][]): Session;\n readonly id: string;\n shop: string;\n state: string;\n isOnline: boolean;\n scope?: string;\n expires?: Date;\n accessToken?: string;\n onlineAccessInfo?: OnlineAccessInfo;\n constructor(params: SessionParams);\n isActive(scopes: AuthScopes | string | string[]): boolean;\n isScopeChanged(scopes: AuthScopes | string | string[]): boolean;\n isExpired(withinMillisecondsOfExpiry?: number): boolean;\n toObject(): SessionParams;\n equals(other: Session | undefined): boolean;\n toPropertyArray(): [string, string | number | boolean][];\n}" + }, + "OnlineAccessInfo": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "name": "OnlineAccessInfo", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "expires_in", + "value": "number", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "associated_user_scope", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "associated_user", + "value": "{ id: number; first_name: string; last_name: string; email: string; email_verified: boolean; account_owner: boolean; locale: string; collaborator: boolean; }", + "description": "" + } + ], + "value": "export interface OnlineAccessInfo {\n expires_in: number;\n associated_user_scope: string;\n associated_user: {\n id: number;\n first_name: string;\n last_name: string;\n email: string;\n email_verified: boolean;\n account_owner: boolean;\n locale: string;\n collaborator: boolean;\n };\n}" + }, + "AuthScopes": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "name": "AuthScopes", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "has", + "value": "(scope: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "equals", + "value": "(otherScopes: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toString", + "value": "() => string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toArray", + "value": "() => string[]", + "description": "" + } + ], + "value": "declare class AuthScopes {\n static SCOPE_DELIMITER: string;\n private compressedScopes;\n private expandedScopes;\n constructor(scopes: string | string[] | AuthScopes | undefined);\n has(scope: string | string[] | AuthScopes | undefined): boolean;\n equals(otherScopes: string | string[] | AuthScopes | undefined): boolean;\n toString(): string;\n toArray(): string[];\n private getImpliedScopes;\n}" + }, + "SessionParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "name": "SessionParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "id", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "shop", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "state", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "isOnline", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "scope", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "expires", + "value": "Date", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "accessToken", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "onlineAccessInfo", + "value": "OnlineAccessInfo", + "description": "", + "isOptional": true + } + ], + "value": "export interface SessionParams {\n readonly id: string;\n shop: string;\n state: string;\n isOnline: boolean;\n scope?: string;\n expires?: Date;\n accessToken?: string;\n onlineAccessInfo?: OnlineAccessInfo;\n}" + }, + "WebhookAdminContext": { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "WebhookAdminContext", + "value": "FeatureEnabled extends true\n ? AdminApiContext\n : LegacyWebhookAdminApiContext", + "description": "" + }, + "AdminContext": { + "filePath": "src/server/authenticate/admin/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "AdminContext", + "value": "Config['isEmbeddedApp'] extends false\n ? NonEmbeddedAdminContext\n : EmbeddedAdminContext", + "description": "" + }, + "NonEmbeddedAdminContext": { + "filePath": "src/server/authenticate/admin/types.ts", + "name": "NonEmbeddedAdminContext", + "description": "", + "members": [ + { + "filePath": "src/server/authenticate/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "session", + "value": "Session", + "description": "The session for the user who made the request.\n\nThis comes from the session storage which `shopifyApp` uses to store sessions in your database of choice.\n\nUse this to get shop or user-specific data.", + "examples": [ + { + "title": "Using offline sessions", + "description": "Get your app's shop-specific data using an offline session.", + "tabs": [ + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "shopify.server.ts" + }, + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session } = await authenticate.admin(request);\n return json(await getMyAppData({shop: session.shop));\n};", + "title": "/app/routes/**\\/*.ts" + } + ] + }, + { + "title": "Using online sessions", + "description": "Get your app's user-specific data using an online session.", + "tabs": [ + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n useOnlineTokens: true,\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "shopify.server.ts" + }, + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session } = await authenticate.admin(request);\n return json(await getMyAppData({user: session.onlineAccessInfo!.id}));\n};", + "title": "/app/routes/**\\/*.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "admin", + "value": "AdminApiContext", + "description": "Methods for interacting with the GraphQL / REST Admin APIs for the store that made the request." + }, + { + "filePath": "src/server/authenticate/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "billing", + "value": "BillingContext", + "description": "Billing methods for this store, based on the plans defined in the `billing` config option.\n\n\n\n\n" + }, + { + "filePath": "src/server/authenticate/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "cors", + "value": "EnsureCORSFunction", + "description": "A function that ensures the CORS headers are set correctly for the response.", + "examples": [ + { + "title": "Setting CORS headers for a admin request", + "description": "Use the `cors` helper to ensure your app can respond to requests from admin extensions.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session, cors } = await authenticate.admin(request);\n return cors(json(await getMyAppData({user: session.onlineAccessInfo!.id})));\n};", + "title": "/app/routes/admin/my-route.ts" + } + ] + } + ] + } + ], + "value": "export interface NonEmbeddedAdminContext<\n Config extends AppConfigArg,\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> extends AdminContextInternal {}" + }, + "AdminApiContext": { + "filePath": "src/server/clients/admin/types.ts", + "name": "AdminApiContext", + "description": "", + "members": [ + { + "filePath": "src/server/clients/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "rest", + "value": "RestClientWithResources", + "description": "Methods for interacting with the Shopify Admin REST API\n\nThere are methods for interacting with individual REST resources. You can also make `GET`, `POST`, `PUT` and `DELETE` requests should the REST resources not meet your needs.\n\n\n\n\n", + "examples": [ + { + "title": "Using REST resources", + "description": "Getting the number of orders in a store using REST resources. Visit the [Admin REST API references](/docs/api/admin-rest) for examples on using each resource.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n return json(admin.rest.resources.Order.count({ session }));\n};", + "title": "/app/routes/**\\/*.ts" + }, + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-07\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "/app/shopify.server.ts" + } + ] + }, + { + "title": "Performing a GET request to the REST API", + "description": "Use `admin.rest.get` to make custom requests to make a request to to the `customer/count` endpoint", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n const response = await admin.rest.get({ path: \"/customers/count.json\" });\n const customers = await response.json();\n return json({ customers });\n};", + "title": "/app/routes/**\\/*.ts" + }, + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "/app/shopify.server.ts" + } + ] + }, + { + "title": "Performing a POST request to the REST API", + "description": "Use `admin.rest.post` to make custom requests to make a request to to the `customers.json` endpoint to send a welcome email", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n const response = admin.rest.post({\n path: \"customers/7392136888625/send_invite.json\",\n body: {\n customer_invite: {\n to: \"new_test_email@shopify.com\",\n from: \"j.limited@example.com\",\n bcc: [\"j.limited@example.com\"],\n subject: \"Welcome to my new shop\",\n custom_message: \"My awesome new store\",\n },\n },\n});\n const customerInvite = await response.json();\n return json({ customerInvite });\n};", + "title": "/app/routes/**\\/*.ts" + }, + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "/app/shopify.server.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/clients/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "graphql", + "value": "GraphQLClient", + "description": "Methods for interacting with the Shopify Admin GraphQL API\n\n\n\n\n\n\n\n\n\n", + "examples": [ + { + "title": "Querying the GraphQL API", + "description": "Use `admin.graphql` to make query / mutation requests.", + "tabs": [ + { + "code": "import { ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.admin(request);\n\n const response = await admin.graphql(\n `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n { variables: { input: { title: \"Product Name\" } } }\n );\n\n const productData = await response.json();\n return json({ data: productData.data });\n}", + "title": "Example" + } + ] + } + ] + } + ], + "value": "export interface AdminApiContext<\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> {\n /**\n * Methods for interacting with the Shopify Admin REST API\n *\n * There are methods for interacting with individual REST resources. You can also make `GET`, `POST`, `PUT` and `DELETE` requests should the REST resources not meet your needs.\n *\n * {@link https://shopify.dev/docs/api/admin-rest}\n *\n * @example\n * Using REST resources.\n * Getting the number of orders in a store using REST resources. Visit the [Admin REST API references](/docs/api/admin-rest) for examples on using each resource. \n *\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * return json(admin.rest.resources.Order.count({ session }));\n * };\n * ```\n *\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-07\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n *\n *\n * @example\n * Performing a GET request to the REST API.\n * Use `admin.rest.get` to make custom requests to make a request to to the `customer/count` endpoint\n *\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * const response = await admin.rest.get({ path: \"/customers/count.json\" });\n * const customers = await response.json();\n * return json({ customers });\n * };\n * ```\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n * @example\n * Performing a POST request to the REST API.\n * Use `admin.rest.post` to make custom requests to make a request to to the `customers.json` endpoint to send a welcome email\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * const response = admin.rest.post({\n * path: \"customers/7392136888625/send_invite.json\",\n * body: {\n * customer_invite: {\n * to: \"new_test_email@shopify.com\",\n * from: \"j.limited@example.com\",\n * bcc: [\"j.limited@example.com\"],\n * subject: \"Welcome to my new shop\",\n * custom_message: \"My awesome new store\",\n * },\n * },\n * });\n * const customerInvite = await response.json();\n * return json({ customerInvite });\n * };\n * ```\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n rest: RestClientWithResources;\n\n /**\n * Methods for interacting with the Shopify Admin GraphQL API\n *\n * {@link https://shopify.dev/docs/api/admin-graphql}\n * {@link https://github.com/Shopify/shopify-api-js/blob/main/packages/shopify-api/docs/reference/clients/Graphql.md}\n *\n * @example\n * Querying the GraphQL API.\n * Use `admin.graphql` to make query / mutation requests.\n * ```ts\n * import { ActionFunctionArgs } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { admin } = await authenticate.admin(request);\n *\n * const response = await admin.graphql(\n * `#graphql\n * mutation populateProduct($input: ProductInput!) {\n * productCreate(input: $input) {\n * product {\n * id\n * }\n * }\n * }`,\n * { variables: { input: { title: \"Product Name\" } } }\n * );\n *\n * const productData = await response.json();\n * return json({ data: productData.data });\n * }\n * ```\n */\n graphql: GraphQLClient;\n}" + }, + "RestClientWithResources": { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "RestClientWithResources", + "value": "RemixRestClient & {resources: Resources}", + "description": "" + }, + "RemixRestClient": { + "filePath": "src/server/clients/admin/rest.ts", + "name": "RemixRestClient", + "description": "", + "members": [ + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "PropertyDeclaration", + "name": "session", + "value": "Session", + "description": "" + }, + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "get", + "value": "(params: GetRequestParams) => Promise", + "description": "Performs a GET request on the given path." + }, + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "post", + "value": "(params: PostRequestParams) => Promise", + "description": "Performs a POST request on the given path." + }, + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "put", + "value": "(params: PostRequestParams) => Promise", + "description": "Performs a PUT request on the given path." + }, + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "delete", + "value": "(params: GetRequestParams) => Promise", + "description": "Performs a DELETE request on the given path." + } + ], + "value": "class RemixRestClient {\n public session: Session;\n private params: AdminClientOptions['params'];\n private handleClientError: AdminClientOptions['handleClientError'];\n\n constructor({params, session, handleClientError}: AdminClientOptions) {\n this.params = params;\n this.handleClientError = handleClientError;\n this.session = session;\n }\n\n /**\n * Performs a GET request on the given path.\n */\n public async get(params: GetRequestParams) {\n return this.makeRequest({\n method: 'GET' as RequestParams['method'],\n ...params,\n });\n }\n\n /**\n * Performs a POST request on the given path.\n */\n public async post(params: PostRequestParams) {\n return this.makeRequest({\n method: 'POST' as RequestParams['method'],\n ...params,\n });\n }\n\n /**\n * Performs a PUT request on the given path.\n */\n public async put(params: PutRequestParams) {\n return this.makeRequest({\n method: 'PUT' as RequestParams['method'],\n ...params,\n });\n }\n\n /**\n * Performs a DELETE request on the given path.\n */\n public async delete(params: DeleteRequestParams) {\n return this.makeRequest({\n method: 'DELETE' as RequestParams['method'],\n ...params,\n });\n }\n\n protected async makeRequest(params: RequestParams): Promise {\n const originalClient = new this.params.api.clients.Rest({\n session: this.session,\n });\n const originalRequest = Reflect.get(originalClient, 'request');\n\n try {\n const apiResponse = await originalRequest.call(originalClient, params);\n\n // We use a separate client for REST requests and REST resources because we want to override the API library\n // client class to return a Response object instead.\n return new Response(JSON.stringify(apiResponse.body), {\n headers: apiResponse.headers,\n });\n } catch (error) {\n if (this.handleClientError) {\n throw await this.handleClientError({\n error,\n session: this.session,\n params: this.params,\n });\n } else throw new Error(error);\n }\n }\n}" + }, + "GetRequestParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "GetRequestParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "path", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "type", + "value": "DataType", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "data", + "value": "string | Record", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "query", + "value": "SearchParams", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "extraHeaders", + "value": "HeaderParams", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "tries", + "value": "number", + "description": "", + "isOptional": true + } + ], + "value": "export interface GetRequestParams {\n path: string;\n type?: DataType;\n data?: Record | string;\n query?: SearchParams;\n extraHeaders?: HeaderParams;\n tries?: number;\n}" + }, + "DataType": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "DataType", + "value": "export declare enum DataType {\n JSON = \"application/json\",\n GraphQL = \"application/graphql\",\n URLEncoded = \"application/x-www-form-urlencoded\"\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "JSON", + "value": "application/json" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "GraphQL", + "value": "application/graphql" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "URLEncoded", + "value": "application/x-www-form-urlencoded" + } + ] + }, + "HeaderParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "HeaderParams", + "value": "Record", + "description": "", + "members": [] + }, + "PostRequestParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "PostRequestParams", + "value": "GetRequestParams & {\n data: Record | string;\n}", + "description": "" + }, + "GraphQLClient": { + "filePath": "src/server/clients/types.ts", + "name": "GraphQLClient", + "description": "", + "params": [ + { + "name": "query", + "description": "", + "value": "Operation extends keyof Operations", + "filePath": "src/server/clients/types.ts" + }, + { + "name": "options", + "description": "", + "value": "GraphQLQueryOptions", + "isOptional": true, + "filePath": "src/server/clients/types.ts" + } + ], + "returns": { + "filePath": "src/server/clients/types.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}" + }, + "value": "export type GraphQLClient = <\n Operation extends keyof Operations,\n>(\n query: Operation,\n options?: GraphQLQueryOptions,\n) => Promise<\n ResponseWithType>>\n>;" + }, + "GraphQLQueryOptions": { + "filePath": "src/server/clients/types.ts", + "name": "GraphQLQueryOptions", + "description": "", + "members": [ + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "variables", + "value": "ApiClientRequestOptions[\"variables\"]", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "apiVersion", + "value": "ApiVersion", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "headers", + "value": "{ [key: string]: any; }", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "tries", + "value": "number", + "description": "", + "isOptional": true + } + ], + "value": "export interface GraphQLQueryOptions<\n Operation extends keyof Operations,\n Operations extends AllOperations,\n> {\n variables?: ApiClientRequestOptions['variables'];\n apiVersion?: ApiVersion;\n headers?: {[key: string]: any};\n tries?: number;\n}" + }, + "ApiVersion": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "ApiVersion", + "value": "export declare enum ApiVersion {\n October22 = \"2022-10\",\n January23 = \"2023-01\",\n April23 = \"2023-04\",\n July23 = \"2023-07\",\n October23 = \"2023-10\",\n January24 = \"2024-01\",\n Unstable = \"unstable\"\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "October22", + "value": "2022-10" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "January23", + "value": "2023-01" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "April23", + "value": "2023-04" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "July23", + "value": "2023-07" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "October23", + "value": "2023-10" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "January24", + "value": "2024-01" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Unstable", + "value": "unstable" + } + ] + }, + "BillingContext": { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "name": "BillingContext", + "description": "", + "members": [ + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "require", + "value": "(options: RequireBillingOptions) => Promise", + "description": "Checks if the shop has an active payment for any plan defined in the `billing` config option.", + "examples": [ + { + "title": "Requesting billing right away", + "description": "Call `billing.request` in the `onFailure` callback to immediately redirect to the Shopify page to request payment.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs } from \"@remix-run/node\";\nimport { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { billing } = await authenticate.admin(request);\n await billing.require({\n plans: [MONTHLY_PLAN],\n isTest: true,\n onFailure: async () => billing.request({ plan: MONTHLY_PLAN }),\n });\n\n // App logic\n};", + "title": "/app/routes/**\\/*.ts" + }, + { + "code": "import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n\nexport const MONTHLY_PLAN = 'Monthly subscription';\nexport const ANNUAL_PLAN = 'Annual subscription';\n\nconst shopify = shopifyApp({\n // ...etc\n billing: {\n [MONTHLY_PLAN]: {\n amount: 5,\n currencyCode: 'USD',\n interval: BillingInterval.Every30Days,\n },\n [ANNUAL_PLAN]: {\n amount: 50,\n currencyCode: 'USD',\n interval: BillingInterval.Annual,\n },\n }\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "shopify.server.ts" + } + ] + }, + { + "title": "Using a plan selection page", + "description": "When the app has multiple plans, create a page in your App that allows the merchant to select a plan. If a merchant does not have the required plan you can redirect them to page in your app to select one.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, redirect } from \"@remix-run/node\";\nimport { authenticate, MONTHLY_PLAN, ANNUAL_PLAN } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { billing } = await authenticate.admin(request);\n const billingCheck = await billing.require({\n plans: [MONTHLY_PLAN, ANNUAL_PLAN],\n isTest: true,\n onFailure: () => redirect('/select-plan'),\n });\n\n const subscription = billingCheck.appSubscriptions[0];\n console.log(`Shop is on ${subscription.name} (id ${subscription.id})`);\n\n // App logic\n};", + "title": "/app/routes/**\\/*.ts" + }, + { + "code": "import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n\nexport const MONTHLY_PLAN = 'Monthly subscription';\nexport const ANNUAL_PLAN = 'Annual subscription';\n\nconst shopify = shopifyApp({\n // ...etc\n billing: {\n [MONTHLY_PLAN]: {\n amount: 5,\n currencyCode: 'USD',\n interval: BillingInterval.Every30Days,\n },\n [ANNUAL_PLAN]: {\n amount: 50,\n currencyCode: 'USD',\n interval: BillingInterval.Annual,\n },\n }\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "shopify.server.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "request", + "value": "(options: RequestBillingOptions) => Promise", + "description": "Requests payment for the plan.", + "examples": [ + { + "title": "Using a custom return URL", + "description": "Change where the merchant is returned to after approving the purchase using the `returnUrl` option.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs } from \"@remix-run/node\";\nimport { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { billing } = await authenticate.admin(request);\n await billing.require({\n plans: [MONTHLY_PLAN],\n onFailure: async () => billing.request({\n plan: MONTHLY_PLAN,\n isTest: true,\n returnUrl: 'https://admin.shopify.com/store/my-store/apps/my-app/billing-page',\n }),\n });\n\n // App logic\n};", + "title": "/app/routes/**\\/*.ts" + }, + { + "code": "import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n\nexport const MONTHLY_PLAN = 'Monthly subscription';\nexport const ANNUAL_PLAN = 'Annual subscription';\n\nconst shopify = shopifyApp({\n // ...etc\n billing: {\n [MONTHLY_PLAN]: {\n amount: 5,\n currencyCode: 'USD',\n interval: BillingInterval.Every30Days,\n },\n [ANNUAL_PLAN]: {\n amount: 50,\n currencyCode: 'USD',\n interval: BillingInterval.Annual,\n },\n }\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "shopify.server.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "cancel", + "value": "(options: CancelBillingOptions) => Promise", + "description": "Cancels an ongoing subscription, given its ID.", + "examples": [ + { + "title": "Cancelling a subscription", + "description": "Use the `billing.cancel` function to cancel an active subscription with the id returned from `billing.require`.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs } from \"@remix-run/node\";\nimport { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { billing } = await authenticate.admin(request);\n const billingCheck = await billing.require({\n plans: [MONTHLY_PLAN],\n onFailure: async () => billing.request({ plan: MONTHLY_PLAN }),\n });\n\n const subscription = billingCheck.appSubscriptions[0];\n const cancelledSubscription = await billing.cancel({\n subscriptionId: subscription.id,\n isTest: true,\n prorate: true,\n });\n\n // App logic\n};", + "title": "/app/routes/cancel-subscription.ts" + }, + { + "code": "import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n\nexport const MONTHLY_PLAN = 'Monthly subscription';\nexport const ANNUAL_PLAN = 'Annual subscription';\n\nconst shopify = shopifyApp({\n // ...etc\n billing: {\n [MONTHLY_PLAN]: {\n amount: 5,\n currencyCode: 'USD',\n interval: BillingInterval.Every30Days,\n },\n [ANNUAL_PLAN]: {\n amount: 50,\n currencyCode: 'USD',\n interval: BillingInterval.Annual,\n },\n }\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "shopify.server.ts" + } + ] + } + ] + } + ], + "value": "export interface BillingContext {\n /**\n * Checks if the shop has an active payment for any plan defined in the `billing` config option.\n *\n * @returns A promise that resolves to an object containing the active purchases for the shop.\n *\n * @example\n * Requesting billing right away.\n * Call `billing.request` in the `onFailure` callback to immediately redirect to the Shopify page to request payment.\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * await billing.require({\n * plans: [MONTHLY_PLAN],\n * isTest: true,\n * onFailure: async () => billing.request({ plan: MONTHLY_PLAN }),\n * });\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n *\n * @example\n * Using a plan selection page.\n * When the app has multiple plans, create a page in your App that allows the merchant to select a plan. If a merchant does not have the required plan you can redirect them to page in your app to select one.\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, redirect } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN, ANNUAL_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * const billingCheck = await billing.require({\n * plans: [MONTHLY_PLAN, ANNUAL_PLAN],\n * isTest: true,\n * onFailure: () => redirect('/select-plan'),\n * });\n *\n * const subscription = billingCheck.appSubscriptions[0];\n * console.log(`Shop is on ${subscription.name} (id ${subscription.id})`);\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n require: (\n options: RequireBillingOptions,\n ) => Promise;\n\n /**\n * Requests payment for the plan.\n *\n * @returns Redirects to the confirmation URL for the payment.\n *\n * @example\n * Using a custom return URL.\n * Change where the merchant is returned to after approving the purchase using the `returnUrl` option.\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * await billing.require({\n * plans: [MONTHLY_PLAN],\n * onFailure: async () => billing.request({\n * plan: MONTHLY_PLAN,\n * isTest: true,\n * returnUrl: 'https://admin.shopify.com/store/my-store/apps/my-app/billing-page',\n * }),\n * });\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n request: (options: RequestBillingOptions) => Promise;\n\n /**\n * Cancels an ongoing subscription, given its ID.\n *\n * @returns The cancelled subscription.\n *\n * @example\n * Cancelling a subscription.\n * Use the `billing.cancel` function to cancel an active subscription with the id returned from `billing.require`.\n * ```ts\n * // /app/routes/cancel-subscription.ts\n * import { LoaderFunctionArgs } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * const billingCheck = await billing.require({\n * plans: [MONTHLY_PLAN],\n * onFailure: async () => billing.request({ plan: MONTHLY_PLAN }),\n * });\n *\n * const subscription = billingCheck.appSubscriptions[0];\n * const cancelledSubscription = await billing.cancel({\n * subscriptionId: subscription.id,\n * isTest: true,\n * prorate: true,\n * });\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n cancel: (options: CancelBillingOptions) => Promise;\n}" + }, + "RequireBillingOptions": { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "name": "RequireBillingOptions", + "description": "", + "members": [ + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "plans", + "value": "(keyof Config[\"billing\"])[]", + "description": "The plans to check for. Must be one of the values defined in the `billing` config option." + }, + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "onFailure", + "value": "(error: any) => Promise", + "description": "How to handle the request if the shop doesn't have an active payment for any plan." + }, + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "isTest", + "value": "boolean", + "description": "", + "isOptional": true + } + ], + "value": "export interface RequireBillingOptions\n extends Omit {\n /**\n * The plans to check for. Must be one of the values defined in the `billing` config option.\n */\n plans: (keyof Config['billing'])[];\n /**\n * How to handle the request if the shop doesn't have an active payment for any plan.\n */\n onFailure: (error: any) => Promise;\n}" + }, + "BillingCheckResponseObject": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingCheckResponseObject", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "hasActivePayment", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "oneTimePurchases", + "value": "OneTimePurchase[]", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "appSubscriptions", + "value": "AppSubscription[]", + "description": "" + } + ], + "value": "export interface BillingCheckResponseObject {\n hasActivePayment: boolean;\n oneTimePurchases: OneTimePurchase[];\n appSubscriptions: AppSubscription[];\n}" + }, + "OneTimePurchase": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "OneTimePurchase", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "id", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "name", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "test", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "status", + "value": "string", + "description": "" + } + ], + "value": "export interface OneTimePurchase {\n id: string;\n name: string;\n test: boolean;\n status: string;\n}" + }, + "AppSubscription": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "AppSubscription", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "id", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "name", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "test", + "value": "boolean", + "description": "" + } + ], + "value": "export interface AppSubscription {\n id: string;\n name: string;\n test: boolean;\n}" + }, + "RequestBillingOptions": { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "name": "RequestBillingOptions", + "description": "", + "members": [ + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "plan", + "value": "keyof Config[\"billing\"]", + "description": "The plan to request. Must be one of the values defined in the `billing` config option." + }, + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "isTest", + "value": "boolean", + "description": "Whether to use the test mode. This prevents the credit card from being charged. Test shops and demo shops cannot be charged.", + "isOptional": true + }, + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "returnUrl", + "value": "string", + "description": "The URL to return to after the merchant approves the payment.", + "isOptional": true + } + ], + "value": "export interface RequestBillingOptions\n extends Omit {\n /**\n * The plan to request. Must be one of the values defined in the `billing` config option.\n */\n plan: keyof Config['billing'];\n /**\n * Whether to use the test mode. This prevents the credit card from being charged. Test shops and demo shops cannot be charged.\n */\n isTest?: boolean;\n /**\n * The URL to return to after the merchant approves the payment.\n */\n returnUrl?: string;\n}" + }, + "CancelBillingOptions": { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "name": "CancelBillingOptions", + "description": "", + "members": [ + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "subscriptionId", + "value": "string", + "description": "The ID of the subscription to cancel." + }, + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "prorate", + "value": "boolean", + "description": "Whether to prorate the cancellation.\n\n\n\n\n", + "isOptional": true + }, + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "isTest", + "value": "boolean", + "description": "", + "isOptional": true + } + ], + "value": "export interface CancelBillingOptions {\n /**\n * The ID of the subscription to cancel.\n */\n subscriptionId: string;\n /**\n * Whether to prorate the cancellation.\n *\n * {@link https://shopify.dev/docs/apps/billing/subscriptions/cancel-recurring-charges}\n */\n prorate?: boolean;\n /*\n * Whether to use the test mode. This prevents the credit card from being charged. Test shops and demo shops cannot be charged.\n */\n isTest?: boolean;\n}" + }, + "EnsureCORSFunction": { + "filePath": "src/server/authenticate/helpers/ensure-cors-headers.ts", + "name": "EnsureCORSFunction", + "description": "", + "members": [], + "value": "export interface EnsureCORSFunction {\n (response: Response): Response;\n}" + }, + "EmbeddedAdminContext": { + "filePath": "src/server/authenticate/admin/types.ts", + "name": "EmbeddedAdminContext", + "description": "", + "members": [ + { + "filePath": "src/server/authenticate/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "sessionToken", + "value": "JwtPayload", + "description": "The decoded and validated session token for the request.\n\nReturned only if `isEmbeddedApp` is `true`.\n\n\n\n\n", + "examples": [ + { + "title": "Using the decoded session token", + "description": "Get user-specific data using the `sessionToken` object.", + "tabs": [ + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n useOnlineTokens: true,\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "shopify.server.ts" + }, + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { sessionToken } = await authenticate.public.checkout(\n request\n );\n return json(await getMyAppData({user: sessionToken.sub}));\n};", + "title": "/app/routes/**\\/*.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "redirect", + "value": "RedirectFunction", + "description": "A function that redirects the user to a new page, ensuring that the appropriate parameters are set for embedded apps.\n\nReturned only if `isEmbeddedApp` is `true`.", + "examples": [ + { + "title": "Redirecting to an app route", + "description": "Use the `redirect` helper to safely redirect between pages.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session, redirect } = await authenticate.admin(request);\n return redirect(\"/\");\n};", + "title": "/app/routes/admin/my-route.ts" + } + ] + }, + { + "title": "Redirecting outside of Shopify admin", + "description": "Pass in a `target` option of `_top` or `_parent` to go to an external URL.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session, redirect } = await authenticate.admin(request);\n return redirect(\"/\", { target: '_parent' });\n};", + "title": "/app/routes/admin/my-route.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "session", + "value": "Session", + "description": "The session for the user who made the request.\n\nThis comes from the session storage which `shopifyApp` uses to store sessions in your database of choice.\n\nUse this to get shop or user-specific data.", + "examples": [ + { + "title": "Using offline sessions", + "description": "Get your app's shop-specific data using an offline session.", + "tabs": [ + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "shopify.server.ts" + }, + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session } = await authenticate.admin(request);\n return json(await getMyAppData({shop: session.shop));\n};", + "title": "/app/routes/**\\/*.ts" + } + ] + }, + { + "title": "Using online sessions", + "description": "Get your app's user-specific data using an online session.", + "tabs": [ + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n useOnlineTokens: true,\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "shopify.server.ts" + }, + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session } = await authenticate.admin(request);\n return json(await getMyAppData({user: session.onlineAccessInfo!.id}));\n};", + "title": "/app/routes/**\\/*.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "admin", + "value": "AdminApiContext", + "description": "Methods for interacting with the GraphQL / REST Admin APIs for the store that made the request." + }, + { + "filePath": "src/server/authenticate/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "billing", + "value": "BillingContext", + "description": "Billing methods for this store, based on the plans defined in the `billing` config option.\n\n\n\n\n" + }, + { + "filePath": "src/server/authenticate/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "cors", + "value": "EnsureCORSFunction", + "description": "A function that ensures the CORS headers are set correctly for the response.", + "examples": [ + { + "title": "Setting CORS headers for a admin request", + "description": "Use the `cors` helper to ensure your app can respond to requests from admin extensions.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session, cors } = await authenticate.admin(request);\n return cors(json(await getMyAppData({user: session.onlineAccessInfo!.id})));\n};", + "title": "/app/routes/admin/my-route.ts" + } + ] + } + ] + } + ], + "value": "export interface EmbeddedAdminContext<\n Config extends AppConfigArg,\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> extends AdminContextInternal {\n /**\n * The decoded and validated session token for the request.\n *\n * Returned only if `isEmbeddedApp` is `true`.\n *\n * {@link https://shopify.dev/docs/apps/auth/oauth/session-tokens#payload}\n *\n * @example\n * Using the decoded session token.\n * Get user-specific data using the `sessionToken` object.\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n *\n * const shopify = shopifyApp({\n * // ...etc\n * useOnlineTokens: true,\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n * import { getMyAppData } from \"~/db/model.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { sessionToken } = await authenticate.public.checkout(\n * request\n * );\n * return json(await getMyAppData({user: sessionToken.sub}));\n * };\n * ```\n */\n sessionToken: JwtPayload;\n\n /**\n * A function that redirects the user to a new page, ensuring that the appropriate parameters are set for embedded\n * apps.\n *\n * Returned only if `isEmbeddedApp` is `true`.\n *\n * @example\n * Redirecting to an app route.\n * Use the `redirect` helper to safely redirect between pages.\n * ```ts\n * // /app/routes/admin/my-route.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { session, redirect } = await authenticate.admin(request);\n * return redirect(\"/\");\n * };\n * ```\n *\n * @example\n * Redirecting outside of Shopify admin.\n * Pass in a `target` option of `_top` or `_parent` to go to an external URL.\n * ```ts\n * // /app/routes/admin/my-route.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { session, redirect } = await authenticate.admin(request);\n * return redirect(\"/\", { target: '_parent' });\n * };\n * ```\n */\n redirect: RedirectFunction;\n}" + }, + "JwtPayload": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "name": "JwtPayload", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "iss", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "dest", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "aud", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "sub", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "exp", + "value": "number", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "nbf", + "value": "number", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "iat", + "value": "number", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "jti", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "sid", + "value": "string", + "description": "" + } + ], + "value": "export interface JwtPayload {\n iss: string;\n dest: string;\n aud: string;\n sub: string;\n exp: number;\n nbf: number;\n iat: number;\n jti: string;\n sid: string;\n}" + }, + "RedirectFunction": { + "filePath": "src/server/authenticate/admin/helpers/redirect.ts", + "name": "RedirectFunction", + "description": "", + "params": [ + { + "name": "url", + "description": "", + "value": "string", + "filePath": "src/server/authenticate/admin/helpers/redirect.ts" + }, + { + "name": "init", + "description": "", + "value": "RedirectInit", + "isOptional": true, + "filePath": "src/server/authenticate/admin/helpers/redirect.ts" + } + ], + "returns": { + "filePath": "src/server/authenticate/admin/helpers/redirect.ts", + "description": "", + "name": "TypedResponse", + "value": "TypedResponse" + }, + "value": "export type RedirectFunction = (\n url: string,\n init?: RedirectInit,\n) => TypedResponse;" + }, + "RedirectInit": { + "filePath": "src/server/authenticate/admin/helpers/redirect.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "RedirectInit", + "value": "number | (ResponseInit & {target?: RedirectTarget})", + "description": "" + }, + "RedirectTarget": { + "filePath": "src/server/authenticate/admin/helpers/redirect.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "RedirectTarget", + "value": "'_self' | '_parent' | '_top'", + "description": "" + }, + "LegacyWebhookAdminApiContext": { + "filePath": "src/server/authenticate/webhooks/types.ts", + "name": "LegacyWebhookAdminApiContext", + "description": "", + "members": [ + { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "PropertySignature", + "name": "rest", + "value": "RestClient & Resources", + "description": "A REST client." + }, + { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "PropertySignature", + "name": "graphql", + "value": "InstanceType", + "description": "A GraphQL client." + } + ], + "value": "export interface LegacyWebhookAdminApiContext<\n Resources extends ShopifyRestResources,\n> {\n /** A REST client. */\n rest: InstanceType & Resources;\n /** A GraphQL client. */\n graphql: InstanceType;\n}" + }, + "RestClient": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/rest/client.d.ts", + "name": "RestClient", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/rest/client.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "loggedDeprecations", + "value": "Record", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/rest/client.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "client", + "value": "AdminRestApiClient", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/rest/client.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "session", + "value": "Session", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/rest/client.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "apiVersion", + "value": "ApiVersion", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/rest/client.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "get", + "value": "(params: GetRequestParams) => Promise>", + "description": "Performs a GET request on the given path." + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/rest/client.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "post", + "value": "(params: PostRequestParams) => Promise>", + "description": "Performs a POST request on the given path." + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/rest/client.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "put", + "value": "(params: PostRequestParams) => Promise>", + "description": "Performs a PUT request on the given path." + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/rest/client.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "delete", + "value": "(params: GetRequestParams) => Promise>", + "description": "Performs a DELETE request on the given path." + } + ], + "value": "export declare class RestClient {\n static config: ConfigInterface;\n static formatPaths: boolean;\n static LINK_HEADER_REGEXP: RegExp;\n static DEFAULT_LIMIT: string;\n static RETRY_WAIT_TIME: number;\n static readonly DEPRECATION_ALERT_DELAY = 300000;\n loggedDeprecations: Record;\n readonly client: AdminRestApiClient;\n readonly session: Session;\n readonly apiVersion: ApiVersion;\n constructor({ session, apiVersion }: RestClientParams);\n /**\n * Performs a GET request on the given path.\n */\n get(params: GetRequestParams): Promise>;\n /**\n * Performs a POST request on the given path.\n */\n post(params: PostRequestParams): Promise>;\n /**\n * Performs a PUT request on the given path.\n */\n put(params: PutRequestParams): Promise>;\n /**\n * Performs a DELETE request on the given path.\n */\n delete(params: DeleteRequestParams): Promise>;\n protected request(params: RequestParams): Promise>;\n private restClass;\n private buildRequestParams;\n private logDeprecations;\n}" + }, + "RestRequestReturn": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "name": "RestRequestReturn", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "body", + "value": "T", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "headers", + "value": "Headers", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "pageInfo", + "value": "PageInfo", + "description": "", + "isOptional": true + } + ], + "value": "export interface RestRequestReturn {\n body: T;\n headers: Headers;\n pageInfo?: PageInfo;\n}" + }, + "Headers": { + "filePath": "../../node_modules/@shopify/shopify-api/runtime/http/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "Headers", + "value": "Record", + "description": "", + "members": [] + }, + "PageInfo": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "name": "PageInfo", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "limit", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "fields", + "value": "string[]", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "previousPageUrl", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "nextPageUrl", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "prevPage", + "value": "PageInfoParams", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "nextPage", + "value": "PageInfoParams", + "description": "", + "isOptional": true + } + ], + "value": "export interface PageInfo {\n limit: string;\n fields?: string[];\n previousPageUrl?: string;\n nextPageUrl?: string;\n prevPage?: PageInfoParams;\n nextPage?: PageInfoParams;\n}" + }, + "PageInfoParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "name": "PageInfoParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "path", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "query", + "value": "SearchParams", + "description": "" + } + ], + "value": "export interface PageInfoParams {\n path: string;\n query: SearchParams;\n}" + }, + "Shopify": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/index.d.ts", + "name": "Shopify", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "config", + "value": "ConfigInterface", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "clients", + "value": "ShopifyClients", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "auth", + "value": "ShopifyAuth", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "session", + "value": "ShopifySession", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "utils", + "value": "ShopifyUtils", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "webhooks", + "value": "ShopifyWebhooks", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "billing", + "value": "ShopifyBilling", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "logger", + "value": "ShopifyLogger", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "rest", + "value": "Resources", + "description": "" + } + ], + "value": "export interface Shopify {\n config: ConfigInterface;\n clients: ShopifyClients;\n auth: ShopifyAuth;\n session: ShopifySession;\n utils: ShopifyUtils;\n webhooks: ShopifyWebhooks;\n billing: ShopifyBilling;\n logger: ShopifyLogger;\n rest: Resources;\n}" + }, + "ConfigInterface": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/base-types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "ConfigInterface", + "value": "Omit & {\n apiKey: string;\n hostScheme: 'http' | 'https';\n scopes: AuthScopes;\n isCustomStoreApp: boolean;\n billing?: BillingConfig;\n logger: {\n log: LogFunction;\n level: LogSeverity;\n httpRequests: boolean;\n timestamps: boolean;\n };\n future: FutureFlagOptions;\n}", + "description": "" + }, + "Key": { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "Key", + "value": "export declare enum Key {\n Backspace = 8,\n Tab = 9,\n Enter = 13,\n Shift = 16,\n Ctrl = 17,\n Alt = 18,\n Pause = 19,\n CapsLock = 20,\n Escape = 27,\n Space = 32,\n PageUp = 33,\n PageDown = 34,\n End = 35,\n Home = 36,\n LeftArrow = 37,\n UpArrow = 38,\n RightArrow = 39,\n DownArrow = 40,\n Insert = 45,\n Delete = 46,\n Key0 = 48,\n Key1 = 49,\n Key2 = 50,\n Key3 = 51,\n Key4 = 52,\n Key5 = 53,\n Key6 = 54,\n Key7 = 55,\n Key8 = 56,\n Key9 = 57,\n KeyA = 65,\n KeyB = 66,\n KeyC = 67,\n KeyD = 68,\n KeyE = 69,\n KeyF = 70,\n KeyG = 71,\n KeyH = 72,\n KeyI = 73,\n KeyJ = 74,\n KeyK = 75,\n KeyL = 76,\n KeyM = 77,\n KeyN = 78,\n KeyO = 79,\n KeyP = 80,\n KeyQ = 81,\n KeyR = 82,\n KeyS = 83,\n KeyT = 84,\n KeyU = 85,\n KeyV = 86,\n KeyW = 87,\n KeyX = 88,\n KeyY = 89,\n KeyZ = 90,\n LeftMeta = 91,\n RightMeta = 92,\n Select = 93,\n Numpad0 = 96,\n Numpad1 = 97,\n Numpad2 = 98,\n Numpad3 = 99,\n Numpad4 = 100,\n Numpad5 = 101,\n Numpad6 = 102,\n Numpad7 = 103,\n Numpad8 = 104,\n Numpad9 = 105,\n Multiply = 106,\n Add = 107,\n Subtract = 109,\n Decimal = 110,\n Divide = 111,\n F1 = 112,\n F2 = 113,\n F3 = 114,\n F4 = 115,\n F5 = 116,\n F6 = 117,\n F7 = 118,\n F8 = 119,\n F9 = 120,\n F10 = 121,\n F11 = 122,\n F12 = 123,\n NumLock = 144,\n ScrollLock = 145,\n Semicolon = 186,\n Equals = 187,\n Comma = 188,\n Dash = 189,\n Period = 190,\n ForwardSlash = 191,\n GraveAccent = 192,\n OpenBracket = 219,\n BackSlash = 220,\n CloseBracket = 221,\n SingleQuote = 222\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Backspace", + "value": 8 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Tab", + "value": 9 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Enter", + "value": 13 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Shift", + "value": 16 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Ctrl", + "value": 17 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Alt", + "value": 18 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Pause", + "value": 19 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "CapsLock", + "value": 20 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Escape", + "value": 27 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Space", + "value": 32 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "PageUp", + "value": 33 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "PageDown", + "value": 34 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "End", + "value": 35 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Home", + "value": 36 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "LeftArrow", + "value": 37 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "UpArrow", + "value": 38 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "RightArrow", + "value": 39 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "DownArrow", + "value": 40 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Insert", + "value": 45 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Delete", + "value": 46 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Key0", + "value": 48 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Key1", + "value": 49 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Key2", + "value": 50 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Key3", + "value": 51 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Key4", + "value": 52 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Key5", + "value": 53 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Key6", + "value": 54 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Key7", + "value": 55 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Key8", + "value": 56 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Key9", + "value": 57 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyA", + "value": 65 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyB", + "value": 66 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyC", + "value": 67 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyD", + "value": 68 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyE", + "value": 69 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyF", + "value": 70 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyG", + "value": 71 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyH", + "value": 72 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyI", + "value": 73 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyJ", + "value": 74 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyK", + "value": 75 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyL", + "value": 76 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyM", + "value": 77 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyN", + "value": 78 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyO", + "value": 79 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyP", + "value": 80 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyQ", + "value": 81 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyR", + "value": 82 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyS", + "value": 83 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyT", + "value": 84 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyU", + "value": 85 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyV", + "value": 86 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyW", + "value": 87 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyX", + "value": 88 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyY", + "value": 89 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyZ", + "value": 90 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "LeftMeta", + "value": 91 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "RightMeta", + "value": 92 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Select", + "value": 93 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Numpad0", + "value": 96 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Numpad1", + "value": 97 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Numpad2", + "value": 98 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Numpad3", + "value": 99 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Numpad4", + "value": 100 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Numpad5", + "value": 101 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Numpad6", + "value": 102 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Numpad7", + "value": 103 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Numpad8", + "value": 104 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Numpad9", + "value": 105 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Multiply", + "value": 106 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Add", + "value": 107 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Subtract", + "value": 109 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Decimal", + "value": 110 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Divide", + "value": 111 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F1", + "value": 112 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F2", + "value": 113 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F3", + "value": 114 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F4", + "value": 115 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F5", + "value": 116 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F6", + "value": 117 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F7", + "value": 118 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F8", + "value": 119 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F9", + "value": 120 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F10", + "value": 121 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F11", + "value": 122 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F12", + "value": 123 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "NumLock", + "value": 144 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "ScrollLock", + "value": 145 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Semicolon", + "value": 186 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Equals", + "value": 187 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Comma", + "value": 188 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Dash", + "value": 189 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Period", + "value": 190 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "ForwardSlash", + "value": 191 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "GraveAccent", + "value": 192 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "OpenBracket", + "value": 219 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "BackSlash", + "value": 220 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "CloseBracket", + "value": 221 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "SingleQuote", + "value": 222 + } + ] + }, + "BillingConfig": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "BillingConfig", + "value": "Record>", + "description": "", + "members": [] + }, + "LogFunction": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/base-types.d.ts", + "name": "LogFunction", + "description": "", + "params": [ + { + "name": "severity", + "description": "", + "value": "LogSeverity", + "filePath": "../../node_modules/@shopify/shopify-api/lib/base-types.d.ts" + }, + { + "name": "msg", + "description": "", + "value": "string", + "filePath": "../../node_modules/@shopify/shopify-api/lib/base-types.d.ts" + } + ], + "returns": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/base-types.d.ts", + "description": "", + "name": "void", + "value": "void" + }, + "value": "export type LogFunction = (severity: LogSeverity, msg: string) => void;" + }, + "LogSeverity": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "LogSeverity", + "value": "export declare enum LogSeverity {\n Error = 0,\n Warning = 1,\n Info = 2,\n Debug = 3\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Error", + "value": 0 + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Warning", + "value": 1 + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Info", + "value": 2 + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Debug", + "value": 3 + } + ] + }, + "ShopifyClients": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "ShopifyClients", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "Rest", + "value": "typeof RestClient", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "Graphql", + "value": "typeof GraphqlClient", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "Storefront", + "value": "typeof StorefrontClient", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "graphqlProxy", + "value": "GraphqlProxy", + "description": "" + } + ], + "value": "export interface ShopifyClients {\n Rest: typeof RestClient;\n Graphql: typeof GraphqlClient;\n Storefront: typeof StorefrontClient;\n graphqlProxy: GraphqlProxy;\n}" + }, + "GraphqlClient": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/graphql/client.d.ts", + "name": "GraphqlClient", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/graphql/client.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "session", + "value": "Session", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/graphql/client.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "client", + "value": "AdminApiClient", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/graphql/client.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "apiVersion", + "value": "ApiVersion", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/graphql/client.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "query", + "value": "(params: GraphqlParams) => Promise>", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/graphql/client.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "request", + "value": "(operation: Operation, options?: GraphqlQueryOptions) => Promise : T>>", + "description": "" + } + ], + "value": "export declare class GraphqlClient {\n static config: ConfigInterface;\n readonly session: Session;\n readonly client: AdminApiClient;\n readonly apiVersion?: ApiVersion;\n constructor(params: GraphqlClientParams);\n query(params: GraphqlParams): Promise>;\n request(operation: Operation, options?: GraphqlQueryOptions): Promise : T>>;\n private graphqlClass;\n}" + }, + "GraphqlParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "GraphqlParams", + "value": "Omit", + "description": "", + "members": [] + }, + "RequestReturn": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "RequestReturn", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "body", + "value": "T", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "headers", + "value": "Headers", + "description": "" + } + ], + "value": "export interface RequestReturn {\n body: T;\n headers: Headers;\n}" + }, + "GraphqlQueryOptions": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "GraphqlQueryOptions", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "variables", + "value": "ApiClientRequestOptions[\"variables\"]", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "headers", + "value": "Record", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "retries", + "value": "number", + "description": "", + "isOptional": true + } + ], + "value": "export interface GraphqlQueryOptions {\n variables?: ApiClientRequestOptions['variables'];\n headers?: Record;\n retries?: number;\n}" + }, + "StorefrontClient": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/storefront/client.d.ts", + "name": "StorefrontClient", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/storefront/client.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "session", + "value": "Session", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/storefront/client.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "client", + "value": "StorefrontApiClient", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/storefront/client.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "apiVersion", + "value": "ApiVersion", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/storefront/client.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "query", + "value": "(params: GraphqlParams) => Promise>", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/storefront/client.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "request", + "value": "(operation: Operation, options?: GraphqlQueryOptions) => Promise : T>>", + "description": "" + } + ], + "value": "export declare class StorefrontClient {\n static config: ConfigInterface;\n readonly session: Session;\n readonly client: StorefrontApiClient;\n readonly apiVersion?: ApiVersion;\n constructor(params: GraphqlClientParams);\n query(params: GraphqlParams): Promise>;\n request(operation: Operation, options?: GraphqlQueryOptions): Promise : T>>;\n private storefrontClass;\n}" + }, + "GraphqlProxy": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/graphql_proxy/types.d.ts", + "name": "GraphqlProxy", + "description": "", + "params": [ + { + "name": "params", + "description": "", + "value": "GraphqlProxyParams", + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/graphql_proxy/types.d.ts" + } + ], + "returns": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/graphql_proxy/types.d.ts", + "description": "", + "name": "Promise", + "value": "Promise" + }, + "value": "export type GraphqlProxy = (params: GraphqlProxyParams) => Promise;" + }, + "GraphqlProxyParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/graphql_proxy/types.d.ts", + "name": "GraphqlProxyParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/graphql_proxy/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "session", + "value": "Session", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/graphql_proxy/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawBody", + "value": "string | Record", + "description": "" + } + ], + "value": "export interface GraphqlProxyParams {\n session: Session;\n rawBody: string | Record;\n}" + }, + "ShopifyAuth": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/index.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "ShopifyAuth", + "value": "{\n begin: OAuthBegin;\n callback: OAuthCallback;\n nonce: Nonce;\n safeCompare: SafeCompare;\n getEmbeddedAppUrl: GetEmbeddedAppUrl;\n buildEmbeddedAppUrl: BuildEmbeddedAppUrl;\n} & (FeatureEnabled extends true ? {\n tokenExchange: TokenExchange;\n} : Record)", + "description": "" + }, + "OAuthBegin": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/oauth.d.ts", + "name": "OAuthBegin", + "description": "", + "params": [ + { + "name": "beginParams", + "description": "", + "value": "BeginParams", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/oauth.d.ts" + } + ], + "returns": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/oauth.d.ts", + "description": "", + "name": "Promise", + "value": "Promise" + }, + "value": "export type OAuthBegin = (beginParams: BeginParams) => Promise;" + }, + "BeginParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "name": "BeginParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "shop", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "callbackPath", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "isOnline", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawRequest", + "value": "AdapterRequest", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawResponse", + "value": "AdapterResponse", + "description": "", + "isOptional": true + } + ], + "value": "export interface BeginParams extends AdapterArgs {\n shop: string;\n callbackPath: string;\n isOnline: boolean;\n}" + }, + "AdapterRequest": { + "filePath": "../../node_modules/@shopify/shopify-api/runtime/http/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "AdapterRequest", + "value": "any", + "description": "" + }, + "AdapterResponse": { + "filePath": "../../node_modules/@shopify/shopify-api/runtime/http/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "AdapterResponse", + "value": "any", + "description": "" + }, + "OAuthCallback": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/oauth.d.ts", + "name": "OAuthCallback", + "description": "", + "params": [ + { + "name": "callbackParams", + "description": "", + "value": "CallbackParams", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/oauth.d.ts" + } + ], + "returns": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/oauth.d.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}" + }, + "value": "export type OAuthCallback = (callbackParams: CallbackParams) => Promise>;" + }, + "CallbackParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "name": "CallbackParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawRequest", + "value": "AdapterRequest", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawResponse", + "value": "AdapterResponse", + "description": "", + "isOptional": true + } + ], + "value": "export interface CallbackParams extends AdapterArgs {\n}" + }, + "Nonce": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/nonce.d.ts", + "name": "Nonce", + "description": "", + "params": [], + "returns": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/nonce.d.ts", + "description": "", + "name": "string", + "value": "string" + }, + "value": "export type Nonce = () => string;" + }, + "SafeCompare": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/safe-compare.d.ts", + "name": "SafeCompare", + "description": "", + "params": [ + { + "name": "strA", + "description": "", + "value": "string | string[] | Record | number[]", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/safe-compare.d.ts" + }, + { + "name": "strB", + "description": "", + "value": "string | string[] | Record | number[]", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/safe-compare.d.ts" + } + ], + "returns": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/safe-compare.d.ts", + "description": "", + "name": "boolean", + "value": "boolean" + }, + "value": "export type SafeCompare = (strA: string | Record | string[] | number[], strB: string | Record | string[] | number[]) => boolean;" + }, + "GetEmbeddedAppUrl": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/get-embedded-app-url.d.ts", + "name": "GetEmbeddedAppUrl", + "description": "", + "params": [ + { + "name": "params", + "description": "", + "value": "GetEmbeddedAppUrlParams", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/get-embedded-app-url.d.ts" + } + ], + "returns": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/get-embedded-app-url.d.ts", + "description": "", + "name": "Promise", + "value": "Promise" + }, + "value": "export type GetEmbeddedAppUrl = (params: GetEmbeddedAppUrlParams) => Promise;" + }, + "GetEmbeddedAppUrlParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/types.d.ts", + "name": "GetEmbeddedAppUrlParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawRequest", + "value": "AdapterRequest", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawResponse", + "value": "AdapterResponse", + "description": "", + "isOptional": true + } + ], + "value": "export interface GetEmbeddedAppUrlParams extends AdapterArgs {\n}" + }, + "BuildEmbeddedAppUrl": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/get-embedded-app-url.d.ts", + "name": "BuildEmbeddedAppUrl", + "description": "", + "params": [ + { + "name": "host", + "description": "", + "value": "string", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/get-embedded-app-url.d.ts" + } + ], + "returns": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/get-embedded-app-url.d.ts", + "description": "", + "name": "string", + "value": "string" + }, + "value": "export type BuildEmbeddedAppUrl = (host: string) => string;" + }, + "TokenExchange": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/token-exchange.d.ts", + "name": "TokenExchange", + "description": "", + "params": [ + { + "name": "params", + "description": "", + "value": "TokenExchangeParams", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/token-exchange.d.ts" + } + ], + "returns": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/token-exchange.d.ts", + "description": "", + "name": "Promise<{\n session: Session;\n}>", + "value": "Promise<{\n session: Session;\n}>" + }, + "value": "export type TokenExchange = (params: TokenExchangeParams) => Promise<{\n session: Session;\n}>;" + }, + "TokenExchangeParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/token-exchange.d.ts", + "name": "TokenExchangeParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/token-exchange.d.ts", + "syntaxKind": "PropertySignature", + "name": "shop", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/token-exchange.d.ts", + "syntaxKind": "PropertySignature", + "name": "sessionToken", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/token-exchange.d.ts", + "syntaxKind": "PropertySignature", + "name": "requestedTokenType", + "value": "RequestedTokenType", + "description": "" + } + ], + "value": "export interface TokenExchangeParams {\n shop: string;\n sessionToken: string;\n requestedTokenType: RequestedTokenType;\n}" + }, + "RequestedTokenType": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/token-exchange.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "RequestedTokenType", + "value": "export declare enum RequestedTokenType {\n OnlineAccessToken = \"urn:shopify:params:oauth:token-type:online-access-token\",\n OfflineAccessToken = \"urn:shopify:params:oauth:token-type:offline-access-token\"\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/token-exchange.d.ts", + "name": "OnlineAccessToken", + "value": "urn:shopify:params:oauth:token-type:online-access-token" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/token-exchange.d.ts", + "name": "OfflineAccessToken", + "value": "urn:shopify:params:oauth:token-type:offline-access-token" + } + ] + }, + "ShopifySession": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/index.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "ShopifySession", + "value": "ReturnType", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "customAppSession", + "value": "(shop: string) => Session", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "getCurrentId", + "value": "({ isOnline, ...adapterArgs }: GetCurrentSessionIdParams) => Promise", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "getOfflineId", + "value": "(shop: string) => string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "getJwtSessionId", + "value": "(shop: string, userId: string) => string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "decodeSessionToken", + "value": "(token: string, { checkAudience }?: DecodeSessionTokenOptions) => Promise", + "description": "" + } + ] + }, + "GetCurrentSessionIdParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "name": "GetCurrentSessionIdParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "isOnline", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawRequest", + "value": "AdapterRequest", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawResponse", + "value": "AdapterResponse", + "description": "", + "isOptional": true + } + ], + "value": "export interface GetCurrentSessionIdParams extends AdapterArgs {\n isOnline: boolean;\n}" + }, + "DecodeSessionTokenOptions": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/decode-session-token.d.ts", + "name": "DecodeSessionTokenOptions", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/decode-session-token.d.ts", + "syntaxKind": "PropertySignature", + "name": "checkAudience", + "value": "boolean", + "description": "", + "isOptional": true + } + ], + "value": "export interface DecodeSessionTokenOptions {\n checkAudience?: boolean;\n}" + }, + "ShopifyUtils": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/utils/index.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "ShopifyUtils", + "value": "ReturnType", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/utils/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "sanitizeShop", + "value": "(shop: string, throwOnInvalid?: boolean) => string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/utils/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "sanitizeHost", + "value": "(host: string, throwOnInvalid?: boolean) => string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/utils/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "validateHmac", + "value": "(query: AuthQuery, { signator }?: { signator: HMACSignator; }) => Promise", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/utils/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "versionCompatible", + "value": "(referenceVersion: ApiVersion, currentVersion?: ApiVersion) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/utils/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "versionPriorTo", + "value": "(referenceVersion: ApiVersion, currentVersion?: ApiVersion) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/utils/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "shopAdminUrlToLegacyUrl", + "value": "(shopAdminUrl: string) => string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/utils/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "legacyUrlToShopAdminUrl", + "value": "(legacyAdminUrl: string) => string", + "description": "" + } + ] + }, + "AuthQuery": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "name": "AuthQuery", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "name": "[key: string]", + "value": "string | undefined" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "hmac", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "signature", + "value": "string", + "description": "", + "isOptional": true + } + ], + "value": "export interface AuthQuery {\n [key: string]: string | undefined;\n hmac?: string;\n signature?: string;\n}" + }, + "HMACSignator": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/utils/hmac-validator.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "HMACSignator", + "value": "'admin' | 'appProxy'", + "description": "" + }, + "ShopifyWebhooks": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/index.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "ShopifyWebhooks", + "value": "ReturnType", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "addHandlers", + "value": "(handlersToAdd: AddHandlersParams) => void", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "getTopicsAdded", + "value": "() => string[]", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "getHandlers", + "value": "(topic: string) => WebhookHandler[]", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "register", + "value": "({ session, }: RegisterParams) => Promise", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "process", + "value": "({ rawBody, ...adapterArgs }: WebhookProcessParams) => Promise", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "validate", + "value": "({ rawBody, ...adapterArgs }: WebhookValidateParams) => Promise", + "description": "" + } + ] + }, + "AddHandlersParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "AddHandlersParams", + "value": "Record", + "description": "", + "members": [] + }, + "WebhookHandler": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "WebhookHandler", + "value": "HttpWebhookHandler | HttpWebhookHandlerWithCallback | EventBridgeWebhookHandler | PubSubWebhookHandler", + "description": "" + }, + "HttpWebhookHandler": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "HttpWebhookHandler", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "deliveryMethod", + "value": "DeliveryMethod.Http", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "callbackUrl", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "id", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "includeFields", + "value": "string[]", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "metafieldNamespaces", + "value": "string[]", + "description": "", + "isOptional": true + } + ], + "value": "export interface HttpWebhookHandler extends BaseWebhookHandler {\n deliveryMethod: DeliveryMethod.Http;\n callbackUrl: string;\n}" + }, + "DeliveryMethod": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "DeliveryMethod", + "value": "export declare enum DeliveryMethod {\n Http = \"http\",\n EventBridge = \"eventbridge\",\n PubSub = \"pubsub\"\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "Http", + "value": "http" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "EventBridge", + "value": "eventbridge" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "PubSub", + "value": "pubsub" + } + ] + }, + "HttpWebhookHandlerWithCallback": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "HttpWebhookHandlerWithCallback", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "callback", + "value": "WebhookHandlerFunction", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "deliveryMethod", + "value": "DeliveryMethod.Http", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "callbackUrl", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "id", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "includeFields", + "value": "string[]", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "metafieldNamespaces", + "value": "string[]", + "description": "", + "isOptional": true + } + ], + "value": "export interface HttpWebhookHandlerWithCallback extends HttpWebhookHandler {\n callback: WebhookHandlerFunction;\n}" + }, + "WebhookHandlerFunction": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "WebhookHandlerFunction", + "description": "", + "params": [ + { + "name": "topic", + "description": "", + "value": "string", + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts" + }, + { + "name": "shop_domain", + "description": "", + "value": "string", + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts" + }, + { + "name": "body", + "description": "", + "value": "string", + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts" + }, + { + "name": "webhookId", + "description": "", + "value": "string", + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts" + }, + { + "name": "apiVersion", + "description": "", + "value": "string", + "isOptional": true, + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts" + } + ], + "returns": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "description": "", + "name": "Promise", + "value": "Promise" + }, + "value": "export type WebhookHandlerFunction = (topic: string, shop_domain: string, body: string, webhookId: string, apiVersion?: string) => Promise;" + }, + "EventBridgeWebhookHandler": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "EventBridgeWebhookHandler", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "deliveryMethod", + "value": "DeliveryMethod.EventBridge", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "arn", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "id", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "includeFields", + "value": "string[]", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "metafieldNamespaces", + "value": "string[]", + "description": "", + "isOptional": true + } + ], + "value": "export interface EventBridgeWebhookHandler extends BaseWebhookHandler {\n deliveryMethod: DeliveryMethod.EventBridge;\n arn: string;\n}" + }, + "PubSubWebhookHandler": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "PubSubWebhookHandler", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "deliveryMethod", + "value": "DeliveryMethod.PubSub", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "pubSubProject", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "pubSubTopic", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "id", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "includeFields", + "value": "string[]", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "metafieldNamespaces", + "value": "string[]", + "description": "", + "isOptional": true + } + ], + "value": "export interface PubSubWebhookHandler extends BaseWebhookHandler {\n deliveryMethod: DeliveryMethod.PubSub;\n pubSubProject: string;\n pubSubTopic: string;\n}" + }, + "RegisterParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "RegisterParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "session", + "value": "Session", + "description": "" + } + ], + "value": "export interface RegisterParams {\n session: Session;\n}" + }, + "RegisterReturn": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "RegisterReturn", + "value": "Record", + "description": "", + "members": [] + }, + "Body": { + "filePath": "../../node_modules/@shopify/shopify-api/rest/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "Body", + "value": "Record", + "description": "", + "members": [] + }, + "WebhookProcessParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "WebhookProcessParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawBody", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawRequest", + "value": "AdapterRequest", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawResponse", + "value": "AdapterResponse", + "description": "", + "isOptional": true + } + ], + "value": "export interface WebhookProcessParams extends AdapterArgs {\n rawBody: string;\n}" + }, + "WebhookValidateParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "WebhookValidateParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawBody", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawRequest", + "value": "AdapterRequest", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawResponse", + "value": "AdapterResponse", + "description": "", + "isOptional": true + } + ], + "value": "export interface WebhookValidateParams extends WebhookProcessParams {\n}" + }, + "WebhookValidation": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "WebhookValidation", + "value": "WebhookValidationValid | WebhookValidationInvalid | WebhookValidationMissingHeaders", + "description": "" + }, + "WebhookValidationValid": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "WebhookValidationValid", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "valid", + "value": "true", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "webhookId", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "apiVersion", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "domain", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "hmac", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "topic", + "value": "string", + "description": "" + } + ], + "value": "export interface WebhookValidationValid extends WebhookFields {\n valid: true;\n}" + }, + "WebhookValidationInvalid": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "WebhookValidationInvalid", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "valid", + "value": "false", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "reason", + "value": "WebhookValidationErrorReason", + "description": "" + } + ], + "value": "export interface WebhookValidationInvalid {\n valid: false;\n reason: WebhookValidationErrorReason;\n}" + }, + "WebhookValidationErrorReason": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "WebhookValidationErrorReason", + "value": "export declare enum WebhookValidationErrorReason {\n MissingHeaders = \"missing_headers\",\n MissingBody = \"missing_body\",\n InvalidHmac = \"invalid_hmac\"\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "MissingHeaders", + "value": "missing_headers" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "MissingBody", + "value": "missing_body" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "InvalidHmac", + "value": "invalid_hmac" + } + ] + }, + "WebhookValidationMissingHeaders": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "WebhookValidationMissingHeaders", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "reason", + "value": "WebhookValidationErrorReason.MissingHeaders", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "missingHeaders", + "value": "string[]", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "valid", + "value": "false", + "description": "" + } + ], + "value": "export interface WebhookValidationMissingHeaders extends WebhookValidationInvalid {\n reason: WebhookValidationErrorReason.MissingHeaders;\n missingHeaders: string[];\n}" + }, + "ShopifyBilling": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/index.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "ShopifyBilling", + "value": "ReturnType", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "check", + "value": "({ session, plans, isTest, returnObject, }: Params_1) => Promise>", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "request", + "value": "({ session, plan, isTest, returnUrl: returnUrlParam, returnObject, ...overrides }: Params_2) => Promise>", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "cancel", + "value": "(subscriptionInfo: BillingCancelParams) => Promise", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "subscriptions", + "value": "({ session, }: BillingSubscriptionParams) => Promise", + "description": "" + } + ] + }, + "BillingCheckParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingCheckParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "session", + "value": "Session", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "plans", + "value": "string | string[]", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "isTest", + "value": "boolean", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "returnObject", + "value": "boolean", + "description": "", + "isOptional": true + } + ], + "value": "export interface BillingCheckParams {\n session: Session;\n plans: string[] | string;\n isTest?: boolean;\n returnObject?: boolean;\n}" + }, + "BillingCheckResponse": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "BillingCheckResponse", + "value": "Params['returnObject'] extends true ? BillingCheckResponseObject : boolean", + "description": "" + }, + "BillingRequestParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "BillingRequestParams", + "value": "{\n session: Session;\n plan: string;\n isTest?: boolean;\n returnUrl?: string;\n returnObject?: boolean;\n} & RequestConfigOverrides", + "description": "" + }, + "RequestConfigOverrides": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "RequestConfigOverrides", + "value": "Partial | Partial | Partial", + "description": "" + }, + "BillingConfigOneTimePlan": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingConfigOneTimePlan", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "interval", + "value": "BillingInterval.OneTime", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "amount", + "value": "number", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "currencyCode", + "value": "string", + "description": "" + } + ], + "value": "export interface BillingConfigOneTimePlan extends BillingConfigPlan {\n interval: BillingInterval.OneTime;\n}" + }, + "BillingInterval": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "BillingInterval", + "value": "export declare enum BillingInterval {\n OneTime = \"ONE_TIME\",\n Every30Days = \"EVERY_30_DAYS\",\n Annual = \"ANNUAL\",\n Usage = \"USAGE\"\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "OneTime", + "value": "ONE_TIME" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Every30Days", + "value": "EVERY_30_DAYS" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Annual", + "value": "ANNUAL" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Usage", + "value": "USAGE" + } + ] + }, + "BillingConfigSubscriptionPlan": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingConfigSubscriptionPlan", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "interval", + "value": "Exclude", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "trialDays", + "value": "number", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "replacementBehavior", + "value": "BillingReplacementBehavior", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "discount", + "value": "BillingConfigSubscriptionPlanDiscount", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "amount", + "value": "number", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "currencyCode", + "value": "string", + "description": "" + } + ], + "value": "export interface BillingConfigSubscriptionPlan extends BillingConfigPlan {\n interval: Exclude;\n trialDays?: number;\n replacementBehavior?: BillingReplacementBehavior;\n discount?: BillingConfigSubscriptionPlanDiscount;\n}" + }, + "RecurringBillingIntervals": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "RecurringBillingIntervals", + "value": "RecurringBillingIntervals", + "description": "" + }, + "BillingReplacementBehavior": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "BillingReplacementBehavior", + "value": "export declare enum BillingReplacementBehavior {\n ApplyImmediately = \"APPLY_IMMEDIATELY\",\n ApplyOnNextBillingCycle = \"APPLY_ON_NEXT_BILLING_CYCLE\",\n Standard = \"STANDARD\"\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "ApplyImmediately", + "value": "APPLY_IMMEDIATELY" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "ApplyOnNextBillingCycle", + "value": "APPLY_ON_NEXT_BILLING_CYCLE" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Standard", + "value": "STANDARD" + } + ] + }, + "BillingConfigSubscriptionPlanDiscount": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingConfigSubscriptionPlanDiscount", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "durationLimitInIntervals", + "value": "number", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "value", + "value": "BillingConfigSubscriptionPlanDiscountAmount | BillingConfigSubscriptionPlanDiscountPercentage", + "description": "" + } + ], + "value": "export interface BillingConfigSubscriptionPlanDiscount {\n durationLimitInIntervals?: number;\n value: BillingConfigSubscriptionPlanDiscountAmount | BillingConfigSubscriptionPlanDiscountPercentage;\n}" + }, + "BillingConfigSubscriptionPlanDiscountAmount": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingConfigSubscriptionPlanDiscountAmount", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "amount", + "value": "number", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "percentage", + "value": "never", + "description": "", + "isOptional": true + } + ], + "value": "export interface BillingConfigSubscriptionPlanDiscountAmount {\n amount: number;\n percentage?: never;\n}" + }, + "BillingConfigSubscriptionPlanDiscountPercentage": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingConfigSubscriptionPlanDiscountPercentage", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "amount", + "value": "never", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "percentage", + "value": "number", + "description": "" + } + ], + "value": "export interface BillingConfigSubscriptionPlanDiscountPercentage {\n amount?: never;\n percentage: number;\n}" + }, + "BillingConfigUsagePlan": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingConfigUsagePlan", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "interval", + "value": "BillingInterval.Usage", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "usageTerms", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "trialDays", + "value": "number", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "replacementBehavior", + "value": "BillingReplacementBehavior", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "amount", + "value": "number", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "currencyCode", + "value": "string", + "description": "" + } + ], + "value": "export interface BillingConfigUsagePlan extends BillingConfigPlan {\n interval: BillingInterval.Usage;\n usageTerms: string;\n trialDays?: number;\n replacementBehavior?: BillingReplacementBehavior;\n}" + }, + "BillingRequestResponse": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "BillingRequestResponse", + "value": "Params['returnObject'] extends true ? BillingRequestResponseObject : string", + "description": "" + }, + "BillingRequestResponseObject": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingRequestResponseObject", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "confirmationUrl", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "oneTimePurchase", + "value": "OneTimePurchase", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "appSubscription", + "value": "AppSubscription", + "description": "", + "isOptional": true + } + ], + "value": "export interface BillingRequestResponseObject {\n confirmationUrl: string;\n oneTimePurchase?: OneTimePurchase;\n appSubscription?: AppSubscription;\n}" + }, + "BillingCancelParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingCancelParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "session", + "value": "Session", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "subscriptionId", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "prorate", + "value": "boolean", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "isTest", + "value": "boolean", + "description": "", + "isOptional": true + } + ], + "value": "export interface BillingCancelParams {\n session: Session;\n subscriptionId: string;\n prorate?: boolean;\n isTest?: boolean;\n}" + }, + "BillingSubscriptionParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingSubscriptionParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "session", + "value": "Session", + "description": "" + } + ], + "value": "export interface BillingSubscriptionParams {\n session: Session;\n}" + }, + "ActiveSubscriptions": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "ActiveSubscriptions", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "activeSubscriptions", + "value": "AppSubscription[]", + "description": "" + } + ], + "value": "export interface ActiveSubscriptions {\n activeSubscriptions: AppSubscription[];\n}" + }, + "ShopifyLogger": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/index.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "ShopifyLogger", + "value": "ReturnType", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "log", + "value": "LoggerFunction", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "debug", + "value": "(message: string, context?: LogContext) => Promise", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "info", + "value": "(message: string, context?: LogContext) => Promise", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "warning", + "value": "(message: string, context?: LogContext) => Promise", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "error", + "value": "(message: string, context?: LogContext) => Promise", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "deprecated", + "value": "(version: string, message: string) => void", + "description": "" + } + ] + }, + "LoggerFunction": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/log.d.ts", + "name": "LoggerFunction", + "description": "", + "params": [ + { + "name": "severity", + "description": "", + "value": "LogSeverity", + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/log.d.ts" + }, + { + "name": "message", + "description": "", + "value": "string", + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/log.d.ts" + }, + { + "name": "context", + "description": "", + "value": "Record", + "isOptional": true, + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/log.d.ts" + } + ], + "returns": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/log.d.ts", + "description": "", + "name": "void", + "value": "void" + }, + "value": "export type LoggerFunction = (severity: LogSeverity, message: string, context?: Record) => void;" + }, + "LogContext": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "LogContext", + "value": "Record", + "description": "", + "members": [] + } + } + } + ], + "jsDocTypeExamples": [ + "WebhookContextWithSession" + ], + "related": [ + { + "name": "Admin API context", + "subtitle": "Interact with the Admin API.", + "url": "/docs/api/shopify-app-remix/apis/admin-api" + } + ], + "examples": { + "description": "", + "exampleGroups": [ + { + "title": "admin", + "examples": [ + { + "description": "With the `v3_webhookAdminContext` future flag enabled, use the `admin` object in the context to interact with the Admin API.", + "codeblock": { + "title": "[V3] Webhook admin context", + "tabs": [ + { + "title": "/app/routes/webhooks.tsx", + "code": "import { ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.webhook(request);\n\n const response = await admin?.graphql(\n `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n { variables: { input: { title: \"Product Name\" } } }\n );\n\n const productData = await response.json();\n return json({ data: productData.data });\n}", + "language": "typescript" + } + ] + } + }, + { + "description": "Use the `admin` object in the context to interact with the Admin API. This format will be removed in V3 of the package.", + "codeblock": { + "title": "Webhook admin context", + "tabs": [ + { + "title": "/app/routes/webhooks.tsx", + "code": "import { json, ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.webhook(request);\n\n const response = await admin?.graphql.query<any>({\n data: {\n query: `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n variables: { input: { title: \"Product Name\" } },\n },\n });\n\n const productData = response?.body.data;\n return json({ data: productData.data });\n}", + "language": "typescript" + } + ] + } + } + ] + }, + { + "title": "apiVersion", + "examples": [ + { + "description": "Get the API version used for webhook request.", + "codeblock": { + "title": "Webhook API version", + "tabs": [ + { + "title": "/app/routes/webhooks.tsx", + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { apiVersion } = await authenticate.webhook(request);\n return new Response();\n};", + "language": "typescript" + } + ] + } + } + ] + }, + { + "title": "shop", + "examples": [ + { + "description": "Get the shop that triggered a webhook.", + "codeblock": { + "title": "Webhook shop", + "tabs": [ + { + "title": "/app/routes/webhooks.tsx", + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { shop } = await authenticate.webhook(request);\n return new Response();\n};", + "language": "typescript" + } + ] + } + } + ] + }, + { + "title": "topic", + "examples": [ + { + "description": "Get the event topic for the webhook.", + "codeblock": { + "title": "Webhook topic", + "tabs": [ + { + "title": "/app/routes/webhooks.tsx", + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { topic } = await authenticate.webhook(request);\n\n switch (topic) {\n case \"APP_UNINSTALLED\":\n // Do something when the app is uninstalled.\n break;\n }\n\n return new Response();\n};", + "language": "typescript" + } + ] + } + } + ] + }, + { + "title": "webhookId", + "examples": [ + { + "description": "Get the webhook ID.", + "codeblock": { + "title": "Webhook ID", + "tabs": [ + { + "title": "/app/routes/webhooks.tsx", + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { webhookId } = await authenticate.webhook(request);\n return new Response();\n};", + "language": "typescript" + } + ] + } + } + ] + }, + { + "title": "payload", + "examples": [ + { + "description": "Get the request's POST payload.", + "codeblock": { + "title": "Webhook payload", + "tabs": [ + { + "title": "/app/routes/webhooks.tsx", + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { payload } = await authenticate.webhook(request);\n return new Response();\n};", + "language": "typescript" + } + ] + } + } + ] + } + ] + } + }, + { + "name": "Admin API", + "description": "Contains objects used to interact with the Admin API.\n\nThis object is returned as part of different contexts, such as [`admin`](/docs/api/shopify-app-remix/authenticate/admin), [`unauthenticated.admin`](/docs/api/shopify-app-remix/unauthenticated/unauthenticated-admin), and [`webhook`](/docs/api/shopify-app-remix/authenticate/webhook).", + "category": "APIs", + "type": "object", + "isVisualComponent": false, + "definitions": [ + { + "title": "admin", + "description": "Provides utilities that apps can use to make requests to the Admin API.", + "type": "AdminApiContext", + "typeDefinitions": { + "AdminApiContext": { + "filePath": "src/server/clients/admin/types.ts", + "name": "AdminApiContext", + "description": "", + "members": [ + { + "filePath": "src/server/clients/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "rest", + "value": "RestClientWithResources", + "description": "Methods for interacting with the Shopify Admin REST API\n\nThere are methods for interacting with individual REST resources. You can also make `GET`, `POST`, `PUT` and `DELETE` requests should the REST resources not meet your needs.\n\n\n\n\n", + "examples": [ + { + "title": "Using REST resources", + "description": "Getting the number of orders in a store using REST resources. Visit the [Admin REST API references](/docs/api/admin-rest) for examples on using each resource.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n return json(admin.rest.resources.Order.count({ session }));\n};", + "title": "/app/routes/**\\/*.ts" + }, + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-07\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "/app/shopify.server.ts" + } + ] + }, + { + "title": "Performing a GET request to the REST API", + "description": "Use `admin.rest.get` to make custom requests to make a request to to the `customer/count` endpoint", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n const response = await admin.rest.get({ path: \"/customers/count.json\" });\n const customers = await response.json();\n return json({ customers });\n};", + "title": "/app/routes/**\\/*.ts" + }, + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "/app/shopify.server.ts" + } + ] + }, + { + "title": "Performing a POST request to the REST API", + "description": "Use `admin.rest.post` to make custom requests to make a request to to the `customers.json` endpoint to send a welcome email", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n const response = admin.rest.post({\n path: \"customers/7392136888625/send_invite.json\",\n body: {\n customer_invite: {\n to: \"new_test_email@shopify.com\",\n from: \"j.limited@example.com\",\n bcc: [\"j.limited@example.com\"],\n subject: \"Welcome to my new shop\",\n custom_message: \"My awesome new store\",\n },\n },\n});\n const customerInvite = await response.json();\n return json({ customerInvite });\n};", + "title": "/app/routes/**\\/*.ts" + }, + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "/app/shopify.server.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/clients/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "graphql", + "value": "GraphQLClient", + "description": "Methods for interacting with the Shopify Admin GraphQL API\n\n\n\n\n\n\n\n\n\n", + "examples": [ + { + "title": "Querying the GraphQL API", + "description": "Use `admin.graphql` to make query / mutation requests.", + "tabs": [ + { + "code": "import { ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.admin(request);\n\n const response = await admin.graphql(\n `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n { variables: { input: { title: \"Product Name\" } } }\n );\n\n const productData = await response.json();\n return json({ data: productData.data });\n}", + "title": "Example" + } + ] + } + ] + } + ], + "value": "export interface AdminApiContext<\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> {\n /**\n * Methods for interacting with the Shopify Admin REST API\n *\n * There are methods for interacting with individual REST resources. You can also make `GET`, `POST`, `PUT` and `DELETE` requests should the REST resources not meet your needs.\n *\n * {@link https://shopify.dev/docs/api/admin-rest}\n *\n * @example\n * Using REST resources.\n * Getting the number of orders in a store using REST resources. Visit the [Admin REST API references](/docs/api/admin-rest) for examples on using each resource. \n *\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * return json(admin.rest.resources.Order.count({ session }));\n * };\n * ```\n *\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-07\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n *\n *\n * @example\n * Performing a GET request to the REST API.\n * Use `admin.rest.get` to make custom requests to make a request to to the `customer/count` endpoint\n *\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * const response = await admin.rest.get({ path: \"/customers/count.json\" });\n * const customers = await response.json();\n * return json({ customers });\n * };\n * ```\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n * @example\n * Performing a POST request to the REST API.\n * Use `admin.rest.post` to make custom requests to make a request to to the `customers.json` endpoint to send a welcome email\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * const response = admin.rest.post({\n * path: \"customers/7392136888625/send_invite.json\",\n * body: {\n * customer_invite: {\n * to: \"new_test_email@shopify.com\",\n * from: \"j.limited@example.com\",\n * bcc: [\"j.limited@example.com\"],\n * subject: \"Welcome to my new shop\",\n * custom_message: \"My awesome new store\",\n * },\n * },\n * });\n * const customerInvite = await response.json();\n * return json({ customerInvite });\n * };\n * ```\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n rest: RestClientWithResources;\n\n /**\n * Methods for interacting with the Shopify Admin GraphQL API\n *\n * {@link https://shopify.dev/docs/api/admin-graphql}\n * {@link https://github.com/Shopify/shopify-api-js/blob/main/packages/shopify-api/docs/reference/clients/Graphql.md}\n *\n * @example\n * Querying the GraphQL API.\n * Use `admin.graphql` to make query / mutation requests.\n * ```ts\n * import { ActionFunctionArgs } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { admin } = await authenticate.admin(request);\n *\n * const response = await admin.graphql(\n * `#graphql\n * mutation populateProduct($input: ProductInput!) {\n * productCreate(input: $input) {\n * product {\n * id\n * }\n * }\n * }`,\n * { variables: { input: { title: \"Product Name\" } } }\n * );\n *\n * const productData = await response.json();\n * return json({ data: productData.data });\n * }\n * ```\n */\n graphql: GraphQLClient;\n}" + }, + "RestClientWithResources": { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "RestClientWithResources", + "value": "RemixRestClient & {resources: Resources}", + "description": "" + }, + "RemixRestClient": { + "filePath": "src/server/clients/admin/rest.ts", + "name": "RemixRestClient", + "description": "", + "members": [ + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "PropertyDeclaration", + "name": "session", + "value": "Session", + "description": "" + }, + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "get", + "value": "(params: GetRequestParams) => Promise", + "description": "Performs a GET request on the given path." + }, + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "post", + "value": "(params: PostRequestParams) => Promise", + "description": "Performs a POST request on the given path." + }, + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "put", + "value": "(params: PostRequestParams) => Promise", + "description": "Performs a PUT request on the given path." + }, + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "delete", + "value": "(params: GetRequestParams) => Promise", + "description": "Performs a DELETE request on the given path." + } + ], + "value": "class RemixRestClient {\n public session: Session;\n private params: AdminClientOptions['params'];\n private handleClientError: AdminClientOptions['handleClientError'];\n\n constructor({params, session, handleClientError}: AdminClientOptions) {\n this.params = params;\n this.handleClientError = handleClientError;\n this.session = session;\n }\n\n /**\n * Performs a GET request on the given path.\n */\n public async get(params: GetRequestParams) {\n return this.makeRequest({\n method: 'GET' as RequestParams['method'],\n ...params,\n });\n }\n\n /**\n * Performs a POST request on the given path.\n */\n public async post(params: PostRequestParams) {\n return this.makeRequest({\n method: 'POST' as RequestParams['method'],\n ...params,\n });\n }\n\n /**\n * Performs a PUT request on the given path.\n */\n public async put(params: PutRequestParams) {\n return this.makeRequest({\n method: 'PUT' as RequestParams['method'],\n ...params,\n });\n }\n\n /**\n * Performs a DELETE request on the given path.\n */\n public async delete(params: DeleteRequestParams) {\n return this.makeRequest({\n method: 'DELETE' as RequestParams['method'],\n ...params,\n });\n }\n\n protected async makeRequest(params: RequestParams): Promise {\n const originalClient = new this.params.api.clients.Rest({\n session: this.session,\n });\n const originalRequest = Reflect.get(originalClient, 'request');\n\n try {\n const apiResponse = await originalRequest.call(originalClient, params);\n\n // We use a separate client for REST requests and REST resources because we want to override the API library\n // client class to return a Response object instead.\n return new Response(JSON.stringify(apiResponse.body), {\n headers: apiResponse.headers,\n });\n } catch (error) {\n if (this.handleClientError) {\n throw await this.handleClientError({\n error,\n session: this.session,\n params: this.params,\n });\n } else throw new Error(error);\n }\n }\n}" + }, + "Session": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "name": "Session", + "description": "Stores App information from logged in merchants so they can make authenticated requests to the Admin API.", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "id", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "shop", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "state", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "isOnline", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "scope", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "expires", + "value": "Date", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "accessToken", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "onlineAccessInfo", + "value": "OnlineAccessInfo", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "isActive", + "value": "(scopes: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "isScopeChanged", + "value": "(scopes: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "isExpired", + "value": "(withinMillisecondsOfExpiry?: number) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toObject", + "value": "() => SessionParams", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "equals", + "value": "(other: Session) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toPropertyArray", + "value": "() => [string, string | number | boolean][]", + "description": "" + } + ], + "value": "export declare class Session {\n static fromPropertyArray(entries: [string, string | number | boolean][]): Session;\n readonly id: string;\n shop: string;\n state: string;\n isOnline: boolean;\n scope?: string;\n expires?: Date;\n accessToken?: string;\n onlineAccessInfo?: OnlineAccessInfo;\n constructor(params: SessionParams);\n isActive(scopes: AuthScopes | string | string[]): boolean;\n isScopeChanged(scopes: AuthScopes | string | string[]): boolean;\n isExpired(withinMillisecondsOfExpiry?: number): boolean;\n toObject(): SessionParams;\n equals(other: Session | undefined): boolean;\n toPropertyArray(): [string, string | number | boolean][];\n}" + }, + "OnlineAccessInfo": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "name": "OnlineAccessInfo", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "expires_in", + "value": "number", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "associated_user_scope", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "associated_user", + "value": "{ id: number; first_name: string; last_name: string; email: string; email_verified: boolean; account_owner: boolean; locale: string; collaborator: boolean; }", + "description": "" + } + ], + "value": "export interface OnlineAccessInfo {\n expires_in: number;\n associated_user_scope: string;\n associated_user: {\n id: number;\n first_name: string;\n last_name: string;\n email: string;\n email_verified: boolean;\n account_owner: boolean;\n locale: string;\n collaborator: boolean;\n };\n}" + }, + "AuthScopes": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "name": "AuthScopes", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "has", + "value": "(scope: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "equals", + "value": "(otherScopes: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toString", + "value": "() => string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toArray", + "value": "() => string[]", + "description": "" + } + ], + "value": "declare class AuthScopes {\n static SCOPE_DELIMITER: string;\n private compressedScopes;\n private expandedScopes;\n constructor(scopes: string | string[] | AuthScopes | undefined);\n has(scope: string | string[] | AuthScopes | undefined): boolean;\n equals(otherScopes: string | string[] | AuthScopes | undefined): boolean;\n toString(): string;\n toArray(): string[];\n private getImpliedScopes;\n}" + }, + "SessionParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "name": "SessionParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "id", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "shop", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "state", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "isOnline", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "scope", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "expires", + "value": "Date", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "accessToken", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "onlineAccessInfo", + "value": "OnlineAccessInfo", + "description": "", + "isOptional": true + } + ], + "value": "export interface SessionParams {\n readonly id: string;\n shop: string;\n state: string;\n isOnline: boolean;\n scope?: string;\n expires?: Date;\n accessToken?: string;\n onlineAccessInfo?: OnlineAccessInfo;\n}" + }, + "GetRequestParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "GetRequestParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "path", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "type", + "value": "DataType", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "data", + "value": "string | Record", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "query", + "value": "SearchParams", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "extraHeaders", + "value": "HeaderParams", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "tries", + "value": "number", + "description": "", + "isOptional": true + } + ], + "value": "export interface GetRequestParams {\n path: string;\n type?: DataType;\n data?: Record | string;\n query?: SearchParams;\n extraHeaders?: HeaderParams;\n tries?: number;\n}" + }, + "DataType": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "DataType", + "value": "export declare enum DataType {\n JSON = \"application/json\",\n GraphQL = \"application/graphql\",\n URLEncoded = \"application/x-www-form-urlencoded\"\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "JSON", + "value": "application/json" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "GraphQL", + "value": "application/graphql" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "URLEncoded", + "value": "application/x-www-form-urlencoded" + } + ] + }, + "HeaderParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "HeaderParams", + "value": "Record", + "description": "", + "members": [] + }, + "PostRequestParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "PostRequestParams", + "value": "GetRequestParams & {\n data: Record | string;\n}", + "description": "" + }, + "GraphQLClient": { + "filePath": "src/server/clients/types.ts", + "name": "GraphQLClient", + "description": "", + "params": [ + { + "name": "query", + "description": "", + "value": "Operation extends keyof Operations", + "filePath": "src/server/clients/types.ts" + }, + { + "name": "options", + "description": "", + "value": "GraphQLQueryOptions", + "isOptional": true, + "filePath": "src/server/clients/types.ts" + } + ], + "returns": { + "filePath": "src/server/clients/types.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}" + }, + "value": "export type GraphQLClient = <\n Operation extends keyof Operations,\n>(\n query: Operation,\n options?: GraphQLQueryOptions,\n) => Promise<\n ResponseWithType>>\n>;" + }, + "GraphQLQueryOptions": { + "filePath": "src/server/clients/types.ts", + "name": "GraphQLQueryOptions", + "description": "", + "members": [ + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "variables", + "value": "ApiClientRequestOptions[\"variables\"]", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "apiVersion", + "value": "ApiVersion", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "headers", + "value": "{ [key: string]: any; }", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "tries", + "value": "number", + "description": "", + "isOptional": true + } + ], + "value": "export interface GraphQLQueryOptions<\n Operation extends keyof Operations,\n Operations extends AllOperations,\n> {\n variables?: ApiClientRequestOptions['variables'];\n apiVersion?: ApiVersion;\n headers?: {[key: string]: any};\n tries?: number;\n}" + }, + "ApiVersion": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "ApiVersion", + "value": "export declare enum ApiVersion {\n October22 = \"2022-10\",\n January23 = \"2023-01\",\n April23 = \"2023-04\",\n July23 = \"2023-07\",\n October23 = \"2023-10\",\n January24 = \"2024-01\",\n Unstable = \"unstable\"\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "October22", + "value": "2022-10" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "January23", + "value": "2023-01" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "April23", + "value": "2023-04" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "July23", + "value": "2023-07" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "October23", + "value": "2023-10" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "January24", + "value": "2024-01" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Unstable", + "value": "unstable" + } + ] + } + } + } + ], + "jsDocTypeExamples": [ + "AdminApiContext" + ], + "related": [ + { + "name": "Authenticated context", + "subtitle": "Authenticate requests from Shopify Admin.", + "url": "/docs/api/shopify-app-remix/authenticate/admin" + }, + { + "name": "Unauthenticated context", + "subtitle": "Interact with the Admin API on non-Shopify requests.", + "url": "/docs/api/shopify-app-remix/unauthenticated/unauthenticated-admin" + } + ], + "examples": { + "description": "", + "exampleGroups": [ + { + "title": "rest", + "examples": [ + { + "description": "Getting the number of orders in a store using REST resources. Visit the [Admin REST API references](/docs/api/admin-rest) for examples on using each resource.", + "codeblock": { + "title": "Using REST resources", + "tabs": [ + { + "title": "/app/routes/**\\/*.ts", + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n return json(admin.rest.resources.Order.count({ session }));\n};", + "language": "typescript" + }, + { + "title": "/app/shopify.server.ts", + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-07\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "language": "typescript" + } + ] + } + }, + { + "description": "Use `admin.rest.get` to make custom requests to make a request to to the `customer/count` endpoint", + "codeblock": { + "title": "Performing a GET request to the REST API", + "tabs": [ + { + "title": "/app/routes/**\\/*.ts", + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n const response = await admin.rest.get({ path: \"/customers/count.json\" });\n const customers = await response.json();\n return json({ customers });\n};", + "language": "typescript" + }, + { + "title": "/app/shopify.server.ts", + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "language": "typescript" + } + ] + } + }, + { + "description": "Use `admin.rest.post` to make custom requests to make a request to to the `customers.json` endpoint to send a welcome email", + "codeblock": { + "title": "Performing a POST request to the REST API", + "tabs": [ + { + "title": "/app/routes/**\\/*.ts", + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n const response = admin.rest.post({\n path: \"customers/7392136888625/send_invite.json\",\n body: {\n customer_invite: {\n to: \"new_test_email@shopify.com\",\n from: \"j.limited@example.com\",\n bcc: [\"j.limited@example.com\"],\n subject: \"Welcome to my new shop\",\n custom_message: \"My awesome new store\",\n },\n },\n});\n const customerInvite = await response.json();\n return json({ customerInvite });\n};", + "language": "typescript" + }, + { + "title": "/app/shopify.server.ts", + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "language": "typescript" + } + ] + } + } + ] + }, + { + "title": "graphql", + "examples": [ + { + "description": "Use `admin.graphql` to make query / mutation requests.", + "codeblock": { + "title": "Querying the GraphQL API", + "tabs": [ + { + "title": "Example", + "code": "import { ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.admin(request);\n\n const response = await admin.graphql(\n `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n { variables: { input: { title: \"Product Name\" } } }\n );\n\n const productData = await response.json();\n return json({ data: productData.data });\n}", + "language": "typescript" + } + ] + } + } + ] + } + ] + } + }, + { + "name": "Storefront API", + "description": "Contains objects used to interact with the Storefront API.\n\nThis object is returned as part of different contexts, such as [`appProxy`](/docs/api/shopify-app-remix/authenticate/public/app-proxy), and [`unauthenticated.storefront`](/docs/api/shopify-app-remix/unauthenticated/unauthenticated-storefront).", + "category": "APIs", + "type": "object", + "isVisualComponent": false, + "definitions": [ + { + "title": "storefront", + "description": "Provides utilities that apps can use to make requests to the Storefront API.", + "type": "StorefrontContext", + "typeDefinitions": { + "StorefrontContext": { + "filePath": "src/server/clients/storefront/types.ts", + "name": "StorefrontContext", + "description": "", + "members": [ + { + "filePath": "src/server/clients/storefront/types.ts", + "syntaxKind": "PropertySignature", + "name": "graphql", + "value": "GraphQLClient", + "description": "Method for interacting with the Shopify Storefront GraphQL API\n\nIf you're getting incorrect type hints in the Shopify template, follow [these instructions](https://github.com/Shopify/shopify-app-template-remix/tree/main#incorrect-graphql-hints).\n\n\n\n\n", + "examples": [ + { + "title": "Querying the GraphQL API", + "description": "Use `storefront.graphql` to make query / mutation requests.", + "tabs": [ + { + "code": "import { json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { storefront } = await authenticate.public.appProxy(request);\n\n const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);\n\n return json(await response.json());\n}", + "title": "app/routes/**\\/.ts" + } + ] + } + ] + } + ], + "value": "export interface StorefrontContext {\n /**\n * Method for interacting with the Shopify Storefront GraphQL API\n *\n * If you're getting incorrect type hints in the Shopify template, follow [these instructions](https://github.com/Shopify/shopify-app-template-remix/tree/main#incorrect-graphql-hints).\n *\n * {@link https://shopify.dev/docs/api/storefront}\n *\n * @example\n * Querying the GraphQL API.\n * Use `storefront.graphql` to make query / mutation requests.\n * ```ts\n * // app/routes/**\\/.ts\n * import { json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { storefront } = await authenticate.public.appProxy(request);\n *\n * const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);\n *\n * return json(await response.json());\n * }\n * ```\n */\n graphql: GraphQLClient;\n}" + }, + "GraphQLClient": { + "filePath": "src/server/clients/types.ts", + "name": "GraphQLClient", + "description": "", + "params": [ + { + "name": "query", + "description": "", + "value": "Operation extends keyof Operations", + "filePath": "src/server/clients/types.ts" + }, + { + "name": "options", + "description": "", + "value": "GraphQLQueryOptions", + "isOptional": true, + "filePath": "src/server/clients/types.ts" + } + ], + "returns": { + "filePath": "src/server/clients/types.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}" + }, + "value": "export type GraphQLClient = <\n Operation extends keyof Operations,\n>(\n query: Operation,\n options?: GraphQLQueryOptions,\n) => Promise<\n ResponseWithType>>\n>;" + }, + "GraphQLQueryOptions": { + "filePath": "src/server/clients/types.ts", + "name": "GraphQLQueryOptions", + "description": "", + "members": [ + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "variables", + "value": "ApiClientRequestOptions[\"variables\"]", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "apiVersion", + "value": "ApiVersion", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "headers", + "value": "{ [key: string]: any; }", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "tries", + "value": "number", + "description": "", + "isOptional": true + } + ], + "value": "export interface GraphQLQueryOptions<\n Operation extends keyof Operations,\n Operations extends AllOperations,\n> {\n variables?: ApiClientRequestOptions['variables'];\n apiVersion?: ApiVersion;\n headers?: {[key: string]: any};\n tries?: number;\n}" + }, + "ApiVersion": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "ApiVersion", + "value": "export declare enum ApiVersion {\n October22 = \"2022-10\",\n January23 = \"2023-01\",\n April23 = \"2023-04\",\n July23 = \"2023-07\",\n October23 = \"2023-10\",\n January24 = \"2024-01\",\n Unstable = \"unstable\"\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "October22", + "value": "2022-10" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "January23", + "value": "2023-01" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "April23", + "value": "2023-04" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "July23", + "value": "2023-07" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "October23", + "value": "2023-10" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "January24", + "value": "2024-01" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Unstable", + "value": "unstable" + } + ] + } + } + } + ], + "jsDocTypeExamples": [ + "StorefrontContext" + ], + "related": [ + { + "name": "App proxy context", + "subtitle": "Authenticate requests from Shopify app proxies.", + "url": "/docs/api/shopify-app-remix/authenticate/public/app-proxy" + }, + { + "name": "Unauthenticated context", + "subtitle": "Interact with the Storefront API on non-Shopify requests.", + "url": "/docs/api/shopify-app-remix/unauthenticated/unauthenticated-storefront" + } + ], + "examples": { + "description": "", + "exampleGroups": [ + { + "title": "graphql", + "examples": [ + { + "description": "Use `storefront.graphql` to make query / mutation requests.", + "codeblock": { + "title": "Querying the GraphQL API", + "tabs": [ + { + "title": "app/routes/**\\/.ts", + "code": "import { json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { storefront } = await authenticate.public.appProxy(request);\n\n const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);\n\n return json(await response.json());\n}", + "language": "typescript" + } + ] + } + } + ] + } + ] + } + }, + { + "name": "shopifyApp", + "description": "Returns a set of functions that can be used by the app's backend to be able to respond to all Shopify requests.\n\nThe shape of the returned object changes depending on the value of `distribution`. If it is `AppDistribution.ShopifyAdmin`, then only `ShopifyAppBase` objects are returned, otherwise `ShopifyAppLogin` objects are included.", + "category": "Entrypoints", + "type": "function", + "isVisualComponent": false, + "definitions": [ + { + "title": "shopifyApp", + "description": "Function to create a new Shopify API object.", + "type": "ShopifyAppGeneratedType", + "typeDefinitions": { + "ShopifyAppGeneratedType": { + "filePath": "src/server/shopify-app.ts", + "name": "ShopifyAppGeneratedType", + "description": "Creates an object your app will use to interact with Shopify.", + "params": [ + { + "name": "appConfig", + "description": "Configuration options for your Shopify app, such as the scopes your app needs.", + "value": "Config extends AppConfigArg", + "filePath": "src/server/shopify-app.ts" + } + ], + "returns": { + "filePath": "src/server/shopify-app.ts", + "description": "`ShopifyApp` An object constructed using your appConfig. It has methods for interacting with Shopify.", + "name": "ShopifyApp>", + "value": "ShopifyApp>" + }, + "value": "export function shopifyApp<\n Config extends AppConfigArg,\n Resources extends ShopifyRestResources,\n Storage extends SessionStorage,\n>(appConfig: Config): ShopifyApp {\n const api = deriveApi(appConfig);\n const config = deriveConfig(appConfig, api.config);\n const logger = overrideLogger(api.logger);\n\n if (appConfig.webhooks) {\n api.webhooks.addHandlers(appConfig.webhooks);\n }\n\n const params: BasicParams = {api, config, logger};\n const oauth = new AuthCodeFlowStrategy(params);\n const authStrategy = authStrategyFactory({\n ...params,\n strategy: oauth,\n });\n\n const shopify:\n | AdminApp\n | AppStoreApp\n | SingleMerchantApp = {\n sessionStorage: config.sessionStorage,\n addDocumentResponseHeaders: addDocumentResponseHeadersFactory(params),\n registerWebhooks: registerWebhooksFactory(params),\n authenticate: {\n admin: authStrategy,\n public: authenticatePublicFactory(params),\n webhook: authenticateWebhookFactory<\n Config['future'],\n Resources,\n keyof Config['webhooks'] | MandatoryTopics\n >(params),\n },\n unauthenticated: {\n admin: unauthenticatedAdminContextFactory(params),\n storefront: unauthenticatedStorefrontContextFactory(params),\n },\n };\n\n if (\n isAppStoreApp(shopify, appConfig) ||\n isSingleMerchantApp(shopify, appConfig)\n ) {\n shopify.login = loginFactory(params);\n }\n\n return shopify as ShopifyApp;\n}", + "examples": [ + { + "title": "The minimum viable configuration", + "description": "", + "tabs": [ + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n apiKey: process.env.SHOPIFY_API_KEY!,\n apiSecretKey: process.env.SHOPIFY_API_SECRET!,\n scopes: process.env.SCOPES?.split(\",\")!,\n appUrl: process.env.SHOPIFY_APP_URL!,\n});\nexport default shopify;", + "title": "/shopify.server.ts" + } + ] + } + ] + }, + "AppConfigArg": { + "filePath": "src/server/config-types.ts", + "name": "AppConfigArg", + "description": "", + "members": [ + { + "filePath": "src/server/config-types.ts", + "syntaxKind": "PropertySignature", + "name": "appUrl", + "value": "string", + "description": "The URL your app is running on.\n\nThe `@shopify/cli` provides this URL as `process.env.SHOPIFY_APP_URL`. For development this is probably a tunnel URL that points to your local machine. If this is a production app, this is your production URL." + }, + { + "filePath": "src/server/config-types.ts", + "syntaxKind": "PropertySignature", + "name": "sessionStorage", + "value": "Storage", + "description": "An adaptor for storing sessions in your database of choice.\n\nShopify provides multiple session storage adaptors and you can create your own.\n\n\n\n\n", + "examples": [ + { + "title": "Storing sessions with Prisma", + "description": "Add the `@shopify/shopify-app-session-storage-prisma` package to use the Prisma session storage.", + "tabs": [ + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { PrismaSessionStorage } from \"@shopify/shopify-app-session-storage-prisma\";\n\nimport prisma from \"~/db.server\";\n\nconst shopify = shopifyApp({\n // ... etc\n sessionStorage: new PrismaSessionStorage(prisma),\n});\nexport default shopify;", + "title": "Example" + } + ] + } + ] + }, + { + "filePath": "src/server/config-types.ts", + "syntaxKind": "PropertySignature", + "name": "useOnlineTokens", + "value": "boolean", + "description": "Whether your app use online or offline tokens.\n\nIf your app uses online tokens, then both online and offline tokens will be saved to your database. This ensures your app can perform background jobs.\n\n\n\n\n", + "isOptional": true, + "defaultValue": "`false`" + }, + { + "filePath": "src/server/config-types.ts", + "syntaxKind": "PropertySignature", + "name": "webhooks", + "value": "WebhookConfig", + "description": "The config for the webhook topics your app would like to subscribe to.\n\n\n\n\n\n\n\nThis can be in used in conjunction with the afterAuth hook to register webhook topics when a user installs your app. Or you can use this function in other processes such as background jobs.", + "isOptional": true, + "examples": [ + { + "title": "Registering for a webhook when a merchant uninstalls your app", + "description": "", + "tabs": [ + { + "code": "import { DeliveryMethod, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n webhooks: {\n APP_UNINSTALLED: {\n deliveryMethod: DeliveryMethod.Http,\n callbackUrl: \"/webhooks\",\n },\n },\n hooks: {\n afterAuth: async ({ session }) => {\n shopify.registerWebhooks({ session });\n }\n },\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;\n\n// /app/routes/webhooks.jsx\nimport { ActionFunctionArgs } from \"@remix-run/node\";\n\nimport { authenticate } from \"../shopify.server\";\nimport db from \"../db.server\";\n\nexport const action = async ({ request }: ActionFunctionArgs) => {\n const { topic, shop } = await authenticate.webhook(request);\n\n switch (topic) {\n case \"APP_UNINSTALLED\":\n await db.session.deleteMany({ where: { shop } });\n break;\n case \"CUSTOMERS_DATA_REQUEST\":\n case \"CUSTOMERS_REDACT\":\n case \"SHOP_REDACT\":\n default:\n throw new Response(\"Unhandled webhook topic\", { status: 404 });\n }\n throw new Response();\n};", + "title": "/app/shopify.server.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/config-types.ts", + "syntaxKind": "PropertySignature", + "name": "hooks", + "value": "HooksConfig", + "description": "Functions to call at key places during your apps lifecycle.\n\nThese functions are called in the context of the request that triggered them. This means you can access the session.", + "isOptional": true, + "examples": [ + { + "title": "Seeding your database custom data when a merchant installs your app", + "description": "", + "tabs": [ + { + "code": "import { DeliveryMethod, shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { seedStoreData } from \"~/db/seeds\"\n\nconst shopify = shopifyApp({\n hooks: {\n afterAuth: async ({ session }) => {\n seedStoreData({session})\n }\n },\n // ...etc\n});", + "title": "Example" + } + ] + } + ] + }, + { + "filePath": "src/server/config-types.ts", + "syntaxKind": "PropertySignature", + "name": "isEmbeddedApp", + "value": "boolean", + "description": "Does your app render embedded inside the Shopify Admin or on its own.\n\nUnless you have very specific needs, this should be true.", + "isOptional": true, + "defaultValue": "`true`" + }, + { + "filePath": "src/server/config-types.ts", + "syntaxKind": "PropertySignature", + "name": "distribution", + "value": "AppDistribution", + "description": "How your app is distributed. Default is `AppDistribution.AppStore`.\n\n\n\n\n", + "isOptional": true + }, + { + "filePath": "src/server/config-types.ts", + "syntaxKind": "PropertySignature", + "name": "apiVersion", + "value": "ApiVersion", + "description": "What version of Shopify's Admin API's would you like to use.\n\n\n\n\n", + "isOptional": true, + "defaultValue": "`LATEST_API_VERSION` from `@shopify/shopify-app-remix`", + "examples": [ + { + "title": "Using the latest API Version (Recommended)", + "description": "", + "tabs": [ + { + "code": "import { LATEST_API_VERSION, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n apiVersion: LATEST_API_VERSION,\n});", + "title": "Example" + } + ] + } + ] + }, + { + "filePath": "src/server/config-types.ts", + "syntaxKind": "PropertySignature", + "name": "authPathPrefix", + "value": "string", + "description": "A path that Shopify can reserve for auth related endpoints.\n\nThis must match a $ route in your Remix app. That route must export a loader function that calls `shopify.authenticate.admin(request)`.", + "isOptional": true, + "defaultValue": "`\"/auth\"`", + "examples": [ + { + "title": "Using the latest API Version (Recommended)", + "description": "", + "tabs": [ + { + "code": "import { LATEST_API_VERSION, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n apiVersion: LATEST_API_VERSION,\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;\n\n// /app/routes/auth/$.jsx\nimport { LoaderFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../../shopify.server\";\n\nexport async function loader({ request }: LoaderFunctionArgs) {\n await authenticate.admin(request);\n\n return null\n}", + "title": "/app/shopify.server.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/config-types.ts", + "syntaxKind": "PropertySignature", + "name": "future", + "value": "Future", + "description": "Features that will be introduced in future releases of this package.\n\nYou can opt in to these features by setting the corresponding flags. By doing so, you can prepare for future releases in advance and provide feedback on the new features.", + "isOptional": true + }, + { + "filePath": "src/server/config-types.ts", + "syntaxKind": "PropertySignature", + "name": "apiKey", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/config-types.ts", + "syntaxKind": "PropertySignature", + "name": "apiSecretKey", + "value": "string", + "description": "" + }, + { + "filePath": "src/server/config-types.ts", + "syntaxKind": "PropertySignature", + "name": "scopes", + "value": "string[] | AuthScopes", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/config-types.ts", + "syntaxKind": "PropertySignature", + "name": "adminApiAccessToken", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/config-types.ts", + "syntaxKind": "PropertySignature", + "name": "userAgentPrefix", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/config-types.ts", + "syntaxKind": "PropertySignature", + "name": "privateAppStorefrontAccessToken", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/config-types.ts", + "syntaxKind": "PropertySignature", + "name": "customShopDomains", + "value": "(string | RegExp)[]", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/config-types.ts", + "syntaxKind": "PropertySignature", + "name": "billing", + "value": "BillingConfig", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/config-types.ts", + "syntaxKind": "PropertySignature", + "name": "restResources", + "value": "Resources", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/config-types.ts", + "syntaxKind": "PropertySignature", + "name": "logger", + "value": "{ log?: LogFunction; level?: LogSeverity; httpRequests?: boolean; timestamps?: boolean; }", + "description": "", + "isOptional": true + } + ], + "value": "export interface AppConfigArg<\n Resources extends ShopifyRestResources = ShopifyRestResources,\n Storage extends SessionStorage = SessionStorage,\n Future extends FutureFlagOptions = FutureFlagOptions,\n> extends Omit<\n ApiConfigArg,\n | 'hostName'\n | 'hostScheme'\n | 'isEmbeddedApp'\n | 'apiVersion'\n | 'isCustomStoreApp'\n | 'future'\n > {\n /**\n * The URL your app is running on.\n *\n * The `@shopify/cli` provides this URL as `process.env.SHOPIFY_APP_URL`. For development this is probably a tunnel URL that points to your local machine. If this is a production app, this is your production URL.\n */\n appUrl: string;\n\n /**\n * An adaptor for storing sessions in your database of choice.\n *\n * Shopify provides multiple session storage adaptors and you can create your own.\n *\n * {@link https://github.com/Shopify/shopify-app-js/blob/main/README.md#session-storage-options}\n *\n * @example\n * Storing sessions with Prisma.\n * Add the `@shopify/shopify-app-session-storage-prisma` package to use the Prisma session storage.\n * ```ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { PrismaSessionStorage } from \"@shopify/shopify-app-session-storage-prisma\";\n *\n * import prisma from \"~/db.server\";\n *\n * const shopify = shopifyApp({\n * // ... etc\n * sessionStorage: new PrismaSessionStorage(prisma),\n * });\n * export default shopify;\n * ```\n */\n sessionStorage: Storage;\n\n /**\n * Whether your app use online or offline tokens.\n *\n * If your app uses online tokens, then both online and offline tokens will be saved to your database. This ensures your app can perform background jobs.\n *\n * {@link https://shopify.dev/docs/apps/auth/oauth/access-modes}\n *\n * @defaultValue `false`\n */\n useOnlineTokens?: boolean;\n\n /**\n * The config for the webhook topics your app would like to subscribe to.\n *\n * {@link https://shopify.dev/docs/apps/webhooks}\n *\n * This can be in used in conjunction with the afterAuth hook to register webhook topics when a user installs your app. Or you can use this function in other processes such as background jobs.\n *\n * @example\n * Registering for a webhook when a merchant uninstalls your app.\n * ```ts\n * // /app/shopify.server.ts\n * import { DeliveryMethod, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n *\n * const shopify = shopifyApp({\n * webhooks: {\n * APP_UNINSTALLED: {\n * deliveryMethod: DeliveryMethod.Http,\n * callbackUrl: \"/webhooks\",\n * },\n * },\n * hooks: {\n * afterAuth: async ({ session }) => {\n * shopify.registerWebhooks({ session });\n * }\n * },\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n *\n * // /app/routes/webhooks.jsx\n * import { ActionFunctionArgs } from \"@remix-run/node\";\n *\n * import { authenticate } from \"../shopify.server\";\n * import db from \"../db.server\";\n *\n * export const action = async ({ request }: ActionFunctionArgs) => {\n * const { topic, shop } = await authenticate.webhook(request);\n *\n * switch (topic) {\n * case \"APP_UNINSTALLED\":\n * await db.session.deleteMany({ where: { shop } });\n * break;\n * case \"CUSTOMERS_DATA_REQUEST\":\n * case \"CUSTOMERS_REDACT\":\n * case \"SHOP_REDACT\":\n * default:\n * throw new Response(\"Unhandled webhook topic\", { status: 404 });\n * }\n * throw new Response();\n * };\n * ```\n */\n webhooks?: WebhookConfig;\n\n /**\n * Functions to call at key places during your apps lifecycle.\n *\n * These functions are called in the context of the request that triggered them. This means you can access the session.\n *\n * @example\n * Seeding your database custom data when a merchant installs your app.\n * ```ts\n * import { DeliveryMethod, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { seedStoreData } from \"~/db/seeds\"\n *\n * const shopify = shopifyApp({\n * hooks: {\n * afterAuth: async ({ session }) => {\n * seedStoreData({session})\n * }\n * },\n * // ...etc\n * });\n * ```\n */\n hooks?: HooksConfig;\n\n /**\n * Does your app render embedded inside the Shopify Admin or on its own.\n *\n * Unless you have very specific needs, this should be true.\n *\n * @defaultValue `true`\n */\n isEmbeddedApp?: boolean;\n\n /**\n * How your app is distributed. Default is `AppDistribution.AppStore`.\n *\n * {@link https://shopify.dev/docs/apps/distribution}\n */\n distribution?: AppDistribution;\n\n /**\n * What version of Shopify's Admin API's would you like to use.\n *\n * {@link https://shopify.dev/docs/api/}\n *\n * @defaultValue `LATEST_API_VERSION` from `@shopify/shopify-app-remix`\n *\n * @example\n * Using the latest API Version (Recommended)\n * ```ts\n * import { LATEST_API_VERSION, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n *\n * const shopify = shopifyApp({\n * // ...etc\n * apiVersion: LATEST_API_VERSION,\n * });\n * ```\n */\n apiVersion?: ApiVersion;\n\n /**\n * A path that Shopify can reserve for auth related endpoints.\n *\n * This must match a $ route in your Remix app. That route must export a loader function that calls `shopify.authenticate.admin(request)`.\n *\n * @default `\"/auth\"`\n *\n * @example\n * Using the latest API Version (Recommended)\n * ```ts\n * // /app/shopify.server.ts\n * import { LATEST_API_VERSION, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n *\n * const shopify = shopifyApp({\n * // ...etc\n * apiVersion: LATEST_API_VERSION,\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n *\n * // /app/routes/auth/$.jsx\n * import { LoaderFunctionArgs } from \"@remix-run/node\";\n * import { authenticate } from \"../../shopify.server\";\n *\n * export async function loader({ request }: LoaderFunctionArgs) {\n * await authenticate.admin(request);\n *\n * return null\n * }\n * ```\n */\n authPathPrefix?: string;\n\n /**\n * Features that will be introduced in future releases of this package.\n *\n * You can opt in to these features by setting the corresponding flags. By doing so, you can prepare for future\n * releases in advance and provide feedback on the new features.\n */\n future?: Future;\n}" + }, + "WebhookConfig": { + "filePath": "src/server/config-types.ts", + "name": "WebhookConfig", + "description": "", + "members": [ + { + "filePath": "src/server/config-types.ts", + "name": "[key: string]", + "value": "WebhookHandler | WebhookHandler[]" + } + ], + "value": "export interface WebhookConfig {\n [key: string]: WebhookHandler | WebhookHandler[];\n}" + }, + "WebhookHandler": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "WebhookHandler", + "value": "HttpWebhookHandler | HttpWebhookHandlerWithCallback | EventBridgeWebhookHandler | PubSubWebhookHandler", + "description": "" + }, + "HttpWebhookHandler": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "HttpWebhookHandler", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "deliveryMethod", + "value": "DeliveryMethod.Http", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "callbackUrl", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "id", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "includeFields", + "value": "string[]", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "metafieldNamespaces", + "value": "string[]", + "description": "", + "isOptional": true + } + ], + "value": "export interface HttpWebhookHandler extends BaseWebhookHandler {\n deliveryMethod: DeliveryMethod.Http;\n callbackUrl: string;\n}" + }, + "DeliveryMethod": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "DeliveryMethod", + "value": "export declare enum DeliveryMethod {\n Http = \"http\",\n EventBridge = \"eventbridge\",\n PubSub = \"pubsub\"\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "Http", + "value": "http" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "EventBridge", + "value": "eventbridge" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "PubSub", + "value": "pubsub" + } + ] + }, + "HttpWebhookHandlerWithCallback": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "HttpWebhookHandlerWithCallback", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "callback", + "value": "WebhookHandlerFunction", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "deliveryMethod", + "value": "DeliveryMethod.Http", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "callbackUrl", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "id", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "includeFields", + "value": "string[]", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "metafieldNamespaces", + "value": "string[]", + "description": "", + "isOptional": true + } + ], + "value": "export interface HttpWebhookHandlerWithCallback extends HttpWebhookHandler {\n callback: WebhookHandlerFunction;\n}" + }, + "WebhookHandlerFunction": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "WebhookHandlerFunction", + "description": "", + "params": [ + { + "name": "topic", + "description": "", + "value": "string", + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts" + }, + { + "name": "shop_domain", + "description": "", + "value": "string", + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts" + }, + { + "name": "body", + "description": "", + "value": "string", + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts" + }, + { + "name": "webhookId", + "description": "", + "value": "string", + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts" + }, + { + "name": "apiVersion", + "description": "", + "value": "string", + "isOptional": true, + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts" + } + ], + "returns": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "description": "", + "name": "Promise", + "value": "Promise" + }, + "value": "export type WebhookHandlerFunction = (topic: string, shop_domain: string, body: string, webhookId: string, apiVersion?: string) => Promise;" + }, + "EventBridgeWebhookHandler": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "EventBridgeWebhookHandler", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "deliveryMethod", + "value": "DeliveryMethod.EventBridge", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "arn", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "id", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "includeFields", + "value": "string[]", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "metafieldNamespaces", + "value": "string[]", + "description": "", + "isOptional": true + } + ], + "value": "export interface EventBridgeWebhookHandler extends BaseWebhookHandler {\n deliveryMethod: DeliveryMethod.EventBridge;\n arn: string;\n}" + }, + "PubSubWebhookHandler": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "PubSubWebhookHandler", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "deliveryMethod", + "value": "DeliveryMethod.PubSub", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "pubSubProject", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "pubSubTopic", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "id", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "includeFields", + "value": "string[]", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "metafieldNamespaces", + "value": "string[]", + "description": "", + "isOptional": true + } + ], + "value": "export interface PubSubWebhookHandler extends BaseWebhookHandler {\n deliveryMethod: DeliveryMethod.PubSub;\n pubSubProject: string;\n pubSubTopic: string;\n}" + }, + "HooksConfig": { + "filePath": "src/server/config-types.ts", + "name": "HooksConfig", + "description": "", + "members": [ + { + "filePath": "src/server/config-types.ts", + "syntaxKind": "PropertySignature", + "name": "afterAuth", + "value": "(options: AfterAuthOptions) => void | Promise", + "description": "A function to call after a merchant installs your app", + "isOptional": true, + "examples": [ + { + "title": "Registering webhooks and seeding data when a merchant installs your app", + "description": "", + "tabs": [ + { + "code": "import { DeliveryMethod, shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { seedStoreData } from \"~/db/seeds\"\n\nconst shopify = shopifyApp({\n hooks: {\n afterAuth: async ({ session }) => {\n shopify.registerWebhooks({ session });\n seedStoreData({session})\n }\n },\n webhooks: {\n APP_UNINSTALLED: {\n deliveryMethod: DeliveryMethod.Http,\n callbackUrl: \"/webhooks\",\n },\n },\n // ...etc\n});", + "title": "Example" + } + ] + } + ] + } + ], + "value": "interface HooksConfig {\n /**\n * A function to call after a merchant installs your app\n *\n * @param context - An object with context about the request that triggered the hook.\n * @param context.session - The session of the merchant that installed your app. This is the output of sessionStorage.loadSession in case people want to load their own.\n * @param context.admin - An object with access to the Shopify Admin API's.\n *\n * @example\n * Registering webhooks and seeding data when a merchant installs your app.\n * ```ts\n * import { DeliveryMethod, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { seedStoreData } from \"~/db/seeds\"\n *\n * const shopify = shopifyApp({\n * hooks: {\n * afterAuth: async ({ session }) => {\n * shopify.registerWebhooks({ session });\n * seedStoreData({session})\n * }\n * },\n * webhooks: {\n * APP_UNINSTALLED: {\n * deliveryMethod: DeliveryMethod.Http,\n * callbackUrl: \"/webhooks\",\n * },\n * },\n * // ...etc\n * });\n * ```\n */\n afterAuth?: (options: AfterAuthOptions) => void | Promise;\n}" + }, + "AfterAuthOptions": { + "filePath": "src/server/config-types.ts", + "name": "AfterAuthOptions", + "description": "", + "members": [ + { + "filePath": "src/server/config-types.ts", + "syntaxKind": "PropertySignature", + "name": "session", + "value": "Session", + "description": "" + }, + { + "filePath": "src/server/config-types.ts", + "syntaxKind": "PropertySignature", + "name": "admin", + "value": "AdminApiContext", + "description": "" + } + ], + "value": "export interface AfterAuthOptions<\n R extends ShopifyRestResources = ShopifyRestResources,\n> {\n session: Session;\n admin: AdminApiContext;\n}" + }, + "Session": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "name": "Session", + "description": "Stores App information from logged in merchants so they can make authenticated requests to the Admin API.", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "id", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "shop", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "state", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "isOnline", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "scope", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "expires", + "value": "Date", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "accessToken", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "onlineAccessInfo", + "value": "OnlineAccessInfo", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "isActive", + "value": "(scopes: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "isScopeChanged", + "value": "(scopes: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "isExpired", + "value": "(withinMillisecondsOfExpiry?: number) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toObject", + "value": "() => SessionParams", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "equals", + "value": "(other: Session) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toPropertyArray", + "value": "() => [string, string | number | boolean][]", + "description": "" + } + ], + "value": "export declare class Session {\n static fromPropertyArray(entries: [string, string | number | boolean][]): Session;\n readonly id: string;\n shop: string;\n state: string;\n isOnline: boolean;\n scope?: string;\n expires?: Date;\n accessToken?: string;\n onlineAccessInfo?: OnlineAccessInfo;\n constructor(params: SessionParams);\n isActive(scopes: AuthScopes | string | string[]): boolean;\n isScopeChanged(scopes: AuthScopes | string | string[]): boolean;\n isExpired(withinMillisecondsOfExpiry?: number): boolean;\n toObject(): SessionParams;\n equals(other: Session | undefined): boolean;\n toPropertyArray(): [string, string | number | boolean][];\n}" + }, + "OnlineAccessInfo": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "name": "OnlineAccessInfo", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "expires_in", + "value": "number", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "associated_user_scope", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "associated_user", + "value": "{ id: number; first_name: string; last_name: string; email: string; email_verified: boolean; account_owner: boolean; locale: string; collaborator: boolean; }", + "description": "" + } + ], + "value": "export interface OnlineAccessInfo {\n expires_in: number;\n associated_user_scope: string;\n associated_user: {\n id: number;\n first_name: string;\n last_name: string;\n email: string;\n email_verified: boolean;\n account_owner: boolean;\n locale: string;\n collaborator: boolean;\n };\n}" + }, + "AuthScopes": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "name": "AuthScopes", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "has", + "value": "(scope: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "equals", + "value": "(otherScopes: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toString", + "value": "() => string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toArray", + "value": "() => string[]", + "description": "" + } + ], + "value": "declare class AuthScopes {\n static SCOPE_DELIMITER: string;\n private compressedScopes;\n private expandedScopes;\n constructor(scopes: string | string[] | AuthScopes | undefined);\n has(scope: string | string[] | AuthScopes | undefined): boolean;\n equals(otherScopes: string | string[] | AuthScopes | undefined): boolean;\n toString(): string;\n toArray(): string[];\n private getImpliedScopes;\n}" + }, + "SessionParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "name": "SessionParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "id", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "shop", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "state", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "isOnline", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "scope", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "expires", + "value": "Date", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "accessToken", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "onlineAccessInfo", + "value": "OnlineAccessInfo", + "description": "", + "isOptional": true + } + ], + "value": "export interface SessionParams {\n readonly id: string;\n shop: string;\n state: string;\n isOnline: boolean;\n scope?: string;\n expires?: Date;\n accessToken?: string;\n onlineAccessInfo?: OnlineAccessInfo;\n}" + }, + "AdminApiContext": { + "filePath": "src/server/clients/admin/types.ts", + "name": "AdminApiContext", + "description": "", + "members": [ + { + "filePath": "src/server/clients/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "rest", + "value": "RestClientWithResources", + "description": "Methods for interacting with the Shopify Admin REST API\n\nThere are methods for interacting with individual REST resources. You can also make `GET`, `POST`, `PUT` and `DELETE` requests should the REST resources not meet your needs.\n\n\n\n\n", + "examples": [ + { + "title": "Using REST resources", + "description": "Getting the number of orders in a store using REST resources. Visit the [Admin REST API references](/docs/api/admin-rest) for examples on using each resource.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n return json(admin.rest.resources.Order.count({ session }));\n};", + "title": "/app/routes/**\\/*.ts" + }, + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-07\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "/app/shopify.server.ts" + } + ] + }, + { + "title": "Performing a GET request to the REST API", + "description": "Use `admin.rest.get` to make custom requests to make a request to to the `customer/count` endpoint", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n const response = await admin.rest.get({ path: \"/customers/count.json\" });\n const customers = await response.json();\n return json({ customers });\n};", + "title": "/app/routes/**\\/*.ts" + }, + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "/app/shopify.server.ts" + } + ] + }, + { + "title": "Performing a POST request to the REST API", + "description": "Use `admin.rest.post` to make custom requests to make a request to to the `customers.json` endpoint to send a welcome email", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n const response = admin.rest.post({\n path: \"customers/7392136888625/send_invite.json\",\n body: {\n customer_invite: {\n to: \"new_test_email@shopify.com\",\n from: \"j.limited@example.com\",\n bcc: [\"j.limited@example.com\"],\n subject: \"Welcome to my new shop\",\n custom_message: \"My awesome new store\",\n },\n },\n});\n const customerInvite = await response.json();\n return json({ customerInvite });\n};", + "title": "/app/routes/**\\/*.ts" + }, + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "/app/shopify.server.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/clients/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "graphql", + "value": "GraphQLClient", + "description": "Methods for interacting with the Shopify Admin GraphQL API\n\n\n\n\n\n\n\n\n\n", + "examples": [ + { + "title": "Querying the GraphQL API", + "description": "Use `admin.graphql` to make query / mutation requests.", + "tabs": [ + { + "code": "import { ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.admin(request);\n\n const response = await admin.graphql(\n `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n { variables: { input: { title: \"Product Name\" } } }\n );\n\n const productData = await response.json();\n return json({ data: productData.data });\n}", + "title": "Example" + } + ] + } + ] + } + ], + "value": "export interface AdminApiContext<\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> {\n /**\n * Methods for interacting with the Shopify Admin REST API\n *\n * There are methods for interacting with individual REST resources. You can also make `GET`, `POST`, `PUT` and `DELETE` requests should the REST resources not meet your needs.\n *\n * {@link https://shopify.dev/docs/api/admin-rest}\n *\n * @example\n * Using REST resources.\n * Getting the number of orders in a store using REST resources. Visit the [Admin REST API references](/docs/api/admin-rest) for examples on using each resource. \n *\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * return json(admin.rest.resources.Order.count({ session }));\n * };\n * ```\n *\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-07\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n *\n *\n * @example\n * Performing a GET request to the REST API.\n * Use `admin.rest.get` to make custom requests to make a request to to the `customer/count` endpoint\n *\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * const response = await admin.rest.get({ path: \"/customers/count.json\" });\n * const customers = await response.json();\n * return json({ customers });\n * };\n * ```\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n * @example\n * Performing a POST request to the REST API.\n * Use `admin.rest.post` to make custom requests to make a request to to the `customers.json` endpoint to send a welcome email\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * const response = admin.rest.post({\n * path: \"customers/7392136888625/send_invite.json\",\n * body: {\n * customer_invite: {\n * to: \"new_test_email@shopify.com\",\n * from: \"j.limited@example.com\",\n * bcc: [\"j.limited@example.com\"],\n * subject: \"Welcome to my new shop\",\n * custom_message: \"My awesome new store\",\n * },\n * },\n * });\n * const customerInvite = await response.json();\n * return json({ customerInvite });\n * };\n * ```\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n rest: RestClientWithResources;\n\n /**\n * Methods for interacting with the Shopify Admin GraphQL API\n *\n * {@link https://shopify.dev/docs/api/admin-graphql}\n * {@link https://github.com/Shopify/shopify-api-js/blob/main/packages/shopify-api/docs/reference/clients/Graphql.md}\n *\n * @example\n * Querying the GraphQL API.\n * Use `admin.graphql` to make query / mutation requests.\n * ```ts\n * import { ActionFunctionArgs } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { admin } = await authenticate.admin(request);\n *\n * const response = await admin.graphql(\n * `#graphql\n * mutation populateProduct($input: ProductInput!) {\n * productCreate(input: $input) {\n * product {\n * id\n * }\n * }\n * }`,\n * { variables: { input: { title: \"Product Name\" } } }\n * );\n *\n * const productData = await response.json();\n * return json({ data: productData.data });\n * }\n * ```\n */\n graphql: GraphQLClient;\n}" + }, + "RestClientWithResources": { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "RestClientWithResources", + "value": "RemixRestClient & {resources: Resources}", + "description": "" + }, + "RemixRestClient": { + "filePath": "src/server/clients/admin/rest.ts", + "name": "RemixRestClient", + "description": "", + "members": [ + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "PropertyDeclaration", + "name": "session", + "value": "Session", + "description": "" + }, + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "get", + "value": "(params: GetRequestParams) => Promise", + "description": "Performs a GET request on the given path." + }, + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "post", + "value": "(params: PostRequestParams) => Promise", + "description": "Performs a POST request on the given path." + }, + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "put", + "value": "(params: PostRequestParams) => Promise", + "description": "Performs a PUT request on the given path." + }, + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "delete", + "value": "(params: GetRequestParams) => Promise", + "description": "Performs a DELETE request on the given path." + } + ], + "value": "class RemixRestClient {\n public session: Session;\n private params: AdminClientOptions['params'];\n private handleClientError: AdminClientOptions['handleClientError'];\n\n constructor({params, session, handleClientError}: AdminClientOptions) {\n this.params = params;\n this.handleClientError = handleClientError;\n this.session = session;\n }\n\n /**\n * Performs a GET request on the given path.\n */\n public async get(params: GetRequestParams) {\n return this.makeRequest({\n method: 'GET' as RequestParams['method'],\n ...params,\n });\n }\n\n /**\n * Performs a POST request on the given path.\n */\n public async post(params: PostRequestParams) {\n return this.makeRequest({\n method: 'POST' as RequestParams['method'],\n ...params,\n });\n }\n\n /**\n * Performs a PUT request on the given path.\n */\n public async put(params: PutRequestParams) {\n return this.makeRequest({\n method: 'PUT' as RequestParams['method'],\n ...params,\n });\n }\n\n /**\n * Performs a DELETE request on the given path.\n */\n public async delete(params: DeleteRequestParams) {\n return this.makeRequest({\n method: 'DELETE' as RequestParams['method'],\n ...params,\n });\n }\n\n protected async makeRequest(params: RequestParams): Promise {\n const originalClient = new this.params.api.clients.Rest({\n session: this.session,\n });\n const originalRequest = Reflect.get(originalClient, 'request');\n\n try {\n const apiResponse = await originalRequest.call(originalClient, params);\n\n // We use a separate client for REST requests and REST resources because we want to override the API library\n // client class to return a Response object instead.\n return new Response(JSON.stringify(apiResponse.body), {\n headers: apiResponse.headers,\n });\n } catch (error) {\n if (this.handleClientError) {\n throw await this.handleClientError({\n error,\n session: this.session,\n params: this.params,\n });\n } else throw new Error(error);\n }\n }\n}" + }, + "GetRequestParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "GetRequestParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "path", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "type", + "value": "DataType", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "data", + "value": "string | Record", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "query", + "value": "SearchParams", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "extraHeaders", + "value": "HeaderParams", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "tries", + "value": "number", + "description": "", + "isOptional": true + } + ], + "value": "export interface GetRequestParams {\n path: string;\n type?: DataType;\n data?: Record | string;\n query?: SearchParams;\n extraHeaders?: HeaderParams;\n tries?: number;\n}" + }, + "DataType": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "DataType", + "value": "export declare enum DataType {\n JSON = \"application/json\",\n GraphQL = \"application/graphql\",\n URLEncoded = \"application/x-www-form-urlencoded\"\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "JSON", + "value": "application/json" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "GraphQL", + "value": "application/graphql" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "URLEncoded", + "value": "application/x-www-form-urlencoded" + } + ] + }, + "HeaderParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "HeaderParams", + "value": "Record", + "description": "", + "members": [] + }, + "PostRequestParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "PostRequestParams", + "value": "GetRequestParams & {\n data: Record | string;\n}", + "description": "" + }, + "GraphQLClient": { + "filePath": "src/server/clients/types.ts", + "name": "GraphQLClient", + "description": "", + "params": [ + { + "name": "query", + "description": "", + "value": "Operation extends keyof Operations", + "filePath": "src/server/clients/types.ts" + }, + { + "name": "options", + "description": "", + "value": "GraphQLQueryOptions", + "isOptional": true, + "filePath": "src/server/clients/types.ts" + } + ], + "returns": { + "filePath": "src/server/clients/types.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}" + }, + "value": "export type GraphQLClient = <\n Operation extends keyof Operations,\n>(\n query: Operation,\n options?: GraphQLQueryOptions,\n) => Promise<\n ResponseWithType>>\n>;" + }, + "GraphQLQueryOptions": { + "filePath": "src/server/clients/types.ts", + "name": "GraphQLQueryOptions", + "description": "", + "members": [ + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "variables", + "value": "ApiClientRequestOptions[\"variables\"]", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "apiVersion", + "value": "ApiVersion", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "headers", + "value": "{ [key: string]: any; }", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "tries", + "value": "number", + "description": "", + "isOptional": true + } + ], + "value": "export interface GraphQLQueryOptions<\n Operation extends keyof Operations,\n Operations extends AllOperations,\n> {\n variables?: ApiClientRequestOptions['variables'];\n apiVersion?: ApiVersion;\n headers?: {[key: string]: any};\n tries?: number;\n}" + }, + "ApiVersion": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "ApiVersion", + "value": "export declare enum ApiVersion {\n October22 = \"2022-10\",\n January23 = \"2023-01\",\n April23 = \"2023-04\",\n July23 = \"2023-07\",\n October23 = \"2023-10\",\n January24 = \"2024-01\",\n Unstable = \"unstable\"\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "October22", + "value": "2022-10" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "January23", + "value": "2023-01" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "April23", + "value": "2023-04" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "July23", + "value": "2023-07" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "October23", + "value": "2023-10" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "January24", + "value": "2024-01" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Unstable", + "value": "unstable" + } + ] + }, + "ShopifyRestResources": { + "filePath": "../../node_modules/@shopify/shopify-api/rest/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "ShopifyRestResources", + "value": "Record", + "description": "", + "members": [] + }, + "AppDistribution": { + "filePath": "src/server/types.ts", + "syntaxKind": "EnumDeclaration", + "name": "AppDistribution", + "value": "export enum AppDistribution {\n AppStore = 'app_store',\n SingleMerchant = 'single_merchant',\n ShopifyAdmin = 'shopify_admin',\n}", + "members": [ + { + "filePath": "src/server/types.ts", + "name": "AppStore", + "value": "app_store" + }, + { + "filePath": "src/server/types.ts", + "name": "SingleMerchant", + "value": "single_merchant" + }, + { + "filePath": "src/server/types.ts", + "name": "ShopifyAdmin", + "value": "shopify_admin" + } + ] + }, + "BillingConfig": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "BillingConfig", + "value": "Record>", + "description": "", + "members": [] + }, + "LogFunction": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/base-types.d.ts", + "name": "LogFunction", + "description": "", + "params": [ + { + "name": "severity", + "description": "", + "value": "LogSeverity", + "filePath": "../../node_modules/@shopify/shopify-api/lib/base-types.d.ts" + }, + { + "name": "msg", + "description": "", + "value": "string", + "filePath": "../../node_modules/@shopify/shopify-api/lib/base-types.d.ts" + } + ], + "returns": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/base-types.d.ts", + "description": "", + "name": "void", + "value": "void" + }, + "value": "export type LogFunction = (severity: LogSeverity, msg: string) => void;" + }, + "LogSeverity": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "LogSeverity", + "value": "export declare enum LogSeverity {\n Error = 0,\n Warning = 1,\n Info = 2,\n Debug = 3\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Error", + "value": 0 + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Warning", + "value": 1 + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Info", + "value": 2 + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Debug", + "value": 3 + } + ] + }, + "ShopifyApp": { + "filePath": "src/server/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "ShopifyApp", + "value": "Config['distribution'] extends AppDistribution.ShopifyAdmin\n ? AdminApp\n : Config['distribution'] extends AppDistribution.SingleMerchant\n ? SingleMerchantApp\n : Config['distribution'] extends AppDistribution.AppStore\n ? AppStoreApp\n : AppStoreApp", + "description": "An object your app can use to interact with Shopify.\n\nBy default, the app's distribution is `AppStore`." + }, + "AdminApp": { + "filePath": "src/server/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "AdminApp", + "value": "ShopifyAppBase", + "description": "", + "members": [ + { + "filePath": "src/server/types.ts", + "syntaxKind": "PropertySignature", + "name": "sessionStorage", + "value": "SessionStorageType", + "description": "The `SessionStorage` instance you passed in as a config option.", + "examples": [ + { + "title": "Storing sessions with Prisma", + "description": "Import the `@shopify/shopify-app-session-storage-prisma` package to store sessions in your Prisma database.", + "tabs": [ + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { PrismaSessionStorage } from \"@shopify/shopify-app-session-storage-prisma\";\nimport prisma from \"~/db.server\";\n\nconst shopify = shopifyApp({\n sesssionStorage: new PrismaSessionStorage(prisma),\n // ...etc\n})\n\n// shopify.sessionStorage is an instance of PrismaSessionStorage", + "title": "/app/shopify.server.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "PropertySignature", + "name": "addDocumentResponseHeaders", + "value": "AddDocumentResponseHeaders", + "description": "Adds the required Content Security Policy headers for Shopify apps to the given Headers object.\n\n\n\n\n", + "examples": [ + { + "title": "Return headers on all requests", + "description": "Add headers to all HTML requests by calling `shopify.addDocumentResponseHeaders` in `entry.server.tsx`.", + "tabs": [ + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n});\nexport default shopify;\nexport const addDocumentResponseheaders = shopify.addDocumentResponseheaders;", + "title": "~/shopify.server.ts" + }, + { + "code": "import { addDocumentResponseHeaders } from \"~/shopify.server\";\n\nexport default function handleRequest(\n request: Request,\n responseStatusCode: number,\n responseHeaders: Headers,\n remixContext: EntryContext\n) {\n const markup = renderToString(\n \n );\n\n responseHeaders.set(\"Content-Type\", \"text/html\");\n addDocumentResponseHeaders(request, responseHeaders);\n\n return new Response(\"\" + markup, {\n status: responseStatusCode,\n headers: responseHeaders,\n });\n}", + "title": "entry.server.tsx" + } + ] + } + ] + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "PropertySignature", + "name": "registerWebhooks", + "value": "RegisterWebhooks", + "description": "Register webhook topics for a store using the given session. Most likely you want to use this in combination with the afterAuth hook.", + "examples": [ + { + "title": "Registering webhooks after install", + "description": "Trigger the registration to create the webhook subscriptions after a merchant installs your app using the `afterAuth` hook. Learn more about [subscribing to webhooks.](/docs/api/shopify-app-remix/v1/guide-webhooks)", + "tabs": [ + { + "code": "import { DeliveryMethod, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n hooks: {\n afterAuth: async ({ session }) => {\n shopify.registerWebhooks({ session });\n }\n },\n webhooks: {\n APP_UNINSTALLED: {\n deliveryMethod: DeliveryMethod.Http,\n callbackUrl: \"/webhooks\",\n },\n },\n // ...etc\n});", + "title": "/app/shopify.server.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "PropertySignature", + "name": "authenticate", + "value": "Authenticate", + "description": "Ways to authenticate requests from different surfaces across Shopify.", + "examples": [ + { + "title": "Authenticate Shopify requests", + "description": "Use the functions in `authenticate` to validate requests coming from Shopify.", + "tabs": [ + { + "code": "import { LATEST_API_VERSION, shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;", + "title": "/app/shopify.server.ts" + }, + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport shopify from \"../../shopify.server\";\n\nexport async function loader({ request }: LoaderFunctionArgs) {\n const {admin, session, sessionToken, billing} = shopify.authenticate.admin(request);\n\n return json(await admin.rest.resources.Product.count({ session }));\n}", + "title": "/app/routes/**\\/*.jsx" + } + ] + } + ] + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "PropertySignature", + "name": "unauthenticated", + "value": "Unauthenticated>", + "description": "Ways to get Contexts from requests that do not originate from Shopify.", + "examples": [ + { + "title": "Using unauthenticated contexts", + "description": "Create contexts for requests that don't come from Shopify.", + "tabs": [ + { + "code": "import { LATEST_API_VERSION, shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;", + "title": "/app/shopify.server.ts" + }, + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticateExternal } from \"~/helpers/authenticate\"\nimport shopify from \"../../shopify.server\";\n\nexport async function loader({ request }: LoaderFunctionArgs) {\n const shop = await authenticateExternal(request)\n const {admin} = await shopify.unauthenticated.admin(shop);\n\n return json(await admin.rest.resources.Product.count({ session }));\n}", + "title": "/app/routes/**\\/*.jsx" + } + ] + } + ] + } + ] + }, + "SessionStorageType": { + "filePath": "src/server/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "SessionStorageType", + "value": "Config['sessionStorage'] extends SessionStorage\n ? Config['sessionStorage']\n : SessionStorage", + "description": "" + }, + "AddDocumentResponseHeaders": { + "filePath": "src/server/types.ts", + "name": "AddDocumentResponseHeaders", + "description": "", + "params": [ + { + "name": "request", + "description": "", + "value": "Request", + "filePath": "src/server/types.ts" + }, + { + "name": "headers", + "description": "", + "value": "Headers", + "filePath": "src/server/types.ts" + } + ], + "returns": { + "filePath": "src/server/types.ts", + "description": "", + "name": "void", + "value": "void" + }, + "value": "type AddDocumentResponseHeaders = (request: Request, headers: Headers) => void;" + }, + "Headers": { + "filePath": "../../node_modules/@shopify/shopify-api/runtime/http/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "Headers", + "value": "Record", + "description": "", + "members": [] + }, + "RegisterWebhooks": { + "filePath": "src/server/types.ts", + "name": "RegisterWebhooks", + "description": "", + "params": [ + { + "name": "options", + "description": "", + "value": "RegisterWebhooksOptions", + "filePath": "src/server/types.ts" + } + ], + "returns": { + "filePath": "src/server/types.ts", + "description": "", + "name": "Promise", + "value": "Promise" + }, + "value": "type RegisterWebhooks = (\n options: RegisterWebhooksOptions,\n) => Promise;" + }, + "RegisterWebhooksOptions": { + "filePath": "src/server/authenticate/webhooks/types.ts", + "name": "RegisterWebhooksOptions", + "description": "", + "members": [ + { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "PropertySignature", + "name": "session", + "value": "Session", + "description": "The Shopify session used to register webhooks using the Admin API." + } + ], + "value": "export interface RegisterWebhooksOptions {\n /**\n * The Shopify session used to register webhooks using the Admin API.\n */\n session: Session;\n}" + }, + "RegisterReturn": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "RegisterReturn", + "value": "Record", + "description": "", + "members": [] + }, + "Authenticate": { + "filePath": "src/server/types.ts", + "name": "Authenticate", + "description": "", + "members": [ + { + "filePath": "src/server/types.ts", + "syntaxKind": "PropertySignature", + "name": "admin", + "value": "AuthenticateAdmin>", + "description": "Authenticate an admin Request and get back an authenticated admin context. Use the authenticated admin context to interact with Shopify.\n\nExamples of when to use this are requests from your app's UI, or requests from admin extensions.\n\nIf there is no session for the Request, this will redirect the merchant to correct auth flows.", + "examples": [ + { + "title": "Authenticating a request for an embedded app", + "description": "", + "tabs": [ + { + "code": "import { LATEST_API_VERSION, shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "/app/shopify.server.ts" + }, + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../../shopify.server\";\n\nexport async function loader({ request }: LoaderFunctionArgs) {\n const {admin, session, sessionToken, billing} = authenticate.admin(request);\n\n return json(await admin.rest.resources.Product.count({ session }));\n}", + "title": "/app/routes/**\\/*.jsx" + } + ] + } + ] + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "PropertySignature", + "name": "public", + "value": "AuthenticatePublic", + "description": "Authenticate a public request and get back a session token.", + "examples": [ + { + "title": "Authenticating a request from a checkout extension", + "description": "", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../../shopify.server\";\nimport { getWidgets } from \"~/db/widgets\";\n\nexport async function loader({ request }: LoaderFunctionArgs) {\n const {sessionToken} = authenticate.public.checkout(request);\n\n return json(await getWidgets(sessionToken));\n}", + "title": "/app/routes/api/checkout.jsx" + } + ] + } + ] + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "PropertySignature", + "name": "webhook", + "value": "AuthenticateWebhook<\n Config['future'],\n RestResourcesType,\n keyof Config['webhooks'] | MandatoryTopics\n >", + "description": "Authenticate a Shopify webhook request, get back an authenticated admin context and details on the webhook request", + "examples": [ + { + "title": "Authenticating a webhook request", + "description": "", + "tabs": [ + { + "code": "import { DeliveryMethod, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n webhooks: {\n APP_UNINSTALLED: {\n deliveryMethod: DeliveryMethod.Http,\n callbackUrl: \"/webhooks\",\n },\n },\n hooks: {\n afterAuth: async ({ session }) => {\n shopify.registerWebhooks({ session });\n },\n },\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "/app/shopify.server.ts" + }, + { + "code": "import { ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport db from \"../db.server\";\n\nexport const action = async ({ request }: ActionFunctionArgs) => {\n const { topic, shop, session } = await authenticate.webhook(request);\n\n switch (topic) {\n case \"APP_UNINSTALLED\":\n if (session) {\n await db.session.deleteMany({ where: { shop } });\n }\n break;\n case \"CUSTOMERS_DATA_REQUEST\":\n case \"CUSTOMERS_REDACT\":\n case \"SHOP_REDACT\":\n default:\n throw new Response(\"Unhandled webhook topic\", { status: 404 });\n }\n\n throw new Response();\n};", + "title": "/app/routes/webhooks.ts" + } + ] + } + ] + } + ], + "value": "interface Authenticate {\n /**\n * Authenticate an admin Request and get back an authenticated admin context. Use the authenticated admin context to interact with Shopify.\n *\n * Examples of when to use this are requests from your app's UI, or requests from admin extensions.\n *\n * If there is no session for the Request, this will redirect the merchant to correct auth flows.\n *\n * @example\n * Authenticating a request for an embedded app.\n * ```ts\n * // /app/shopify.server.ts\n * import { LATEST_API_VERSION, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n * ```ts\n * // /app/routes/**\\/*.jsx\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../../shopify.server\";\n *\n * export async function loader({ request }: LoaderFunctionArgs) {\n * const {admin, session, sessionToken, billing} = authenticate.admin(request);\n *\n * return json(await admin.rest.resources.Product.count({ session }));\n * }\n * ```\n */\n admin: AuthenticateAdmin>;\n\n /**\n * Authenticate a public request and get back a session token.\n *\n * @example\n * Authenticating a request from a checkout extension\n *\n * ```ts\n * // /app/routes/api/checkout.jsx\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../../shopify.server\";\n * import { getWidgets } from \"~/db/widgets\";\n *\n * export async function loader({ request }: LoaderFunctionArgs) {\n * const {sessionToken} = authenticate.public.checkout(request);\n *\n * return json(await getWidgets(sessionToken));\n * }\n * ```\n */\n public: AuthenticatePublic;\n\n /**\n * Authenticate a Shopify webhook request, get back an authenticated admin context and details on the webhook request\n *\n * @example\n * Authenticating a webhook request\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { DeliveryMethod, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n *\n * const shopify = shopifyApp({\n * webhooks: {\n * APP_UNINSTALLED: {\n * deliveryMethod: DeliveryMethod.Http,\n * callbackUrl: \"/webhooks\",\n * },\n * },\n * hooks: {\n * afterAuth: async ({ session }) => {\n * shopify.registerWebhooks({ session });\n * },\n * },\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n * ```ts\n * // /app/routes/webhooks.ts\n * import { ActionFunctionArgs } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n * import db from \"../db.server\";\n *\n * export const action = async ({ request }: ActionFunctionArgs) => {\n * const { topic, shop, session } = await authenticate.webhook(request);\n *\n * switch (topic) {\n * case \"APP_UNINSTALLED\":\n * if (session) {\n * await db.session.deleteMany({ where: { shop } });\n * }\n * break;\n * case \"CUSTOMERS_DATA_REQUEST\":\n * case \"CUSTOMERS_REDACT\":\n * case \"SHOP_REDACT\":\n * default:\n * throw new Response(\"Unhandled webhook topic\", { status: 404 });\n * }\n *\n * throw new Response();\n * };\n * ```\n */\n webhook: AuthenticateWebhook<\n Config['future'],\n RestResourcesType,\n keyof Config['webhooks'] | MandatoryTopics\n >;\n}" + }, + "AuthenticateAdmin": { + "filePath": "src/server/types.ts", + "name": "AuthenticateAdmin", + "description": "", + "params": [ + { + "name": "request", + "description": "", + "value": "Request", + "filePath": "src/server/types.ts" + } + ], + "returns": { + "filePath": "src/server/types.ts", + "description": "", + "name": "Promise>", + "value": "Promise>" + }, + "value": "type AuthenticateAdmin<\n Config extends AppConfigArg,\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> = (request: Request) => Promise>;" + }, + "AdminContext": { + "filePath": "src/server/authenticate/admin/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "AdminContext", + "value": "Config['isEmbeddedApp'] extends false\n ? NonEmbeddedAdminContext\n : EmbeddedAdminContext", + "description": "" + }, + "NonEmbeddedAdminContext": { + "filePath": "src/server/authenticate/admin/types.ts", + "name": "NonEmbeddedAdminContext", + "description": "", + "members": [ + { + "filePath": "src/server/authenticate/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "session", + "value": "Session", + "description": "The session for the user who made the request.\n\nThis comes from the session storage which `shopifyApp` uses to store sessions in your database of choice.\n\nUse this to get shop or user-specific data.", + "examples": [ + { + "title": "Using offline sessions", + "description": "Get your app's shop-specific data using an offline session.", + "tabs": [ + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "shopify.server.ts" + }, + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session } = await authenticate.admin(request);\n return json(await getMyAppData({shop: session.shop));\n};", + "title": "/app/routes/**\\/*.ts" + } + ] + }, + { + "title": "Using online sessions", + "description": "Get your app's user-specific data using an online session.", + "tabs": [ + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n useOnlineTokens: true,\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "shopify.server.ts" + }, + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session } = await authenticate.admin(request);\n return json(await getMyAppData({user: session.onlineAccessInfo!.id}));\n};", + "title": "/app/routes/**\\/*.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "admin", + "value": "AdminApiContext", + "description": "Methods for interacting with the GraphQL / REST Admin APIs for the store that made the request." + }, + { + "filePath": "src/server/authenticate/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "billing", + "value": "BillingContext", + "description": "Billing methods for this store, based on the plans defined in the `billing` config option.\n\n\n\n\n" + }, + { + "filePath": "src/server/authenticate/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "cors", + "value": "EnsureCORSFunction", + "description": "A function that ensures the CORS headers are set correctly for the response.", + "examples": [ + { + "title": "Setting CORS headers for a admin request", + "description": "Use the `cors` helper to ensure your app can respond to requests from admin extensions.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session, cors } = await authenticate.admin(request);\n return cors(json(await getMyAppData({user: session.onlineAccessInfo!.id})));\n};", + "title": "/app/routes/admin/my-route.ts" + } + ] + } + ] + } + ], + "value": "export interface NonEmbeddedAdminContext<\n Config extends AppConfigArg,\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> extends AdminContextInternal {}" + }, + "BillingContext": { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "name": "BillingContext", + "description": "", + "members": [ + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "require", + "value": "(options: RequireBillingOptions) => Promise", + "description": "Checks if the shop has an active payment for any plan defined in the `billing` config option.", + "examples": [ + { + "title": "Requesting billing right away", + "description": "Call `billing.request` in the `onFailure` callback to immediately redirect to the Shopify page to request payment.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs } from \"@remix-run/node\";\nimport { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { billing } = await authenticate.admin(request);\n await billing.require({\n plans: [MONTHLY_PLAN],\n isTest: true,\n onFailure: async () => billing.request({ plan: MONTHLY_PLAN }),\n });\n\n // App logic\n};", + "title": "/app/routes/**\\/*.ts" + }, + { + "code": "import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n\nexport const MONTHLY_PLAN = 'Monthly subscription';\nexport const ANNUAL_PLAN = 'Annual subscription';\n\nconst shopify = shopifyApp({\n // ...etc\n billing: {\n [MONTHLY_PLAN]: {\n amount: 5,\n currencyCode: 'USD',\n interval: BillingInterval.Every30Days,\n },\n [ANNUAL_PLAN]: {\n amount: 50,\n currencyCode: 'USD',\n interval: BillingInterval.Annual,\n },\n }\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "shopify.server.ts" + } + ] + }, + { + "title": "Using a plan selection page", + "description": "When the app has multiple plans, create a page in your App that allows the merchant to select a plan. If a merchant does not have the required plan you can redirect them to page in your app to select one.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, redirect } from \"@remix-run/node\";\nimport { authenticate, MONTHLY_PLAN, ANNUAL_PLAN } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { billing } = await authenticate.admin(request);\n const billingCheck = await billing.require({\n plans: [MONTHLY_PLAN, ANNUAL_PLAN],\n isTest: true,\n onFailure: () => redirect('/select-plan'),\n });\n\n const subscription = billingCheck.appSubscriptions[0];\n console.log(`Shop is on ${subscription.name} (id ${subscription.id})`);\n\n // App logic\n};", + "title": "/app/routes/**\\/*.ts" + }, + { + "code": "import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n\nexport const MONTHLY_PLAN = 'Monthly subscription';\nexport const ANNUAL_PLAN = 'Annual subscription';\n\nconst shopify = shopifyApp({\n // ...etc\n billing: {\n [MONTHLY_PLAN]: {\n amount: 5,\n currencyCode: 'USD',\n interval: BillingInterval.Every30Days,\n },\n [ANNUAL_PLAN]: {\n amount: 50,\n currencyCode: 'USD',\n interval: BillingInterval.Annual,\n },\n }\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "shopify.server.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "request", + "value": "(options: RequestBillingOptions) => Promise", + "description": "Requests payment for the plan.", + "examples": [ + { + "title": "Using a custom return URL", + "description": "Change where the merchant is returned to after approving the purchase using the `returnUrl` option.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs } from \"@remix-run/node\";\nimport { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { billing } = await authenticate.admin(request);\n await billing.require({\n plans: [MONTHLY_PLAN],\n onFailure: async () => billing.request({\n plan: MONTHLY_PLAN,\n isTest: true,\n returnUrl: 'https://admin.shopify.com/store/my-store/apps/my-app/billing-page',\n }),\n });\n\n // App logic\n};", + "title": "/app/routes/**\\/*.ts" + }, + { + "code": "import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n\nexport const MONTHLY_PLAN = 'Monthly subscription';\nexport const ANNUAL_PLAN = 'Annual subscription';\n\nconst shopify = shopifyApp({\n // ...etc\n billing: {\n [MONTHLY_PLAN]: {\n amount: 5,\n currencyCode: 'USD',\n interval: BillingInterval.Every30Days,\n },\n [ANNUAL_PLAN]: {\n amount: 50,\n currencyCode: 'USD',\n interval: BillingInterval.Annual,\n },\n }\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "shopify.server.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "cancel", + "value": "(options: CancelBillingOptions) => Promise", + "description": "Cancels an ongoing subscription, given its ID.", + "examples": [ + { + "title": "Cancelling a subscription", + "description": "Use the `billing.cancel` function to cancel an active subscription with the id returned from `billing.require`.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs } from \"@remix-run/node\";\nimport { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { billing } = await authenticate.admin(request);\n const billingCheck = await billing.require({\n plans: [MONTHLY_PLAN],\n onFailure: async () => billing.request({ plan: MONTHLY_PLAN }),\n });\n\n const subscription = billingCheck.appSubscriptions[0];\n const cancelledSubscription = await billing.cancel({\n subscriptionId: subscription.id,\n isTest: true,\n prorate: true,\n });\n\n // App logic\n};", + "title": "/app/routes/cancel-subscription.ts" + }, + { + "code": "import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n\nexport const MONTHLY_PLAN = 'Monthly subscription';\nexport const ANNUAL_PLAN = 'Annual subscription';\n\nconst shopify = shopifyApp({\n // ...etc\n billing: {\n [MONTHLY_PLAN]: {\n amount: 5,\n currencyCode: 'USD',\n interval: BillingInterval.Every30Days,\n },\n [ANNUAL_PLAN]: {\n amount: 50,\n currencyCode: 'USD',\n interval: BillingInterval.Annual,\n },\n }\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "shopify.server.ts" + } + ] + } + ] + } + ], + "value": "export interface BillingContext {\n /**\n * Checks if the shop has an active payment for any plan defined in the `billing` config option.\n *\n * @returns A promise that resolves to an object containing the active purchases for the shop.\n *\n * @example\n * Requesting billing right away.\n * Call `billing.request` in the `onFailure` callback to immediately redirect to the Shopify page to request payment.\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * await billing.require({\n * plans: [MONTHLY_PLAN],\n * isTest: true,\n * onFailure: async () => billing.request({ plan: MONTHLY_PLAN }),\n * });\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n *\n * @example\n * Using a plan selection page.\n * When the app has multiple plans, create a page in your App that allows the merchant to select a plan. If a merchant does not have the required plan you can redirect them to page in your app to select one.\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, redirect } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN, ANNUAL_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * const billingCheck = await billing.require({\n * plans: [MONTHLY_PLAN, ANNUAL_PLAN],\n * isTest: true,\n * onFailure: () => redirect('/select-plan'),\n * });\n *\n * const subscription = billingCheck.appSubscriptions[0];\n * console.log(`Shop is on ${subscription.name} (id ${subscription.id})`);\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n require: (\n options: RequireBillingOptions,\n ) => Promise;\n\n /**\n * Requests payment for the plan.\n *\n * @returns Redirects to the confirmation URL for the payment.\n *\n * @example\n * Using a custom return URL.\n * Change where the merchant is returned to after approving the purchase using the `returnUrl` option.\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * await billing.require({\n * plans: [MONTHLY_PLAN],\n * onFailure: async () => billing.request({\n * plan: MONTHLY_PLAN,\n * isTest: true,\n * returnUrl: 'https://admin.shopify.com/store/my-store/apps/my-app/billing-page',\n * }),\n * });\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n request: (options: RequestBillingOptions) => Promise;\n\n /**\n * Cancels an ongoing subscription, given its ID.\n *\n * @returns The cancelled subscription.\n *\n * @example\n * Cancelling a subscription.\n * Use the `billing.cancel` function to cancel an active subscription with the id returned from `billing.require`.\n * ```ts\n * // /app/routes/cancel-subscription.ts\n * import { LoaderFunctionArgs } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * const billingCheck = await billing.require({\n * plans: [MONTHLY_PLAN],\n * onFailure: async () => billing.request({ plan: MONTHLY_PLAN }),\n * });\n *\n * const subscription = billingCheck.appSubscriptions[0];\n * const cancelledSubscription = await billing.cancel({\n * subscriptionId: subscription.id,\n * isTest: true,\n * prorate: true,\n * });\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n cancel: (options: CancelBillingOptions) => Promise;\n}" + }, + "RequireBillingOptions": { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "name": "RequireBillingOptions", + "description": "", + "members": [ + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "plans", + "value": "(keyof Config[\"billing\"])[]", + "description": "The plans to check for. Must be one of the values defined in the `billing` config option." + }, + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "onFailure", + "value": "(error: any) => Promise", + "description": "How to handle the request if the shop doesn't have an active payment for any plan." + }, + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "isTest", + "value": "boolean", + "description": "", + "isOptional": true + } + ], + "value": "export interface RequireBillingOptions\n extends Omit {\n /**\n * The plans to check for. Must be one of the values defined in the `billing` config option.\n */\n plans: (keyof Config['billing'])[];\n /**\n * How to handle the request if the shop doesn't have an active payment for any plan.\n */\n onFailure: (error: any) => Promise;\n}" + }, + "BillingCheckResponseObject": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingCheckResponseObject", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "hasActivePayment", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "oneTimePurchases", + "value": "OneTimePurchase[]", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "appSubscriptions", + "value": "AppSubscription[]", + "description": "" + } + ], + "value": "export interface BillingCheckResponseObject {\n hasActivePayment: boolean;\n oneTimePurchases: OneTimePurchase[];\n appSubscriptions: AppSubscription[];\n}" + }, + "OneTimePurchase": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "OneTimePurchase", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "id", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "name", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "test", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "status", + "value": "string", + "description": "" + } + ], + "value": "export interface OneTimePurchase {\n id: string;\n name: string;\n test: boolean;\n status: string;\n}" + }, + "AppSubscription": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "AppSubscription", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "id", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "name", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "test", + "value": "boolean", + "description": "" + } + ], + "value": "export interface AppSubscription {\n id: string;\n name: string;\n test: boolean;\n}" + }, + "RequestBillingOptions": { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "name": "RequestBillingOptions", + "description": "", + "members": [ + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "plan", + "value": "keyof Config[\"billing\"]", + "description": "The plan to request. Must be one of the values defined in the `billing` config option." + }, + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "isTest", + "value": "boolean", + "description": "Whether to use the test mode. This prevents the credit card from being charged. Test shops and demo shops cannot be charged.", + "isOptional": true + }, + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "returnUrl", + "value": "string", + "description": "The URL to return to after the merchant approves the payment.", + "isOptional": true + } + ], + "value": "export interface RequestBillingOptions\n extends Omit {\n /**\n * The plan to request. Must be one of the values defined in the `billing` config option.\n */\n plan: keyof Config['billing'];\n /**\n * Whether to use the test mode. This prevents the credit card from being charged. Test shops and demo shops cannot be charged.\n */\n isTest?: boolean;\n /**\n * The URL to return to after the merchant approves the payment.\n */\n returnUrl?: string;\n}" + }, + "CancelBillingOptions": { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "name": "CancelBillingOptions", + "description": "", + "members": [ + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "subscriptionId", + "value": "string", + "description": "The ID of the subscription to cancel." + }, + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "prorate", + "value": "boolean", + "description": "Whether to prorate the cancellation.\n\n\n\n\n", + "isOptional": true + }, + { + "filePath": "src/server/authenticate/admin/billing/types.ts", + "syntaxKind": "PropertySignature", + "name": "isTest", + "value": "boolean", + "description": "", + "isOptional": true + } + ], + "value": "export interface CancelBillingOptions {\n /**\n * The ID of the subscription to cancel.\n */\n subscriptionId: string;\n /**\n * Whether to prorate the cancellation.\n *\n * {@link https://shopify.dev/docs/apps/billing/subscriptions/cancel-recurring-charges}\n */\n prorate?: boolean;\n /*\n * Whether to use the test mode. This prevents the credit card from being charged. Test shops and demo shops cannot be charged.\n */\n isTest?: boolean;\n}" + }, + "EnsureCORSFunction": { + "filePath": "src/server/authenticate/helpers/ensure-cors-headers.ts", + "name": "EnsureCORSFunction", + "description": "", + "members": [], + "value": "export interface EnsureCORSFunction {\n (response: Response): Response;\n}" + }, + "EmbeddedAdminContext": { + "filePath": "src/server/authenticate/admin/types.ts", + "name": "EmbeddedAdminContext", + "description": "", + "members": [ + { + "filePath": "src/server/authenticate/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "sessionToken", + "value": "JwtPayload", + "description": "The decoded and validated session token for the request.\n\nReturned only if `isEmbeddedApp` is `true`.\n\n\n\n\n", + "examples": [ + { + "title": "Using the decoded session token", + "description": "Get user-specific data using the `sessionToken` object.", + "tabs": [ + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n useOnlineTokens: true,\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "shopify.server.ts" + }, + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { sessionToken } = await authenticate.public.checkout(\n request\n );\n return json(await getMyAppData({user: sessionToken.sub}));\n};", + "title": "/app/routes/**\\/*.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "redirect", + "value": "RedirectFunction", + "description": "A function that redirects the user to a new page, ensuring that the appropriate parameters are set for embedded apps.\n\nReturned only if `isEmbeddedApp` is `true`.", + "examples": [ + { + "title": "Redirecting to an app route", + "description": "Use the `redirect` helper to safely redirect between pages.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session, redirect } = await authenticate.admin(request);\n return redirect(\"/\");\n};", + "title": "/app/routes/admin/my-route.ts" + } + ] + }, + { + "title": "Redirecting outside of Shopify admin", + "description": "Pass in a `target` option of `_top` or `_parent` to go to an external URL.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session, redirect } = await authenticate.admin(request);\n return redirect(\"/\", { target: '_parent' });\n};", + "title": "/app/routes/admin/my-route.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "session", + "value": "Session", + "description": "The session for the user who made the request.\n\nThis comes from the session storage which `shopifyApp` uses to store sessions in your database of choice.\n\nUse this to get shop or user-specific data.", + "examples": [ + { + "title": "Using offline sessions", + "description": "Get your app's shop-specific data using an offline session.", + "tabs": [ + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "shopify.server.ts" + }, + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session } = await authenticate.admin(request);\n return json(await getMyAppData({shop: session.shop));\n};", + "title": "/app/routes/**\\/*.ts" + } + ] + }, + { + "title": "Using online sessions", + "description": "Get your app's user-specific data using an online session.", + "tabs": [ + { + "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n useOnlineTokens: true,\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", + "title": "shopify.server.ts" + }, + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session } = await authenticate.admin(request);\n return json(await getMyAppData({user: session.onlineAccessInfo!.id}));\n};", + "title": "/app/routes/**\\/*.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "admin", + "value": "AdminApiContext", + "description": "Methods for interacting with the GraphQL / REST Admin APIs for the store that made the request." + }, + { + "filePath": "src/server/authenticate/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "billing", + "value": "BillingContext", + "description": "Billing methods for this store, based on the plans defined in the `billing` config option.\n\n\n\n\n" + }, + { + "filePath": "src/server/authenticate/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "cors", + "value": "EnsureCORSFunction", + "description": "A function that ensures the CORS headers are set correctly for the response.", + "examples": [ + { + "title": "Setting CORS headers for a admin request", + "description": "Use the `cors` helper to ensure your app can respond to requests from admin extensions.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session, cors } = await authenticate.admin(request);\n return cors(json(await getMyAppData({user: session.onlineAccessInfo!.id})));\n};", + "title": "/app/routes/admin/my-route.ts" + } + ] + } + ] + } + ], + "value": "export interface EmbeddedAdminContext<\n Config extends AppConfigArg,\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> extends AdminContextInternal {\n /**\n * The decoded and validated session token for the request.\n *\n * Returned only if `isEmbeddedApp` is `true`.\n *\n * {@link https://shopify.dev/docs/apps/auth/oauth/session-tokens#payload}\n *\n * @example\n * Using the decoded session token.\n * Get user-specific data using the `sessionToken` object.\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n *\n * const shopify = shopifyApp({\n * // ...etc\n * useOnlineTokens: true,\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n * import { getMyAppData } from \"~/db/model.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { sessionToken } = await authenticate.public.checkout(\n * request\n * );\n * return json(await getMyAppData({user: sessionToken.sub}));\n * };\n * ```\n */\n sessionToken: JwtPayload;\n\n /**\n * A function that redirects the user to a new page, ensuring that the appropriate parameters are set for embedded\n * apps.\n *\n * Returned only if `isEmbeddedApp` is `true`.\n *\n * @example\n * Redirecting to an app route.\n * Use the `redirect` helper to safely redirect between pages.\n * ```ts\n * // /app/routes/admin/my-route.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { session, redirect } = await authenticate.admin(request);\n * return redirect(\"/\");\n * };\n * ```\n *\n * @example\n * Redirecting outside of Shopify admin.\n * Pass in a `target` option of `_top` or `_parent` to go to an external URL.\n * ```ts\n * // /app/routes/admin/my-route.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { session, redirect } = await authenticate.admin(request);\n * return redirect(\"/\", { target: '_parent' });\n * };\n * ```\n */\n redirect: RedirectFunction;\n}" + }, + "JwtPayload": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "name": "JwtPayload", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "iss", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "dest", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "aud", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "sub", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "exp", + "value": "number", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "nbf", + "value": "number", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "iat", + "value": "number", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "jti", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "sid", + "value": "string", + "description": "" + } + ], + "value": "export interface JwtPayload {\n iss: string;\n dest: string;\n aud: string;\n sub: string;\n exp: number;\n nbf: number;\n iat: number;\n jti: string;\n sid: string;\n}" + }, + "RedirectFunction": { + "filePath": "src/server/authenticate/admin/helpers/redirect.ts", + "name": "RedirectFunction", + "description": "", + "params": [ + { + "name": "url", + "description": "", + "value": "string", + "filePath": "src/server/authenticate/admin/helpers/redirect.ts" + }, + { + "name": "init", + "description": "", + "value": "RedirectInit", + "isOptional": true, + "filePath": "src/server/authenticate/admin/helpers/redirect.ts" + } + ], + "returns": { + "filePath": "src/server/authenticate/admin/helpers/redirect.ts", + "description": "", + "name": "TypedResponse", + "value": "TypedResponse" + }, + "value": "export type RedirectFunction = (\n url: string,\n init?: RedirectInit,\n) => TypedResponse;" + }, + "RedirectInit": { + "filePath": "src/server/authenticate/admin/helpers/redirect.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "RedirectInit", + "value": "number | (ResponseInit & {target?: RedirectTarget})", + "description": "" + }, + "RedirectTarget": { + "filePath": "src/server/authenticate/admin/helpers/redirect.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "RedirectTarget", + "value": "'_self' | '_parent' | '_top'", + "description": "" + }, + "RestResourcesType": { + "filePath": "src/server/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "RestResourcesType", + "value": "Config['restResources'] extends ShopifyRestResources\n ? Config['restResources']\n : ShopifyRestResources", + "description": "" + }, + "AuthenticatePublic": { + "filePath": "src/server/authenticate/public/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "AuthenticatePublic", + "value": "FeatureEnabled extends true\n ? AuthenticatePublicObject\n : AuthenticatePublicLegacy", + "description": "" + }, + "AuthenticatePublicObject": { + "filePath": "src/server/authenticate/public/types.ts", + "name": "AuthenticatePublicObject", + "description": "", + "members": [ + { + "filePath": "src/server/authenticate/public/types.ts", + "syntaxKind": "PropertySignature", + "name": "checkout", + "value": "AuthenticateCheckout", + "description": "Authenticate a request from a checkout extension", + "examples": [ + { + "title": "Authenticating a checkout extension request", + "description": "", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { sessionToken, cors } = await authenticate.public.checkout(\n request,\n );\n return cors(json({my: \"data\", shop: sessionToken.dest}));\n};", + "title": "/app/routes/public/widgets.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/public/types.ts", + "syntaxKind": "PropertySignature", + "name": "appProxy", + "value": "AuthenticateAppProxy", + "description": "Authenticate a request from an app proxy", + "examples": [ + { + "title": "Authenticating an app proxy request", + "description": "", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n await authenticate.public.appProxy(\n request,\n );\n\n const {searchParams} = new URL(request.url);\n const shop = searchParams.get(\"shop\");\n const customerId = searchParams.get(\"logged_in_customer_id\")\n\n return json({my: \"data\", shop, customerId});\n};", + "title": "/app/routes/public/widgets.ts" + } + ] + } + ] + } + ], + "value": "export interface AuthenticatePublicObject {\n /**\n * Authenticate a request from a checkout extension\n *\n * @example\n * Authenticating a checkout extension request\n * ```ts\n * // /app/routes/public/widgets.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { sessionToken, cors } = await authenticate.public.checkout(\n * request,\n * );\n * return cors(json({my: \"data\", shop: sessionToken.dest}));\n * };\n * ```\n */\n checkout: AuthenticateCheckout;\n\n /**\n * Authenticate a request from an app proxy\n *\n * @example\n * Authenticating an app proxy request\n * ```ts\n * // /app/routes/public/widgets.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * await authenticate.public.appProxy(\n * request,\n * );\n *\n * const {searchParams} = new URL(request.url);\n * const shop = searchParams.get(\"shop\");\n * const customerId = searchParams.get(\"logged_in_customer_id\")\n *\n * return json({my: \"data\", shop, customerId});\n * };\n * ```\n */\n appProxy: AuthenticateAppProxy;\n}" + }, + "AuthenticateCheckout": { + "filePath": "src/server/authenticate/public/checkout/types.ts", + "name": "AuthenticateCheckout", + "description": "", + "params": [ + { + "name": "request", + "description": "", + "value": "Request", + "filePath": "src/server/authenticate/public/checkout/types.ts" + }, + { + "name": "options", + "description": "", + "value": "AuthenticateCheckoutOptions", + "isOptional": true, + "filePath": "src/server/authenticate/public/checkout/types.ts" + } + ], + "returns": { + "filePath": "src/server/authenticate/public/checkout/types.ts", + "description": "", + "name": "Promise", + "value": "Promise" + }, + "value": "export type AuthenticateCheckout = (\n request: Request,\n options?: AuthenticateCheckoutOptions,\n) => Promise;" + }, + "AuthenticateCheckoutOptions": { + "filePath": "src/server/authenticate/public/checkout/types.ts", + "name": "AuthenticateCheckoutOptions", + "description": "", + "members": [ + { + "filePath": "src/server/authenticate/public/checkout/types.ts", + "syntaxKind": "PropertySignature", + "name": "corsHeaders", + "value": "string[]", + "description": "", + "isOptional": true + } + ], + "value": "export interface AuthenticateCheckoutOptions {\n corsHeaders?: string[];\n}" + }, + "CheckoutContext": { + "filePath": "src/server/authenticate/public/checkout/types.ts", + "name": "CheckoutContext", + "description": "Authenticated Context for a checkout request", + "members": [ + { + "filePath": "src/server/authenticate/public/checkout/types.ts", + "syntaxKind": "PropertySignature", + "name": "sessionToken", + "value": "JwtPayload", + "description": "The decoded and validated session token for the request\n\nRefer to the OAuth docs for the [session token payload](https://shopify.dev/docs/apps/auth/oauth/session-tokens#payload).", + "examples": [ + { + "title": "Using the decoded session token", + "description": "Get store-specific data using the `sessionToken` object.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { sessionToken } = await authenticate.public.checkout(\n request\n );\n return json(await getMyAppData({shop: sessionToken.dest}));\n};", + "title": "app/routes/public/my-route.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/public/checkout/types.ts", + "syntaxKind": "PropertySignature", + "name": "cors", + "value": "EnsureCORSFunction", + "description": "A function that ensures the CORS headers are set correctly for the response.", + "examples": [ + { + "title": "Setting CORS headers for a public request", + "description": "Use the `cors` helper to ensure your app can respond to checkout extension requests.", + "tabs": [ + { + "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { sessionToken, cors } = await authenticate.public.checkout(\n request,\n { corsHeaders: [\"X-My-Custom-Header\"] }\n );\n const data = await getMyAppData({shop: sessionToken.dest});\n return cors(json(data));\n};", + "title": "app/routes/public/my-route.ts" + } + ] + } + ] + } + ], + "value": "export interface CheckoutContext {\n /**\n * The decoded and validated session token for the request\n *\n * Refer to the OAuth docs for the [session token payload](https://shopify.dev/docs/apps/auth/oauth/session-tokens#payload).\n *\n * @example\n * Using the decoded session token.\n * Get store-specific data using the `sessionToken` object.\n * ```ts\n * // app/routes/public/my-route.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n * import { getMyAppData } from \"~/db/model.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { sessionToken } = await authenticate.public.checkout(\n * request\n * );\n * return json(await getMyAppData({shop: sessionToken.dest}));\n * };\n * ```\n */\n sessionToken: JwtPayload;\n\n /**\n * A function that ensures the CORS headers are set correctly for the response.\n *\n * @example\n * Setting CORS headers for a public request.\n * Use the `cors` helper to ensure your app can respond to checkout extension requests.\n * ```ts\n * // app/routes/public/my-route.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n * import { getMyAppData } from \"~/db/model.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { sessionToken, cors } = await authenticate.public.checkout(\n * request,\n * { corsHeaders: [\"X-My-Custom-Header\"] }\n * );\n * const data = await getMyAppData({shop: sessionToken.dest});\n * return cors(json(data));\n * };\n * ```\n */\n cors: EnsureCORSFunction;\n}" + }, + "AuthenticateAppProxy": { + "filePath": "src/server/authenticate/public/appProxy/types.ts", + "name": "AuthenticateAppProxy", + "description": "", + "params": [ + { + "name": "request", + "description": "", + "value": "Request", + "filePath": "src/server/authenticate/public/appProxy/types.ts" + } + ], + "returns": { + "filePath": "src/server/authenticate/public/appProxy/types.ts", + "description": "", + "name": "Promise", + "value": "Promise" + }, + "value": "export type AuthenticateAppProxy = (\n request: Request,\n) => Promise;" + }, + "AppProxyContext": { + "filePath": "src/server/authenticate/public/appProxy/types.ts", + "name": "AppProxyContext", + "description": "", + "members": [ + { + "filePath": "src/server/authenticate/public/appProxy/types.ts", + "syntaxKind": "PropertySignature", + "name": "session", + "value": "undefined", + "description": "No session is available for the shop that made this request.\n\nThis comes from the session storage which `shopifyApp` uses to store sessions in your database of choice." + }, + { + "filePath": "src/server/authenticate/public/appProxy/types.ts", + "syntaxKind": "PropertySignature", + "name": "admin", + "value": "undefined", + "description": "No session is available for the shop that made this request. Therefore no methods for interacting with the GraphQL / REST Admin APIs are available." + }, + { + "filePath": "src/server/authenticate/public/appProxy/types.ts", + "syntaxKind": "PropertySignature", + "name": "storefront", + "value": "undefined", + "description": "No session is available for the shop that made this request. Therefore no method for interacting with the Storefront API is available." + }, + { + "filePath": "src/server/authenticate/public/appProxy/types.ts", + "syntaxKind": "PropertySignature", + "name": "liquid", + "value": "LiquidResponseFunction", + "description": "A utility for creating a Liquid Response.", + "examples": [ + { + "title": "Rendering liquid content", + "description": "Use the `liquid` helper to render a `Response` with Liquid content.", + "tabs": [ + { + "code": "import {authenticate} from \"~/shopify.server\"\n\nexport async function loader({ request }) {\n const {liquid} = await authenticate.public.appProxy(request);\n\n return liquid(\"Hello {{shop.name}}\")\n}", + "title": "app/routes/**\\/.ts" + } + ] + } + ] + } + ], + "value": "export interface AppProxyContext extends Context {\n /**\n * No session is available for the shop that made this request.\n *\n * This comes from the session storage which `shopifyApp` uses to store sessions in your database of choice.\n */\n session: undefined;\n\n /**\n * No session is available for the shop that made this request.\n * Therefore no methods for interacting with the GraphQL / REST Admin APIs are available.\n */\n admin: undefined;\n\n /**\n * No session is available for the shop that made this request.\n * Therefore no method for interacting with the Storefront API is available.\n */\n storefront: undefined;\n}" + }, + "LiquidResponseFunction": { + "filePath": "src/server/authenticate/public/appProxy/types.ts", + "name": "LiquidResponseFunction", + "description": "", + "params": [ + { + "name": "body", + "description": "", + "value": "string", + "filePath": "src/server/authenticate/public/appProxy/types.ts" + }, + { + "name": "initAndOptions", + "description": "", + "value": "number | (ResponseInit & Options)", + "isOptional": true, + "filePath": "src/server/authenticate/public/appProxy/types.ts" + } + ], + "returns": { + "filePath": "src/server/authenticate/public/appProxy/types.ts", + "description": "", + "name": "Response", + "value": "Response" + }, + "value": "export type LiquidResponseFunction = (\n body: string,\n initAndOptions?: number | (ResponseInit & Options),\n) => Response;" + }, + "Options": { + "filePath": "src/server/authenticate/public/appProxy/types.ts", + "name": "Options", + "description": "", + "members": [ + { + "filePath": "src/server/authenticate/public/appProxy/types.ts", + "syntaxKind": "PropertySignature", + "name": "layout", + "value": "boolean", + "description": "", + "isOptional": true + } + ], + "value": "interface Options {\n layout?: boolean;\n}" + }, + "AppProxyContextWithSession": { + "filePath": "src/server/authenticate/public/appProxy/types.ts", + "name": "AppProxyContextWithSession", + "description": "", + "members": [ + { + "filePath": "src/server/authenticate/public/appProxy/types.ts", + "syntaxKind": "PropertySignature", + "name": "session", + "value": "Session", + "description": "The session for the shop that made the request.\n\nThis comes from the session storage which `shopifyApp` uses to store sessions in your database of choice.\n\nUse this to get shop or user-specific data.", + "examples": [ + { + "title": "Using the session object", + "description": "Get the session for the shop that initiated the request to the app proxy.", + "tabs": [ + { + "code": "import { json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppModelData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }) => {\n // Get the session for the shop that initiated the request to the app proxy.\n const { session } = await authenticate.public.appProxy(request);\n\n // Use the session data to make to queries to your database or additional requests.\n return json(await getMyAppModelData({shop: session.shop));\n};", + "title": "app/routes/**\\/.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/public/appProxy/types.ts", + "syntaxKind": "PropertySignature", + "name": "admin", + "value": "AdminApiContext", + "description": "Methods for interacting with the GraphQL / REST Admin APIs for the store that made the request.", + "examples": [ + { + "title": "Interacting with the Admin API", + "description": "Use the `admin` object to interact with the REST or GraphQL APIs.", + "tabs": [ + { + "code": "import { json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.public.appProxy(request);\n\n const response = await admin.graphql(\n `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n { variables: { input: { title: \"Product Name\" } } }\n );\n\n const productData = await response.json();\n return json({ data: productData.data });\n}", + "title": "app/routes/**\\/.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/public/appProxy/types.ts", + "syntaxKind": "PropertySignature", + "name": "storefront", + "value": "StorefrontContext", + "description": "Method for interacting with the Shopify Storefront Graphql API for the store that made the request.", + "examples": [ + { + "title": "Interacting with the Storefront API", + "description": "Use the `storefront` object to interact with the GraphQL API.", + "tabs": [ + { + "code": "import { json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { storefront } = await authenticate.public.appProxy(request);\n\n const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);\n\n return json(await response.json());\n}", + "title": "app/routes/**\\/.ts" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/public/appProxy/types.ts", + "syntaxKind": "PropertySignature", + "name": "liquid", + "value": "LiquidResponseFunction", + "description": "A utility for creating a Liquid Response.", + "examples": [ + { + "title": "Rendering liquid content", + "description": "Use the `liquid` helper to render a `Response` with Liquid content.", + "tabs": [ + { + "code": "import {authenticate} from \"~/shopify.server\"\n\nexport async function loader({ request }) {\n const {liquid} = await authenticate.public.appProxy(request);\n\n return liquid(\"Hello {{shop.name}}\")\n}", + "title": "app/routes/**\\/.ts" + } + ] + } + ] + } + ], + "value": "export interface AppProxyContextWithSession<\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> extends Context {\n /**\n * The session for the shop that made the request.\n *\n * This comes from the session storage which `shopifyApp` uses to store sessions in your database of choice.\n *\n * Use this to get shop or user-specific data.\n *\n * @example\n * Using the session object.\n * Get the session for the shop that initiated the request to the app proxy.\n * ```ts\n * // app/routes/**\\/.ts\n * import { json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n * import { getMyAppModelData } from \"~/db/model.server\";\n *\n * export const loader = async ({ request }) => {\n * // Get the session for the shop that initiated the request to the app proxy.\n * const { session } = await authenticate.public.appProxy(request);\n *\n * // Use the session data to make to queries to your database or additional requests.\n * return json(await getMyAppModelData({shop: session.shop));\n * };\n * ```\n */\n session: Session;\n\n /**\n * Methods for interacting with the GraphQL / REST Admin APIs for the store that made the request.\n *\n * @example\n * Interacting with the Admin API.\n * Use the `admin` object to interact with the REST or GraphQL APIs.\n * ```ts\n * // app/routes/**\\/.ts\n * import { json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { admin } = await authenticate.public.appProxy(request);\n *\n * const response = await admin.graphql(\n * `#graphql\n * mutation populateProduct($input: ProductInput!) {\n * productCreate(input: $input) {\n * product {\n * id\n * }\n * }\n * }`,\n * { variables: { input: { title: \"Product Name\" } } }\n * );\n *\n * const productData = await response.json();\n * return json({ data: productData.data });\n * }\n * ```\n */\n admin: AdminApiContext;\n\n /**\n * Method for interacting with the Shopify Storefront Graphql API for the store that made the request.\n *\n * @example\n * Interacting with the Storefront API.\n * Use the `storefront` object to interact with the GraphQL API.\n * ```ts\n * // app/routes/**\\/.ts\n * import { json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { storefront } = await authenticate.public.appProxy(request);\n *\n * const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);\n *\n * return json(await response.json());\n * }\n * ```\n */\n storefront: StorefrontContext;\n}" + }, + "StorefrontContext": { + "filePath": "src/server/clients/storefront/types.ts", + "name": "StorefrontContext", + "description": "", + "members": [ + { + "filePath": "src/server/clients/storefront/types.ts", + "syntaxKind": "PropertySignature", + "name": "graphql", + "value": "GraphQLClient", + "description": "Method for interacting with the Shopify Storefront GraphQL API\n\nIf you're getting incorrect type hints in the Shopify template, follow [these instructions](https://github.com/Shopify/shopify-app-template-remix/tree/main#incorrect-graphql-hints).\n\n\n\n\n", + "examples": [ + { + "title": "Querying the GraphQL API", + "description": "Use `storefront.graphql` to make query / mutation requests.", + "tabs": [ + { + "code": "import { json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { storefront } = await authenticate.public.appProxy(request);\n\n const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);\n\n return json(await response.json());\n}", + "title": "app/routes/**\\/.ts" + } + ] + } + ] + } + ], + "value": "export interface StorefrontContext {\n /**\n * Method for interacting with the Shopify Storefront GraphQL API\n *\n * If you're getting incorrect type hints in the Shopify template, follow [these instructions](https://github.com/Shopify/shopify-app-template-remix/tree/main#incorrect-graphql-hints).\n *\n * {@link https://shopify.dev/docs/api/storefront}\n *\n * @example\n * Querying the GraphQL API.\n * Use `storefront.graphql` to make query / mutation requests.\n * ```ts\n * // app/routes/**\\/.ts\n * import { json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { storefront } = await authenticate.public.appProxy(request);\n *\n * const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);\n *\n * return json(await response.json());\n * }\n * ```\n */\n graphql: GraphQLClient;\n}" + }, + "AuthenticatePublicLegacy": { + "filePath": "src/server/authenticate/public/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "AuthenticatePublicLegacy", + "value": "AuthenticateCheckout & AuthenticatePublicObject", + "description": "Methods for authenticating Requests from Shopify's public surfaces\n\nTo maintain backwards compatability this is a function and an object.\n\nDo not use `authenticate.public()`. Use `authenticate.public.checkout()` instead. `authenticate.public()` will be removed in v2.\n\nMethods are:\n\n- `authenticate.public.checkout()` for authenticating requests from checkout extensions - `authenticate.public.appProxy()` for authenticating requests from app proxies" + }, + "AuthenticateWebhook": { + "filePath": "src/server/authenticate/webhooks/types.ts", + "name": "AuthenticateWebhook", + "description": "", + "params": [ + { + "name": "request", + "description": "", + "value": "Request", + "filePath": "src/server/authenticate/webhooks/types.ts" + } + ], + "returns": { + "filePath": "src/server/authenticate/webhooks/types.ts", + "description": "", + "name": "Promise>", + "value": "Promise>" + }, + "value": "export type AuthenticateWebhook<\n Future extends FutureFlagOptions,\n Resources extends ShopifyRestResources,\n Topics = string | number | symbol,\n> = (request: Request) => Promise>;" + }, + "WebhookContext": { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "WebhookContext", + "value": "WebhookContextWithoutSession | WebhookContextWithSession", + "description": "" + }, + "WebhookContextWithoutSession": { + "filePath": "src/server/authenticate/webhooks/types.ts", + "name": "WebhookContextWithoutSession", + "description": "", + "members": [ + { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "PropertySignature", + "name": "session", + "value": "undefined", + "description": "" + }, + { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "PropertySignature", + "name": "admin", + "value": "undefined", + "description": "" + }, + { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "PropertySignature", + "name": "apiVersion", + "value": "string", + "description": "The API version used for the webhook.", + "examples": [ + { + "title": "Webhook API version", + "description": "Get the API version used for webhook request.", + "tabs": [ + { + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { apiVersion } = await authenticate.webhook(request);\n return new Response();\n};", + "title": "/app/routes/webhooks.tsx" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "PropertySignature", + "name": "shop", + "value": "string", + "description": "The shop where the webhook was triggered.", + "examples": [ + { + "title": "Webhook shop", + "description": "Get the shop that triggered a webhook.", + "tabs": [ + { + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { shop } = await authenticate.webhook(request);\n return new Response();\n};", + "title": "/app/routes/webhooks.tsx" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "PropertySignature", + "name": "topic", + "value": "Topics", + "description": "The topic of the webhook.", + "examples": [ + { + "title": "Webhook topic", + "description": "Get the event topic for the webhook.", + "tabs": [ + { + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { topic } = await authenticate.webhook(request);\n\n switch (topic) {\n case \"APP_UNINSTALLED\":\n // Do something when the app is uninstalled.\n break;\n }\n\n return new Response();\n};", + "title": "/app/routes/webhooks.tsx" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "PropertySignature", + "name": "webhookId", + "value": "string", + "description": "A unique ID for the webhook. Useful to keep track of which events your app has already processed.", + "examples": [ + { + "title": "Webhook ID", + "description": "Get the webhook ID.", + "tabs": [ + { + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { webhookId } = await authenticate.webhook(request);\n return new Response();\n};", + "title": "/app/routes/webhooks.tsx" + } + ] + } + ] + }, + { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "PropertySignature", + "name": "payload", + "value": "JSONValue", + "description": "The payload from the webhook request.", + "examples": [ + { + "title": "Webhook payload", + "description": "Get the request's POST payload.", + "tabs": [ + { + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { payload } = await authenticate.webhook(request);\n return new Response();\n};", + "title": "/app/routes/webhooks.tsx" + } ] } ] } ], - "value": "export interface EmbeddedAdminContext<\n Config extends AppConfigArg,\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> extends AdminContextInternal {\n /**\n * The decoded and validated session token for the request.\n *\n * Returned only if `isEmbeddedApp` is `true`.\n *\n * {@link https://shopify.dev/docs/apps/auth/oauth/session-tokens#payload}\n *\n * @example\n * Using the decoded session token.\n * Get user-specific data using the `sessionToken` object.\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n *\n * const shopify = shopifyApp({\n * // ...etc\n * useOnlineTokens: true,\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n * import { getMyAppData } from \"~/db/model.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { sessionToken } = await authenticate.public.checkout(\n * request\n * );\n * return json(await getMyAppData({user: sessionToken.sub}));\n * };\n * ```\n */\n sessionToken: JwtPayload;\n\n /**\n * A function that redirects the user to a new page, ensuring that the appropriate parameters are set for embedded\n * apps.\n *\n * Returned only if `isEmbeddedApp` is `true`.\n *\n * @example\n * Redirecting to an app route.\n * Use the `redirect` helper to safely redirect between pages.\n * ```ts\n * // /app/routes/admin/my-route.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { session, redirect } = await authenticate.admin(request);\n * return redirect(\"/\");\n * };\n * ```\n *\n * @example\n * Redirecting outside of Shopify admin.\n * Pass in a `target` option of `_top` or `_parent` to go to an external URL.\n * ```ts\n * // /app/routes/admin/my-route.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { session, redirect } = await authenticate.admin(request);\n * return redirect(\"/\", { target: '_parent' });\n * };\n * ```\n */\n redirect: RedirectFunction;\n}" + "value": "export interface WebhookContextWithoutSession\n extends Context {\n session: undefined;\n admin: undefined;\n}" }, - "RedirectFunction": { - "filePath": "/server/authenticate/admin/helpers/redirect.ts", - "name": "RedirectFunction", + "JSONValue": { + "filePath": "src/server/types.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "JSONValue", + "value": "string | number | boolean | null | JSONObject | JSONArray", + "description": "" + }, + "JSONObject": { + "filePath": "src/server/types.ts", + "name": "JSONObject", "description": "", - "params": [ + "members": [ + { + "filePath": "src/server/types.ts", + "name": "[x: string]", + "value": "JSONValue" + } + ], + "value": "interface JSONObject {\n [x: string]: JSONValue;\n}" + }, + "JSONArray": { + "filePath": "src/server/types.ts", + "name": "JSONArray", + "description": "", + "members": [ + { + "filePath": "src/server/types.ts", + "syntaxKind": "PropertySignature", + "name": "length", + "value": "number", + "description": "Gets or sets the length of the array. This is a number one higher than the highest index in the array." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "toString", + "value": "() => string", + "description": "Returns a string representation of an array." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "toLocaleString", + "value": "() => string", + "description": "Returns a string representation of an array. The elements are converted to string using their toLocaleString methods." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "pop", + "value": "() => JSONValue", + "description": "Removes the last element from an array and returns it. If the array is empty, undefined is returned and the array is not modified." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "push", + "value": "(...items: JSONValue[]) => number", + "description": "Appends new elements to the end of an array, and returns the new length of the array." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "concat", + "value": "{ (...items: ConcatArray[]): JSONValue[]; (...items: (JSONValue | ConcatArray)[]): JSONValue[]; }", + "description": "Combines two or more arrays. This method returns a new array without modifying any existing arrays." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "join", + "value": "(separator?: string) => string", + "description": "Adds all the elements of an array into a string, separated by the specified separator string." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "reverse", + "value": "() => JSONValue[]", + "description": "Reverses the elements in an array in place. This method mutates the array and returns a reference to the same array." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "shift", + "value": "() => JSONValue", + "description": "Removes the first element from an array and returns it. If the array is empty, undefined is returned and the array is not modified." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "slice", + "value": "(start?: number, end?: number) => JSONValue[]", + "description": "Returns a copy of a section of an array. For both start and end, a negative index can be used to indicate an offset from the end of the array. For example, -2 refers to the second to last element of the array." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "sort", + "value": "(compareFn?: (a: JSONValue, b: JSONValue) => number) => JSONArray", + "description": "Sorts an array in place. This method mutates the array and returns a reference to the same array." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "splice", + "value": "{ (start: number, deleteCount?: number): JSONValue[]; (start: number, deleteCount: number, ...items: JSONValue[]): JSONValue[]; }", + "description": "Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "unshift", + "value": "(...items: JSONValue[]) => number", + "description": "Inserts new elements at the start of an array, and returns the new length of the array." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "indexOf", + "value": "(searchElement: JSONValue, fromIndex?: number) => number", + "description": "Returns the index of the first occurrence of a value in an array, or -1 if it is not present." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "lastIndexOf", + "value": "(searchElement: JSONValue, fromIndex?: number) => number", + "description": "Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "every", + "value": "{ (predicate: (value: JSONValue, index: number, array: JSONValue[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: JSONValue, index: number, array: JSONValue[]) => unknown, thisArg?: any): boolean; }", + "description": "Determines whether all the members of an array satisfy the specified test." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "some", + "value": "(predicate: (value: JSONValue, index: number, array: JSONValue[]) => unknown, thisArg?: any) => boolean", + "description": "Determines whether the specified callback function returns true for any element of an array." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "forEach", + "value": "(callbackfn: (value: JSONValue, index: number, array: JSONValue[]) => void, thisArg?: any) => void", + "description": "Performs the specified action for each element in an array." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "map", + "value": "(callbackfn: (value: JSONValue, index: number, array: JSONValue[]) => U, thisArg?: any) => U[]", + "description": "Calls a defined callback function on each element of an array, and returns an array that contains the results." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "filter", + "value": "{ (predicate: (value: JSONValue, index: number, array: JSONValue[]) => value is S, thisArg?: any): S[]; (predicate: (value: JSONValue, index: number, array: JSONValue[]) => unknown, thisArg?: any): JSONValue[]; }", + "description": "Returns the elements of an array that meet the condition specified in a callback function." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "reduce", + "value": "{ (callbackfn: (previousValue: JSONValue, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => JSONValue): JSONValue; (callbackfn: (previousValue: JSONValue, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => JSONValue, initialValue: JSONValue): JSONValue; (callbackfn: (previousValue: U, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => U, initialValue: U): U; }", + "description": "Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "reduceRight", + "value": "{ (callbackfn: (previousValue: JSONValue, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => JSONValue): JSONValue; (callbackfn: (previousValue: JSONValue, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => JSONValue, initialValue: JSONValue): JSONValue; (callbackfn: (previousValue: U, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => U, initialValue: U): U; }", + "description": "Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "find", + "value": "{ (predicate: (value: JSONValue, index: number, obj: JSONValue[]) => value is S, thisArg?: any): S; (predicate: (value: JSONValue, index: number, obj: JSONValue[]) => unknown, thisArg?: any): JSONValue; }", + "description": "Returns the value of the first element in the array where predicate is true, and undefined otherwise." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "findIndex", + "value": "(predicate: (value: JSONValue, index: number, obj: JSONValue[]) => unknown, thisArg?: any) => number", + "description": "Returns the index of the first element in the array where predicate is true, and -1 otherwise." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "fill", + "value": "(value: JSONValue, start?: number, end?: number) => JSONArray", + "description": "Changes all array elements from `start` to `end` index to a static `value` and returns the modified array" + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "copyWithin", + "value": "(target: number, start: number, end?: number) => JSONArray", + "description": "Returns the this object after copying a section of the array identified by start and end to the same array starting at position target" + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "entries", + "value": "() => IterableIterator<[number, JSONValue]>", + "description": "Returns an iterable of key, value pairs for every entry in the array" + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "keys", + "value": "() => IterableIterator", + "description": "Returns an iterable of keys in the array" + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "values", + "value": "() => IterableIterator", + "description": "Returns an iterable of values in the array" + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "includes", + "value": "(searchElement: JSONValue, fromIndex?: number) => boolean", + "description": "Determines whether an array includes a certain element, returning true or false as appropriate." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "flatMap", + "value": "(callback: (this: This, value: JSONValue, index: number, array: JSONValue[]) => U | readonly U[], thisArg?: This) => U[]", + "description": "Calls a defined callback function on each element of an array. Then, flattens the result into a new array. This is identical to a map followed by flat with depth 1." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "flat", + "value": "(this: A, depth?: D) => FlatArray[]", + "description": "Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth." + }, + { + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "__@iterator@1657", + "value": "() => IterableIterator", + "description": "Iterator" + }, { - "name": "url", - "description": "", - "value": "string", - "filePath": "/server/authenticate/admin/helpers/redirect.ts" + "filePath": "src/server/types.ts", + "syntaxKind": "PropertySignature", + "name": "__@unscopables@1659", + "value": "{ [x: number]: boolean; length?: boolean; toString?: boolean; toLocaleString?: boolean; pop?: boolean; push?: boolean; concat?: boolean; join?: boolean; reverse?: boolean; shift?: boolean; slice?: boolean; sort?: boolean; splice?: boolean; unshift?: boolean; indexOf?: boolean; lastIndexOf?: boolean; every?: boolean; some?: boolean; forEach?: boolean; map?: boolean; filter?: boolean; reduce?: boolean; reduceRight?: boolean; find?: boolean; findIndex?: boolean; fill?: boolean; copyWithin?: boolean; entries?: boolean; keys?: boolean; values?: boolean; includes?: boolean; flatMap?: boolean; flat?: boolean; [Symbol.iterator]?: boolean; readonly [Symbol.unscopables]?: boolean; at?: boolean; }", + "description": "Is an object whose properties have the value 'true' when they will be absent when used in a 'with' statement." }, { - "name": "init", - "description": "", - "value": "RedirectInit", - "isOptional": true, - "filePath": "/server/authenticate/admin/helpers/redirect.ts" + "filePath": "src/server/types.ts", + "syntaxKind": "MethodSignature", + "name": "at", + "value": "(index: number) => JSONValue", + "description": "Takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array." } ], - "returns": { - "filePath": "/server/authenticate/admin/helpers/redirect.ts", - "description": "", - "name": "TypedResponse", - "value": "TypedResponse" - }, - "value": "export type RedirectFunction = (\n url: string,\n init?: RedirectInit,\n) => TypedResponse;" - }, - "RedirectInit": { - "filePath": "/server/authenticate/admin/helpers/redirect.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "RedirectInit", - "value": "number | (ResponseInit & {target?: RedirectTarget})", - "description": "" - }, - "RedirectTarget": { - "filePath": "/server/authenticate/admin/helpers/redirect.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "RedirectTarget", - "value": "'_self' | '_parent' | '_top'", - "description": "" + "value": "interface JSONArray extends Array {}" }, - "LegacyWebhookAdminApiContext": { - "filePath": "/server/authenticate/webhooks/types.ts", - "name": "LegacyWebhookAdminApiContext", + "WebhookContextWithSession": { + "filePath": "src/server/authenticate/webhooks/types.ts", + "name": "WebhookContextWithSession", "description": "", "members": [ { - "filePath": "/server/authenticate/webhooks/types.ts", + "filePath": "src/server/authenticate/webhooks/types.ts", "syntaxKind": "PropertySignature", - "name": "rest", - "value": "RestClient & Resources", - "description": "A REST client." + "name": "session", + "value": "Session", + "description": "A session with an offline token for the shop.\n\nReturned only if there is a session for the shop." }, { - "filePath": "/server/authenticate/webhooks/types.ts", + "filePath": "src/server/authenticate/webhooks/types.ts", "syntaxKind": "PropertySignature", - "name": "graphql", - "value": "InstanceType", - "description": "A GraphQL client." - } - ], - "value": "export interface LegacyWebhookAdminApiContext<\n Resources extends ShopifyRestResources,\n> {\n /** A REST client. */\n rest: InstanceType & Resources;\n /** A GraphQL client. */\n graphql: InstanceType;\n}" - } - } - } - ], - "jsDocTypeExamples": [ - "WebhookContextWithSession" - ], - "related": [ - { - "name": "Admin API context", - "subtitle": "Interact with the Admin API.", - "url": "/docs/api/shopify-app-remix/apis/admin-api" - } - ], - "examples": { - "description": "", - "exampleGroups": [ - { - "title": "admin", - "examples": [ - { - "description": "With the `v3_webhookAdminContext` future flag enabled, use the `admin` object in the context to interact with the Admin API.", - "codeblock": { - "title": "[V3] Webhook admin context", - "tabs": [ - { - "title": "/app/routes/webhooks.tsx", - "code": "import { ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.webhook(request);\n\n const response = await admin?.graphql(\n `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n { variables: { input: { title: \"Product Name\" } } }\n );\n\n const productData = await response.json();\n return json({ data: productData.data });\n}", - "language": "typescript" - } - ] - } - }, - { - "description": "Use the `admin` object in the context to interact with the Admin API. This format will be removed in V3 of the package.", - "codeblock": { - "title": "Webhook admin context", - "tabs": [ - { - "title": "/app/routes/webhooks.tsx", - "code": "import { json, ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.webhook(request);\n\n const response = await admin?.graphql.query<any>({\n data: {\n query: `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n variables: { input: { title: \"Product Name\" } },\n },\n });\n\n const productData = response?.body.data;\n return json({ data: productData.data });\n}", - "language": "typescript" - } - ] - } - } - ] - }, - { - "title": "apiVersion", - "examples": [ - { - "description": "Get the API version used for webhook request.", - "codeblock": { - "title": "Webhook API version", - "tabs": [ - { - "title": "/app/routes/webhooks.tsx", - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { apiVersion } = await authenticate.webhook(request);\n return new Response();\n};", - "language": "typescript" - } - ] - } - } - ] - }, - { - "title": "shop", - "examples": [ - { - "description": "Get the shop that triggered a webhook.", - "codeblock": { - "title": "Webhook shop", - "tabs": [ - { - "title": "/app/routes/webhooks.tsx", - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { shop } = await authenticate.webhook(request);\n return new Response();\n};", - "language": "typescript" - } - ] - } - } - ] - }, - { - "title": "topic", - "examples": [ - { - "description": "Get the event topic for the webhook.", - "codeblock": { - "title": "Webhook topic", - "tabs": [ + "name": "admin", + "value": "WebhookAdminContext", + "description": "An admin context for the webhook.\n\nReturned only if there is a session for the shop.", + "examples": [ { - "title": "/app/routes/webhooks.tsx", - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { topic } = await authenticate.webhook(request);\n\n switch (topic) {\n case \"APP_UNINSTALLED\":\n // Do something when the app is uninstalled.\n break;\n }\n\n return new Response();\n};", - "language": "typescript" - } - ] - } - } - ] - }, - { - "title": "webhookId", - "examples": [ - { - "description": "Get the webhook ID.", - "codeblock": { - "title": "Webhook ID", - "tabs": [ + "title": "[V3] Webhook admin context", + "description": "With the `v3_webhookAdminContext` future flag enabled, use the `admin` object in the context to interact with the Admin API.", + "tabs": [ + { + "code": "import { ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.webhook(request);\n\n const response = await admin?.graphql(\n `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n { variables: { input: { title: \"Product Name\" } } }\n );\n\n const productData = await response.json();\n return json({ data: productData.data });\n}", + "title": "/app/routes/webhooks.tsx" + } + ] + }, { - "title": "/app/routes/webhooks.tsx", - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { webhookId } = await authenticate.webhook(request);\n return new Response();\n};", - "language": "typescript" + "title": "Webhook admin context", + "description": "Use the `admin` object in the context to interact with the Admin API. This format will be removed in V3 of the package.", + "tabs": [ + { + "code": "import { json, ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.webhook(request);\n\n const response = await admin?.graphql.query({\n data: {\n query: `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n variables: { input: { title: \"Product Name\" } },\n },\n });\n\n const productData = response?.body.data;\n return json({ data: productData.data });\n}", + "title": "/app/routes/webhooks.tsx" + } + ] } ] - } - } - ] - }, - { - "title": "payload", - "examples": [ - { - "description": "Get the request's POST payload.", - "codeblock": { - "title": "Webhook payload", - "tabs": [ + }, + { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "PropertySignature", + "name": "apiVersion", + "value": "string", + "description": "The API version used for the webhook.", + "examples": [ { - "title": "/app/routes/webhooks.tsx", - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { payload } = await authenticate.webhook(request);\n return new Response();\n};", - "language": "typescript" + "title": "Webhook API version", + "description": "Get the API version used for webhook request.", + "tabs": [ + { + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { apiVersion } = await authenticate.webhook(request);\n return new Response();\n};", + "title": "/app/routes/webhooks.tsx" + } + ] } ] - } - } - ] - } - ] - } - }, - { - "name": "Admin API", - "description": "Contains objects used to interact with the Admin API.\n\nThis object is returned as part of different contexts, such as [`admin`](/docs/api/shopify-app-remix/authenticate/admin), [`unauthenticated.admin`](/docs/api/shopify-app-remix/unauthenticated/unauthenticated-admin), and [`webhook`](/docs/api/shopify-app-remix/authenticate/webhook).", - "category": "APIs", - "type": "object", - "isVisualComponent": false, - "definitions": [ - { - "title": "admin", - "description": "Provides utilities that apps can use to make requests to the Admin API.", - "type": "AdminApiContext", - "typeDefinitions": { - "AdminApiContext": { - "filePath": "/server/clients/admin/types.ts", - "name": "AdminApiContext", - "description": "", - "members": [ + }, { - "filePath": "/server/clients/admin/types.ts", + "filePath": "src/server/authenticate/webhooks/types.ts", "syntaxKind": "PropertySignature", - "name": "rest", - "value": "RestClientWithResources", - "description": "Methods for interacting with the Shopify Admin REST API\n\nThere are methods for interacting with individual REST resources. You can also make `GET`, `POST`, `PUT` and `DELETE` requests should the REST resources not meet your needs.\n\n\n\n\n", + "name": "shop", + "value": "string", + "description": "The shop where the webhook was triggered.", "examples": [ { - "title": "Using REST resources", - "description": "Getting the number of orders in a store using REST resources. Visit the [Admin REST API references](/docs/api/admin-rest) for examples on using each resource.", + "title": "Webhook shop", + "description": "Get the shop that triggered a webhook.", "tabs": [ { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n return json(admin.rest.resources.Order.count({ session }));\n};", - "title": "/app/routes/**\\/*.ts" - }, - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-07\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "/app/shopify.server.ts" + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { shop } = await authenticate.webhook(request);\n return new Response();\n};", + "title": "/app/routes/webhooks.tsx" } ] - }, + } + ] + }, + { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "PropertySignature", + "name": "topic", + "value": "Topics", + "description": "The topic of the webhook.", + "examples": [ { - "title": "Performing a GET request to the REST API", - "description": "Use `admin.rest.get` to make custom requests to make a request to to the `customer/count` endpoint", + "title": "Webhook topic", + "description": "Get the event topic for the webhook.", "tabs": [ { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n const response = await admin.rest.get({ path: \"/customers/count.json\" });\n const customers = await response.json();\n return json({ customers });\n};", - "title": "/app/routes/**\\/*.ts" - }, - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "/app/shopify.server.ts" + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { topic } = await authenticate.webhook(request);\n\n switch (topic) {\n case \"APP_UNINSTALLED\":\n // Do something when the app is uninstalled.\n break;\n }\n\n return new Response();\n};", + "title": "/app/routes/webhooks.tsx" } ] - }, + } + ] + }, + { + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "PropertySignature", + "name": "webhookId", + "value": "string", + "description": "A unique ID for the webhook. Useful to keep track of which events your app has already processed.", + "examples": [ { - "title": "Performing a POST request to the REST API", - "description": "Use `admin.rest.post` to make custom requests to make a request to to the `customers.json` endpoint to send a welcome email", + "title": "Webhook ID", + "description": "Get the webhook ID.", "tabs": [ { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n const response = admin.rest.post({\n path: \"customers/7392136888625/send_invite.json\",\n body: {\n customer_invite: {\n to: \"new_test_email@shopify.com\",\n from: \"j.limited@example.com\",\n bcc: [\"j.limited@example.com\"],\n subject: \"Welcome to my new shop\",\n custom_message: \"My awesome new store\",\n },\n },\n});\n const customerInvite = await response.json();\n return json({ customerInvite });\n};", - "title": "/app/routes/**\\/*.ts" - }, - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "/app/shopify.server.ts" + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { webhookId } = await authenticate.webhook(request);\n return new Response();\n};", + "title": "/app/routes/webhooks.tsx" } ] } ] }, { - "filePath": "/server/clients/admin/types.ts", + "filePath": "src/server/authenticate/webhooks/types.ts", "syntaxKind": "PropertySignature", - "name": "graphql", - "value": "GraphQLClient", - "description": "Methods for interacting with the Shopify Admin GraphQL API\n\n\n\n\n\n\n\n\n\n", + "name": "payload", + "value": "JSONValue", + "description": "The payload from the webhook request.", "examples": [ { - "title": "Querying the GraphQL API", - "description": "Use `admin.graphql` to make query / mutation requests.", + "title": "Webhook payload", + "description": "Get the request's POST payload.", "tabs": [ { - "code": "import { ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.admin(request);\n\n const response = await admin.graphql(\n `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n { variables: { input: { title: \"Product Name\" } } }\n );\n\n const productData = await response.json();\n return json({ data: productData.data });\n}", - "title": "Example" + "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { payload } = await authenticate.webhook(request);\n return new Response();\n};", + "title": "/app/routes/webhooks.tsx" } ] } ] } ], - "value": "export interface AdminApiContext<\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> {\n /**\n * Methods for interacting with the Shopify Admin REST API\n *\n * There are methods for interacting with individual REST resources. You can also make `GET`, `POST`, `PUT` and `DELETE` requests should the REST resources not meet your needs.\n *\n * {@link https://shopify.dev/docs/api/admin-rest}\n *\n * @example\n * Using REST resources.\n * Getting the number of orders in a store using REST resources. Visit the [Admin REST API references](/docs/api/admin-rest) for examples on using each resource. \n *\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * return json(admin.rest.resources.Order.count({ session }));\n * };\n * ```\n *\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-07\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n *\n *\n * @example\n * Performing a GET request to the REST API.\n * Use `admin.rest.get` to make custom requests to make a request to to the `customer/count` endpoint\n *\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * const response = await admin.rest.get({ path: \"/customers/count.json\" });\n * const customers = await response.json();\n * return json({ customers });\n * };\n * ```\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n * @example\n * Performing a POST request to the REST API.\n * Use `admin.rest.post` to make custom requests to make a request to to the `customers.json` endpoint to send a welcome email\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * const response = admin.rest.post({\n * path: \"customers/7392136888625/send_invite.json\",\n * body: {\n * customer_invite: {\n * to: \"new_test_email@shopify.com\",\n * from: \"j.limited@example.com\",\n * bcc: [\"j.limited@example.com\"],\n * subject: \"Welcome to my new shop\",\n * custom_message: \"My awesome new store\",\n * },\n * },\n * });\n * const customerInvite = await response.json();\n * return json({ customerInvite });\n * };\n * ```\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n rest: RestClientWithResources;\n\n /**\n * Methods for interacting with the Shopify Admin GraphQL API\n *\n * {@link https://shopify.dev/docs/api/admin-graphql}\n * {@link https://github.com/Shopify/shopify-api-js/blob/main/packages/shopify-api/docs/reference/clients/Graphql.md}\n *\n * @example\n * Querying the GraphQL API.\n * Use `admin.graphql` to make query / mutation requests.\n * ```ts\n * import { ActionFunctionArgs } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { admin } = await authenticate.admin(request);\n *\n * const response = await admin.graphql(\n * `#graphql\n * mutation populateProduct($input: ProductInput!) {\n * productCreate(input: $input) {\n * product {\n * id\n * }\n * }\n * }`,\n * { variables: { input: { title: \"Product Name\" } } }\n * );\n *\n * const productData = await response.json();\n * return json({ data: productData.data });\n * }\n * ```\n */\n graphql: GraphQLClient;\n}" + "value": "export interface WebhookContextWithSession<\n Future extends FutureFlagOptions,\n Resources extends ShopifyRestResources,\n Topics = string | number | symbol,\n> extends Context {\n /**\n * A session with an offline token for the shop.\n *\n * Returned only if there is a session for the shop.\n */\n session: Session;\n\n /**\n * An admin context for the webhook.\n *\n * Returned only if there is a session for the shop.\n *\n * @example\n * [V3] Webhook admin context.\n * With the `v3_webhookAdminContext` future flag enabled, use the `admin` object in the context to interact with the Admin API.\n * ```ts\n * // /app/routes/webhooks.tsx\n * import { ActionFunctionArgs } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { admin } = await authenticate.webhook(request);\n *\n * const response = await admin?.graphql(\n * `#graphql\n * mutation populateProduct($input: ProductInput!) {\n * productCreate(input: $input) {\n * product {\n * id\n * }\n * }\n * }`,\n * { variables: { input: { title: \"Product Name\" } } }\n * );\n *\n * const productData = await response.json();\n * return json({ data: productData.data });\n * }\n * ```\n *\n * @example\n * Webhook admin context.\n * Use the `admin` object in the context to interact with the Admin API. This format will be removed in V3 of the package.\n * ```ts\n * // /app/routes/webhooks.tsx\n * import { json, ActionFunctionArgs } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { admin } = await authenticate.webhook(request);\n *\n * const response = await admin?.graphql.query({\n * data: {\n * query: `#graphql\n * mutation populateProduct($input: ProductInput!) {\n * productCreate(input: $input) {\n * product {\n * id\n * }\n * }\n * }`,\n * variables: { input: { title: \"Product Name\" } },\n * },\n * });\n *\n * const productData = response?.body.data;\n * return json({ data: productData.data });\n * }\n * ```\n */\n admin: WebhookAdminContext;\n}" }, - "RestClientWithResources": { - "filePath": "/server/clients/admin/rest.ts", + "WebhookAdminContext": { + "filePath": "src/server/authenticate/webhooks/types.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "RestClientWithResources", - "value": "RemixRestClient & {resources: Resources}", + "name": "WebhookAdminContext", + "value": "FeatureEnabled extends true\n ? AdminApiContext\n : LegacyWebhookAdminApiContext", "description": "" - } - } - } - ], - "jsDocTypeExamples": [ - "AdminApiContext" - ], - "related": [ - { - "name": "Authenticated context", - "subtitle": "Authenticate requests from Shopify Admin.", - "url": "/docs/api/shopify-app-remix/authenticate/admin" - }, - { - "name": "Unauthenticated context", - "subtitle": "Interact with the Admin API on non-Shopify requests.", - "url": "/docs/api/shopify-app-remix/unauthenticated/unauthenticated-admin" - } - ], - "examples": { - "description": "", - "exampleGroups": [ - { - "title": "rest", - "examples": [ - { - "description": "Getting the number of orders in a store using REST resources. Visit the [Admin REST API references](/docs/api/admin-rest) for examples on using each resource.", - "codeblock": { - "title": "Using REST resources", - "tabs": [ - { - "title": "/app/routes/**\\/*.ts", - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n return json(admin.rest.resources.Order.count({ session }));\n};", - "language": "typescript" - }, - { - "title": "/app/shopify.server.ts", - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-07\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "language": "typescript" - } - ] - } - }, - { - "description": "Use `admin.rest.get` to make custom requests to make a request to to the `customer/count` endpoint", - "codeblock": { - "title": "Performing a GET request to the REST API", - "tabs": [ - { - "title": "/app/routes/**\\/*.ts", - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n const response = await admin.rest.get({ path: \"/customers/count.json\" });\n const customers = await response.json();\n return json({ customers });\n};", - "language": "typescript" - }, - { - "title": "/app/shopify.server.ts", - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "language": "typescript" - } - ] - } - }, - { - "description": "Use `admin.rest.post` to make custom requests to make a request to to the `customers.json` endpoint to send a welcome email", - "codeblock": { - "title": "Performing a POST request to the REST API", - "tabs": [ - { - "title": "/app/routes/**\\/*.ts", - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n const response = admin.rest.post({\n path: \"customers/7392136888625/send_invite.json\",\n body: {\n customer_invite: {\n to: \"new_test_email@shopify.com\",\n from: \"j.limited@example.com\",\n bcc: [\"j.limited@example.com\"],\n subject: \"Welcome to my new shop\",\n custom_message: \"My awesome new store\",\n },\n },\n});\n const customerInvite = await response.json();\n return json({ customerInvite });\n};", - "language": "typescript" - }, - { - "title": "/app/shopify.server.ts", - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "language": "typescript" - } - ] - } - } - ] - }, - { - "title": "graphql", - "examples": [ - { - "description": "Use `admin.graphql` to make query / mutation requests.", - "codeblock": { - "title": "Querying the GraphQL API", - "tabs": [ - { - "title": "Example", - "code": "import { ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.admin(request);\n\n const response = await admin.graphql(\n `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n { variables: { input: { title: \"Product Name\" } } }\n );\n\n const productData = await response.json();\n return json({ data: productData.data });\n}", - "language": "typescript" - } - ] - } - } - ] - } - ] - } - }, - { - "name": "Storefront API", - "description": "Contains objects used to interact with the Storefront API.\n\nThis object is returned as part of different contexts, such as [`appProxy`](/docs/api/shopify-app-remix/authenticate/public/app-proxy), and [`unauthenticated.storefront`](/docs/api/shopify-app-remix/unauthenticated/unauthenticated-storefront).", - "category": "APIs", - "type": "object", - "isVisualComponent": false, - "definitions": [ - { - "title": "storefront", - "description": "Provides utilities that apps can use to make requests to the Storefront API.", - "type": "StorefrontContext", - "typeDefinitions": { - "StorefrontContext": { - "filePath": "/server/clients/storefront/types.ts", - "name": "StorefrontContext", + }, + "LegacyWebhookAdminApiContext": { + "filePath": "src/server/authenticate/webhooks/types.ts", + "name": "LegacyWebhookAdminApiContext", "description": "", "members": [ { - "filePath": "/server/clients/storefront/types.ts", + "filePath": "src/server/authenticate/webhooks/types.ts", + "syntaxKind": "PropertySignature", + "name": "rest", + "value": "RestClient & Resources", + "description": "A REST client." + }, + { + "filePath": "src/server/authenticate/webhooks/types.ts", "syntaxKind": "PropertySignature", "name": "graphql", - "value": "GraphQLClient", - "description": "Method for interacting with the Shopify Storefront GraphQL API\n\nIf you're getting incorrect type hints in the Shopify template, follow [these instructions](https://github.com/Shopify/shopify-app-template-remix/tree/main#incorrect-graphql-hints).\n\n\n\n\n", - "examples": [ - { - "title": "Querying the GraphQL API", - "description": "Use `storefront.graphql` to make query / mutation requests.", - "tabs": [ - { - "code": "import { json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { storefront } = await authenticate.public.appProxy(request);\n\n const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);\n\n return json(await response.json());\n}", - "title": "app/routes/**\\/.ts" - } - ] - } - ] + "value": "InstanceType", + "description": "A GraphQL client." } ], - "value": "export interface StorefrontContext {\n /**\n * Method for interacting with the Shopify Storefront GraphQL API\n *\n * If you're getting incorrect type hints in the Shopify template, follow [these instructions](https://github.com/Shopify/shopify-app-template-remix/tree/main#incorrect-graphql-hints).\n *\n * {@link https://shopify.dev/docs/api/storefront}\n *\n * @example\n * Querying the GraphQL API.\n * Use `storefront.graphql` to make query / mutation requests.\n * ```ts\n * // app/routes/**\\/.ts\n * import { json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { storefront } = await authenticate.public.appProxy(request);\n *\n * const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);\n *\n * return json(await response.json());\n * }\n * ```\n */\n graphql: GraphQLClient;\n}" - } - } - } - ], - "jsDocTypeExamples": [ - "StorefrontContext" - ], - "related": [ - { - "name": "App proxy context", - "subtitle": "Authenticate requests from Shopify app proxies.", - "url": "/docs/api/shopify-app-remix/authenticate/public/app-proxy" - }, - { - "name": "Unauthenticated context", - "subtitle": "Interact with the Storefront API on non-Shopify requests.", - "url": "/docs/api/shopify-app-remix/unauthenticated/unauthenticated-storefront" - } - ], - "examples": { - "description": "", - "exampleGroups": [ - { - "title": "graphql", - "examples": [ - { - "description": "Use `storefront.graphql` to make query / mutation requests.", - "codeblock": { - "title": "Querying the GraphQL API", - "tabs": [ - { - "title": "app/routes/**\\/.ts", - "code": "import { json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { storefront } = await authenticate.public.appProxy(request);\n\n const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);\n\n return json(await response.json());\n}", - "language": "typescript" - } - ] + "value": "export interface LegacyWebhookAdminApiContext<\n Resources extends ShopifyRestResources,\n> {\n /** A REST client. */\n rest: InstanceType & Resources;\n /** A GraphQL client. */\n graphql: InstanceType;\n}" + }, + "RestClient": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/rest/client.d.ts", + "name": "RestClient", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/rest/client.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "loggedDeprecations", + "value": "Record", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/rest/client.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "client", + "value": "AdminRestApiClient", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/rest/client.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "session", + "value": "Session", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/rest/client.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "apiVersion", + "value": "ApiVersion", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/rest/client.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "get", + "value": "(params: GetRequestParams) => Promise>", + "description": "Performs a GET request on the given path." + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/rest/client.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "post", + "value": "(params: PostRequestParams) => Promise>", + "description": "Performs a POST request on the given path." + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/rest/client.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "put", + "value": "(params: PostRequestParams) => Promise>", + "description": "Performs a PUT request on the given path." + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/rest/client.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "delete", + "value": "(params: GetRequestParams) => Promise>", + "description": "Performs a DELETE request on the given path." } - } - ] - } - ] - } - }, - { - "name": "shopifyApp", - "description": "Returns a set of functions that can be used by the app's backend to be able to respond to all Shopify requests.\n\nThe shape of the returned object changes depending on the value of `distribution`. If it is `AppDistribution.ShopifyAdmin`, then only `ShopifyAppBase` objects are returned, otherwise `ShopifyAppLogin` objects are included.", - "category": "Entrypoints", - "type": "function", - "isVisualComponent": false, - "definitions": [ - { - "title": "shopifyApp", - "description": "Function to create a new Shopify API object.", - "type": "ShopifyAppGeneratedType", - "typeDefinitions": { - "ShopifyAppGeneratedType": { - "filePath": "/server/shopify-app.ts", - "name": "ShopifyAppGeneratedType", - "description": "Creates an object your app will use to interact with Shopify.", - "params": [ + ], + "value": "export declare class RestClient {\n static config: ConfigInterface;\n static formatPaths: boolean;\n static LINK_HEADER_REGEXP: RegExp;\n static DEFAULT_LIMIT: string;\n static RETRY_WAIT_TIME: number;\n static readonly DEPRECATION_ALERT_DELAY = 300000;\n loggedDeprecations: Record;\n readonly client: AdminRestApiClient;\n readonly session: Session;\n readonly apiVersion: ApiVersion;\n constructor({ session, apiVersion }: RestClientParams);\n /**\n * Performs a GET request on the given path.\n */\n get(params: GetRequestParams): Promise>;\n /**\n * Performs a POST request on the given path.\n */\n post(params: PostRequestParams): Promise>;\n /**\n * Performs a PUT request on the given path.\n */\n put(params: PutRequestParams): Promise>;\n /**\n * Performs a DELETE request on the given path.\n */\n delete(params: DeleteRequestParams): Promise>;\n protected request(params: RequestParams): Promise>;\n private restClass;\n private buildRequestParams;\n private logDeprecations;\n}" + }, + "RestRequestReturn": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "name": "RestRequestReturn", + "description": "", + "members": [ { - "name": "appConfig", - "description": "Configuration options for your Shopify app, such as the scopes your app needs.", - "value": "Config extends AppConfigArg", - "filePath": "/server/shopify-app.ts" + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "body", + "value": "T", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "headers", + "value": "Headers", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "pageInfo", + "value": "PageInfo", + "description": "", + "isOptional": true } ], - "returns": { - "filePath": "/server/shopify-app.ts", - "description": "`ShopifyApp` An object constructed using your appConfig. It has methods for interacting with Shopify.", - "name": "ShopifyApp>", - "value": "ShopifyApp>" - }, - "value": "export function shopifyApp<\n Config extends AppConfigArg,\n Resources extends ShopifyRestResources,\n Storage extends SessionStorage,\n>(appConfig: Config): ShopifyApp {\n const api = deriveApi(appConfig);\n const config = deriveConfig(appConfig, api.config);\n const logger = overrideLogger(api.logger);\n\n if (appConfig.webhooks) {\n api.webhooks.addHandlers(appConfig.webhooks);\n }\n\n const params: BasicParams = {api, config, logger};\n const oauth = new AuthCodeFlowStrategy(params);\n const authStrategy = authStrategyFactory({\n ...params,\n strategy: oauth,\n });\n\n const shopify:\n | AdminApp\n | AppStoreApp\n | SingleMerchantApp = {\n sessionStorage: config.sessionStorage,\n addDocumentResponseHeaders: addDocumentResponseHeadersFactory(params),\n registerWebhooks: registerWebhooksFactory(params),\n authenticate: {\n admin: authStrategy,\n public: authenticatePublicFactory(params),\n webhook: authenticateWebhookFactory<\n Config['future'],\n Resources,\n keyof Config['webhooks'] | MandatoryTopics\n >(params),\n },\n unauthenticated: {\n admin: unauthenticatedAdminContextFactory(params),\n storefront: unauthenticatedStorefrontContextFactory(params),\n },\n };\n\n if (\n isAppStoreApp(shopify, appConfig) ||\n isSingleMerchantApp(shopify, appConfig)\n ) {\n shopify.login = loginFactory(params);\n }\n\n return shopify as ShopifyApp;\n}", - "examples": [ + "value": "export interface RestRequestReturn {\n body: T;\n headers: Headers;\n pageInfo?: PageInfo;\n}" + }, + "PageInfo": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "name": "PageInfo", + "description": "", + "members": [ { - "title": "The minimum viable configuration", + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "limit", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "fields", + "value": "string[]", "description": "", - "tabs": [ - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n apiKey: process.env.SHOPIFY_API_KEY!,\n apiSecretKey: process.env.SHOPIFY_API_SECRET!,\n scopes: process.env.SCOPES?.split(\",\")!,\n appUrl: process.env.SHOPIFY_APP_URL!,\n});\nexport default shopify;", - "title": "/shopify.server.ts" - } - ] + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "previousPageUrl", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "nextPageUrl", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "prevPage", + "value": "PageInfoParams", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "nextPage", + "value": "PageInfoParams", + "description": "", + "isOptional": true } - ] + ], + "value": "export interface PageInfo {\n limit: string;\n fields?: string[];\n previousPageUrl?: string;\n nextPageUrl?: string;\n prevPage?: PageInfoParams;\n nextPage?: PageInfoParams;\n}" }, - "AppConfigArg": { - "filePath": "/server/config-types.ts", - "name": "AppConfigArg", + "PageInfoParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", + "name": "PageInfoParams", "description": "", "members": [ { - "filePath": "/server/config-types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", "syntaxKind": "PropertySignature", - "name": "appUrl", + "name": "path", "value": "string", - "description": "The URL your app is running on.\n\nThe `@shopify/cli` provides this URL as `process.env.SHOPIFY_APP_URL`. For development this is probably a tunnel URL that points to your local machine. If this is a production app, this is your production URL." + "description": "" }, { - "filePath": "/server/config-types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/types.d.ts", "syntaxKind": "PropertySignature", - "name": "sessionStorage", - "value": "Storage", - "description": "An adaptor for storing sessions in your database of choice.\n\nShopify provides multiple session storage adaptors and you can create your own.\n\n\n\n\n", - "examples": [ - { - "title": "Storing sessions with Prisma", - "description": "Add the `@shopify/shopify-app-session-storage-prisma` package to use the Prisma session storage.", - "tabs": [ - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { PrismaSessionStorage } from \"@shopify/shopify-app-session-storage-prisma\";\n\nimport prisma from \"~/db.server\";\n\nconst shopify = shopifyApp({\n // ... etc\n sessionStorage: new PrismaSessionStorage(prisma),\n});\nexport default shopify;", - "title": "Example" - } - ] - } - ] + "name": "query", + "value": "SearchParams", + "description": "" + } + ], + "value": "export interface PageInfoParams {\n path: string;\n query: SearchParams;\n}" + }, + "Shopify": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/index.d.ts", + "name": "Shopify", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "config", + "value": "ConfigInterface", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "clients", + "value": "ShopifyClients", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "auth", + "value": "ShopifyAuth", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "session", + "value": "ShopifySession", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "utils", + "value": "ShopifyUtils", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "webhooks", + "value": "ShopifyWebhooks", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "billing", + "value": "ShopifyBilling", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "logger", + "value": "ShopifyLogger", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "rest", + "value": "Resources", + "description": "" + } + ], + "value": "export interface Shopify {\n config: ConfigInterface;\n clients: ShopifyClients;\n auth: ShopifyAuth;\n session: ShopifySession;\n utils: ShopifyUtils;\n webhooks: ShopifyWebhooks;\n billing: ShopifyBilling;\n logger: ShopifyLogger;\n rest: Resources;\n}" + }, + "ConfigInterface": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/base-types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "ConfigInterface", + "value": "Omit & {\n apiKey: string;\n hostScheme: 'http' | 'https';\n scopes: AuthScopes;\n isCustomStoreApp: boolean;\n billing?: BillingConfig;\n logger: {\n log: LogFunction;\n level: LogSeverity;\n httpRequests: boolean;\n timestamps: boolean;\n };\n future: FutureFlagOptions;\n}", + "description": "" + }, + "Key": { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "Key", + "value": "export declare enum Key {\n Backspace = 8,\n Tab = 9,\n Enter = 13,\n Shift = 16,\n Ctrl = 17,\n Alt = 18,\n Pause = 19,\n CapsLock = 20,\n Escape = 27,\n Space = 32,\n PageUp = 33,\n PageDown = 34,\n End = 35,\n Home = 36,\n LeftArrow = 37,\n UpArrow = 38,\n RightArrow = 39,\n DownArrow = 40,\n Insert = 45,\n Delete = 46,\n Key0 = 48,\n Key1 = 49,\n Key2 = 50,\n Key3 = 51,\n Key4 = 52,\n Key5 = 53,\n Key6 = 54,\n Key7 = 55,\n Key8 = 56,\n Key9 = 57,\n KeyA = 65,\n KeyB = 66,\n KeyC = 67,\n KeyD = 68,\n KeyE = 69,\n KeyF = 70,\n KeyG = 71,\n KeyH = 72,\n KeyI = 73,\n KeyJ = 74,\n KeyK = 75,\n KeyL = 76,\n KeyM = 77,\n KeyN = 78,\n KeyO = 79,\n KeyP = 80,\n KeyQ = 81,\n KeyR = 82,\n KeyS = 83,\n KeyT = 84,\n KeyU = 85,\n KeyV = 86,\n KeyW = 87,\n KeyX = 88,\n KeyY = 89,\n KeyZ = 90,\n LeftMeta = 91,\n RightMeta = 92,\n Select = 93,\n Numpad0 = 96,\n Numpad1 = 97,\n Numpad2 = 98,\n Numpad3 = 99,\n Numpad4 = 100,\n Numpad5 = 101,\n Numpad6 = 102,\n Numpad7 = 103,\n Numpad8 = 104,\n Numpad9 = 105,\n Multiply = 106,\n Add = 107,\n Subtract = 109,\n Decimal = 110,\n Divide = 111,\n F1 = 112,\n F2 = 113,\n F3 = 114,\n F4 = 115,\n F5 = 116,\n F6 = 117,\n F7 = 118,\n F8 = 119,\n F9 = 120,\n F10 = 121,\n F11 = 122,\n F12 = 123,\n NumLock = 144,\n ScrollLock = 145,\n Semicolon = 186,\n Equals = 187,\n Comma = 188,\n Dash = 189,\n Period = 190,\n ForwardSlash = 191,\n GraveAccent = 192,\n OpenBracket = 219,\n BackSlash = 220,\n CloseBracket = 221,\n SingleQuote = 222\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Backspace", + "value": 8 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Tab", + "value": 9 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Enter", + "value": 13 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Shift", + "value": 16 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Ctrl", + "value": 17 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Alt", + "value": 18 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Pause", + "value": 19 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "CapsLock", + "value": 20 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Escape", + "value": 27 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Space", + "value": 32 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "PageUp", + "value": 33 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "PageDown", + "value": 34 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "End", + "value": 35 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Home", + "value": 36 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "LeftArrow", + "value": 37 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "UpArrow", + "value": 38 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "RightArrow", + "value": 39 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "DownArrow", + "value": 40 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Insert", + "value": 45 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Delete", + "value": 46 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Key0", + "value": 48 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Key1", + "value": 49 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Key2", + "value": 50 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Key3", + "value": 51 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Key4", + "value": 52 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Key5", + "value": 53 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Key6", + "value": 54 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Key7", + "value": 55 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Key8", + "value": 56 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Key9", + "value": 57 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyA", + "value": 65 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyB", + "value": 66 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyC", + "value": 67 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyD", + "value": 68 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyE", + "value": 69 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyF", + "value": 70 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyG", + "value": 71 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyH", + "value": 72 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyI", + "value": 73 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyJ", + "value": 74 }, { - "filePath": "/server/config-types.ts", - "syntaxKind": "PropertySignature", - "name": "useOnlineTokens", - "value": "boolean", - "description": "Whether your app use online or offline tokens.\n\nIf your app uses online tokens, then both online and offline tokens will be saved to your database. This ensures your app can perform background jobs.\n\n\n\n\n", - "isOptional": true, - "defaultValue": "`false`" + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyK", + "value": 75 }, { - "filePath": "/server/config-types.ts", - "syntaxKind": "PropertySignature", - "name": "webhooks", - "value": "WebhookConfig", - "description": "The config for the webhook topics your app would like to subscribe to.\n\n\n\n\n\n\n\nThis can be in used in conjunction with the afterAuth hook to register webhook topics when a user installs your app. Or you can use this function in other processes such as background jobs.", - "isOptional": true, - "examples": [ - { - "title": "Registering for a webhook when a merchant uninstalls your app", - "description": "", - "tabs": [ - { - "code": "import { DeliveryMethod, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n webhooks: {\n APP_UNINSTALLED: {\n deliveryMethod: DeliveryMethod.Http,\n callbackUrl: \"/webhooks\",\n },\n },\n hooks: {\n afterAuth: async ({ session }) => {\n shopify.registerWebhooks({ session });\n }\n },\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;\n\n// /app/routes/webhooks.jsx\nimport { ActionFunctionArgs } from \"@remix-run/node\";\n\nimport { authenticate } from \"../shopify.server\";\nimport db from \"../db.server\";\n\nexport const action = async ({ request }: ActionFunctionArgs) => {\n const { topic, shop } = await authenticate.webhook(request);\n\n switch (topic) {\n case \"APP_UNINSTALLED\":\n await db.session.deleteMany({ where: { shop } });\n break;\n case \"CUSTOMERS_DATA_REQUEST\":\n case \"CUSTOMERS_REDACT\":\n case \"SHOP_REDACT\":\n default:\n throw new Response(\"Unhandled webhook topic\", { status: 404 });\n }\n throw new Response();\n};", - "title": "/app/shopify.server.ts" - } - ] - } - ] + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyL", + "value": 76 }, { - "filePath": "/server/config-types.ts", - "syntaxKind": "PropertySignature", - "name": "hooks", - "value": "HooksConfig", - "description": "Functions to call at key places during your apps lifecycle.\n\nThese functions are called in the context of the request that triggered them. This means you can access the session.", - "isOptional": true, - "examples": [ - { - "title": "Seeding your database custom data when a merchant installs your app", - "description": "", - "tabs": [ - { - "code": "import { DeliveryMethod, shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { seedStoreData } from \"~/db/seeds\"\n\nconst shopify = shopifyApp({\n hooks: {\n afterAuth: async ({ session }) => {\n seedStoreData({session})\n }\n },\n // ...etc\n});", - "title": "Example" - } - ] - } - ] + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyM", + "value": 77 }, { - "filePath": "/server/config-types.ts", - "syntaxKind": "PropertySignature", - "name": "isEmbeddedApp", - "value": "boolean", - "description": "Does your app render embedded inside the Shopify Admin or on its own.\n\nUnless you have very specific needs, this should be true.", - "isOptional": true, - "defaultValue": "`true`" + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyN", + "value": 78 }, { - "filePath": "/server/config-types.ts", - "syntaxKind": "PropertySignature", - "name": "distribution", - "value": "AppDistribution", - "description": "How your app is distributed. Default is `AppDistribution.AppStore`.\n\n\n\n\n", - "isOptional": true + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyO", + "value": 79 }, { - "filePath": "/server/config-types.ts", - "syntaxKind": "PropertySignature", - "name": "apiVersion", - "value": "ApiVersion", - "description": "What version of Shopify's Admin API's would you like to use.\n\n\n\n\n", - "isOptional": true, - "defaultValue": "`LATEST_API_VERSION` from `@shopify/shopify-app-remix`", - "examples": [ - { - "title": "Using the latest API Version (Recommended)", - "description": "", - "tabs": [ - { - "code": "import { LATEST_API_VERSION, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n apiVersion: LATEST_API_VERSION,\n});", - "title": "Example" - } - ] - } - ] + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyP", + "value": 80 }, { - "filePath": "/server/config-types.ts", - "syntaxKind": "PropertySignature", - "name": "authPathPrefix", - "value": "string", - "description": "A path that Shopify can reserve for auth related endpoints.\n\nThis must match a $ route in your Remix app. That route must export a loader function that calls `shopify.authenticate.admin(request)`.", - "isOptional": true, - "defaultValue": "`\"/auth\"`", - "examples": [ - { - "title": "Using the latest API Version (Recommended)", - "description": "", - "tabs": [ - { - "code": "import { LATEST_API_VERSION, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n apiVersion: LATEST_API_VERSION,\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;\n\n// /app/routes/auth/$.jsx\nimport { LoaderFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../../shopify.server\";\n\nexport async function loader({ request }: LoaderFunctionArgs) {\n await authenticate.admin(request);\n\n return null\n}", - "title": "/app/shopify.server.ts" - } - ] - } - ] + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyQ", + "value": 81 }, { - "filePath": "/server/config-types.ts", - "syntaxKind": "PropertySignature", - "name": "future", - "value": "Future", - "description": "Features that will be introduced in future releases of this package.\n\nYou can opt in to these features by setting the corresponding flags. By doing so, you can prepare for future releases in advance and provide feedback on the new features.", - "isOptional": true + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyR", + "value": 82 }, { - "filePath": "/server/config-types.ts", - "syntaxKind": "PropertySignature", - "name": "apiKey", - "value": "string", - "description": "", - "isOptional": true + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyS", + "value": 83 }, { - "filePath": "/server/config-types.ts", - "syntaxKind": "PropertySignature", - "name": "apiSecretKey", - "value": "string", - "description": "" + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyT", + "value": 84 }, { - "filePath": "/server/config-types.ts", - "syntaxKind": "PropertySignature", - "name": "scopes", - "value": "string[] | AuthScopes", - "description": "", - "isOptional": true + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyU", + "value": 85 }, { - "filePath": "/server/config-types.ts", - "syntaxKind": "PropertySignature", - "name": "adminApiAccessToken", - "value": "string", - "description": "", - "isOptional": true + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyV", + "value": 86 }, { - "filePath": "/server/config-types.ts", - "syntaxKind": "PropertySignature", - "name": "userAgentPrefix", - "value": "string", - "description": "", - "isOptional": true + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyW", + "value": 87 }, { - "filePath": "/server/config-types.ts", - "syntaxKind": "PropertySignature", - "name": "privateAppStorefrontAccessToken", - "value": "string", - "description": "", - "isOptional": true + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyX", + "value": 88 }, { - "filePath": "/server/config-types.ts", - "syntaxKind": "PropertySignature", - "name": "customShopDomains", - "value": "(string | RegExp)[]", - "description": "", - "isOptional": true + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyY", + "value": 89 }, { - "filePath": "/server/config-types.ts", - "syntaxKind": "PropertySignature", - "name": "billing", - "value": "BillingConfig", - "description": "", - "isOptional": true + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "KeyZ", + "value": 90 }, { - "filePath": "/server/config-types.ts", - "syntaxKind": "PropertySignature", - "name": "restResources", - "value": "Resources", - "description": "", - "isOptional": true + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "LeftMeta", + "value": 91 }, { - "filePath": "/server/config-types.ts", - "syntaxKind": "PropertySignature", - "name": "logger", - "value": "{ log?: LogFunction; level?: LogSeverity; httpRequests?: boolean; timestamps?: boolean; }", - "description": "", - "isOptional": true - } - ], - "value": "export interface AppConfigArg<\n Resources extends ShopifyRestResources = ShopifyRestResources,\n Storage extends SessionStorage = SessionStorage,\n Future extends FutureFlagOptions = FutureFlagOptions,\n> extends Omit<\n ApiConfigArg,\n | 'hostName'\n | 'hostScheme'\n | 'isEmbeddedApp'\n | 'apiVersion'\n | 'isCustomStoreApp'\n | 'future'\n > {\n /**\n * The URL your app is running on.\n *\n * The `@shopify/cli` provides this URL as `process.env.SHOPIFY_APP_URL`. For development this is probably a tunnel URL that points to your local machine. If this is a production app, this is your production URL.\n */\n appUrl: string;\n\n /**\n * An adaptor for storing sessions in your database of choice.\n *\n * Shopify provides multiple session storage adaptors and you can create your own.\n *\n * {@link https://github.com/Shopify/shopify-app-js/blob/main/README.md#session-storage-options}\n *\n * @example\n * Storing sessions with Prisma.\n * Add the `@shopify/shopify-app-session-storage-prisma` package to use the Prisma session storage.\n * ```ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { PrismaSessionStorage } from \"@shopify/shopify-app-session-storage-prisma\";\n *\n * import prisma from \"~/db.server\";\n *\n * const shopify = shopifyApp({\n * // ... etc\n * sessionStorage: new PrismaSessionStorage(prisma),\n * });\n * export default shopify;\n * ```\n */\n sessionStorage: Storage;\n\n /**\n * Whether your app use online or offline tokens.\n *\n * If your app uses online tokens, then both online and offline tokens will be saved to your database. This ensures your app can perform background jobs.\n *\n * {@link https://shopify.dev/docs/apps/auth/oauth/access-modes}\n *\n * @defaultValue `false`\n */\n useOnlineTokens?: boolean;\n\n /**\n * The config for the webhook topics your app would like to subscribe to.\n *\n * {@link https://shopify.dev/docs/apps/webhooks}\n *\n * This can be in used in conjunction with the afterAuth hook to register webhook topics when a user installs your app. Or you can use this function in other processes such as background jobs.\n *\n * @example\n * Registering for a webhook when a merchant uninstalls your app.\n * ```ts\n * // /app/shopify.server.ts\n * import { DeliveryMethod, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n *\n * const shopify = shopifyApp({\n * webhooks: {\n * APP_UNINSTALLED: {\n * deliveryMethod: DeliveryMethod.Http,\n * callbackUrl: \"/webhooks\",\n * },\n * },\n * hooks: {\n * afterAuth: async ({ session }) => {\n * shopify.registerWebhooks({ session });\n * }\n * },\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n *\n * // /app/routes/webhooks.jsx\n * import { ActionFunctionArgs } from \"@remix-run/node\";\n *\n * import { authenticate } from \"../shopify.server\";\n * import db from \"../db.server\";\n *\n * export const action = async ({ request }: ActionFunctionArgs) => {\n * const { topic, shop } = await authenticate.webhook(request);\n *\n * switch (topic) {\n * case \"APP_UNINSTALLED\":\n * await db.session.deleteMany({ where: { shop } });\n * break;\n * case \"CUSTOMERS_DATA_REQUEST\":\n * case \"CUSTOMERS_REDACT\":\n * case \"SHOP_REDACT\":\n * default:\n * throw new Response(\"Unhandled webhook topic\", { status: 404 });\n * }\n * throw new Response();\n * };\n * ```\n */\n webhooks?: WebhookConfig;\n\n /**\n * Functions to call at key places during your apps lifecycle.\n *\n * These functions are called in the context of the request that triggered them. This means you can access the session.\n *\n * @example\n * Seeding your database custom data when a merchant installs your app.\n * ```ts\n * import { DeliveryMethod, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { seedStoreData } from \"~/db/seeds\"\n *\n * const shopify = shopifyApp({\n * hooks: {\n * afterAuth: async ({ session }) => {\n * seedStoreData({session})\n * }\n * },\n * // ...etc\n * });\n * ```\n */\n hooks?: HooksConfig;\n\n /**\n * Does your app render embedded inside the Shopify Admin or on its own.\n *\n * Unless you have very specific needs, this should be true.\n *\n * @defaultValue `true`\n */\n isEmbeddedApp?: boolean;\n\n /**\n * How your app is distributed. Default is `AppDistribution.AppStore`.\n *\n * {@link https://shopify.dev/docs/apps/distribution}\n */\n distribution?: AppDistribution;\n\n /**\n * What version of Shopify's Admin API's would you like to use.\n *\n * {@link https://shopify.dev/docs/api/}\n *\n * @defaultValue `LATEST_API_VERSION` from `@shopify/shopify-app-remix`\n *\n * @example\n * Using the latest API Version (Recommended)\n * ```ts\n * import { LATEST_API_VERSION, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n *\n * const shopify = shopifyApp({\n * // ...etc\n * apiVersion: LATEST_API_VERSION,\n * });\n * ```\n */\n apiVersion?: ApiVersion;\n\n /**\n * A path that Shopify can reserve for auth related endpoints.\n *\n * This must match a $ route in your Remix app. That route must export a loader function that calls `shopify.authenticate.admin(request)`.\n *\n * @default `\"/auth\"`\n *\n * @example\n * Using the latest API Version (Recommended)\n * ```ts\n * // /app/shopify.server.ts\n * import { LATEST_API_VERSION, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n *\n * const shopify = shopifyApp({\n * // ...etc\n * apiVersion: LATEST_API_VERSION,\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n *\n * // /app/routes/auth/$.jsx\n * import { LoaderFunctionArgs } from \"@remix-run/node\";\n * import { authenticate } from \"../../shopify.server\";\n *\n * export async function loader({ request }: LoaderFunctionArgs) {\n * await authenticate.admin(request);\n *\n * return null\n * }\n * ```\n */\n authPathPrefix?: string;\n\n /**\n * Features that will be introduced in future releases of this package.\n *\n * You can opt in to these features by setting the corresponding flags. By doing so, you can prepare for future\n * releases in advance and provide feedback on the new features.\n */\n future?: Future;\n}" - }, - "WebhookConfig": { - "filePath": "/server/config-types.ts", - "name": "WebhookConfig", - "description": "", - "members": [ + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "RightMeta", + "value": 92 + }, { - "filePath": "/server/config-types.ts", - "name": "[key: string]", - "value": "WebhookHandler | WebhookHandler[]" - } - ], - "value": "export interface WebhookConfig {\n [key: string]: WebhookHandler | WebhookHandler[];\n}" - }, - "HooksConfig": { - "filePath": "/server/config-types.ts", - "name": "HooksConfig", - "description": "", - "members": [ + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Select", + "value": 93 + }, { - "filePath": "/server/config-types.ts", - "syntaxKind": "PropertySignature", - "name": "afterAuth", - "value": "(options: AfterAuthOptions) => void | Promise", - "description": "A function to call after a merchant installs your app", - "isOptional": true, - "examples": [ - { - "title": "Registering webhooks and seeding data when a merchant installs your app", - "description": "", - "tabs": [ - { - "code": "import { DeliveryMethod, shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { seedStoreData } from \"~/db/seeds\"\n\nconst shopify = shopifyApp({\n hooks: {\n afterAuth: async ({ session }) => {\n shopify.registerWebhooks({ session });\n seedStoreData({session})\n }\n },\n webhooks: {\n APP_UNINSTALLED: {\n deliveryMethod: DeliveryMethod.Http,\n callbackUrl: \"/webhooks\",\n },\n },\n // ...etc\n});", - "title": "Example" - } - ] - } - ] - } - ], - "value": "interface HooksConfig {\n /**\n * A function to call after a merchant installs your app\n *\n * @param context - An object with context about the request that triggered the hook.\n * @param context.session - The session of the merchant that installed your app. This is the output of sessionStorage.loadSession in case people want to load their own.\n * @param context.admin - An object with access to the Shopify Admin API's.\n *\n * @example\n * Registering webhooks and seeding data when a merchant installs your app.\n * ```ts\n * import { DeliveryMethod, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { seedStoreData } from \"~/db/seeds\"\n *\n * const shopify = shopifyApp({\n * hooks: {\n * afterAuth: async ({ session }) => {\n * shopify.registerWebhooks({ session });\n * seedStoreData({session})\n * }\n * },\n * webhooks: {\n * APP_UNINSTALLED: {\n * deliveryMethod: DeliveryMethod.Http,\n * callbackUrl: \"/webhooks\",\n * },\n * },\n * // ...etc\n * });\n * ```\n */\n afterAuth?: (options: AfterAuthOptions) => void | Promise;\n}" - }, - "AfterAuthOptions": { - "filePath": "/server/config-types.ts", - "name": "AfterAuthOptions", - "description": "", - "members": [ + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Numpad0", + "value": 96 + }, { - "filePath": "/server/config-types.ts", - "syntaxKind": "PropertySignature", - "name": "session", - "value": "Session", - "description": "" + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Numpad1", + "value": 97 }, { - "filePath": "/server/config-types.ts", - "syntaxKind": "PropertySignature", - "name": "admin", - "value": "AdminApiContext", - "description": "" - } - ], - "value": "export interface AfterAuthOptions<\n R extends ShopifyRestResources = ShopifyRestResources,\n> {\n session: Session;\n admin: AdminApiContext;\n}" - }, - "AdminApiContext": { - "filePath": "/server/clients/admin/types.ts", - "name": "AdminApiContext", - "description": "", - "members": [ + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Numpad2", + "value": 98 + }, { - "filePath": "/server/clients/admin/types.ts", - "syntaxKind": "PropertySignature", - "name": "rest", - "value": "RestClientWithResources", - "description": "Methods for interacting with the Shopify Admin REST API\n\nThere are methods for interacting with individual REST resources. You can also make `GET`, `POST`, `PUT` and `DELETE` requests should the REST resources not meet your needs.\n\n\n\n\n", - "examples": [ - { - "title": "Using REST resources", - "description": "Getting the number of orders in a store using REST resources. Visit the [Admin REST API references](/docs/api/admin-rest) for examples on using each resource.", - "tabs": [ - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n return json(admin.rest.resources.Order.count({ session }));\n};", - "title": "/app/routes/**\\/*.ts" - }, - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-07\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "/app/shopify.server.ts" - } - ] - }, - { - "title": "Performing a GET request to the REST API", - "description": "Use `admin.rest.get` to make custom requests to make a request to to the `customer/count` endpoint", - "tabs": [ - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n const response = await admin.rest.get({ path: \"/customers/count.json\" });\n const customers = await response.json();\n return json({ customers });\n};", - "title": "/app/routes/**\\/*.ts" - }, - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "/app/shopify.server.ts" - } - ] - }, - { - "title": "Performing a POST request to the REST API", - "description": "Use `admin.rest.post` to make custom requests to make a request to to the `customers.json` endpoint to send a welcome email", - "tabs": [ - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { admin, session } = await authenticate.admin(request);\n const response = admin.rest.post({\n path: \"customers/7392136888625/send_invite.json\",\n body: {\n customer_invite: {\n to: \"new_test_email@shopify.com\",\n from: \"j.limited@example.com\",\n bcc: [\"j.limited@example.com\"],\n subject: \"Welcome to my new shop\",\n custom_message: \"My awesome new store\",\n },\n },\n});\n const customerInvite = await response.json();\n return json({ customerInvite });\n};", - "title": "/app/routes/**\\/*.ts" - }, - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "/app/shopify.server.ts" - } - ] - } - ] + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Numpad3", + "value": 99 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Numpad4", + "value": 100 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Numpad5", + "value": 101 }, { - "filePath": "/server/clients/admin/types.ts", - "syntaxKind": "PropertySignature", - "name": "graphql", - "value": "GraphQLClient", - "description": "Methods for interacting with the Shopify Admin GraphQL API\n\n\n\n\n\n\n\n\n\n", - "examples": [ - { - "title": "Querying the GraphQL API", - "description": "Use `admin.graphql` to make query / mutation requests.", - "tabs": [ - { - "code": "import { ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.admin(request);\n\n const response = await admin.graphql(\n `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n { variables: { input: { title: \"Product Name\" } } }\n );\n\n const productData = await response.json();\n return json({ data: productData.data });\n}", - "title": "Example" - } - ] - } - ] - } - ], - "value": "export interface AdminApiContext<\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> {\n /**\n * Methods for interacting with the Shopify Admin REST API\n *\n * There are methods for interacting with individual REST resources. You can also make `GET`, `POST`, `PUT` and `DELETE` requests should the REST resources not meet your needs.\n *\n * {@link https://shopify.dev/docs/api/admin-rest}\n *\n * @example\n * Using REST resources.\n * Getting the number of orders in a store using REST resources. Visit the [Admin REST API references](/docs/api/admin-rest) for examples on using each resource. \n *\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * return json(admin.rest.resources.Order.count({ session }));\n * };\n * ```\n *\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-07\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n *\n *\n * @example\n * Performing a GET request to the REST API.\n * Use `admin.rest.get` to make custom requests to make a request to to the `customer/count` endpoint\n *\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * const response = await admin.rest.get({ path: \"/customers/count.json\" });\n * const customers = await response.json();\n * return json({ customers });\n * };\n * ```\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n * @example\n * Performing a POST request to the REST API.\n * Use `admin.rest.post` to make custom requests to make a request to to the `customers.json` endpoint to send a welcome email\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * const response = admin.rest.post({\n * path: \"customers/7392136888625/send_invite.json\",\n * body: {\n * customer_invite: {\n * to: \"new_test_email@shopify.com\",\n * from: \"j.limited@example.com\",\n * bcc: [\"j.limited@example.com\"],\n * subject: \"Welcome to my new shop\",\n * custom_message: \"My awesome new store\",\n * },\n * },\n * });\n * const customerInvite = await response.json();\n * return json({ customerInvite });\n * };\n * ```\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n rest: RestClientWithResources;\n\n /**\n * Methods for interacting with the Shopify Admin GraphQL API\n *\n * {@link https://shopify.dev/docs/api/admin-graphql}\n * {@link https://github.com/Shopify/shopify-api-js/blob/main/packages/shopify-api/docs/reference/clients/Graphql.md}\n *\n * @example\n * Querying the GraphQL API.\n * Use `admin.graphql` to make query / mutation requests.\n * ```ts\n * import { ActionFunctionArgs } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { admin } = await authenticate.admin(request);\n *\n * const response = await admin.graphql(\n * `#graphql\n * mutation populateProduct($input: ProductInput!) {\n * productCreate(input: $input) {\n * product {\n * id\n * }\n * }\n * }`,\n * { variables: { input: { title: \"Product Name\" } } }\n * );\n *\n * const productData = await response.json();\n * return json({ data: productData.data });\n * }\n * ```\n */\n graphql: GraphQLClient;\n}" - }, - "RestClientWithResources": { - "filePath": "/server/clients/admin/rest.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "RestClientWithResources", - "value": "RemixRestClient & {resources: Resources}", - "description": "" - }, - "AppDistribution": { - "filePath": "/server/types.ts", - "syntaxKind": "EnumDeclaration", - "name": "AppDistribution", - "value": "export enum AppDistribution {\n AppStore = 'app_store',\n SingleMerchant = 'single_merchant',\n ShopifyAdmin = 'shopify_admin',\n}", - "members": [ + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Numpad6", + "value": 102 + }, { - "filePath": "/server/types.ts", - "name": "AppStore", - "value": "app_store" + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Numpad7", + "value": 103 }, { - "filePath": "/server/types.ts", - "name": "SingleMerchant", - "value": "single_merchant" + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Numpad8", + "value": 104 }, { - "filePath": "/server/types.ts", - "name": "ShopifyAdmin", - "value": "shopify_admin" - } - ] - }, - "FutureFlags": { - "filePath": "/server/future/flags.ts", - "name": "FutureFlags", - "description": "", - "members": [ + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Numpad9", + "value": 105 + }, { - "filePath": "/server/future/flags.ts", - "syntaxKind": "PropertySignature", - "name": "v3_webhookAdminContext", - "value": "boolean", - "description": "When enabled, returns the same `admin` context (`AdminApiContext`) from `authenticate.webhook` that is returned from `authenticate.admin`.", - "isOptional": true, - "defaultValue": "false" + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Multiply", + "value": 106 }, { - "filePath": "/server/future/flags.ts", - "syntaxKind": "PropertySignature", - "name": "v3_authenticatePublic", - "value": "boolean", - "description": "When enabled authenticate.public() will not work. Use authenticate.public.checkout() instead.", - "isOptional": true, - "defaultValue": "false" - } - ], - "value": "export interface FutureFlags {\n /**\n * When enabled, returns the same `admin` context (`AdminApiContext`) from `authenticate.webhook` that is returned from `authenticate.admin`.\n *\n * @default false\n */\n v3_webhookAdminContext?: boolean;\n\n /**\n * When enabled authenticate.public() will not work. Use authenticate.public.checkout() instead.\n *\n * @default false\n */\n v3_authenticatePublic?: boolean;\n}" - }, - "ShopifyApp": { - "filePath": "/server/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "ShopifyApp", - "value": "Config['distribution'] extends AppDistribution.ShopifyAdmin\n ? AdminApp\n : Config['distribution'] extends AppDistribution.SingleMerchant\n ? SingleMerchantApp\n : Config['distribution'] extends AppDistribution.AppStore\n ? AppStoreApp\n : AppStoreApp", - "description": "An object your app can use to interact with Shopify.\n\nBy default, the app's distribution is `AppStore`." - }, - "AdminApp": { - "filePath": "/server/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "AdminApp", - "value": "ShopifyAppBase", - "description": "", - "members": [ + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Add", + "value": 107 + }, { - "filePath": "/server/types.ts", - "syntaxKind": "PropertySignature", - "name": "sessionStorage", - "value": "SessionStorageType", - "description": "The `SessionStorage` instance you passed in as a config option.", - "examples": [ - { - "title": "Storing sessions with Prisma", - "description": "Import the `@shopify/shopify-app-session-storage-prisma` package to store sessions in your Prisma database.", - "tabs": [ - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { PrismaSessionStorage } from \"@shopify/shopify-app-session-storage-prisma\";\nimport prisma from \"~/db.server\";\n\nconst shopify = shopifyApp({\n sesssionStorage: new PrismaSessionStorage(prisma),\n // ...etc\n})\n\n// shopify.sessionStorage is an instance of PrismaSessionStorage", - "title": "/app/shopify.server.ts" - } - ] - } - ] + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Subtract", + "value": 109 }, { - "filePath": "/server/types.ts", - "syntaxKind": "PropertySignature", - "name": "addDocumentResponseHeaders", - "value": "AddDocumentResponseHeaders", - "description": "Adds the required Content Security Policy headers for Shopify apps to the given Headers object.\n\n\n\n\n", - "examples": [ - { - "title": "Return headers on all requests", - "description": "Add headers to all HTML requests by calling `shopify.addDocumentResponseHeaders` in `entry.server.tsx`.", - "tabs": [ - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n});\nexport default shopify;\nexport const addDocumentResponseheaders = shopify.addDocumentResponseheaders;", - "title": "~/shopify.server.ts" - }, - { - "code": "import { addDocumentResponseHeaders } from \"~/shopify.server\";\n\nexport default function handleRequest(\n request: Request,\n responseStatusCode: number,\n responseHeaders: Headers,\n remixContext: EntryContext\n) {\n const markup = renderToString(\n \n );\n\n responseHeaders.set(\"Content-Type\", \"text/html\");\n addDocumentResponseHeaders(request, responseHeaders);\n\n return new Response(\"\" + markup, {\n status: responseStatusCode,\n headers: responseHeaders,\n });\n}", - "title": "entry.server.tsx" - } - ] - } - ] + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Decimal", + "value": 110 }, { - "filePath": "/server/types.ts", - "syntaxKind": "PropertySignature", - "name": "registerWebhooks", - "value": "RegisterWebhooks", - "description": "Register webhook topics for a store using the given session. Most likely you want to use this in combination with the afterAuth hook.", - "examples": [ - { - "title": "Registering webhooks after install", - "description": "Trigger the registration to create the webhook subscriptions after a merchant installs your app using the `afterAuth` hook. Learn more about [subscribing to webhooks.](/docs/api/shopify-app-remix/v1/guide-webhooks)", - "tabs": [ - { - "code": "import { DeliveryMethod, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n hooks: {\n afterAuth: async ({ session }) => {\n shopify.registerWebhooks({ session });\n }\n },\n webhooks: {\n APP_UNINSTALLED: {\n deliveryMethod: DeliveryMethod.Http,\n callbackUrl: \"/webhooks\",\n },\n },\n // ...etc\n});", - "title": "/app/shopify.server.ts" - } - ] - } - ] + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Divide", + "value": 111 }, { - "filePath": "/server/types.ts", - "syntaxKind": "PropertySignature", - "name": "authenticate", - "value": "Authenticate", - "description": "Ways to authenticate requests from different surfaces across Shopify.", - "examples": [ - { - "title": "Authenticate Shopify requests", - "description": "Use the functions in `authenticate` to validate requests coming from Shopify.", - "tabs": [ - { - "code": "import { LATEST_API_VERSION, shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;", - "title": "/app/shopify.server.ts" - }, - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport shopify from \"../../shopify.server\";\n\nexport async function loader({ request }: LoaderFunctionArgs) {\n const {admin, session, sessionToken, billing} = shopify.authenticate.admin(request);\n\n return json(await admin.rest.resources.Product.count({ session }));\n}", - "title": "/app/routes/**\\/*.jsx" - } - ] - } - ] + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F1", + "value": 112 }, { - "filePath": "/server/types.ts", - "syntaxKind": "PropertySignature", - "name": "unauthenticated", - "value": "Unauthenticated>", - "description": "Ways to get Contexts from requests that do not originate from Shopify.", - "examples": [ - { - "title": "Using unauthenticated contexts", - "description": "Create contexts for requests that don't come from Shopify.", - "tabs": [ - { - "code": "import { LATEST_API_VERSION, shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;", - "title": "/app/shopify.server.ts" - }, - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticateExternal } from \"~/helpers/authenticate\"\nimport shopify from \"../../shopify.server\";\n\nexport async function loader({ request }: LoaderFunctionArgs) {\n const shop = await authenticateExternal(request)\n const {admin} = await shopify.unauthenticated.admin(shop);\n\n return json(await admin.rest.resources.Product.count({ session }));\n}", - "title": "/app/routes/**\\/*.jsx" - } - ] - } - ] - } - ] - }, - "SessionStorageType": { - "filePath": "/server/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "SessionStorageType", - "value": "Config['sessionStorage'] extends SessionStorage\n ? Config['sessionStorage']\n : SessionStorage", - "description": "" - }, - "AddDocumentResponseHeaders": { - "filePath": "/server/types.ts", - "name": "AddDocumentResponseHeaders", - "description": "", - "params": [ + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F2", + "value": 113 + }, { - "name": "request", - "description": "", - "value": "Request", - "filePath": "/server/types.ts" + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F3", + "value": 114 }, { - "name": "headers", - "description": "", - "value": "Headers", - "filePath": "/server/types.ts" - } - ], - "returns": { - "filePath": "/server/types.ts", - "description": "", - "name": "void", - "value": "void" - }, - "value": "type AddDocumentResponseHeaders = (request: Request, headers: Headers) => void;" - }, - "RegisterWebhooks": { - "filePath": "/server/types.ts", - "name": "RegisterWebhooks", - "description": "", - "params": [ + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F4", + "value": 115 + }, { - "name": "options", - "description": "", - "value": "RegisterWebhooksOptions", - "filePath": "/server/types.ts" - } - ], - "returns": { - "filePath": "/server/types.ts", - "description": "", - "name": "Promise", - "value": "Promise" - }, - "value": "type RegisterWebhooks = (\n options: RegisterWebhooksOptions,\n) => Promise;" - }, - "RegisterWebhooksOptions": { - "filePath": "/server/authenticate/webhooks/types.ts", - "name": "RegisterWebhooksOptions", - "description": "", - "members": [ + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F5", + "value": 116 + }, { - "filePath": "/server/authenticate/webhooks/types.ts", - "syntaxKind": "PropertySignature", - "name": "session", - "value": "Session", - "description": "The Shopify session used to register webhooks using the Admin API." - } - ], - "value": "export interface RegisterWebhooksOptions {\n /**\n * The Shopify session used to register webhooks using the Admin API.\n */\n session: Session;\n}" - }, - "Authenticate": { - "filePath": "/server/types.ts", - "name": "Authenticate", - "description": "", - "members": [ + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F6", + "value": 117 + }, { - "filePath": "/server/types.ts", - "syntaxKind": "PropertySignature", - "name": "admin", - "value": "AuthenticateAdmin>", - "description": "Authenticate an admin Request and get back an authenticated admin context. Use the authenticated admin context to interact with Shopify.\n\nExamples of when to use this are requests from your app's UI, or requests from admin extensions.\n\nIf there is no session for the Request, this will redirect the merchant to correct auth flows.", - "examples": [ - { - "title": "Authenticating a request for an embedded app", - "description": "", - "tabs": [ - { - "code": "import { LATEST_API_VERSION, shopifyApp } from \"@shopify/shopify-app-remix/server\";\nimport { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n\nconst shopify = shopifyApp({\n restResources,\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "/app/shopify.server.ts" - }, - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../../shopify.server\";\n\nexport async function loader({ request }: LoaderFunctionArgs) {\n const {admin, session, sessionToken, billing} = authenticate.admin(request);\n\n return json(await admin.rest.resources.Product.count({ session }));\n}", - "title": "/app/routes/**\\/*.jsx" - } - ] - } - ] + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F7", + "value": 118 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F8", + "value": 119 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F9", + "value": 120 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F10", + "value": 121 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F11", + "value": 122 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "F12", + "value": 123 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "NumLock", + "value": 144 }, { - "filePath": "/server/types.ts", - "syntaxKind": "PropertySignature", - "name": "public", - "value": "AuthenticatePublic", - "description": "Authenticate a public request and get back a session token.", - "examples": [ - { - "title": "Authenticating a request from a checkout extension", - "description": "", - "tabs": [ - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../../shopify.server\";\nimport { getWidgets } from \"~/db/widgets\";\n\nexport async function loader({ request }: LoaderFunctionArgs) {\n const {sessionToken} = authenticate.public.checkout(request);\n\n return json(await getWidgets(sessionToken));\n}", - "title": "/app/routes/api/checkout.jsx" - } - ] - } - ] + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "ScrollLock", + "value": 145 }, { - "filePath": "/server/types.ts", - "syntaxKind": "PropertySignature", - "name": "webhook", - "value": "AuthenticateWebhook<\n Config['future'],\n RestResourcesType,\n keyof Config['webhooks'] | MandatoryTopics\n >", - "description": "Authenticate a Shopify webhook request, get back an authenticated admin context and details on the webhook request", - "examples": [ - { - "title": "Authenticating a webhook request", - "description": "", - "tabs": [ - { - "code": "import { DeliveryMethod, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n webhooks: {\n APP_UNINSTALLED: {\n deliveryMethod: DeliveryMethod.Http,\n callbackUrl: \"/webhooks\",\n },\n },\n hooks: {\n afterAuth: async ({ session }) => {\n shopify.registerWebhooks({ session });\n },\n },\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "/app/shopify.server.ts" - }, - { - "code": "import { ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport db from \"../db.server\";\n\nexport const action = async ({ request }: ActionFunctionArgs) => {\n const { topic, shop, session } = await authenticate.webhook(request);\n\n switch (topic) {\n case \"APP_UNINSTALLED\":\n if (session) {\n await db.session.deleteMany({ where: { shop } });\n }\n break;\n case \"CUSTOMERS_DATA_REQUEST\":\n case \"CUSTOMERS_REDACT\":\n case \"SHOP_REDACT\":\n default:\n throw new Response(\"Unhandled webhook topic\", { status: 404 });\n }\n\n throw new Response();\n};", - "title": "/app/routes/webhooks.ts" - } - ] - } - ] - } - ], - "value": "interface Authenticate {\n /**\n * Authenticate an admin Request and get back an authenticated admin context. Use the authenticated admin context to interact with Shopify.\n *\n * Examples of when to use this are requests from your app's UI, or requests from admin extensions.\n *\n * If there is no session for the Request, this will redirect the merchant to correct auth flows.\n *\n * @example\n * Authenticating a request for an embedded app.\n * ```ts\n * // /app/shopify.server.ts\n * import { LATEST_API_VERSION, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n * ```ts\n * // /app/routes/**\\/*.jsx\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../../shopify.server\";\n *\n * export async function loader({ request }: LoaderFunctionArgs) {\n * const {admin, session, sessionToken, billing} = authenticate.admin(request);\n *\n * return json(await admin.rest.resources.Product.count({ session }));\n * }\n * ```\n */\n admin: AuthenticateAdmin>;\n\n /**\n * Authenticate a public request and get back a session token.\n *\n * @example\n * Authenticating a request from a checkout extension\n *\n * ```ts\n * // /app/routes/api/checkout.jsx\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../../shopify.server\";\n * import { getWidgets } from \"~/db/widgets\";\n *\n * export async function loader({ request }: LoaderFunctionArgs) {\n * const {sessionToken} = authenticate.public.checkout(request);\n *\n * return json(await getWidgets(sessionToken));\n * }\n * ```\n */\n public: AuthenticatePublic;\n\n /**\n * Authenticate a Shopify webhook request, get back an authenticated admin context and details on the webhook request\n *\n * @example\n * Authenticating a webhook request\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { DeliveryMethod, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n *\n * const shopify = shopifyApp({\n * webhooks: {\n * APP_UNINSTALLED: {\n * deliveryMethod: DeliveryMethod.Http,\n * callbackUrl: \"/webhooks\",\n * },\n * },\n * hooks: {\n * afterAuth: async ({ session }) => {\n * shopify.registerWebhooks({ session });\n * },\n * },\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n * ```ts\n * // /app/routes/webhooks.ts\n * import { ActionFunctionArgs } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n * import db from \"../db.server\";\n *\n * export const action = async ({ request }: ActionFunctionArgs) => {\n * const { topic, shop, session } = await authenticate.webhook(request);\n *\n * switch (topic) {\n * case \"APP_UNINSTALLED\":\n * if (session) {\n * await db.session.deleteMany({ where: { shop } });\n * }\n * break;\n * case \"CUSTOMERS_DATA_REQUEST\":\n * case \"CUSTOMERS_REDACT\":\n * case \"SHOP_REDACT\":\n * default:\n * throw new Response(\"Unhandled webhook topic\", { status: 404 });\n * }\n *\n * throw new Response();\n * };\n * ```\n */\n webhook: AuthenticateWebhook<\n Config['future'],\n RestResourcesType,\n keyof Config['webhooks'] | MandatoryTopics\n >;\n}" - }, - "AuthenticateAdmin": { - "filePath": "/server/types.ts", - "name": "AuthenticateAdmin", - "description": "", - "params": [ + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Semicolon", + "value": 186 + }, { - "name": "request", - "description": "", - "value": "Request", - "filePath": "/server/types.ts" - } - ], - "returns": { - "filePath": "/server/types.ts", - "description": "", - "name": "Promise>", - "value": "Promise>" - }, - "value": "type AuthenticateAdmin<\n Config extends AppConfigArg,\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> = (request: Request) => Promise>;" - }, - "AdminContext": { - "filePath": "/server/authenticate/admin/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "AdminContext", - "value": "Config['isEmbeddedApp'] extends false\n ? NonEmbeddedAdminContext\n : EmbeddedAdminContext", - "description": "" - }, - "NonEmbeddedAdminContext": { - "filePath": "/server/authenticate/admin/types.ts", - "name": "NonEmbeddedAdminContext", - "description": "", - "members": [ + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Equals", + "value": 187 + }, { - "filePath": "/server/authenticate/admin/types.ts", - "syntaxKind": "PropertySignature", - "name": "session", - "value": "Session", - "description": "The session for the user who made the request.\n\nThis comes from the session storage which `shopifyApp` uses to store sessions in your database of choice.\n\nUse this to get shop or user-specific data.", - "examples": [ - { - "title": "Using offline sessions", - "description": "Get your app's shop-specific data using an offline session.", - "tabs": [ - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "shopify.server.ts" - }, - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session } = await authenticate.admin(request);\n return json(await getMyAppData({shop: session.shop));\n};", - "title": "/app/routes/**\\/*.ts" - } - ] - }, - { - "title": "Using online sessions", - "description": "Get your app's user-specific data using an online session.", - "tabs": [ - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n useOnlineTokens: true,\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "shopify.server.ts" - }, - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session } = await authenticate.admin(request);\n return json(await getMyAppData({user: session.onlineAccessInfo!.id}));\n};", - "title": "/app/routes/**\\/*.ts" - } - ] - } - ] + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Comma", + "value": 188 }, { - "filePath": "/server/authenticate/admin/types.ts", - "syntaxKind": "PropertySignature", - "name": "admin", - "value": "AdminApiContext", - "description": "Methods for interacting with the GraphQL / REST Admin APIs for the store that made the request." + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Dash", + "value": 189 }, { - "filePath": "/server/authenticate/admin/types.ts", - "syntaxKind": "PropertySignature", - "name": "billing", - "value": "BillingContext", - "description": "Billing methods for this store, based on the plans defined in the `billing` config option.\n\n\n\n\n" + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "Period", + "value": 190 }, { - "filePath": "/server/authenticate/admin/types.ts", - "syntaxKind": "PropertySignature", - "name": "cors", - "value": "EnsureCORSFunction", - "description": "A function that ensures the CORS headers are set correctly for the response.", - "examples": [ - { - "title": "Setting CORS headers for a admin request", - "description": "Use the `cors` helper to ensure your app can respond to requests from admin extensions.", - "tabs": [ - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session, cors } = await authenticate.admin(request);\n return cors(json(await getMyAppData({user: session.onlineAccessInfo!.id})));\n};", - "title": "/app/routes/admin/my-route.ts" - } - ] - } - ] + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "ForwardSlash", + "value": 191 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "GraveAccent", + "value": 192 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "OpenBracket", + "value": 219 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "BackSlash", + "value": 220 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "CloseBracket", + "value": 221 + }, + { + "filePath": "../../node_modules/@shopify/polaris/build/ts/src/types.d.ts", + "name": "SingleQuote", + "value": 222 } - ], - "value": "export interface NonEmbeddedAdminContext<\n Config extends AppConfigArg,\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> extends AdminContextInternal {}" + ] }, - "BillingContext": { - "filePath": "/server/authenticate/admin/billing/types.ts", - "name": "BillingContext", + "ShopifyClients": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "ShopifyClients", "description": "", "members": [ { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", "syntaxKind": "PropertySignature", - "name": "require", - "value": "(options: RequireBillingOptions) => Promise", - "description": "Checks if the shop has an active payment for any plan defined in the `billing` config option.", - "examples": [ - { - "title": "Requesting billing right away", - "description": "Call `billing.request` in the `onFailure` callback to immediately redirect to the Shopify page to request payment.", - "tabs": [ - { - "code": "import { LoaderFunctionArgs } from \"@remix-run/node\";\nimport { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { billing } = await authenticate.admin(request);\n await billing.require({\n plans: [MONTHLY_PLAN],\n isTest: true,\n onFailure: async () => billing.request({ plan: MONTHLY_PLAN }),\n });\n\n // App logic\n};", - "title": "/app/routes/**\\/*.ts" - }, - { - "code": "import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n\nexport const MONTHLY_PLAN = 'Monthly subscription';\nexport const ANNUAL_PLAN = 'Annual subscription';\n\nconst shopify = shopifyApp({\n // ...etc\n billing: {\n [MONTHLY_PLAN]: {\n amount: 5,\n currencyCode: 'USD',\n interval: BillingInterval.Every30Days,\n },\n [ANNUAL_PLAN]: {\n amount: 50,\n currencyCode: 'USD',\n interval: BillingInterval.Annual,\n },\n }\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "shopify.server.ts" - } - ] - }, - { - "title": "Using a plan selection page", - "description": "When the app has multiple plans, create a page in your App that allows the merchant to select a plan. If a merchant does not have the required plan you can redirect them to page in your app to select one.", - "tabs": [ - { - "code": "import { LoaderFunctionArgs, redirect } from \"@remix-run/node\";\nimport { authenticate, MONTHLY_PLAN, ANNUAL_PLAN } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { billing } = await authenticate.admin(request);\n const billingCheck = await billing.require({\n plans: [MONTHLY_PLAN, ANNUAL_PLAN],\n isTest: true,\n onFailure: () => redirect('/select-plan'),\n });\n\n const subscription = billingCheck.appSubscriptions[0];\n console.log(`Shop is on ${subscription.name} (id ${subscription.id})`);\n\n // App logic\n};", - "title": "/app/routes/**\\/*.ts" - }, - { - "code": "import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n\nexport const MONTHLY_PLAN = 'Monthly subscription';\nexport const ANNUAL_PLAN = 'Annual subscription';\n\nconst shopify = shopifyApp({\n // ...etc\n billing: {\n [MONTHLY_PLAN]: {\n amount: 5,\n currencyCode: 'USD',\n interval: BillingInterval.Every30Days,\n },\n [ANNUAL_PLAN]: {\n amount: 50,\n currencyCode: 'USD',\n interval: BillingInterval.Annual,\n },\n }\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "shopify.server.ts" - } - ] - } - ] + "name": "Rest", + "value": "typeof RestClient", + "description": "" }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", "syntaxKind": "PropertySignature", - "name": "request", - "value": "(options: RequestBillingOptions) => Promise", - "description": "Requests payment for the plan.", - "examples": [ - { - "title": "Using a custom return URL", - "description": "Change where the merchant is returned to after approving the purchase using the `returnUrl` option.", - "tabs": [ - { - "code": "import { LoaderFunctionArgs } from \"@remix-run/node\";\nimport { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { billing } = await authenticate.admin(request);\n await billing.require({\n plans: [MONTHLY_PLAN],\n onFailure: async () => billing.request({\n plan: MONTHLY_PLAN,\n isTest: true,\n returnUrl: 'https://admin.shopify.com/store/my-store/apps/my-app/billing-page',\n }),\n });\n\n // App logic\n};", - "title": "/app/routes/**\\/*.ts" - }, - { - "code": "import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n\nexport const MONTHLY_PLAN = 'Monthly subscription';\nexport const ANNUAL_PLAN = 'Annual subscription';\n\nconst shopify = shopifyApp({\n // ...etc\n billing: {\n [MONTHLY_PLAN]: {\n amount: 5,\n currencyCode: 'USD',\n interval: BillingInterval.Every30Days,\n },\n [ANNUAL_PLAN]: {\n amount: 50,\n currencyCode: 'USD',\n interval: BillingInterval.Annual,\n },\n }\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "shopify.server.ts" - } - ] - } - ] + "name": "Graphql", + "value": "typeof GraphqlClient", + "description": "" }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", "syntaxKind": "PropertySignature", - "name": "cancel", - "value": "(options: CancelBillingOptions) => Promise", - "description": "Cancels an ongoing subscription, given its ID.", - "examples": [ - { - "title": "Cancelling a subscription", - "description": "Use the `billing.cancel` function to cancel an active subscription with the id returned from `billing.require`.", - "tabs": [ - { - "code": "import { LoaderFunctionArgs } from \"@remix-run/node\";\nimport { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { billing } = await authenticate.admin(request);\n const billingCheck = await billing.require({\n plans: [MONTHLY_PLAN],\n onFailure: async () => billing.request({ plan: MONTHLY_PLAN }),\n });\n\n const subscription = billingCheck.appSubscriptions[0];\n const cancelledSubscription = await billing.cancel({\n subscriptionId: subscription.id,\n isTest: true,\n prorate: true,\n });\n\n // App logic\n};", - "title": "/app/routes/cancel-subscription.ts" - }, - { - "code": "import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n\nexport const MONTHLY_PLAN = 'Monthly subscription';\nexport const ANNUAL_PLAN = 'Annual subscription';\n\nconst shopify = shopifyApp({\n // ...etc\n billing: {\n [MONTHLY_PLAN]: {\n amount: 5,\n currencyCode: 'USD',\n interval: BillingInterval.Every30Days,\n },\n [ANNUAL_PLAN]: {\n amount: 50,\n currencyCode: 'USD',\n interval: BillingInterval.Annual,\n },\n }\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "shopify.server.ts" - } - ] - } - ] + "name": "Storefront", + "value": "typeof StorefrontClient", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "graphqlProxy", + "value": "GraphqlProxy", + "description": "" } ], - "value": "export interface BillingContext {\n /**\n * Checks if the shop has an active payment for any plan defined in the `billing` config option.\n *\n * @returns A promise that resolves to an object containing the active purchases for the shop.\n *\n * @example\n * Requesting billing right away.\n * Call `billing.request` in the `onFailure` callback to immediately redirect to the Shopify page to request payment.\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * await billing.require({\n * plans: [MONTHLY_PLAN],\n * isTest: true,\n * onFailure: async () => billing.request({ plan: MONTHLY_PLAN }),\n * });\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n *\n * @example\n * Using a plan selection page.\n * When the app has multiple plans, create a page in your App that allows the merchant to select a plan. If a merchant does not have the required plan you can redirect them to page in your app to select one.\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, redirect } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN, ANNUAL_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * const billingCheck = await billing.require({\n * plans: [MONTHLY_PLAN, ANNUAL_PLAN],\n * isTest: true,\n * onFailure: () => redirect('/select-plan'),\n * });\n *\n * const subscription = billingCheck.appSubscriptions[0];\n * console.log(`Shop is on ${subscription.name} (id ${subscription.id})`);\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n require: (\n options: RequireBillingOptions,\n ) => Promise;\n\n /**\n * Requests payment for the plan.\n *\n * @returns Redirects to the confirmation URL for the payment.\n *\n * @example\n * Using a custom return URL.\n * Change where the merchant is returned to after approving the purchase using the `returnUrl` option.\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * await billing.require({\n * plans: [MONTHLY_PLAN],\n * onFailure: async () => billing.request({\n * plan: MONTHLY_PLAN,\n * isTest: true,\n * returnUrl: 'https://admin.shopify.com/store/my-store/apps/my-app/billing-page',\n * }),\n * });\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n request: (options: RequestBillingOptions) => Promise;\n\n /**\n * Cancels an ongoing subscription, given its ID.\n *\n * @returns The cancelled subscription.\n *\n * @example\n * Cancelling a subscription.\n * Use the `billing.cancel` function to cancel an active subscription with the id returned from `billing.require`.\n * ```ts\n * // /app/routes/cancel-subscription.ts\n * import { LoaderFunctionArgs } from \"@remix-run/node\";\n * import { authenticate, MONTHLY_PLAN } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { billing } = await authenticate.admin(request);\n * const billingCheck = await billing.require({\n * plans: [MONTHLY_PLAN],\n * onFailure: async () => billing.request({ plan: MONTHLY_PLAN }),\n * });\n *\n * const subscription = billingCheck.appSubscriptions[0];\n * const cancelledSubscription = await billing.cancel({\n * subscriptionId: subscription.id,\n * isTest: true,\n * prorate: true,\n * });\n *\n * // App logic\n * };\n * ```\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp, BillingInterval } from \"@shopify/shopify-app-remix/server\";\n *\n * export const MONTHLY_PLAN = 'Monthly subscription';\n * export const ANNUAL_PLAN = 'Annual subscription';\n *\n * const shopify = shopifyApp({\n * // ...etc\n * billing: {\n * [MONTHLY_PLAN]: {\n * amount: 5,\n * currencyCode: 'USD',\n * interval: BillingInterval.Every30Days,\n * },\n * [ANNUAL_PLAN]: {\n * amount: 50,\n * currencyCode: 'USD',\n * interval: BillingInterval.Annual,\n * },\n * }\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n cancel: (options: CancelBillingOptions) => Promise;\n}" + "value": "export interface ShopifyClients {\n Rest: typeof RestClient;\n Graphql: typeof GraphqlClient;\n Storefront: typeof StorefrontClient;\n graphqlProxy: GraphqlProxy;\n}" }, - "RequireBillingOptions": { - "filePath": "/server/authenticate/admin/billing/types.ts", - "name": "RequireBillingOptions", + "GraphqlClient": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/graphql/client.d.ts", + "name": "GraphqlClient", "description": "", "members": [ { - "filePath": "/server/authenticate/admin/billing/types.ts", - "syntaxKind": "PropertySignature", - "name": "plans", - "value": "(keyof Config[\"billing\"])[]", - "description": "The plans to check for. Must be one of the values defined in the `billing` config option." + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/graphql/client.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "session", + "value": "Session", + "description": "" }, { - "filePath": "/server/authenticate/admin/billing/types.ts", - "syntaxKind": "PropertySignature", - "name": "onFailure", - "value": "(error: any) => Promise", - "description": "How to handle the request if the shop doesn't have an active payment for any plan." + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/graphql/client.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "client", + "value": "AdminApiClient", + "description": "" }, { - "filePath": "/server/authenticate/admin/billing/types.ts", - "syntaxKind": "PropertySignature", - "name": "isTest", - "value": "boolean", - "description": "", - "isOptional": true + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/graphql/client.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "apiVersion", + "value": "ApiVersion", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/graphql/client.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "query", + "value": "(params: GraphqlParams) => Promise>", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/admin/graphql/client.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "request", + "value": "(operation: Operation, options?: GraphqlQueryOptions) => Promise : T>>", + "description": "" } ], - "value": "export interface RequireBillingOptions\n extends Omit {\n /**\n * The plans to check for. Must be one of the values defined in the `billing` config option.\n */\n plans: (keyof Config['billing'])[];\n /**\n * How to handle the request if the shop doesn't have an active payment for any plan.\n */\n onFailure: (error: any) => Promise;\n}" + "value": "export declare class GraphqlClient {\n static config: ConfigInterface;\n readonly session: Session;\n readonly client: AdminApiClient;\n readonly apiVersion?: ApiVersion;\n constructor(params: GraphqlClientParams);\n query(params: GraphqlParams): Promise>;\n request(operation: Operation, options?: GraphqlQueryOptions): Promise : T>>;\n private graphqlClass;\n}" }, - "RequestBillingOptions": { - "filePath": "/server/authenticate/admin/billing/types.ts", - "name": "RequestBillingOptions", + "GraphqlParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "GraphqlParams", + "value": "Omit", + "description": "", + "members": [] + }, + "RequestReturn": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "RequestReturn", "description": "", "members": [ { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", "syntaxKind": "PropertySignature", - "name": "plan", - "value": "keyof Config[\"billing\"]", - "description": "The plan to request. Must be one of the values defined in the `billing` config option." - }, - { - "filePath": "/server/authenticate/admin/billing/types.ts", - "syntaxKind": "PropertySignature", - "name": "isTest", - "value": "boolean", - "description": "Whether to use the test mode. This prevents the credit card from being charged. Test shops and demo shops cannot be charged.", - "isOptional": true + "name": "body", + "value": "T", + "description": "" }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", "syntaxKind": "PropertySignature", - "name": "returnUrl", - "value": "string", - "description": "The URL to return to after the merchant approves the payment.", - "isOptional": true + "name": "headers", + "value": "Headers", + "description": "" } ], - "value": "export interface RequestBillingOptions\n extends Omit {\n /**\n * The plan to request. Must be one of the values defined in the `billing` config option.\n */\n plan: keyof Config['billing'];\n /**\n * Whether to use the test mode. This prevents the credit card from being charged. Test shops and demo shops cannot be charged.\n */\n isTest?: boolean;\n /**\n * The URL to return to after the merchant approves the payment.\n */\n returnUrl?: string;\n}" + "value": "export interface RequestReturn {\n body: T;\n headers: Headers;\n}" }, - "CancelBillingOptions": { - "filePath": "/server/authenticate/admin/billing/types.ts", - "name": "CancelBillingOptions", + "GraphqlQueryOptions": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "GraphqlQueryOptions", "description": "", "members": [ { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", "syntaxKind": "PropertySignature", - "name": "subscriptionId", - "value": "string", - "description": "The ID of the subscription to cancel." + "name": "variables", + "value": "ApiClientRequestOptions[\"variables\"]", + "description": "", + "isOptional": true }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", "syntaxKind": "PropertySignature", - "name": "prorate", - "value": "boolean", - "description": "Whether to prorate the cancellation.\n\n\n\n\n", + "name": "headers", + "value": "Record", + "description": "", "isOptional": true }, { - "filePath": "/server/authenticate/admin/billing/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", "syntaxKind": "PropertySignature", - "name": "isTest", - "value": "boolean", + "name": "retries", + "value": "number", "description": "", "isOptional": true } ], - "value": "export interface CancelBillingOptions {\n /**\n * The ID of the subscription to cancel.\n */\n subscriptionId: string;\n /**\n * Whether to prorate the cancellation.\n *\n * {@link https://shopify.dev/docs/apps/billing/subscriptions/cancel-recurring-charges}\n */\n prorate?: boolean;\n /*\n * Whether to use the test mode. This prevents the credit card from being charged. Test shops and demo shops cannot be charged.\n */\n isTest?: boolean;\n}" + "value": "export interface GraphqlQueryOptions {\n variables?: ApiClientRequestOptions['variables'];\n headers?: Record;\n retries?: number;\n}" }, - "EmbeddedAdminContext": { - "filePath": "/server/authenticate/admin/types.ts", - "name": "EmbeddedAdminContext", + "StorefrontClient": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/storefront/client.d.ts", + "name": "StorefrontClient", "description": "", "members": [ { - "filePath": "/server/authenticate/admin/types.ts", - "syntaxKind": "PropertySignature", - "name": "sessionToken", - "value": "JwtPayload", - "description": "The decoded and validated session token for the request.\n\nReturned only if `isEmbeddedApp` is `true`.\n\n\n\n\n", - "examples": [ - { - "title": "Using the decoded session token", - "description": "Get user-specific data using the `sessionToken` object.", - "tabs": [ - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n useOnlineTokens: true,\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "shopify.server.ts" - }, - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { sessionToken } = await authenticate.public.checkout(\n request\n );\n return json(await getMyAppData({user: sessionToken.sub}));\n};", - "title": "/app/routes/**\\/*.ts" - } - ] - } - ] - }, - { - "filePath": "/server/authenticate/admin/types.ts", - "syntaxKind": "PropertySignature", - "name": "redirect", - "value": "RedirectFunction", - "description": "A function that redirects the user to a new page, ensuring that the appropriate parameters are set for embedded apps.\n\nReturned only if `isEmbeddedApp` is `true`.", - "examples": [ - { - "title": "Redirecting to an app route", - "description": "Use the `redirect` helper to safely redirect between pages.", - "tabs": [ - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session, redirect } = await authenticate.admin(request);\n return redirect(\"/\");\n};", - "title": "/app/routes/admin/my-route.ts" - } - ] - }, - { - "title": "Redirecting outside of Shopify admin", - "description": "Pass in a `target` option of `_top` or `_parent` to go to an external URL.", - "tabs": [ - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session, redirect } = await authenticate.admin(request);\n return redirect(\"/\", { target: '_parent' });\n};", - "title": "/app/routes/admin/my-route.ts" - } - ] - } - ] - }, - { - "filePath": "/server/authenticate/admin/types.ts", - "syntaxKind": "PropertySignature", + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/storefront/client.d.ts", + "syntaxKind": "PropertyDeclaration", "name": "session", "value": "Session", - "description": "The session for the user who made the request.\n\nThis comes from the session storage which `shopifyApp` uses to store sessions in your database of choice.\n\nUse this to get shop or user-specific data.", - "examples": [ - { - "title": "Using offline sessions", - "description": "Get your app's shop-specific data using an offline session.", - "tabs": [ - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "shopify.server.ts" - }, - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session } = await authenticate.admin(request);\n return json(await getMyAppData({shop: session.shop));\n};", - "title": "/app/routes/**\\/*.ts" - } - ] - }, - { - "title": "Using online sessions", - "description": "Get your app's user-specific data using an online session.", - "tabs": [ - { - "code": "import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n\nconst shopify = shopifyApp({\n // ...etc\n useOnlineTokens: true,\n});\nexport default shopify;\nexport const authenticate = shopify.authenticate;", - "title": "shopify.server.ts" - }, - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session } = await authenticate.admin(request);\n return json(await getMyAppData({user: session.onlineAccessInfo!.id}));\n};", - "title": "/app/routes/**\\/*.ts" - } - ] - } - ] + "description": "" }, { - "filePath": "/server/authenticate/admin/types.ts", - "syntaxKind": "PropertySignature", - "name": "admin", - "value": "AdminApiContext", - "description": "Methods for interacting with the GraphQL / REST Admin APIs for the store that made the request." + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/storefront/client.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "client", + "value": "StorefrontApiClient", + "description": "" }, { - "filePath": "/server/authenticate/admin/types.ts", - "syntaxKind": "PropertySignature", - "name": "billing", - "value": "BillingContext", - "description": "Billing methods for this store, based on the plans defined in the `billing` config option.\n\n\n\n\n" + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/storefront/client.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "apiVersion", + "value": "ApiVersion", + "description": "" }, { - "filePath": "/server/authenticate/admin/types.ts", - "syntaxKind": "PropertySignature", - "name": "cors", - "value": "EnsureCORSFunction", - "description": "A function that ensures the CORS headers are set correctly for the response.", - "examples": [ - { - "title": "Setting CORS headers for a admin request", - "description": "Use the `cors` helper to ensure your app can respond to requests from admin extensions.", - "tabs": [ - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { session, cors } = await authenticate.admin(request);\n return cors(json(await getMyAppData({user: session.onlineAccessInfo!.id})));\n};", - "title": "/app/routes/admin/my-route.ts" - } - ] - } - ] + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/storefront/client.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "query", + "value": "(params: GraphqlParams) => Promise>", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/storefront/client.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "request", + "value": "(operation: Operation, options?: GraphqlQueryOptions) => Promise : T>>", + "description": "" } ], - "value": "export interface EmbeddedAdminContext<\n Config extends AppConfigArg,\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> extends AdminContextInternal {\n /**\n * The decoded and validated session token for the request.\n *\n * Returned only if `isEmbeddedApp` is `true`.\n *\n * {@link https://shopify.dev/docs/apps/auth/oauth/session-tokens#payload}\n *\n * @example\n * Using the decoded session token.\n * Get user-specific data using the `sessionToken` object.\n * ```ts\n * // shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n *\n * const shopify = shopifyApp({\n * // ...etc\n * useOnlineTokens: true,\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n * import { getMyAppData } from \"~/db/model.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { sessionToken } = await authenticate.public.checkout(\n * request\n * );\n * return json(await getMyAppData({user: sessionToken.sub}));\n * };\n * ```\n */\n sessionToken: JwtPayload;\n\n /**\n * A function that redirects the user to a new page, ensuring that the appropriate parameters are set for embedded\n * apps.\n *\n * Returned only if `isEmbeddedApp` is `true`.\n *\n * @example\n * Redirecting to an app route.\n * Use the `redirect` helper to safely redirect between pages.\n * ```ts\n * // /app/routes/admin/my-route.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { session, redirect } = await authenticate.admin(request);\n * return redirect(\"/\");\n * };\n * ```\n *\n * @example\n * Redirecting outside of Shopify admin.\n * Pass in a `target` option of `_top` or `_parent` to go to an external URL.\n * ```ts\n * // /app/routes/admin/my-route.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { session, redirect } = await authenticate.admin(request);\n * return redirect(\"/\", { target: '_parent' });\n * };\n * ```\n */\n redirect: RedirectFunction;\n}" + "value": "export declare class StorefrontClient {\n static config: ConfigInterface;\n readonly session: Session;\n readonly client: StorefrontApiClient;\n readonly apiVersion?: ApiVersion;\n constructor(params: GraphqlClientParams);\n query(params: GraphqlParams): Promise>;\n request(operation: Operation, options?: GraphqlQueryOptions): Promise : T>>;\n private storefrontClass;\n}" }, - "RedirectFunction": { - "filePath": "/server/authenticate/admin/helpers/redirect.ts", - "name": "RedirectFunction", + "GraphqlProxy": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/graphql_proxy/types.d.ts", + "name": "GraphqlProxy", "description": "", "params": [ { - "name": "url", - "description": "", - "value": "string", - "filePath": "/server/authenticate/admin/helpers/redirect.ts" - }, - { - "name": "init", + "name": "params", "description": "", - "value": "RedirectInit", - "isOptional": true, - "filePath": "/server/authenticate/admin/helpers/redirect.ts" + "value": "GraphqlProxyParams", + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/graphql_proxy/types.d.ts" } ], "returns": { - "filePath": "/server/authenticate/admin/helpers/redirect.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/graphql_proxy/types.d.ts", "description": "", - "name": "TypedResponse", - "value": "TypedResponse" + "name": "Promise", + "value": "Promise" }, - "value": "export type RedirectFunction = (\n url: string,\n init?: RedirectInit,\n) => TypedResponse;" + "value": "export type GraphqlProxy = (params: GraphqlProxyParams) => Promise;" }, - "RedirectInit": { - "filePath": "/server/authenticate/admin/helpers/redirect.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "RedirectInit", - "value": "number | (ResponseInit & {target?: RedirectTarget})", - "description": "" + "GraphqlProxyParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/graphql_proxy/types.d.ts", + "name": "GraphqlProxyParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/graphql_proxy/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "session", + "value": "Session", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/graphql_proxy/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawBody", + "value": "string | Record", + "description": "" + } + ], + "value": "export interface GraphqlProxyParams {\n session: Session;\n rawBody: string | Record;\n}" }, - "RedirectTarget": { - "filePath": "/server/authenticate/admin/helpers/redirect.ts", + "ShopifyAuth": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/index.d.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "RedirectTarget", - "value": "'_self' | '_parent' | '_top'", + "name": "ShopifyAuth", + "value": "{\n begin: OAuthBegin;\n callback: OAuthCallback;\n nonce: Nonce;\n safeCompare: SafeCompare;\n getEmbeddedAppUrl: GetEmbeddedAppUrl;\n buildEmbeddedAppUrl: BuildEmbeddedAppUrl;\n} & (FeatureEnabled extends true ? {\n tokenExchange: TokenExchange;\n} : Record)", "description": "" }, - "RestResourcesType": { - "filePath": "/server/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "RestResourcesType", - "value": "Config['restResources'] extends ShopifyRestResources\n ? Config['restResources']\n : ShopifyRestResources", - "description": "" + "OAuthBegin": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/oauth.d.ts", + "name": "OAuthBegin", + "description": "", + "params": [ + { + "name": "beginParams", + "description": "", + "value": "BeginParams", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/oauth.d.ts" + } + ], + "returns": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/oauth.d.ts", + "description": "", + "name": "Promise", + "value": "Promise" + }, + "value": "export type OAuthBegin = (beginParams: BeginParams) => Promise;" }, - "AuthenticatePublic": { - "filePath": "/server/authenticate/public/types.ts", + "BeginParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "name": "BeginParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "shop", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "callbackPath", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "isOnline", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawRequest", + "value": "AdapterRequest", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawResponse", + "value": "AdapterResponse", + "description": "", + "isOptional": true + } + ], + "value": "export interface BeginParams extends AdapterArgs {\n shop: string;\n callbackPath: string;\n isOnline: boolean;\n}" + }, + "AdapterRequest": { + "filePath": "../../node_modules/@shopify/shopify-api/runtime/http/types.d.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "AuthenticatePublic", - "value": "FeatureEnabled extends true\n ? AuthenticatePublicObject\n : AuthenticatePublicLegacy", + "name": "AdapterRequest", + "value": "any", "description": "" }, - "FeatureEnabled": { - "filePath": "/server/future/flags.ts", + "AdapterResponse": { + "filePath": "../../node_modules/@shopify/shopify-api/runtime/http/types.d.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "FeatureEnabled", - "value": "Future extends FutureFlags\n ? Future[Flag] extends true\n ? true\n : false\n : false", + "name": "AdapterResponse", + "value": "any", "description": "" }, - "AuthenticatePublicObject": { - "filePath": "/server/authenticate/public/types.ts", - "name": "AuthenticatePublicObject", - "description": "", - "members": [ - { - "filePath": "/server/authenticate/public/types.ts", - "syntaxKind": "PropertySignature", - "name": "checkout", - "value": "AuthenticateCheckout", - "description": "Authenticate a request from a checkout extension", - "examples": [ - { - "title": "Authenticating a checkout extension request", - "description": "", - "tabs": [ - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { sessionToken, cors } = await authenticate.public.checkout(\n request,\n );\n return cors(json({my: \"data\", shop: sessionToken.dest}));\n};", - "title": "/app/routes/public/widgets.ts" - } - ] - } - ] + "OAuthCallback": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/oauth.d.ts", + "name": "OAuthCallback", + "description": "", + "params": [ + { + "name": "callbackParams", + "description": "", + "value": "CallbackParams", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/oauth.d.ts" + } + ], + "returns": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/oauth.d.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}" + }, + "value": "export type OAuthCallback = (callbackParams: CallbackParams) => Promise>;" + }, + "CallbackParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "name": "CallbackParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawRequest", + "value": "AdapterRequest", + "description": "" }, { - "filePath": "/server/authenticate/public/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", "syntaxKind": "PropertySignature", - "name": "appProxy", - "value": "AuthenticateAppProxy", - "description": "Authenticate a request from an app proxy", - "examples": [ - { - "title": "Authenticating an app proxy request", - "description": "", - "tabs": [ - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n await authenticate.public.appProxy(\n request,\n );\n\n const {searchParams} = new URL(request.url);\n const shop = searchParams.get(\"shop\");\n const customerId = searchParams.get(\"logged_in_customer_id\")\n\n return json({my: \"data\", shop, customerId});\n};", - "title": "/app/routes/public/widgets.ts" - } - ] - } - ] + "name": "rawResponse", + "value": "AdapterResponse", + "description": "", + "isOptional": true } ], - "value": "export interface AuthenticatePublicObject {\n /**\n * Authenticate a request from a checkout extension\n *\n * @example\n * Authenticating a checkout extension request\n * ```ts\n * // /app/routes/public/widgets.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { sessionToken, cors } = await authenticate.public.checkout(\n * request,\n * );\n * return cors(json({my: \"data\", shop: sessionToken.dest}));\n * };\n * ```\n */\n checkout: AuthenticateCheckout;\n\n /**\n * Authenticate a request from an app proxy\n *\n * @example\n * Authenticating an app proxy request\n * ```ts\n * // /app/routes/public/widgets.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * await authenticate.public.appProxy(\n * request,\n * );\n *\n * const {searchParams} = new URL(request.url);\n * const shop = searchParams.get(\"shop\");\n * const customerId = searchParams.get(\"logged_in_customer_id\")\n *\n * return json({my: \"data\", shop, customerId});\n * };\n * ```\n */\n appProxy: AuthenticateAppProxy;\n}" + "value": "export interface CallbackParams extends AdapterArgs {\n}" }, - "AuthenticateCheckout": { - "filePath": "/server/authenticate/public/checkout/types.ts", - "name": "AuthenticateCheckout", + "Nonce": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/nonce.d.ts", + "name": "Nonce", + "description": "", + "params": [], + "returns": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/nonce.d.ts", + "description": "", + "name": "string", + "value": "string" + }, + "value": "export type Nonce = () => string;" + }, + "SafeCompare": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/safe-compare.d.ts", + "name": "SafeCompare", "description": "", "params": [ { - "name": "request", + "name": "strA", "description": "", - "value": "Request", - "filePath": "/server/authenticate/public/checkout/types.ts" + "value": "string | string[] | Record | number[]", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/safe-compare.d.ts" }, { - "name": "options", + "name": "strB", "description": "", - "value": "AuthenticateCheckoutOptions", - "isOptional": true, - "filePath": "/server/authenticate/public/checkout/types.ts" + "value": "string | string[] | Record | number[]", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/safe-compare.d.ts" } ], "returns": { - "filePath": "/server/authenticate/public/checkout/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/safe-compare.d.ts", "description": "", - "name": "Promise", - "value": "Promise" + "name": "boolean", + "value": "boolean" }, - "value": "export type AuthenticateCheckout = (\n request: Request,\n options?: AuthenticateCheckoutOptions,\n) => Promise;" + "value": "export type SafeCompare = (strA: string | Record | string[] | number[], strB: string | Record | string[] | number[]) => boolean;" }, - "AuthenticateCheckoutOptions": { - "filePath": "/server/authenticate/public/checkout/types.ts", - "name": "AuthenticateCheckoutOptions", + "GetEmbeddedAppUrl": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/get-embedded-app-url.d.ts", + "name": "GetEmbeddedAppUrl", "description": "", - "members": [ + "params": [ { - "filePath": "/server/authenticate/public/checkout/types.ts", - "syntaxKind": "PropertySignature", - "name": "corsHeaders", - "value": "string[]", + "name": "params", "description": "", - "isOptional": true + "value": "GetEmbeddedAppUrlParams", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/get-embedded-app-url.d.ts" } ], - "value": "export interface AuthenticateCheckoutOptions {\n corsHeaders?: string[];\n}" + "returns": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/get-embedded-app-url.d.ts", + "description": "", + "name": "Promise", + "value": "Promise" + }, + "value": "export type GetEmbeddedAppUrl = (params: GetEmbeddedAppUrlParams) => Promise;" }, - "CheckoutContext": { - "filePath": "/server/authenticate/public/checkout/types.ts", - "name": "CheckoutContext", - "description": "Authenticated Context for a checkout request", + "GetEmbeddedAppUrlParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/types.d.ts", + "name": "GetEmbeddedAppUrlParams", + "description": "", "members": [ { - "filePath": "/server/authenticate/public/checkout/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/types.d.ts", "syntaxKind": "PropertySignature", - "name": "sessionToken", - "value": "JwtPayload", - "description": "The decoded and validated session token for the request\n\nRefer to the OAuth docs for the [session token payload](https://shopify.dev/docs/apps/auth/oauth/session-tokens#payload).", - "examples": [ - { - "title": "Using the decoded session token", - "description": "Get store-specific data using the `sessionToken` object.", - "tabs": [ - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { sessionToken } = await authenticate.public.checkout(\n request\n );\n return json(await getMyAppData({shop: sessionToken.dest}));\n};", - "title": "app/routes/public/my-route.ts" - } - ] - } - ] + "name": "rawRequest", + "value": "AdapterRequest", + "description": "" }, { - "filePath": "/server/authenticate/public/checkout/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/types.d.ts", "syntaxKind": "PropertySignature", - "name": "cors", - "value": "EnsureCORSFunction", - "description": "A function that ensures the CORS headers are set correctly for the response.", - "examples": [ - { - "title": "Setting CORS headers for a public request", - "description": "Use the `cors` helper to ensure your app can respond to checkout extension requests.", - "tabs": [ - { - "code": "import { LoaderFunctionArgs, json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }: LoaderFunctionArgs) => {\n const { sessionToken, cors } = await authenticate.public.checkout(\n request,\n { corsHeaders: [\"X-My-Custom-Header\"] }\n );\n const data = await getMyAppData({shop: sessionToken.dest});\n return cors(json(data));\n};", - "title": "app/routes/public/my-route.ts" - } - ] - } - ] + "name": "rawResponse", + "value": "AdapterResponse", + "description": "", + "isOptional": true } ], - "value": "export interface CheckoutContext {\n /**\n * The decoded and validated session token for the request\n *\n * Refer to the OAuth docs for the [session token payload](https://shopify.dev/docs/apps/auth/oauth/session-tokens#payload).\n *\n * @example\n * Using the decoded session token.\n * Get store-specific data using the `sessionToken` object.\n * ```ts\n * // app/routes/public/my-route.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n * import { getMyAppData } from \"~/db/model.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { sessionToken } = await authenticate.public.checkout(\n * request\n * );\n * return json(await getMyAppData({shop: sessionToken.dest}));\n * };\n * ```\n */\n sessionToken: JwtPayload;\n\n /**\n * A function that ensures the CORS headers are set correctly for the response.\n *\n * @example\n * Setting CORS headers for a public request.\n * Use the `cors` helper to ensure your app can respond to checkout extension requests.\n * ```ts\n * // app/routes/public/my-route.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n * import { getMyAppData } from \"~/db/model.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { sessionToken, cors } = await authenticate.public.checkout(\n * request,\n * { corsHeaders: [\"X-My-Custom-Header\"] }\n * );\n * const data = await getMyAppData({shop: sessionToken.dest});\n * return cors(json(data));\n * };\n * ```\n */\n cors: EnsureCORSFunction;\n}" + "value": "export interface GetEmbeddedAppUrlParams extends AdapterArgs {\n}" }, - "AuthenticateAppProxy": { - "filePath": "/server/authenticate/public/appProxy/types.ts", - "name": "AuthenticateAppProxy", + "BuildEmbeddedAppUrl": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/get-embedded-app-url.d.ts", + "name": "BuildEmbeddedAppUrl", "description": "", "params": [ { - "name": "request", + "name": "host", "description": "", - "value": "Request", - "filePath": "/server/authenticate/public/appProxy/types.ts" + "value": "string", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/get-embedded-app-url.d.ts" } ], "returns": { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/get-embedded-app-url.d.ts", "description": "", - "name": "Promise", - "value": "Promise" + "name": "string", + "value": "string" }, - "value": "export type AuthenticateAppProxy = (\n request: Request,\n) => Promise;" + "value": "export type BuildEmbeddedAppUrl = (host: string) => string;" }, - "AppProxyContext": { - "filePath": "/server/authenticate/public/appProxy/types.ts", - "name": "AppProxyContext", + "TokenExchange": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/token-exchange.d.ts", + "name": "TokenExchange", + "description": "", + "params": [ + { + "name": "params", + "description": "", + "value": "TokenExchangeParams", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/token-exchange.d.ts" + } + ], + "returns": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/token-exchange.d.ts", + "description": "", + "name": "Promise<{\n session: Session;\n}>", + "value": "Promise<{\n session: Session;\n}>" + }, + "value": "export type TokenExchange = (params: TokenExchangeParams) => Promise<{\n session: Session;\n}>;" + }, + "TokenExchangeParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/token-exchange.d.ts", + "name": "TokenExchangeParams", "description": "", "members": [ { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/token-exchange.d.ts", "syntaxKind": "PropertySignature", - "name": "session", - "value": "undefined", - "description": "No session is available for the shop that made this request.\n\nThis comes from the session storage which `shopifyApp` uses to store sessions in your database of choice." + "name": "shop", + "value": "string", + "description": "" }, { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/token-exchange.d.ts", "syntaxKind": "PropertySignature", - "name": "admin", - "value": "undefined", - "description": "No session is available for the shop that made this request. Therefore no methods for interacting with the GraphQL / REST Admin APIs are available." + "name": "sessionToken", + "value": "string", + "description": "" }, { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/token-exchange.d.ts", "syntaxKind": "PropertySignature", - "name": "storefront", - "value": "undefined", - "description": "No session is available for the shop that made this request. Therefore no method for interacting with the Storefront API is available." + "name": "requestedTokenType", + "value": "RequestedTokenType", + "description": "" + } + ], + "value": "export interface TokenExchangeParams {\n shop: string;\n sessionToken: string;\n requestedTokenType: RequestedTokenType;\n}" + }, + "RequestedTokenType": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/token-exchange.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "RequestedTokenType", + "value": "export declare enum RequestedTokenType {\n OnlineAccessToken = \"urn:shopify:params:oauth:token-type:online-access-token\",\n OfflineAccessToken = \"urn:shopify:params:oauth:token-type:offline-access-token\"\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/token-exchange.d.ts", + "name": "OnlineAccessToken", + "value": "urn:shopify:params:oauth:token-type:online-access-token" }, { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/token-exchange.d.ts", + "name": "OfflineAccessToken", + "value": "urn:shopify:params:oauth:token-type:offline-access-token" + } + ] + }, + "ShopifySession": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/index.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "ShopifySession", + "value": "ReturnType", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/index.d.ts", "syntaxKind": "PropertySignature", - "name": "liquid", - "value": "LiquidResponseFunction", - "description": "A utility for creating a Liquid Response.", - "examples": [ - { - "title": "Rendering liquid content", - "description": "Use the `liquid` helper to render a `Response` with Liquid content.", - "tabs": [ - { - "code": "import {authenticate} from \"~/shopify.server\"\n\nexport async function loader({ request }) {\n const {liquid} = await authenticate.public.appProxy(request);\n\n return liquid(\"Hello {{shop.name}}\")\n}", - "title": "app/routes/**\\/.ts" - } - ] - } - ] + "name": "customAppSession", + "value": "(shop: string) => Session", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "getCurrentId", + "value": "({ isOnline, ...adapterArgs }: GetCurrentSessionIdParams) => Promise", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "getOfflineId", + "value": "(shop: string) => string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "getJwtSessionId", + "value": "(shop: string, userId: string) => string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "decodeSessionToken", + "value": "(token: string, { checkAudience }?: DecodeSessionTokenOptions) => Promise", + "description": "" } - ], - "value": "export interface AppProxyContext extends Context {\n /**\n * No session is available for the shop that made this request.\n *\n * This comes from the session storage which `shopifyApp` uses to store sessions in your database of choice.\n */\n session: undefined;\n\n /**\n * No session is available for the shop that made this request.\n * Therefore no methods for interacting with the GraphQL / REST Admin APIs are available.\n */\n admin: undefined;\n\n /**\n * No session is available for the shop that made this request.\n * Therefore no method for interacting with the Storefront API is available.\n */\n storefront: undefined;\n}" + ] }, - "LiquidResponseFunction": { - "filePath": "/server/authenticate/public/appProxy/types.ts", - "name": "LiquidResponseFunction", + "GetCurrentSessionIdParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "name": "GetCurrentSessionIdParams", "description": "", - "params": [ + "members": [ { - "name": "body", - "description": "", - "value": "string", - "filePath": "/server/authenticate/public/appProxy/types.ts" + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "isOnline", + "value": "boolean", + "description": "" }, { - "name": "initAndOptions", + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawRequest", + "value": "AdapterRequest", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawResponse", + "value": "AdapterResponse", "description": "", - "value": "number | (ResponseInit & Options)", - "isOptional": true, - "filePath": "/server/authenticate/public/appProxy/types.ts" + "isOptional": true } ], - "returns": { - "filePath": "/server/authenticate/public/appProxy/types.ts", - "description": "", - "name": "Response", - "value": "Response" - }, - "value": "export type LiquidResponseFunction = (\n body: string,\n initAndOptions?: number | (ResponseInit & Options),\n) => Response;" + "value": "export interface GetCurrentSessionIdParams extends AdapterArgs {\n isOnline: boolean;\n}" }, - "Options": { - "filePath": "/server/authenticate/public/appProxy/types.ts", - "name": "Options", + "DecodeSessionTokenOptions": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/decode-session-token.d.ts", + "name": "DecodeSessionTokenOptions", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/decode-session-token.d.ts", + "syntaxKind": "PropertySignature", + "name": "checkAudience", + "value": "boolean", + "description": "", + "isOptional": true + } + ], + "value": "export interface DecodeSessionTokenOptions {\n checkAudience?: boolean;\n}" + }, + "ShopifyUtils": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/utils/index.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "ShopifyUtils", + "value": "ReturnType", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/utils/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "sanitizeShop", + "value": "(shop: string, throwOnInvalid?: boolean) => string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/utils/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "sanitizeHost", + "value": "(host: string, throwOnInvalid?: boolean) => string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/utils/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "validateHmac", + "value": "(query: AuthQuery, { signator }?: { signator: HMACSignator; }) => Promise", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/utils/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "versionCompatible", + "value": "(referenceVersion: ApiVersion, currentVersion?: ApiVersion) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/utils/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "versionPriorTo", + "value": "(referenceVersion: ApiVersion, currentVersion?: ApiVersion) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/utils/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "shopAdminUrlToLegacyUrl", + "value": "(shopAdminUrl: string) => string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/utils/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "legacyUrlToShopAdminUrl", + "value": "(legacyAdminUrl: string) => string", + "description": "" + } + ] + }, + "AuthQuery": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "name": "AuthQuery", "description": "", "members": [ { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "name": "[key: string]", + "value": "string | undefined" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "hmac", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", "syntaxKind": "PropertySignature", - "name": "layout", - "value": "boolean", + "name": "signature", + "value": "string", "description": "", "isOptional": true } ], - "value": "interface Options {\n layout?: boolean;\n}" + "value": "export interface AuthQuery {\n [key: string]: string | undefined;\n hmac?: string;\n signature?: string;\n}" }, - "AppProxyContextWithSession": { - "filePath": "/server/authenticate/public/appProxy/types.ts", - "name": "AppProxyContextWithSession", + "HMACSignator": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/utils/hmac-validator.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "HMACSignator", + "value": "'admin' | 'appProxy'", + "description": "" + }, + "ShopifyWebhooks": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/index.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "ShopifyWebhooks", + "value": "ReturnType", "description": "", "members": [ { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/index.d.ts", "syntaxKind": "PropertySignature", - "name": "session", - "value": "Session", - "description": "The session for the shop that made the request.\n\nThis comes from the session storage which `shopifyApp` uses to store sessions in your database of choice.\n\nUse this to get shop or user-specific data.", - "examples": [ - { - "title": "Using the session object", - "description": "Get the session for the shop that initiated the request to the app proxy.", - "tabs": [ - { - "code": "import { json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\nimport { getMyAppModelData } from \"~/db/model.server\";\n\nexport const loader = async ({ request }) => {\n // Get the session for the shop that initiated the request to the app proxy.\n const { session } = await authenticate.public.appProxy(request);\n\n // Use the session data to make to queries to your database or additional requests.\n return json(await getMyAppModelData({shop: session.shop));\n};", - "title": "app/routes/**\\/.ts" - } - ] - } - ] + "name": "addHandlers", + "value": "(handlersToAdd: AddHandlersParams) => void", + "description": "" }, { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/index.d.ts", "syntaxKind": "PropertySignature", - "name": "admin", - "value": "AdminApiContext", - "description": "Methods for interacting with the GraphQL / REST Admin APIs for the store that made the request.", - "examples": [ - { - "title": "Interacting with the Admin API", - "description": "Use the `admin` object to interact with the REST or GraphQL APIs.", - "tabs": [ - { - "code": "import { json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.public.appProxy(request);\n\n const response = await admin.graphql(\n `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n { variables: { input: { title: \"Product Name\" } } }\n );\n\n const productData = await response.json();\n return json({ data: productData.data });\n}", - "title": "app/routes/**\\/.ts" - } - ] - } - ] + "name": "getTopicsAdded", + "value": "() => string[]", + "description": "" }, { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/index.d.ts", "syntaxKind": "PropertySignature", - "name": "storefront", - "value": "StorefrontContext", - "description": "Method for interacting with the Shopify Storefront Graphql API for the store that made the request.", - "examples": [ - { - "title": "Interacting with the Storefront API", - "description": "Use the `storefront` object to interact with the GraphQL API.", - "tabs": [ - { - "code": "import { json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { storefront } = await authenticate.public.appProxy(request);\n\n const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);\n\n return json(await response.json());\n}", - "title": "app/routes/**\\/.ts" - } - ] - } - ] + "name": "getHandlers", + "value": "(topic: string) => WebhookHandler[]", + "description": "" }, { - "filePath": "/server/authenticate/public/appProxy/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/index.d.ts", "syntaxKind": "PropertySignature", - "name": "liquid", - "value": "LiquidResponseFunction", - "description": "A utility for creating a Liquid Response.", - "examples": [ - { - "title": "Rendering liquid content", - "description": "Use the `liquid` helper to render a `Response` with Liquid content.", - "tabs": [ - { - "code": "import {authenticate} from \"~/shopify.server\"\n\nexport async function loader({ request }) {\n const {liquid} = await authenticate.public.appProxy(request);\n\n return liquid(\"Hello {{shop.name}}\")\n}", - "title": "app/routes/**\\/.ts" - } - ] - } - ] + "name": "register", + "value": "({ session, }: RegisterParams) => Promise", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "process", + "value": "({ rawBody, ...adapterArgs }: WebhookProcessParams) => Promise", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "validate", + "value": "({ rawBody, ...adapterArgs }: WebhookValidateParams) => Promise", + "description": "" } - ], - "value": "export interface AppProxyContextWithSession<\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> extends Context {\n /**\n * The session for the shop that made the request.\n *\n * This comes from the session storage which `shopifyApp` uses to store sessions in your database of choice.\n *\n * Use this to get shop or user-specific data.\n *\n * @example\n * Using the session object.\n * Get the session for the shop that initiated the request to the app proxy.\n * ```ts\n * // app/routes/**\\/.ts\n * import { json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n * import { getMyAppModelData } from \"~/db/model.server\";\n *\n * export const loader = async ({ request }) => {\n * // Get the session for the shop that initiated the request to the app proxy.\n * const { session } = await authenticate.public.appProxy(request);\n *\n * // Use the session data to make to queries to your database or additional requests.\n * return json(await getMyAppModelData({shop: session.shop));\n * };\n * ```\n */\n session: Session;\n\n /**\n * Methods for interacting with the GraphQL / REST Admin APIs for the store that made the request.\n *\n * @example\n * Interacting with the Admin API.\n * Use the `admin` object to interact with the REST or GraphQL APIs.\n * ```ts\n * // app/routes/**\\/.ts\n * import { json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { admin } = await authenticate.public.appProxy(request);\n *\n * const response = await admin.graphql(\n * `#graphql\n * mutation populateProduct($input: ProductInput!) {\n * productCreate(input: $input) {\n * product {\n * id\n * }\n * }\n * }`,\n * { variables: { input: { title: \"Product Name\" } } }\n * );\n *\n * const productData = await response.json();\n * return json({ data: productData.data });\n * }\n * ```\n */\n admin: AdminApiContext;\n\n /**\n * Method for interacting with the Shopify Storefront Graphql API for the store that made the request.\n *\n * @example\n * Interacting with the Storefront API.\n * Use the `storefront` object to interact with the GraphQL API.\n * ```ts\n * // app/routes/**\\/.ts\n * import { json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { storefront } = await authenticate.public.appProxy(request);\n *\n * const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);\n *\n * return json(await response.json());\n * }\n * ```\n */\n storefront: StorefrontContext;\n}" + ] }, - "StorefrontContext": { - "filePath": "/server/clients/storefront/types.ts", - "name": "StorefrontContext", + "AddHandlersParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "AddHandlersParams", + "value": "Record", + "description": "", + "members": [] + }, + "RegisterParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "RegisterParams", "description": "", "members": [ { - "filePath": "/server/clients/storefront/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", "syntaxKind": "PropertySignature", - "name": "graphql", - "value": "GraphQLClient", - "description": "Method for interacting with the Shopify Storefront GraphQL API\n\nIf you're getting incorrect type hints in the Shopify template, follow [these instructions](https://github.com/Shopify/shopify-app-template-remix/tree/main#incorrect-graphql-hints).\n\n\n\n\n", - "examples": [ - { - "title": "Querying the GraphQL API", - "description": "Use `storefront.graphql` to make query / mutation requests.", - "tabs": [ - { - "code": "import { json } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { storefront } = await authenticate.public.appProxy(request);\n\n const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);\n\n return json(await response.json());\n}", - "title": "app/routes/**\\/.ts" - } - ] - } - ] + "name": "session", + "value": "Session", + "description": "" } ], - "value": "export interface StorefrontContext {\n /**\n * Method for interacting with the Shopify Storefront GraphQL API\n *\n * If you're getting incorrect type hints in the Shopify template, follow [these instructions](https://github.com/Shopify/shopify-app-template-remix/tree/main#incorrect-graphql-hints).\n *\n * {@link https://shopify.dev/docs/api/storefront}\n *\n * @example\n * Querying the GraphQL API.\n * Use `storefront.graphql` to make query / mutation requests.\n * ```ts\n * // app/routes/**\\/.ts\n * import { json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { storefront } = await authenticate.public.appProxy(request);\n *\n * const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);\n *\n * return json(await response.json());\n * }\n * ```\n */\n graphql: GraphQLClient;\n}" + "value": "export interface RegisterParams {\n session: Session;\n}" }, - "AuthenticatePublicLegacy": { - "filePath": "/server/authenticate/public/types.ts", + "Body": { + "filePath": "../../node_modules/@shopify/shopify-api/rest/types.d.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "AuthenticatePublicLegacy", - "value": "AuthenticateCheckout & AuthenticatePublicObject", - "description": "Methods for authenticating Requests from Shopify's public surfaces\n\nTo maintain backwards compatability this is a function and an object.\n\nDo not use `authenticate.public()`. Use `authenticate.public.checkout()` instead. `authenticate.public()` will be removed in v2.\n\nMethods are:\n\n- `authenticate.public.checkout()` for authenticating requests from checkout extensions - `authenticate.public.appProxy()` for authenticating requests from app proxies" + "name": "Body", + "value": "Record", + "description": "", + "members": [] }, - "AuthenticateWebhook": { - "filePath": "/server/authenticate/webhooks/types.ts", - "name": "AuthenticateWebhook", + "WebhookProcessParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "WebhookProcessParams", "description": "", - "params": [ + "members": [ { - "name": "request", + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawBody", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawRequest", + "value": "AdapterRequest", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawResponse", + "value": "AdapterResponse", "description": "", - "value": "Request", - "filePath": "/server/authenticate/webhooks/types.ts" + "isOptional": true } ], - "returns": { - "filePath": "/server/authenticate/webhooks/types.ts", - "description": "", - "name": "Promise>", - "value": "Promise>" - }, - "value": "export type AuthenticateWebhook<\n Future extends FutureFlagOptions,\n Resources extends ShopifyRestResources,\n Topics = string | number | symbol,\n> = (request: Request) => Promise>;" + "value": "export interface WebhookProcessParams extends AdapterArgs {\n rawBody: string;\n}" }, - "WebhookContext": { - "filePath": "/server/authenticate/webhooks/types.ts", + "WebhookValidateParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "WebhookValidateParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawBody", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawRequest", + "value": "AdapterRequest", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "rawResponse", + "value": "AdapterResponse", + "description": "", + "isOptional": true + } + ], + "value": "export interface WebhookValidateParams extends WebhookProcessParams {\n}" + }, + "WebhookValidation": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", "syntaxKind": "TypeAliasDeclaration", - "name": "WebhookContext", - "value": "WebhookContextWithoutSession | WebhookContextWithSession", + "name": "WebhookValidation", + "value": "WebhookValidationValid | WebhookValidationInvalid | WebhookValidationMissingHeaders", "description": "" }, - "WebhookContextWithoutSession": { - "filePath": "/server/authenticate/webhooks/types.ts", - "name": "WebhookContextWithoutSession", + "WebhookValidationValid": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "WebhookValidationValid", "description": "", "members": [ { - "filePath": "/server/authenticate/webhooks/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", "syntaxKind": "PropertySignature", - "name": "session", - "value": "undefined", + "name": "valid", + "value": "true", "description": "" }, { - "filePath": "/server/authenticate/webhooks/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", "syntaxKind": "PropertySignature", - "name": "admin", - "value": "undefined", + "name": "webhookId", + "value": "string", "description": "" }, { - "filePath": "/server/authenticate/webhooks/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", "syntaxKind": "PropertySignature", "name": "apiVersion", "value": "string", - "description": "The API version used for the webhook.", - "examples": [ - { - "title": "Webhook API version", - "description": "Get the API version used for webhook request.", - "tabs": [ - { - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { apiVersion } = await authenticate.webhook(request);\n return new Response();\n};", - "title": "/app/routes/webhooks.tsx" - } - ] - } - ] + "description": "" }, { - "filePath": "/server/authenticate/webhooks/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", "syntaxKind": "PropertySignature", - "name": "shop", + "name": "domain", "value": "string", - "description": "The shop where the webhook was triggered.", - "examples": [ - { - "title": "Webhook shop", - "description": "Get the shop that triggered a webhook.", - "tabs": [ - { - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { shop } = await authenticate.webhook(request);\n return new Response();\n};", - "title": "/app/routes/webhooks.tsx" - } - ] - } - ] + "description": "" }, { - "filePath": "/server/authenticate/webhooks/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", "syntaxKind": "PropertySignature", - "name": "topic", - "value": "Topics", - "description": "The topic of the webhook.", - "examples": [ - { - "title": "Webhook topic", - "description": "Get the event topic for the webhook.", - "tabs": [ - { - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { topic } = await authenticate.webhook(request);\n\n switch (topic) {\n case \"APP_UNINSTALLED\":\n // Do something when the app is uninstalled.\n break;\n }\n\n return new Response();\n};", - "title": "/app/routes/webhooks.tsx" - } - ] - } - ] + "name": "hmac", + "value": "string", + "description": "" }, { - "filePath": "/server/authenticate/webhooks/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", "syntaxKind": "PropertySignature", - "name": "webhookId", + "name": "topic", "value": "string", - "description": "A unique ID for the webhook. Useful to keep track of which events your app has already processed.", - "examples": [ - { - "title": "Webhook ID", - "description": "Get the webhook ID.", - "tabs": [ - { - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { webhookId } = await authenticate.webhook(request);\n return new Response();\n};", - "title": "/app/routes/webhooks.tsx" - } - ] - } - ] + "description": "" + } + ], + "value": "export interface WebhookValidationValid extends WebhookFields {\n valid: true;\n}" + }, + "WebhookValidationInvalid": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "WebhookValidationInvalid", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "valid", + "value": "false", + "description": "" }, { - "filePath": "/server/authenticate/webhooks/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", "syntaxKind": "PropertySignature", - "name": "payload", - "value": "JSONValue", - "description": "The payload from the webhook request.", - "examples": [ - { - "title": "Webhook payload", - "description": "Get the request's POST payload.", - "tabs": [ - { - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { payload } = await authenticate.webhook(request);\n return new Response();\n};", - "title": "/app/routes/webhooks.tsx" - } - ] - } - ] + "name": "reason", + "value": "WebhookValidationErrorReason", + "description": "" } ], - "value": "export interface WebhookContextWithoutSession\n extends Context {\n session: undefined;\n admin: undefined;\n}" + "value": "export interface WebhookValidationInvalid {\n valid: false;\n reason: WebhookValidationErrorReason;\n}" }, - "JSONValue": { - "filePath": "/server/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "JSONValue", - "value": "string | number | boolean | null | JSONObject | JSONArray", - "description": "" + "WebhookValidationErrorReason": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "WebhookValidationErrorReason", + "value": "export declare enum WebhookValidationErrorReason {\n MissingHeaders = \"missing_headers\",\n MissingBody = \"missing_body\",\n InvalidHmac = \"invalid_hmac\"\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "MissingHeaders", + "value": "missing_headers" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "MissingBody", + "value": "missing_body" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "InvalidHmac", + "value": "invalid_hmac" + } + ] }, - "JSONObject": { - "filePath": "/server/types.ts", - "name": "JSONObject", + "WebhookValidationMissingHeaders": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "name": "WebhookValidationMissingHeaders", "description": "", "members": [ { - "filePath": "/server/types.ts", - "name": "[x: string]", - "value": "JSONValue" + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "reason", + "value": "WebhookValidationErrorReason.MissingHeaders", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "missingHeaders", + "value": "string[]", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/webhooks/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "valid", + "value": "false", + "description": "" } ], - "value": "interface JSONObject {\n [x: string]: JSONValue;\n}" + "value": "export interface WebhookValidationMissingHeaders extends WebhookValidationInvalid {\n reason: WebhookValidationErrorReason.MissingHeaders;\n missingHeaders: string[];\n}" }, - "JSONArray": { - "filePath": "/server/types.ts", - "name": "JSONArray", + "ShopifyBilling": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/index.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "ShopifyBilling", + "value": "ReturnType", "description": "", "members": [ { - "filePath": "/server/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/index.d.ts", "syntaxKind": "PropertySignature", - "name": "length", - "value": "number", - "description": "Gets or sets the length of the array. This is a number one higher than the highest index in the array." + "name": "check", + "value": "({ session, plans, isTest, returnObject, }: Params_1) => Promise>", + "description": "" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "toString", - "value": "() => string", - "description": "Returns a string representation of an array." + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "request", + "value": "({ session, plan, isTest, returnUrl: returnUrlParam, returnObject, ...overrides }: Params_2) => Promise>", + "description": "" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "toLocaleString", - "value": "() => string", - "description": "Returns a string representation of an array. The elements are converted to string using their toLocaleString methods." + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "cancel", + "value": "(subscriptionInfo: BillingCancelParams) => Promise", + "description": "" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "pop", - "value": "() => JSONValue", - "description": "Removes the last element from an array and returns it.\r\nIf the array is empty, undefined is returned and the array is not modified." - }, + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "subscriptions", + "value": "({ session, }: BillingSubscriptionParams) => Promise", + "description": "" + } + ] + }, + "BillingCheckParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingCheckParams", + "description": "", + "members": [ { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "push", - "value": "(...items: JSONValue[]) => number", - "description": "Appends new elements to the end of an array, and returns the new length of the array." + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "session", + "value": "Session", + "description": "" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "concat", - "value": "{ (...items: ConcatArray[]): JSONValue[]; (...items: (JSONValue | ConcatArray)[]): JSONValue[]; }", - "description": "Combines two or more arrays.\r\nThis method returns a new array without modifying any existing arrays." + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "plans", + "value": "string | string[]", + "description": "" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "join", - "value": "(separator?: string) => string", - "description": "Adds all the elements of an array into a string, separated by the specified separator string." + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "isTest", + "value": "boolean", + "description": "", + "isOptional": true }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "reverse", - "value": "() => JSONValue[]", - "description": "Reverses the elements in an array in place.\r\nThis method mutates the array and returns a reference to the same array." - }, + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "returnObject", + "value": "boolean", + "description": "", + "isOptional": true + } + ], + "value": "export interface BillingCheckParams {\n session: Session;\n plans: string[] | string;\n isTest?: boolean;\n returnObject?: boolean;\n}" + }, + "BillingCheckResponse": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "BillingCheckResponse", + "value": "Params['returnObject'] extends true ? BillingCheckResponseObject : boolean", + "description": "" + }, + "BillingRequestParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "BillingRequestParams", + "value": "{\n session: Session;\n plan: string;\n isTest?: boolean;\n returnUrl?: string;\n returnObject?: boolean;\n} & RequestConfigOverrides", + "description": "" + }, + "RequestConfigOverrides": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "RequestConfigOverrides", + "value": "Partial | Partial | Partial", + "description": "" + }, + "BillingConfigOneTimePlan": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingConfigOneTimePlan", + "description": "", + "members": [ { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "shift", - "value": "() => JSONValue", - "description": "Removes the first element from an array and returns it.\r\nIf the array is empty, undefined is returned and the array is not modified." + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "interval", + "value": "BillingInterval.OneTime", + "description": "" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "slice", - "value": "(start?: number, end?: number) => JSONValue[]", - "description": "Returns a copy of a section of an array.\r\nFor both start and end, a negative index can be used to indicate an offset from the end of the array.\r\nFor example, -2 refers to the second to last element of the array." + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "amount", + "value": "number", + "description": "" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "sort", - "value": "(compareFn?: (a: JSONValue, b: JSONValue) => number) => JSONArray", - "description": "Sorts an array in place.\r\nThis method mutates the array and returns a reference to the same array." - }, + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "currencyCode", + "value": "string", + "description": "" + } + ], + "value": "export interface BillingConfigOneTimePlan extends BillingConfigPlan {\n interval: BillingInterval.OneTime;\n}" + }, + "BillingInterval": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "BillingInterval", + "value": "export declare enum BillingInterval {\n OneTime = \"ONE_TIME\",\n Every30Days = \"EVERY_30_DAYS\",\n Annual = \"ANNUAL\",\n Usage = \"USAGE\"\n}", + "members": [ { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "splice", - "value": "{ (start: number, deleteCount?: number): JSONValue[]; (start: number, deleteCount: number, ...items: JSONValue[]): JSONValue[]; }", - "description": "Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements." + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "OneTime", + "value": "ONE_TIME" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "unshift", - "value": "(...items: JSONValue[]) => number", - "description": "Inserts new elements at the start of an array, and returns the new length of the array." + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Every30Days", + "value": "EVERY_30_DAYS" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "indexOf", - "value": "(searchElement: JSONValue, fromIndex?: number) => number", - "description": "Returns the index of the first occurrence of a value in an array, or -1 if it is not present." + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Annual", + "value": "ANNUAL" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "lastIndexOf", - "value": "(searchElement: JSONValue, fromIndex?: number) => number", - "description": "Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present." + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Usage", + "value": "USAGE" + } + ] + }, + "BillingConfigSubscriptionPlan": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingConfigSubscriptionPlan", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "interval", + "value": "Exclude", + "description": "" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "every", - "value": "{ (predicate: (value: JSONValue, index: number, array: JSONValue[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: JSONValue, index: number, array: JSONValue[]) => unknown, thisArg?: any): boolean; }", - "description": "Determines whether all the members of an array satisfy the specified test." + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "trialDays", + "value": "number", + "description": "", + "isOptional": true }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "some", - "value": "(predicate: (value: JSONValue, index: number, array: JSONValue[]) => unknown, thisArg?: any) => boolean", - "description": "Determines whether the specified callback function returns true for any element of an array." + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "replacementBehavior", + "value": "BillingReplacementBehavior", + "description": "", + "isOptional": true }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "forEach", - "value": "(callbackfn: (value: JSONValue, index: number, array: JSONValue[]) => void, thisArg?: any) => void", - "description": "Performs the specified action for each element in an array." + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "discount", + "value": "BillingConfigSubscriptionPlanDiscount", + "description": "", + "isOptional": true }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "map", - "value": "(callbackfn: (value: JSONValue, index: number, array: JSONValue[]) => U, thisArg?: any) => U[]", - "description": "Calls a defined callback function on each element of an array, and returns an array that contains the results." + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "amount", + "value": "number", + "description": "" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "filter", - "value": "{ (predicate: (value: JSONValue, index: number, array: JSONValue[]) => value is S, thisArg?: any): S[]; (predicate: (value: JSONValue, index: number, array: JSONValue[]) => unknown, thisArg?: any): JSONValue[]; }", - "description": "Returns the elements of an array that meet the condition specified in a callback function." + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "currencyCode", + "value": "string", + "description": "" + } + ], + "value": "export interface BillingConfigSubscriptionPlan extends BillingConfigPlan {\n interval: Exclude;\n trialDays?: number;\n replacementBehavior?: BillingReplacementBehavior;\n discount?: BillingConfigSubscriptionPlanDiscount;\n}" + }, + "RecurringBillingIntervals": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "RecurringBillingIntervals", + "value": "RecurringBillingIntervals", + "description": "" + }, + "BillingReplacementBehavior": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "BillingReplacementBehavior", + "value": "export declare enum BillingReplacementBehavior {\n ApplyImmediately = \"APPLY_IMMEDIATELY\",\n ApplyOnNextBillingCycle = \"APPLY_ON_NEXT_BILLING_CYCLE\",\n Standard = \"STANDARD\"\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "ApplyImmediately", + "value": "APPLY_IMMEDIATELY" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "reduce", - "value": "{ (callbackfn: (previousValue: JSONValue, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => JSONValue): JSONValue; (callbackfn: (previousValue: JSONValue, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => JSONValue, initialValue: JSONValue): JSONValue; (callbackfn: (previousValue: U, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => U, initialValue: U): U; }", - "description": "Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function." + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "ApplyOnNextBillingCycle", + "value": "APPLY_ON_NEXT_BILLING_CYCLE" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "reduceRight", - "value": "{ (callbackfn: (previousValue: JSONValue, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => JSONValue): JSONValue; (callbackfn: (previousValue: JSONValue, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => JSONValue, initialValue: JSONValue): JSONValue; (callbackfn: (previousValue: U, currentValue: JSONValue, currentIndex: number, array: JSONValue[]) => U, initialValue: U): U; }", - "description": "Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function." + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Standard", + "value": "STANDARD" + } + ] + }, + "BillingConfigSubscriptionPlanDiscount": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingConfigSubscriptionPlanDiscount", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "durationLimitInIntervals", + "value": "number", + "description": "", + "isOptional": true }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "find", - "value": "{ (predicate: (this: void, value: JSONValue, index: number, obj: JSONValue[]) => value is S, thisArg?: any): S; (predicate: (value: JSONValue, index: number, obj: JSONValue[]) => unknown, thisArg?: any): JSONValue; }", - "description": "Returns the value of the first element in the array where predicate is true, and undefined\r\notherwise." + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "value", + "value": "BillingConfigSubscriptionPlanDiscountAmount | BillingConfigSubscriptionPlanDiscountPercentage", + "description": "" + } + ], + "value": "export interface BillingConfigSubscriptionPlanDiscount {\n durationLimitInIntervals?: number;\n value: BillingConfigSubscriptionPlanDiscountAmount | BillingConfigSubscriptionPlanDiscountPercentage;\n}" + }, + "BillingConfigSubscriptionPlanDiscountAmount": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingConfigSubscriptionPlanDiscountAmount", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "amount", + "value": "number", + "description": "" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "findIndex", - "value": "(predicate: (value: JSONValue, index: number, obj: JSONValue[]) => unknown, thisArg?: any) => number", - "description": "Returns the index of the first element in the array where predicate is true, and -1\r\notherwise." + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "percentage", + "value": "never", + "description": "", + "isOptional": true + } + ], + "value": "export interface BillingConfigSubscriptionPlanDiscountAmount {\n amount: number;\n percentage?: never;\n}" + }, + "BillingConfigSubscriptionPlanDiscountPercentage": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingConfigSubscriptionPlanDiscountPercentage", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "amount", + "value": "never", + "description": "", + "isOptional": true }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "fill", - "value": "(value: JSONValue, start?: number, end?: number) => JSONArray", - "description": "Changes all array elements from `start` to `end` index to a static `value` and returns the modified array" + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "percentage", + "value": "number", + "description": "" + } + ], + "value": "export interface BillingConfigSubscriptionPlanDiscountPercentage {\n amount?: never;\n percentage: number;\n}" + }, + "BillingConfigUsagePlan": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingConfigUsagePlan", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "interval", + "value": "BillingInterval.Usage", + "description": "" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "copyWithin", - "value": "(target: number, start: number, end?: number) => JSONArray", - "description": "Returns the this object after copying a section of the array identified by start and end\r\nto the same array starting at position target" + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "usageTerms", + "value": "string", + "description": "" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "entries", - "value": "() => IterableIterator<[number, JSONValue]>", - "description": "Returns an iterable of key, value pairs for every entry in the array" + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "trialDays", + "value": "number", + "description": "", + "isOptional": true }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "keys", - "value": "() => IterableIterator", - "description": "Returns an iterable of keys in the array" + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "replacementBehavior", + "value": "BillingReplacementBehavior", + "description": "", + "isOptional": true }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "values", - "value": "() => IterableIterator", - "description": "Returns an iterable of values in the array" + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "amount", + "value": "number", + "description": "" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "includes", - "value": "(searchElement: JSONValue, fromIndex?: number) => boolean", - "description": "Determines whether an array includes a certain element, returning true or false as appropriate." + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "currencyCode", + "value": "string", + "description": "" + } + ], + "value": "export interface BillingConfigUsagePlan extends BillingConfigPlan {\n interval: BillingInterval.Usage;\n usageTerms: string;\n trialDays?: number;\n replacementBehavior?: BillingReplacementBehavior;\n}" + }, + "BillingRequestResponse": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "BillingRequestResponse", + "value": "Params['returnObject'] extends true ? BillingRequestResponseObject : string", + "description": "" + }, + "BillingRequestResponseObject": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingRequestResponseObject", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "confirmationUrl", + "value": "string", + "description": "" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "flatMap", - "value": "(callback: (this: This, value: JSONValue, index: number, array: JSONValue[]) => U | readonly U[], thisArg?: This) => U[]", - "description": "Calls a defined callback function on each element of an array. Then, flattens the result into\r\na new array.\r\nThis is identical to a map followed by flat with depth 1." + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "oneTimePurchase", + "value": "OneTimePurchase", + "description": "", + "isOptional": true }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "flat", - "value": "(this: A, depth?: D) => FlatArray[]", - "description": "Returns a new array with all sub-array elements concatenated into it recursively up to the\r\nspecified depth." + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "appSubscription", + "value": "AppSubscription", + "description": "", + "isOptional": true + } + ], + "value": "export interface BillingRequestResponseObject {\n confirmationUrl: string;\n oneTimePurchase?: OneTimePurchase;\n appSubscription?: AppSubscription;\n}" + }, + "BillingCancelParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingCancelParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "session", + "value": "Session", + "description": "" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "__@iterator@716", - "value": "() => IterableIterator", - "description": "Iterator" + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "subscriptionId", + "value": "string", + "description": "" }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "__@unscopables@718", - "value": "() => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }", - "description": "Returns an object whose properties have the value 'true'\r\nwhen they will be absent when used in a 'with' statement." + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "prorate", + "value": "boolean", + "description": "", + "isOptional": true }, { - "filePath": "/server/types.ts", - "syntaxKind": "MethodSignature", - "name": "at", - "value": "(index: number) => JSONValue", - "description": "Takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array." + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "isTest", + "value": "boolean", + "description": "", + "isOptional": true } ], - "value": "interface JSONArray extends Array {}" + "value": "export interface BillingCancelParams {\n session: Session;\n subscriptionId: string;\n prorate?: boolean;\n isTest?: boolean;\n}" }, - "WebhookContextWithSession": { - "filePath": "/server/authenticate/webhooks/types.ts", - "name": "WebhookContextWithSession", + "BillingSubscriptionParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "BillingSubscriptionParams", "description": "", "members": [ { - "filePath": "/server/authenticate/webhooks/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", "syntaxKind": "PropertySignature", "name": "session", "value": "Session", - "description": "A session with an offline token for the shop.\n\nReturned only if there is a session for the shop." - }, + "description": "" + } + ], + "value": "export interface BillingSubscriptionParams {\n session: Session;\n}" + }, + "ActiveSubscriptions": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", + "name": "ActiveSubscriptions", + "description": "", + "members": [ { - "filePath": "/server/authenticate/webhooks/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/billing/types.d.ts", "syntaxKind": "PropertySignature", - "name": "admin", - "value": "WebhookAdminContext", - "description": "An admin context for the webhook.\n\nReturned only if there is a session for the shop.", - "examples": [ - { - "title": "[V3] Webhook admin context", - "description": "With the `v3_webhookAdminContext` future flag enabled, use the `admin` object in the context to interact with the Admin API.", - "tabs": [ - { - "code": "import { ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.webhook(request);\n\n const response = await admin?.graphql(\n `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n { variables: { input: { title: \"Product Name\" } } }\n );\n\n const productData = await response.json();\n return json({ data: productData.data });\n}", - "title": "/app/routes/webhooks.tsx" - } - ] - }, - { - "title": "Webhook admin context", - "description": "Use the `admin` object in the context to interact with the Admin API. This format will be removed in V3 of the package.", - "tabs": [ - { - "code": "import { json, ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.webhook(request);\n\n const response = await admin?.graphql.query({\n data: {\n query: `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n variables: { input: { title: \"Product Name\" } },\n },\n });\n\n const productData = response?.body.data;\n return json({ data: productData.data });\n}", - "title": "/app/routes/webhooks.tsx" - } - ] - } - ] + "name": "activeSubscriptions", + "value": "AppSubscription[]", + "description": "" + } + ], + "value": "export interface ActiveSubscriptions {\n activeSubscriptions: AppSubscription[];\n}" + }, + "ShopifyLogger": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/index.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "ShopifyLogger", + "value": "ReturnType", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/index.d.ts", + "syntaxKind": "PropertySignature", + "name": "log", + "value": "LoggerFunction", + "description": "" }, { - "filePath": "/server/authenticate/webhooks/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/index.d.ts", "syntaxKind": "PropertySignature", - "name": "apiVersion", - "value": "string", - "description": "The API version used for the webhook.", - "examples": [ - { - "title": "Webhook API version", - "description": "Get the API version used for webhook request.", - "tabs": [ - { - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { apiVersion } = await authenticate.webhook(request);\n return new Response();\n};", - "title": "/app/routes/webhooks.tsx" - } - ] - } - ] + "name": "debug", + "value": "(message: string, context?: LogContext) => Promise", + "description": "" }, { - "filePath": "/server/authenticate/webhooks/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/index.d.ts", "syntaxKind": "PropertySignature", - "name": "shop", - "value": "string", - "description": "The shop where the webhook was triggered.", - "examples": [ - { - "title": "Webhook shop", - "description": "Get the shop that triggered a webhook.", - "tabs": [ - { - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { shop } = await authenticate.webhook(request);\n return new Response();\n};", - "title": "/app/routes/webhooks.tsx" - } - ] - } - ] + "name": "info", + "value": "(message: string, context?: LogContext) => Promise", + "description": "" }, { - "filePath": "/server/authenticate/webhooks/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/index.d.ts", "syntaxKind": "PropertySignature", - "name": "topic", - "value": "Topics", - "description": "The topic of the webhook.", - "examples": [ - { - "title": "Webhook topic", - "description": "Get the event topic for the webhook.", - "tabs": [ - { - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { topic } = await authenticate.webhook(request);\n\n switch (topic) {\n case \"APP_UNINSTALLED\":\n // Do something when the app is uninstalled.\n break;\n }\n\n return new Response();\n};", - "title": "/app/routes/webhooks.tsx" - } - ] - } - ] + "name": "warning", + "value": "(message: string, context?: LogContext) => Promise", + "description": "" }, { - "filePath": "/server/authenticate/webhooks/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/index.d.ts", "syntaxKind": "PropertySignature", - "name": "webhookId", - "value": "string", - "description": "A unique ID for the webhook. Useful to keep track of which events your app has already processed.", - "examples": [ - { - "title": "Webhook ID", - "description": "Get the webhook ID.", - "tabs": [ - { - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { webhookId } = await authenticate.webhook(request);\n return new Response();\n};", - "title": "/app/routes/webhooks.tsx" - } - ] - } - ] + "name": "error", + "value": "(message: string, context?: LogContext) => Promise", + "description": "" }, { - "filePath": "/server/authenticate/webhooks/types.ts", + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/index.d.ts", "syntaxKind": "PropertySignature", - "name": "payload", - "value": "JSONValue", - "description": "The payload from the webhook request.", - "examples": [ - { - "title": "Webhook payload", - "description": "Get the request's POST payload.", - "tabs": [ - { - "code": "import { ActionFunction } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport const action: ActionFunction = async ({ request }) => {\n const { payload } = await authenticate.webhook(request);\n return new Response();\n};", - "title": "/app/routes/webhooks.tsx" - } - ] - } - ] + "name": "deprecated", + "value": "(version: string, message: string) => void", + "description": "" } - ], - "value": "export interface WebhookContextWithSession<\n Future extends FutureFlagOptions,\n Resources extends ShopifyRestResources,\n Topics = string | number | symbol,\n> extends Context {\n /**\n * A session with an offline token for the shop.\n *\n * Returned only if there is a session for the shop.\n */\n session: Session;\n\n /**\n * An admin context for the webhook.\n *\n * Returned only if there is a session for the shop.\n *\n * @example\n * [V3] Webhook admin context.\n * With the `v3_webhookAdminContext` future flag enabled, use the `admin` object in the context to interact with the Admin API.\n * ```ts\n * // /app/routes/webhooks.tsx\n * import { ActionFunctionArgs } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { admin } = await authenticate.webhook(request);\n *\n * const response = await admin?.graphql(\n * `#graphql\n * mutation populateProduct($input: ProductInput!) {\n * productCreate(input: $input) {\n * product {\n * id\n * }\n * }\n * }`,\n * { variables: { input: { title: \"Product Name\" } } }\n * );\n *\n * const productData = await response.json();\n * return json({ data: productData.data });\n * }\n * ```\n *\n * @example\n * Webhook admin context.\n * Use the `admin` object in the context to interact with the Admin API. This format will be removed in V3 of the package.\n * ```ts\n * // /app/routes/webhooks.tsx\n * import { json, ActionFunctionArgs } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { admin } = await authenticate.webhook(request);\n *\n * const response = await admin?.graphql.query({\n * data: {\n * query: `#graphql\n * mutation populateProduct($input: ProductInput!) {\n * productCreate(input: $input) {\n * product {\n * id\n * }\n * }\n * }`,\n * variables: { input: { title: \"Product Name\" } },\n * },\n * });\n *\n * const productData = response?.body.data;\n * return json({ data: productData.data });\n * }\n * ```\n */\n admin: WebhookAdminContext;\n}" - }, - "WebhookAdminContext": { - "filePath": "/server/authenticate/webhooks/types.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "WebhookAdminContext", - "value": "FeatureEnabled extends true\n ? AdminApiContext\n : LegacyWebhookAdminApiContext", - "description": "" + ] }, - "LegacyWebhookAdminApiContext": { - "filePath": "/server/authenticate/webhooks/types.ts", - "name": "LegacyWebhookAdminApiContext", + "LoggerFunction": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/log.d.ts", + "name": "LoggerFunction", "description": "", - "members": [ + "params": [ { - "filePath": "/server/authenticate/webhooks/types.ts", - "syntaxKind": "PropertySignature", - "name": "rest", - "value": "RestClient & Resources", - "description": "A REST client." + "name": "severity", + "description": "", + "value": "LogSeverity", + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/log.d.ts" }, { - "filePath": "/server/authenticate/webhooks/types.ts", - "syntaxKind": "PropertySignature", - "name": "graphql", - "value": "InstanceType", - "description": "A GraphQL client." + "name": "message", + "description": "", + "value": "string", + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/log.d.ts" + }, + { + "name": "context", + "description": "", + "value": "Record", + "isOptional": true, + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/log.d.ts" } ], - "value": "export interface LegacyWebhookAdminApiContext<\n Resources extends ShopifyRestResources,\n> {\n /** A REST client. */\n rest: InstanceType & Resources;\n /** A GraphQL client. */\n graphql: InstanceType;\n}" + "returns": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/log.d.ts", + "description": "", + "name": "void", + "value": "void" + }, + "value": "export type LoggerFunction = (severity: LogSeverity, message: string, context?: Record) => void;" + }, + "LogContext": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/logger/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "LogContext", + "value": "Record", + "description": "", + "members": [] }, "MandatoryTopics": { - "filePath": "/server/types.ts", + "filePath": "src/server/types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "MandatoryTopics", "value": "'CUSTOMERS_DATA_REQUEST' | 'CUSTOMERS_REDACT' | 'SHOP_REDACT'", "description": "" }, "Unauthenticated": { - "filePath": "/server/unauthenticated/types.ts", + "filePath": "src/server/unauthenticated/types.ts", "name": "Unauthenticated", "description": "", "members": [ { - "filePath": "/server/unauthenticated/types.ts", + "filePath": "src/server/unauthenticated/types.ts", "syntaxKind": "PropertySignature", "name": "admin", "value": "GetUnauthenticatedAdminContext", @@ -5618,7 +14091,7 @@ ] }, { - "filePath": "/server/unauthenticated/types.ts", + "filePath": "src/server/unauthenticated/types.ts", "syntaxKind": "PropertySignature", "name": "storefront", "value": "GetUnauthenticatedStorefrontContext", @@ -5640,7 +14113,7 @@ "value": "export interface Unauthenticated {\n /**\n * Get an admin context by passing a shop\n *\n * **Warning** This should only be used for Requests that do not originate from Shopify.\n * You must do your own authentication before using this method.\n * This method throws an error if there is no session for the shop.\n *\n * @example\n * Responding to a request not controlled by Shopify.\n * ```ts\n * // /app/shopify.server.ts\n * import { LATEST_API_VERSION, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * ```\n * ```ts\n * // /app/routes/**\\/*.jsx\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticateExternal } from \"~/helpers/authenticate\"\n * import shopify from \"../../shopify.server\";\n *\n * export async function loader({ request }: LoaderFunctionArgs) {\n * const shop = await authenticateExternal(request)\n * const {admin} = await shopify.unauthenticated.admin(shop);\n *\n * return json(await admin.rest.resources.Product.count({ session }));\n * }\n * ```\n */\n admin: GetUnauthenticatedAdminContext;\n\n /**\n * Get a storefront context by passing a shop\n *\n * **Warning** This should only be used for Requests that do not originate from Shopify.\n * You must do your own authentication before using this method.\n * This method throws an error if there is no session for the shop.\n *\n * @example\n * Responding to a request not controlled by Shopify\n * ```ts\n * // /app/routes/**\\/*.jsx\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticateExternal } from \"~/helpers/authenticate\"\n * import shopify from \"../../shopify.server\";\n *\n * export async function loader({ request }: LoaderFunctionArgs) {\n * const shop = await authenticateExternal(request)\n * const {storefront} = await shopify.unauthenticated.storefront(shop);\n * const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);\n *\n * return json(await response.json());\n * }\n * ```\n */\n storefront: GetUnauthenticatedStorefrontContext;\n}" }, "GetUnauthenticatedAdminContext": { - "filePath": "/server/unauthenticated/admin/types.ts", + "filePath": "src/server/unauthenticated/admin/types.ts", "name": "GetUnauthenticatedAdminContext", "description": "", "params": [ @@ -5648,11 +14121,11 @@ "name": "shop", "description": "", "value": "string", - "filePath": "/server/unauthenticated/admin/types.ts" + "filePath": "src/server/unauthenticated/admin/types.ts" } ], "returns": { - "filePath": "/server/unauthenticated/admin/types.ts", + "filePath": "src/server/unauthenticated/admin/types.ts", "description": "", "name": "Promise>", "value": "Promise>" @@ -5660,12 +14133,12 @@ "value": "export type GetUnauthenticatedAdminContext<\n Resources extends ShopifyRestResources,\n> = (shop: string) => Promise>;" }, "UnauthenticatedAdminContext": { - "filePath": "/server/unauthenticated/admin/types.ts", + "filePath": "src/server/unauthenticated/admin/types.ts", "name": "UnauthenticatedAdminContext", "description": "", "members": [ { - "filePath": "/server/unauthenticated/admin/types.ts", + "filePath": "src/server/unauthenticated/admin/types.ts", "syntaxKind": "PropertySignature", "name": "session", "value": "Session", @@ -5684,7 +14157,7 @@ ] }, { - "filePath": "/server/unauthenticated/admin/types.ts", + "filePath": "src/server/unauthenticated/admin/types.ts", "syntaxKind": "PropertySignature", "name": "admin", "value": "AdminApiContext", @@ -5694,7 +14167,7 @@ "value": "export interface UnauthenticatedAdminContext<\n Resources extends ShopifyRestResources,\n> {\n /**\n * The session for the given shop.\n *\n * This comes from the session storage which `shopifyApp` uses to store sessions in your database of choice.\n *\n * This will always be an offline session. You can use to get shop-specific data.\n *\n * @example\n * Using the offline session.\n * Get your app's shop-specific data using the returned offline `session` object.\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { unauthenticated } from \"../shopify.server\";\n * import { getMyAppData } from \"~/db/model.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const shop = getShopFromExternalRequest(request);\n * const { session } = await unauthenticated.admin(shop);\n * return json(await getMyAppData({shop: session.shop));\n * };\n * ```\n */\n session: Session;\n\n /**\n * Methods for interacting with the GraphQL / REST Admin APIs for the given store.\n */\n admin: AdminApiContext;\n}" }, "GetUnauthenticatedStorefrontContext": { - "filePath": "/server/unauthenticated/storefront/types.ts", + "filePath": "src/server/unauthenticated/storefront/types.ts", "name": "GetUnauthenticatedStorefrontContext", "description": "", "params": [ @@ -5702,11 +14175,11 @@ "name": "shop", "description": "", "value": "string", - "filePath": "/server/unauthenticated/storefront/types.ts" + "filePath": "src/server/unauthenticated/storefront/types.ts" } ], "returns": { - "filePath": "/server/unauthenticated/storefront/types.ts", + "filePath": "src/server/unauthenticated/storefront/types.ts", "description": "", "name": "Promise", "value": "Promise" @@ -5714,12 +14187,12 @@ "value": "export type GetUnauthenticatedStorefrontContext = (\n shop: string,\n) => Promise;" }, "UnauthenticatedStorefrontContext": { - "filePath": "/server/unauthenticated/storefront/types.ts", + "filePath": "src/server/unauthenticated/storefront/types.ts", "name": "UnauthenticatedStorefrontContext", "description": "", "members": [ { - "filePath": "/server/unauthenticated/storefront/types.ts", + "filePath": "src/server/unauthenticated/storefront/types.ts", "syntaxKind": "PropertySignature", "name": "session", "value": "Session", @@ -5738,7 +14211,7 @@ ] }, { - "filePath": "/server/unauthenticated/storefront/types.ts", + "filePath": "src/server/unauthenticated/storefront/types.ts", "syntaxKind": "PropertySignature", "name": "storefront", "value": "StorefrontContext", @@ -5748,19 +14221,19 @@ "value": "export interface UnauthenticatedStorefrontContext {\n /**\n * The session for the given shop.\n *\n * This comes from the session storage which `shopifyApp` uses to store sessions in your database of choice.\n *\n * This will always be an offline session. You can use this to get shop specific data.\n *\n * @example\n * Using the offline session.\n * Get your app's shop-specific data using the returned offline `session` object.\n * ```ts\n * // app/routes/**\\/.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { unauthenticated } from \"../shopify.server\";\n * import { getMyAppData } from \"~/db/model.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const shop = getShopFromExternalRequest(request);\n * const { session } = await unauthenticated.storefront(shop);\n * return json(await getMyAppData({shop: session.shop));\n * };\n * ```\n */\n session: Session;\n\n /**\n * Method for interacting with the Shopify GraphQL Storefront API for the given store.\n */\n storefront: StorefrontContext;\n}" }, "SingleMerchantApp": { - "filePath": "/server/types.ts", + "filePath": "src/server/types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "SingleMerchantApp", "value": "ShopifyAppBase & ShopifyAppLogin", "description": "" }, "ShopifyAppBase": { - "filePath": "/server/types.ts", + "filePath": "src/server/types.ts", "name": "ShopifyAppBase", "description": "", "members": [ { - "filePath": "/server/types.ts", + "filePath": "src/server/types.ts", "syntaxKind": "PropertySignature", "name": "sessionStorage", "value": "SessionStorageType", @@ -5779,7 +14252,7 @@ ] }, { - "filePath": "/server/types.ts", + "filePath": "src/server/types.ts", "syntaxKind": "PropertySignature", "name": "addDocumentResponseHeaders", "value": "AddDocumentResponseHeaders", @@ -5802,7 +14275,7 @@ ] }, { - "filePath": "/server/types.ts", + "filePath": "src/server/types.ts", "syntaxKind": "PropertySignature", "name": "registerWebhooks", "value": "RegisterWebhooks", @@ -5821,7 +14294,7 @@ ] }, { - "filePath": "/server/types.ts", + "filePath": "src/server/types.ts", "syntaxKind": "PropertySignature", "name": "authenticate", "value": "Authenticate", @@ -5844,7 +14317,7 @@ ] }, { - "filePath": "/server/types.ts", + "filePath": "src/server/types.ts", "syntaxKind": "PropertySignature", "name": "unauthenticated", "value": "Unauthenticated>", @@ -5870,12 +14343,12 @@ "value": "export interface ShopifyAppBase {\n /**\n * The `SessionStorage` instance you passed in as a config option.\n *\n * @example\n * Storing sessions with Prisma.\n * Import the `@shopify/shopify-app-session-storage-prisma` package to store sessions in your Prisma database.\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { PrismaSessionStorage } from \"@shopify/shopify-app-session-storage-prisma\";\n * import prisma from \"~/db.server\";\n *\n * const shopify = shopifyApp({\n * sesssionStorage: new PrismaSessionStorage(prisma),\n * // ...etc\n * })\n *\n * // shopify.sessionStorage is an instance of PrismaSessionStorage\n * ```\n */\n sessionStorage: SessionStorageType;\n\n /**\n * Adds the required Content Security Policy headers for Shopify apps to the given Headers object.\n *\n * {@link https://shopify.dev/docs/apps/store/security/iframe-protection}\n *\n * @example\n * Return headers on all requests.\n * Add headers to all HTML requests by calling `shopify.addDocumentResponseHeaders` in `entry.server.tsx`.\n *\n * ```\n * // ~/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n *\n * const shopify = shopifyApp({\n * // ...etc\n * });\n * export default shopify;\n * export const addDocumentResponseheaders = shopify.addDocumentResponseheaders;\n * ```\n *\n * ```ts\n * // entry.server.tsx\n * import { addDocumentResponseHeaders } from \"~/shopify.server\";\n *\n * export default function handleRequest(\n * request: Request,\n * responseStatusCode: number,\n * responseHeaders: Headers,\n * remixContext: EntryContext\n * ) {\n * const markup = renderToString(\n * \n * );\n *\n * responseHeaders.set(\"Content-Type\", \"text/html\");\n * addDocumentResponseHeaders(request, responseHeaders);\n *\n * return new Response(\"\" + markup, {\n * status: responseStatusCode,\n * headers: responseHeaders,\n * });\n * }\n * ```\n */\n addDocumentResponseHeaders: AddDocumentResponseHeaders;\n\n /**\n * Register webhook topics for a store using the given session. Most likely you want to use this in combination with the afterAuth hook.\n *\n * @example\n * Registering webhooks after install\n * Trigger the registration to create the webhook subscriptions after a merchant installs your app using the `afterAuth` hook. Learn more about [subscribing to webhooks.](/docs/api/shopify-app-remix/v1/guide-webhooks)\n * ```ts\n * // /app/shopify.server.ts\n * import { DeliveryMethod, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n *\n * const shopify = shopifyApp({\n * hooks: {\n * afterAuth: async ({ session }) => {\n * shopify.registerWebhooks({ session });\n * }\n * },\n * webhooks: {\n * APP_UNINSTALLED: {\n * deliveryMethod: DeliveryMethod.Http,\n * callbackUrl: \"/webhooks\",\n * },\n * },\n * // ...etc\n * });\n * ```\n */\n registerWebhooks: RegisterWebhooks;\n\n /**\n * Ways to authenticate requests from different surfaces across Shopify.\n *\n * @example\n * Authenticate Shopify requests.\n * Use the functions in `authenticate` to validate requests coming from Shopify.\n * ```ts\n * // /app/shopify.server.ts\n * import { LATEST_API_VERSION, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * ```\n * ```ts\n * // /app/routes/**\\/*.jsx\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import shopify from \"../../shopify.server\";\n *\n * export async function loader({ request }: LoaderFunctionArgs) {\n * const {admin, session, sessionToken, billing} = shopify.authenticate.admin(request);\n *\n * return json(await admin.rest.resources.Product.count({ session }));\n * }\n * ```\n */\n authenticate: Authenticate;\n\n /**\n * Ways to get Contexts from requests that do not originate from Shopify.\n *\n * @example\n * Using unauthenticated contexts.\n * Create contexts for requests that don't come from Shopify.\n * ```ts\n * // /app/shopify.server.ts\n * import { LATEST_API_VERSION, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * ```\n * ```ts\n * // /app/routes/**\\/*.jsx\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticateExternal } from \"~/helpers/authenticate\"\n * import shopify from \"../../shopify.server\";\n *\n * export async function loader({ request }: LoaderFunctionArgs) {\n * const shop = await authenticateExternal(request)\n * const {admin} = await shopify.unauthenticated.admin(shop);\n *\n * return json(await admin.rest.resources.Product.count({ session }));\n * }\n * ```\n */\n unauthenticated: Unauthenticated>;\n}" }, "ShopifyAppLogin": { - "filePath": "/server/types.ts", + "filePath": "src/server/types.ts", "name": "ShopifyAppLogin", "description": "", "members": [ { - "filePath": "/server/types.ts", + "filePath": "src/server/types.ts", "syntaxKind": "PropertySignature", "name": "login", "value": "Login", @@ -5901,7 +14374,7 @@ "value": "interface ShopifyAppLogin {\n /**\n * Log a merchant in, and redirect them to the app root. Will redirect the merchant to authentication if a shop is\n * present in the URL search parameters or form data.\n *\n * This function won't be present when the `distribution` config option is set to `AppDistribution.ShopifyAdmin`,\n * because Admin apps aren't allowed to show a login page.\n *\n * @example\n * Creating a login page.\n * Use `shopify.login` to create a login form, in a route that can handle GET and POST requests.\n * ```ts\n * // /app/shopify.server.ts\n * import { LATEST_API_VERSION, shopifyApp } from \"@shopify/shopify-app-remix/server\";\n *\n * const shopify = shopifyApp({\n * // ...etc\n * });\n * export default shopify;\n * ```\n * ```ts\n * // /app/routes/auth/login.tsx\n * import shopify from \"../../shopify.server\";\n *\n * export async function loader({ request }: LoaderFunctionArgs) {\n * const errors = shopify.login(request);\n *\n * return json(errors);\n * }\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const errors = shopify.login(request);\n *\n * return json(errors);\n * }\n *\n * export default function Auth() {\n * const actionData = useActionData();\n * const [shop, setShop] = useState(\"\");\n *\n * return (\n * \n * \n *
\n * \n * \n * Login\n * \n * \n * \n * \n *
\n *
\n *
\n * );\n * }\n * ```\n */\n login: Login;\n}" }, "Login": { - "filePath": "/server/types.ts", + "filePath": "src/server/types.ts", "name": "Login", "description": "", "params": [ @@ -5909,11 +14382,11 @@ "name": "request", "description": "", "value": "Request", - "filePath": "/server/types.ts" + "filePath": "src/server/types.ts" } ], "returns": { - "filePath": "/server/types.ts", + "filePath": "src/server/types.ts", "description": "", "name": "Promise", "value": "Promise" @@ -5921,12 +14394,12 @@ "value": "type Login = (request: Request) => Promise;" }, "LoginError": { - "filePath": "/server/types.ts", + "filePath": "src/server/types.ts", "name": "LoginError", "description": "", "members": [ { - "filePath": "/server/types.ts", + "filePath": "src/server/types.ts", "syntaxKind": "PropertySignature", "name": "shop", "value": "LoginErrorType", @@ -5937,25 +14410,25 @@ "value": "export interface LoginError {\n shop?: LoginErrorType;\n}" }, "LoginErrorType": { - "filePath": "/server/types.ts", + "filePath": "src/server/types.ts", "syntaxKind": "EnumDeclaration", "name": "LoginErrorType", "value": "export enum LoginErrorType {\n MissingShop = 'MISSING_SHOP',\n InvalidShop = 'INVALID_SHOP',\n}", "members": [ { - "filePath": "/server/types.ts", + "filePath": "src/server/types.ts", "name": "MissingShop", "value": "MISSING_SHOP" }, { - "filePath": "/server/types.ts", + "filePath": "src/server/types.ts", "name": "InvalidShop", "value": "INVALID_SHOP" } ] }, "AppStoreApp": { - "filePath": "/server/types.ts", + "filePath": "src/server/types.ts", "syntaxKind": "TypeAliasDeclaration", "name": "AppStoreApp", "value": "ShopifyAppBase & ShopifyAppLogin", @@ -5969,30 +14442,28 @@ "type": "FutureFlags", "typeDefinitions": { "FutureFlags": { - "filePath": "/server/future/flags.ts", + "filePath": "../../node_modules/@shopify/shopify-api/future/flags.d.ts", "name": "FutureFlags", "description": "", "members": [ { - "filePath": "/server/future/flags.ts", + "filePath": "../../node_modules/@shopify/shopify-api/future/flags.d.ts", "syntaxKind": "PropertySignature", - "name": "v3_webhookAdminContext", + "name": "unstable_tokenExchange", "value": "boolean", - "description": "When enabled, returns the same `admin` context (`AdminApiContext`) from `authenticate.webhook` that is returned from `authenticate.admin`.", - "isOptional": true, - "defaultValue": "false" + "description": "", + "isOptional": true }, { - "filePath": "/server/future/flags.ts", + "filePath": "../../node_modules/@shopify/shopify-api/future/flags.d.ts", "syntaxKind": "PropertySignature", - "name": "v3_authenticatePublic", + "name": "unstable_lineItemBilling", "value": "boolean", - "description": "When enabled authenticate.public() will not work. Use authenticate.public.checkout() instead.", - "isOptional": true, - "defaultValue": "false" + "description": "", + "isOptional": true } ], - "value": "export interface FutureFlags {\n /**\n * When enabled, returns the same `admin` context (`AdminApiContext`) from `authenticate.webhook` that is returned from `authenticate.admin`.\n *\n * @default false\n */\n v3_webhookAdminContext?: boolean;\n\n /**\n * When enabled authenticate.public() will not work. Use authenticate.public.checkout() instead.\n *\n * @default false\n */\n v3_authenticatePublic?: boolean;\n}" + "value": "export interface FutureFlags {\n unstable_tokenExchange?: boolean;\n unstable_lineItemBilling?: boolean;\n}" } } } @@ -6174,7 +14645,7 @@ "type": "GetUnauthenticatedAdminContext", "typeDefinitions": { "GetUnauthenticatedAdminContext": { - "filePath": "/server/unauthenticated/admin/types.ts", + "filePath": "src/server/unauthenticated/admin/types.ts", "name": "GetUnauthenticatedAdminContext", "description": "", "params": [ @@ -6182,11 +14653,11 @@ "name": "shop", "description": "", "value": "string", - "filePath": "/server/unauthenticated/admin/types.ts" + "filePath": "src/server/unauthenticated/admin/types.ts" } ], "returns": { - "filePath": "/server/unauthenticated/admin/types.ts", + "filePath": "src/server/unauthenticated/admin/types.ts", "description": "", "name": "Promise>", "value": "Promise>" @@ -6194,12 +14665,12 @@ "value": "export type GetUnauthenticatedAdminContext<\n Resources extends ShopifyRestResources,\n> = (shop: string) => Promise>;" }, "UnauthenticatedAdminContext": { - "filePath": "/server/unauthenticated/admin/types.ts", + "filePath": "src/server/unauthenticated/admin/types.ts", "name": "UnauthenticatedAdminContext", "description": "", "members": [ { - "filePath": "/server/unauthenticated/admin/types.ts", + "filePath": "src/server/unauthenticated/admin/types.ts", "syntaxKind": "PropertySignature", "name": "session", "value": "Session", @@ -6218,7 +14689,7 @@ ] }, { - "filePath": "/server/unauthenticated/admin/types.ts", + "filePath": "src/server/unauthenticated/admin/types.ts", "syntaxKind": "PropertySignature", "name": "admin", "value": "AdminApiContext", @@ -6227,13 +14698,252 @@ ], "value": "export interface UnauthenticatedAdminContext<\n Resources extends ShopifyRestResources,\n> {\n /**\n * The session for the given shop.\n *\n * This comes from the session storage which `shopifyApp` uses to store sessions in your database of choice.\n *\n * This will always be an offline session. You can use to get shop-specific data.\n *\n * @example\n * Using the offline session.\n * Get your app's shop-specific data using the returned offline `session` object.\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { unauthenticated } from \"../shopify.server\";\n * import { getMyAppData } from \"~/db/model.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const shop = getShopFromExternalRequest(request);\n * const { session } = await unauthenticated.admin(shop);\n * return json(await getMyAppData({shop: session.shop));\n * };\n * ```\n */\n session: Session;\n\n /**\n * Methods for interacting with the GraphQL / REST Admin APIs for the given store.\n */\n admin: AdminApiContext;\n}" }, + "Session": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "name": "Session", + "description": "Stores App information from logged in merchants so they can make authenticated requests to the Admin API.", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "id", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "shop", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "state", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "isOnline", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "scope", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "expires", + "value": "Date", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "accessToken", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "onlineAccessInfo", + "value": "OnlineAccessInfo", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "isActive", + "value": "(scopes: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "isScopeChanged", + "value": "(scopes: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "isExpired", + "value": "(withinMillisecondsOfExpiry?: number) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toObject", + "value": "() => SessionParams", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "equals", + "value": "(other: Session) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toPropertyArray", + "value": "() => [string, string | number | boolean][]", + "description": "" + } + ], + "value": "export declare class Session {\n static fromPropertyArray(entries: [string, string | number | boolean][]): Session;\n readonly id: string;\n shop: string;\n state: string;\n isOnline: boolean;\n scope?: string;\n expires?: Date;\n accessToken?: string;\n onlineAccessInfo?: OnlineAccessInfo;\n constructor(params: SessionParams);\n isActive(scopes: AuthScopes | string | string[]): boolean;\n isScopeChanged(scopes: AuthScopes | string | string[]): boolean;\n isExpired(withinMillisecondsOfExpiry?: number): boolean;\n toObject(): SessionParams;\n equals(other: Session | undefined): boolean;\n toPropertyArray(): [string, string | number | boolean][];\n}" + }, + "OnlineAccessInfo": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "name": "OnlineAccessInfo", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "expires_in", + "value": "number", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "associated_user_scope", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "associated_user", + "value": "{ id: number; first_name: string; last_name: string; email: string; email_verified: boolean; account_owner: boolean; locale: string; collaborator: boolean; }", + "description": "" + } + ], + "value": "export interface OnlineAccessInfo {\n expires_in: number;\n associated_user_scope: string;\n associated_user: {\n id: number;\n first_name: string;\n last_name: string;\n email: string;\n email_verified: boolean;\n account_owner: boolean;\n locale: string;\n collaborator: boolean;\n };\n}" + }, + "AuthScopes": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "name": "AuthScopes", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "has", + "value": "(scope: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "equals", + "value": "(otherScopes: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toString", + "value": "() => string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toArray", + "value": "() => string[]", + "description": "" + } + ], + "value": "declare class AuthScopes {\n static SCOPE_DELIMITER: string;\n private compressedScopes;\n private expandedScopes;\n constructor(scopes: string | string[] | AuthScopes | undefined);\n has(scope: string | string[] | AuthScopes | undefined): boolean;\n equals(otherScopes: string | string[] | AuthScopes | undefined): boolean;\n toString(): string;\n toArray(): string[];\n private getImpliedScopes;\n}" + }, + "SessionParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "name": "SessionParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "id", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "shop", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "state", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "isOnline", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "scope", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "expires", + "value": "Date", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "accessToken", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "onlineAccessInfo", + "value": "OnlineAccessInfo", + "description": "", + "isOptional": true + } + ], + "value": "export interface SessionParams {\n readonly id: string;\n shop: string;\n state: string;\n isOnline: boolean;\n scope?: string;\n expires?: Date;\n accessToken?: string;\n onlineAccessInfo?: OnlineAccessInfo;\n}" + }, "AdminApiContext": { - "filePath": "/server/clients/admin/types.ts", + "filePath": "src/server/clients/admin/types.ts", "name": "AdminApiContext", "description": "", "members": [ { - "filePath": "/server/clients/admin/types.ts", + "filePath": "src/server/clients/admin/types.ts", "syntaxKind": "PropertySignature", "name": "rest", "value": "RestClientWithResources", @@ -6284,33 +14994,279 @@ ] }, { - "filePath": "/server/clients/admin/types.ts", + "filePath": "src/server/clients/admin/types.ts", + "syntaxKind": "PropertySignature", + "name": "graphql", + "value": "GraphQLClient", + "description": "Methods for interacting with the Shopify Admin GraphQL API\n\n\n\n\n\n\n\n\n\n", + "examples": [ + { + "title": "Querying the GraphQL API", + "description": "Use `admin.graphql` to make query / mutation requests.", + "tabs": [ + { + "code": "import { ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.admin(request);\n\n const response = await admin.graphql(\n `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n { variables: { input: { title: \"Product Name\" } } }\n );\n\n const productData = await response.json();\n return json({ data: productData.data });\n}", + "title": "Example" + } + ] + } + ] + } + ], + "value": "export interface AdminApiContext<\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> {\n /**\n * Methods for interacting with the Shopify Admin REST API\n *\n * There are methods for interacting with individual REST resources. You can also make `GET`, `POST`, `PUT` and `DELETE` requests should the REST resources not meet your needs.\n *\n * {@link https://shopify.dev/docs/api/admin-rest}\n *\n * @example\n * Using REST resources.\n * Getting the number of orders in a store using REST resources. Visit the [Admin REST API references](/docs/api/admin-rest) for examples on using each resource. \n *\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * return json(admin.rest.resources.Order.count({ session }));\n * };\n * ```\n *\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-07\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n *\n *\n * @example\n * Performing a GET request to the REST API.\n * Use `admin.rest.get` to make custom requests to make a request to to the `customer/count` endpoint\n *\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * const response = await admin.rest.get({ path: \"/customers/count.json\" });\n * const customers = await response.json();\n * return json({ customers });\n * };\n * ```\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n * @example\n * Performing a POST request to the REST API.\n * Use `admin.rest.post` to make custom requests to make a request to to the `customers.json` endpoint to send a welcome email\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * const response = admin.rest.post({\n * path: \"customers/7392136888625/send_invite.json\",\n * body: {\n * customer_invite: {\n * to: \"new_test_email@shopify.com\",\n * from: \"j.limited@example.com\",\n * bcc: [\"j.limited@example.com\"],\n * subject: \"Welcome to my new shop\",\n * custom_message: \"My awesome new store\",\n * },\n * },\n * });\n * const customerInvite = await response.json();\n * return json({ customerInvite });\n * };\n * ```\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n rest: RestClientWithResources;\n\n /**\n * Methods for interacting with the Shopify Admin GraphQL API\n *\n * {@link https://shopify.dev/docs/api/admin-graphql}\n * {@link https://github.com/Shopify/shopify-api-js/blob/main/packages/shopify-api/docs/reference/clients/Graphql.md}\n *\n * @example\n * Querying the GraphQL API.\n * Use `admin.graphql` to make query / mutation requests.\n * ```ts\n * import { ActionFunctionArgs } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { admin } = await authenticate.admin(request);\n *\n * const response = await admin.graphql(\n * `#graphql\n * mutation populateProduct($input: ProductInput!) {\n * productCreate(input: $input) {\n * product {\n * id\n * }\n * }\n * }`,\n * { variables: { input: { title: \"Product Name\" } } }\n * );\n *\n * const productData = await response.json();\n * return json({ data: productData.data });\n * }\n * ```\n */\n graphql: GraphQLClient;\n}" + }, + "RestClientWithResources": { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "RestClientWithResources", + "value": "RemixRestClient & {resources: Resources}", + "description": "" + }, + "RemixRestClient": { + "filePath": "src/server/clients/admin/rest.ts", + "name": "RemixRestClient", + "description": "", + "members": [ + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "PropertyDeclaration", + "name": "session", + "value": "Session", + "description": "" + }, + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "get", + "value": "(params: GetRequestParams) => Promise", + "description": "Performs a GET request on the given path." + }, + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "post", + "value": "(params: PostRequestParams) => Promise", + "description": "Performs a POST request on the given path." + }, + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "put", + "value": "(params: PostRequestParams) => Promise", + "description": "Performs a PUT request on the given path." + }, + { + "filePath": "src/server/clients/admin/rest.ts", + "syntaxKind": "MethodDeclaration", + "name": "delete", + "value": "(params: GetRequestParams) => Promise", + "description": "Performs a DELETE request on the given path." + } + ], + "value": "class RemixRestClient {\n public session: Session;\n private params: AdminClientOptions['params'];\n private handleClientError: AdminClientOptions['handleClientError'];\n\n constructor({params, session, handleClientError}: AdminClientOptions) {\n this.params = params;\n this.handleClientError = handleClientError;\n this.session = session;\n }\n\n /**\n * Performs a GET request on the given path.\n */\n public async get(params: GetRequestParams) {\n return this.makeRequest({\n method: 'GET' as RequestParams['method'],\n ...params,\n });\n }\n\n /**\n * Performs a POST request on the given path.\n */\n public async post(params: PostRequestParams) {\n return this.makeRequest({\n method: 'POST' as RequestParams['method'],\n ...params,\n });\n }\n\n /**\n * Performs a PUT request on the given path.\n */\n public async put(params: PutRequestParams) {\n return this.makeRequest({\n method: 'PUT' as RequestParams['method'],\n ...params,\n });\n }\n\n /**\n * Performs a DELETE request on the given path.\n */\n public async delete(params: DeleteRequestParams) {\n return this.makeRequest({\n method: 'DELETE' as RequestParams['method'],\n ...params,\n });\n }\n\n protected async makeRequest(params: RequestParams): Promise {\n const originalClient = new this.params.api.clients.Rest({\n session: this.session,\n });\n const originalRequest = Reflect.get(originalClient, 'request');\n\n try {\n const apiResponse = await originalRequest.call(originalClient, params);\n\n // We use a separate client for REST requests and REST resources because we want to override the API library\n // client class to return a Response object instead.\n return new Response(JSON.stringify(apiResponse.body), {\n headers: apiResponse.headers,\n });\n } catch (error) {\n if (this.handleClientError) {\n throw await this.handleClientError({\n error,\n session: this.session,\n params: this.params,\n });\n } else throw new Error(error);\n }\n }\n}" + }, + "GetRequestParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "GetRequestParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "path", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "type", + "value": "DataType", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "data", + "value": "string | Record", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "query", + "value": "SearchParams", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "extraHeaders", + "value": "HeaderParams", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "tries", + "value": "number", + "description": "", + "isOptional": true + } + ], + "value": "export interface GetRequestParams {\n path: string;\n type?: DataType;\n data?: Record | string;\n query?: SearchParams;\n extraHeaders?: HeaderParams;\n tries?: number;\n}" + }, + "DataType": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "DataType", + "value": "export declare enum DataType {\n JSON = \"application/json\",\n GraphQL = \"application/graphql\",\n URLEncoded = \"application/x-www-form-urlencoded\"\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "JSON", + "value": "application/json" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "GraphQL", + "value": "application/graphql" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "name": "URLEncoded", + "value": "application/x-www-form-urlencoded" + } + ] + }, + "HeaderParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "HeaderParams", + "value": "Record", + "description": "", + "members": [] + }, + "PostRequestParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/clients/types.d.ts", + "syntaxKind": "TypeAliasDeclaration", + "name": "PostRequestParams", + "value": "GetRequestParams & {\n data: Record | string;\n}", + "description": "" + }, + "GraphQLClient": { + "filePath": "src/server/clients/types.ts", + "name": "GraphQLClient", + "description": "", + "params": [ + { + "name": "query", + "description": "", + "value": "Operation extends keyof Operations", + "filePath": "src/server/clients/types.ts" + }, + { + "name": "options", + "description": "", + "value": "GraphQLQueryOptions", + "isOptional": true, + "filePath": "src/server/clients/types.ts" + } + ], + "returns": { + "filePath": "src/server/clients/types.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}" + }, + "value": "export type GraphQLClient = <\n Operation extends keyof Operations,\n>(\n query: Operation,\n options?: GraphQLQueryOptions,\n) => Promise<\n ResponseWithType>>\n>;" + }, + "GraphQLQueryOptions": { + "filePath": "src/server/clients/types.ts", + "name": "GraphQLQueryOptions", + "description": "", + "members": [ + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "variables", + "value": "ApiClientRequestOptions[\"variables\"]", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/clients/types.ts", "syntaxKind": "PropertySignature", - "name": "graphql", - "value": "GraphQLClient", - "description": "Methods for interacting with the Shopify Admin GraphQL API\n\n\n\n\n\n\n\n\n\n", - "examples": [ - { - "title": "Querying the GraphQL API", - "description": "Use `admin.graphql` to make query / mutation requests.", - "tabs": [ - { - "code": "import { ActionFunctionArgs } from \"@remix-run/node\";\nimport { authenticate } from \"../shopify.server\";\n\nexport async function action({ request }: ActionFunctionArgs) {\n const { admin } = await authenticate.admin(request);\n\n const response = await admin.graphql(\n `#graphql\n mutation populateProduct($input: ProductInput!) {\n productCreate(input: $input) {\n product {\n id\n }\n }\n }`,\n { variables: { input: { title: \"Product Name\" } } }\n );\n\n const productData = await response.json();\n return json({ data: productData.data });\n}", - "title": "Example" - } - ] - } - ] + "name": "apiVersion", + "value": "ApiVersion", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "headers", + "value": "{ [key: string]: any; }", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "tries", + "value": "number", + "description": "", + "isOptional": true } ], - "value": "export interface AdminApiContext<\n Resources extends ShopifyRestResources = ShopifyRestResources,\n> {\n /**\n * Methods for interacting with the Shopify Admin REST API\n *\n * There are methods for interacting with individual REST resources. You can also make `GET`, `POST`, `PUT` and `DELETE` requests should the REST resources not meet your needs.\n *\n * {@link https://shopify.dev/docs/api/admin-rest}\n *\n * @example\n * Using REST resources.\n * Getting the number of orders in a store using REST resources. Visit the [Admin REST API references](/docs/api/admin-rest) for examples on using each resource. \n *\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * return json(admin.rest.resources.Order.count({ session }));\n * };\n * ```\n *\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-07\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n *\n *\n * @example\n * Performing a GET request to the REST API.\n * Use `admin.rest.get` to make custom requests to make a request to to the `customer/count` endpoint\n *\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * const response = await admin.rest.get({ path: \"/customers/count.json\" });\n * const customers = await response.json();\n * return json({ customers });\n * };\n * ```\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n * @example\n * Performing a POST request to the REST API.\n * Use `admin.rest.post` to make custom requests to make a request to to the `customers.json` endpoint to send a welcome email\n * ```ts\n * // /app/routes/**\\/*.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const { admin, session } = await authenticate.admin(request);\n * const response = admin.rest.post({\n * path: \"customers/7392136888625/send_invite.json\",\n * body: {\n * customer_invite: {\n * to: \"new_test_email@shopify.com\",\n * from: \"j.limited@example.com\",\n * bcc: [\"j.limited@example.com\"],\n * subject: \"Welcome to my new shop\",\n * custom_message: \"My awesome new store\",\n * },\n * },\n * });\n * const customerInvite = await response.json();\n * return json({ customerInvite });\n * };\n * ```\n *\n * ```ts\n * // /app/shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n * import { restResources } from \"@shopify/shopify-api/rest/admin/2023-04\";\n *\n * const shopify = shopifyApp({\n * restResources,\n * // ...etc\n * });\n * export default shopify;\n * export const authenticate = shopify.authenticate;\n * ```\n */\n rest: RestClientWithResources;\n\n /**\n * Methods for interacting with the Shopify Admin GraphQL API\n *\n * {@link https://shopify.dev/docs/api/admin-graphql}\n * {@link https://github.com/Shopify/shopify-api-js/blob/main/packages/shopify-api/docs/reference/clients/Graphql.md}\n *\n * @example\n * Querying the GraphQL API.\n * Use `admin.graphql` to make query / mutation requests.\n * ```ts\n * import { ActionFunctionArgs } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { admin } = await authenticate.admin(request);\n *\n * const response = await admin.graphql(\n * `#graphql\n * mutation populateProduct($input: ProductInput!) {\n * productCreate(input: $input) {\n * product {\n * id\n * }\n * }\n * }`,\n * { variables: { input: { title: \"Product Name\" } } }\n * );\n *\n * const productData = await response.json();\n * return json({ data: productData.data });\n * }\n * ```\n */\n graphql: GraphQLClient;\n}" + "value": "export interface GraphQLQueryOptions<\n Operation extends keyof Operations,\n Operations extends AllOperations,\n> {\n variables?: ApiClientRequestOptions['variables'];\n apiVersion?: ApiVersion;\n headers?: {[key: string]: any};\n tries?: number;\n}" }, - "RestClientWithResources": { - "filePath": "/server/clients/admin/rest.ts", - "syntaxKind": "TypeAliasDeclaration", - "name": "RestClientWithResources", - "value": "RemixRestClient & {resources: Resources}", - "description": "" + "ApiVersion": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "ApiVersion", + "value": "export declare enum ApiVersion {\n October22 = \"2022-10\",\n January23 = \"2023-01\",\n April23 = \"2023-04\",\n July23 = \"2023-07\",\n October23 = \"2023-10\",\n January24 = \"2024-01\",\n Unstable = \"unstable\"\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "October22", + "value": "2022-10" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "January23", + "value": "2023-01" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "April23", + "value": "2023-04" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "July23", + "value": "2023-07" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "October23", + "value": "2023-10" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "January24", + "value": "2024-01" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Unstable", + "value": "unstable" + } + ] } } } @@ -6440,7 +15396,7 @@ "type": "GetUnauthenticatedStorefrontContext", "typeDefinitions": { "GetUnauthenticatedStorefrontContext": { - "filePath": "/server/unauthenticated/storefront/types.ts", + "filePath": "src/server/unauthenticated/storefront/types.ts", "name": "GetUnauthenticatedStorefrontContext", "description": "", "params": [ @@ -6448,11 +15404,11 @@ "name": "shop", "description": "", "value": "string", - "filePath": "/server/unauthenticated/storefront/types.ts" + "filePath": "src/server/unauthenticated/storefront/types.ts" } ], "returns": { - "filePath": "/server/unauthenticated/storefront/types.ts", + "filePath": "src/server/unauthenticated/storefront/types.ts", "description": "", "name": "Promise", "value": "Promise" @@ -6460,12 +15416,12 @@ "value": "export type GetUnauthenticatedStorefrontContext = (\n shop: string,\n) => Promise;" }, "UnauthenticatedStorefrontContext": { - "filePath": "/server/unauthenticated/storefront/types.ts", + "filePath": "src/server/unauthenticated/storefront/types.ts", "name": "UnauthenticatedStorefrontContext", "description": "", "members": [ { - "filePath": "/server/unauthenticated/storefront/types.ts", + "filePath": "src/server/unauthenticated/storefront/types.ts", "syntaxKind": "PropertySignature", "name": "session", "value": "Session", @@ -6484,7 +15440,7 @@ ] }, { - "filePath": "/server/unauthenticated/storefront/types.ts", + "filePath": "src/server/unauthenticated/storefront/types.ts", "syntaxKind": "PropertySignature", "name": "storefront", "value": "StorefrontContext", @@ -6493,13 +15449,252 @@ ], "value": "export interface UnauthenticatedStorefrontContext {\n /**\n * The session for the given shop.\n *\n * This comes from the session storage which `shopifyApp` uses to store sessions in your database of choice.\n *\n * This will always be an offline session. You can use this to get shop specific data.\n *\n * @example\n * Using the offline session.\n * Get your app's shop-specific data using the returned offline `session` object.\n * ```ts\n * // app/routes/**\\/.ts\n * import { LoaderFunctionArgs, json } from \"@remix-run/node\";\n * import { unauthenticated } from \"../shopify.server\";\n * import { getMyAppData } from \"~/db/model.server\";\n *\n * export const loader = async ({ request }: LoaderFunctionArgs) => {\n * const shop = getShopFromExternalRequest(request);\n * const { session } = await unauthenticated.storefront(shop);\n * return json(await getMyAppData({shop: session.shop));\n * };\n * ```\n */\n session: Session;\n\n /**\n * Method for interacting with the Shopify GraphQL Storefront API for the given store.\n */\n storefront: StorefrontContext;\n}" }, + "Session": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "name": "Session", + "description": "Stores App information from logged in merchants so they can make authenticated requests to the Admin API.", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "id", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "shop", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "state", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "isOnline", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "scope", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "expires", + "value": "Date", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "accessToken", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "PropertyDeclaration", + "name": "onlineAccessInfo", + "value": "OnlineAccessInfo", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "isActive", + "value": "(scopes: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "isScopeChanged", + "value": "(scopes: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "isExpired", + "value": "(withinMillisecondsOfExpiry?: number) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toObject", + "value": "() => SessionParams", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "equals", + "value": "(other: Session) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/session.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toPropertyArray", + "value": "() => [string, string | number | boolean][]", + "description": "" + } + ], + "value": "export declare class Session {\n static fromPropertyArray(entries: [string, string | number | boolean][]): Session;\n readonly id: string;\n shop: string;\n state: string;\n isOnline: boolean;\n scope?: string;\n expires?: Date;\n accessToken?: string;\n onlineAccessInfo?: OnlineAccessInfo;\n constructor(params: SessionParams);\n isActive(scopes: AuthScopes | string | string[]): boolean;\n isScopeChanged(scopes: AuthScopes | string | string[]): boolean;\n isExpired(withinMillisecondsOfExpiry?: number): boolean;\n toObject(): SessionParams;\n equals(other: Session | undefined): boolean;\n toPropertyArray(): [string, string | number | boolean][];\n}" + }, + "OnlineAccessInfo": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "name": "OnlineAccessInfo", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "expires_in", + "value": "number", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "associated_user_scope", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/oauth/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "associated_user", + "value": "{ id: number; first_name: string; last_name: string; email: string; email_verified: boolean; account_owner: boolean; locale: string; collaborator: boolean; }", + "description": "" + } + ], + "value": "export interface OnlineAccessInfo {\n expires_in: number;\n associated_user_scope: string;\n associated_user: {\n id: number;\n first_name: string;\n last_name: string;\n email: string;\n email_verified: boolean;\n account_owner: boolean;\n locale: string;\n collaborator: boolean;\n };\n}" + }, + "AuthScopes": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "name": "AuthScopes", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "has", + "value": "(scope: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "equals", + "value": "(otherScopes: string | string[] | AuthScopes) => boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toString", + "value": "() => string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/auth/scopes/index.d.ts", + "syntaxKind": "MethodDeclaration", + "name": "toArray", + "value": "() => string[]", + "description": "" + } + ], + "value": "declare class AuthScopes {\n static SCOPE_DELIMITER: string;\n private compressedScopes;\n private expandedScopes;\n constructor(scopes: string | string[] | AuthScopes | undefined);\n has(scope: string | string[] | AuthScopes | undefined): boolean;\n equals(otherScopes: string | string[] | AuthScopes | undefined): boolean;\n toString(): string;\n toArray(): string[];\n private getImpliedScopes;\n}" + }, + "SessionParams": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "name": "SessionParams", + "description": "", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "id", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "shop", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "state", + "value": "string", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "isOnline", + "value": "boolean", + "description": "" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "scope", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "expires", + "value": "Date", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "accessToken", + "value": "string", + "description": "", + "isOptional": true + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/session/types.d.ts", + "syntaxKind": "PropertySignature", + "name": "onlineAccessInfo", + "value": "OnlineAccessInfo", + "description": "", + "isOptional": true + } + ], + "value": "export interface SessionParams {\n readonly id: string;\n shop: string;\n state: string;\n isOnline: boolean;\n scope?: string;\n expires?: Date;\n accessToken?: string;\n onlineAccessInfo?: OnlineAccessInfo;\n}" + }, "StorefrontContext": { - "filePath": "/server/clients/storefront/types.ts", + "filePath": "src/server/clients/storefront/types.ts", "name": "StorefrontContext", "description": "", "members": [ { - "filePath": "/server/clients/storefront/types.ts", + "filePath": "src/server/clients/storefront/types.ts", "syntaxKind": "PropertySignature", "name": "graphql", "value": "GraphQLClient", @@ -6519,6 +15714,116 @@ } ], "value": "export interface StorefrontContext {\n /**\n * Method for interacting with the Shopify Storefront GraphQL API\n *\n * If you're getting incorrect type hints in the Shopify template, follow [these instructions](https://github.com/Shopify/shopify-app-template-remix/tree/main#incorrect-graphql-hints).\n *\n * {@link https://shopify.dev/docs/api/storefront}\n *\n * @example\n * Querying the GraphQL API.\n * Use `storefront.graphql` to make query / mutation requests.\n * ```ts\n * // app/routes/**\\/.ts\n * import { json } from \"@remix-run/node\";\n * import { authenticate } from \"../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const { storefront } = await authenticate.public.appProxy(request);\n *\n * const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);\n *\n * return json(await response.json());\n * }\n * ```\n */\n graphql: GraphQLClient;\n}" + }, + "GraphQLClient": { + "filePath": "src/server/clients/types.ts", + "name": "GraphQLClient", + "description": "", + "params": [ + { + "name": "query", + "description": "", + "value": "Operation extends keyof Operations", + "filePath": "src/server/clients/types.ts" + }, + { + "name": "options", + "description": "", + "value": "GraphQLQueryOptions", + "isOptional": true, + "filePath": "src/server/clients/types.ts" + } + ], + "returns": { + "filePath": "src/server/clients/types.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}" + }, + "value": "export type GraphQLClient = <\n Operation extends keyof Operations,\n>(\n query: Operation,\n options?: GraphQLQueryOptions,\n) => Promise<\n ResponseWithType>>\n>;" + }, + "GraphQLQueryOptions": { + "filePath": "src/server/clients/types.ts", + "name": "GraphQLQueryOptions", + "description": "", + "members": [ + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "variables", + "value": "ApiClientRequestOptions[\"variables\"]", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "apiVersion", + "value": "ApiVersion", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "headers", + "value": "{ [key: string]: any; }", + "description": "", + "isOptional": true + }, + { + "filePath": "src/server/clients/types.ts", + "syntaxKind": "PropertySignature", + "name": "tries", + "value": "number", + "description": "", + "isOptional": true + } + ], + "value": "export interface GraphQLQueryOptions<\n Operation extends keyof Operations,\n Operations extends AllOperations,\n> {\n variables?: ApiClientRequestOptions['variables'];\n apiVersion?: ApiVersion;\n headers?: {[key: string]: any};\n tries?: number;\n}" + }, + "ApiVersion": { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "syntaxKind": "EnumDeclaration", + "name": "ApiVersion", + "value": "export declare enum ApiVersion {\n October22 = \"2022-10\",\n January23 = \"2023-01\",\n April23 = \"2023-04\",\n July23 = \"2023-07\",\n October23 = \"2023-10\",\n January24 = \"2024-01\",\n Unstable = \"unstable\"\n}", + "members": [ + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "October22", + "value": "2022-10" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "January23", + "value": "2023-01" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "April23", + "value": "2023-04" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "July23", + "value": "2023-07" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "October23", + "value": "2023-10" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "January24", + "value": "2024-01" + }, + { + "filePath": "../../node_modules/@shopify/shopify-api/lib/types.d.ts", + "name": "Unstable", + "value": "unstable" + } + ] } } } diff --git a/packages/shopify-app-remix/package.json b/packages/shopify-app-remix/package.json index d59a0102fc..dc9c2488cc 100644 --- a/packages/shopify-app-remix/package.json +++ b/packages/shopify-app-remix/package.json @@ -51,7 +51,7 @@ ], "devDependencies": { "@remix-run/react": "^2.5.0", - "@shopify/generate-docs": "^0.11.1", + "@shopify/generate-docs": "^0.13.1", "@shopify/polaris": "^11.8.0", "@shopify/react-testing": "^5.1.3", "@shopify/shopify-app-session-storage-memory": "^2.0.3", diff --git a/yarn.lock b/yarn.lock index 73d520f74e..b4483d0af0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2839,14 +2839,14 @@ pkg-dir "^5.0.0" pluralize "^8.0.0" -"@shopify/generate-docs@^0.11.1": - version "0.11.1" - resolved "https://registry.yarnpkg.com/@shopify/generate-docs/-/generate-docs-0.11.1.tgz#4b4d159cb5578dc98fa4218bbc9edade1872d0f1" - integrity sha512-pZxCkUtO6MXJaetEdd4Tyk6t7tjJTUNd3VGCXyOeZqKAWrXEob+8gkost0x23EmuES4GGqQKSB9nnKdFvbdk1w== +"@shopify/generate-docs@^0.13.1": + version "0.13.1" + resolved "https://registry.yarnpkg.com/@shopify/generate-docs/-/generate-docs-0.13.1.tgz#c2f41671c488a70e4bf91648ffc5631c56febc3e" + integrity sha512-V3vk6oemlqX/1joFYLPjvzephgVTzbuysw9lig7UgSbuMah0kXq+VSvF9IxgQMnfloTT32nWbkBtl+AJTQurtw== dependencies: "@types/react" "^18.0.21" globby "^11.1.0" - typescript "^4.8.3" + typescript "^4.8.3 || ^5.0.0" "@shopify/graphql-client@^0.9.1": version "0.9.1" @@ -3718,9 +3718,9 @@ csstype "^3.0.2" "@types/react@^18.0.21": - version "18.2.21" - resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.21.tgz#774c37fd01b522d0b91aed04811b58e4e0514ed9" - integrity sha512-neFKG/sBAwGxHgXiIxnbm3/AAVQ/cMRS93hvBpg8xYRbeQSPVABp9U2bRnPf0iI4+Ucdv3plSxKK+3CW2ENJxA== + version "18.2.48" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.48.tgz#11df5664642d0bd879c1f58bc1d37205b064e8f1" + integrity sha512-qboRCl6Ie70DQQG9hhNREz81jqC1cs9EVNcjQ1AU+jH6NFfSAhVVbrrY/+nSF+Bsk4AOwm9Qa61InvMCyV+H3w== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" @@ -10197,11 +10197,16 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typescript@4.9.5, typescript@^4.3.5, typescript@^4.8.3, typescript@^4.9.5: +typescript@4.9.5, typescript@^4.3.5, typescript@^4.9.5: version "4.9.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== +"typescript@^4.8.3 || ^5.0.0": + version "5.3.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37" + integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw== + unbox-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e"