@shopify/shopify-app-remix 3.8.2 → 3.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/react/components/AppProvider/AppProvider.js.map +1 -1
- package/dist/cjs/react/components/AppProxyForm/AppProxyForm.js.map +1 -1
- package/dist/cjs/react/components/AppProxyLink/AppProxyLink.js.map +1 -1
- package/dist/cjs/react/components/AppProxyProvider/AppProxyProvider.js.map +1 -1
- package/dist/cjs/react/components/RemixPolarisLink.js.map +1 -1
- package/dist/cjs/react/const.js.map +1 -1
- package/dist/cjs/server/adapters/node/index.js.map +1 -1
- package/dist/cjs/server/adapters/vercel/index.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/authenticate.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/billing/cancel.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/billing/check.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/billing/create-usage-record.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/billing/helpers.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/billing/request.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/billing/require.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/billing/update-usage-subscription-capped-amount.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/helpers/begin-auth.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/helpers/create-admin-api-context.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/helpers/ensure-app-is-embedded-if-required.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/helpers/ensure-session-token-search-param-if-required.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/helpers/handle-client-error.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/helpers/redirect-to-auth-page.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/helpers/redirect-to-bounce-page.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/helpers/redirect-to-install-page.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/helpers/redirect-to-shopify-or-app-root.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/helpers/redirect-with-app-bridge-headers.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/helpers/redirect-with-exitiframe.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/helpers/redirect.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/helpers/render-app-bridge.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/helpers/trigger-after-auth-hook.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/helpers/validate-redirect-url.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/helpers/validate-shop-and-host-params.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/scope/client/fetch-scopes-details.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/scope/client/revoke-scopes.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/scope/factory.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/scope/query.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/scope/request.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/scope/revoke.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/strategies/auth-code-flow.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/strategies/merchant-custom-app.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/strategies/token-exchange.js.map +1 -1
- package/dist/cjs/server/authenticate/const.js.map +1 -1
- package/dist/cjs/server/authenticate/flow/authenticate.js.map +1 -1
- package/dist/cjs/server/authenticate/fulfillment-service/authenticate.js.map +1 -1
- package/dist/cjs/server/authenticate/helpers/add-response-headers.js.map +1 -1
- package/dist/cjs/server/authenticate/helpers/app-bridge-url.js.map +1 -1
- package/dist/cjs/server/authenticate/helpers/create-or-load-offline-session.js.map +1 -1
- package/dist/cjs/server/authenticate/helpers/ensure-cors-headers.js.map +1 -1
- package/dist/cjs/server/authenticate/helpers/get-session-token-header.js.map +1 -1
- package/dist/cjs/server/authenticate/helpers/get-shop-from-request.js.map +1 -1
- package/dist/cjs/server/authenticate/helpers/idempotent-promise-handler.js.map +1 -1
- package/dist/cjs/server/authenticate/helpers/invalidate-access-token.js.map +1 -1
- package/dist/cjs/server/authenticate/helpers/reject-bot-request.js.map +1 -1
- package/dist/cjs/server/authenticate/helpers/respond-to-invalid-session-token.js.map +1 -1
- package/dist/cjs/server/authenticate/helpers/respond-to-options-request.js.map +1 -1
- package/dist/cjs/server/authenticate/helpers/validate-session-token.js.map +1 -1
- package/dist/cjs/server/authenticate/login/login.js.map +1 -1
- package/dist/cjs/server/authenticate/public/appProxy/authenticate.js.map +1 -1
- package/dist/cjs/server/authenticate/public/checkout/authenticate.js.map +1 -1
- package/dist/cjs/server/authenticate/public/customer-account/authenticate.js.map +1 -1
- package/dist/cjs/server/authenticate/public/extension/authenticate.js.map +1 -1
- package/dist/cjs/server/authenticate/public/factory.js.map +1 -1
- package/dist/cjs/server/authenticate/public/pos/authenticate.js.map +1 -1
- package/dist/cjs/server/authenticate/webhooks/authenticate.js.map +1 -1
- package/dist/cjs/server/authenticate/webhooks/register.js.map +1 -1
- package/dist/cjs/server/boundary/error.js.map +1 -1
- package/dist/cjs/server/boundary/headers.js.map +1 -1
- package/dist/cjs/server/boundary/index.js.map +1 -1
- package/dist/cjs/server/clients/admin/factory.js.map +1 -1
- package/dist/cjs/server/clients/admin/graphql.js.map +1 -1
- package/dist/cjs/server/clients/admin/rest.js.map +1 -1
- package/dist/cjs/server/clients/storefront/factory.js.map +1 -1
- package/dist/cjs/server/errors.js.map +1 -1
- package/dist/cjs/server/future/flags.js.map +1 -1
- package/dist/cjs/server/index.js.map +1 -1
- package/dist/cjs/server/override-logger.js.map +1 -1
- package/dist/cjs/server/shopify-app.js.map +1 -1
- package/dist/cjs/server/test-helpers/test-config.js.map +1 -1
- package/dist/cjs/server/types.js.map +1 -1
- package/dist/cjs/server/unauthenticated/admin/factory.js.map +1 -1
- package/dist/cjs/server/unauthenticated/storefront/factory.js.map +1 -1
- package/dist/cjs/server/version.js +1 -1
- package/dist/cjs/server/version.js.map +1 -1
- package/dist/cjs/session-storage/shopify-app-session-storage-memory/dist/esm/memory.js.map +1 -1
- package/dist/esm/react/components/AppProvider/AppProvider.mjs.map +1 -1
- package/dist/esm/react/components/AppProxyForm/AppProxyForm.mjs.map +1 -1
- package/dist/esm/react/components/AppProxyLink/AppProxyLink.mjs.map +1 -1
- package/dist/esm/react/components/AppProxyProvider/AppProxyProvider.mjs.map +1 -1
- package/dist/esm/react/components/RemixPolarisLink.mjs.map +1 -1
- package/dist/esm/react/const.mjs.map +1 -1
- package/dist/esm/server/adapters/node/index.mjs.map +1 -1
- package/dist/esm/server/adapters/vercel/index.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/authenticate.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/billing/cancel.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/billing/check.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/billing/create-usage-record.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/billing/helpers.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/billing/request.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/billing/require.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/billing/update-usage-subscription-capped-amount.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/helpers/begin-auth.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/helpers/create-admin-api-context.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/helpers/ensure-app-is-embedded-if-required.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/helpers/ensure-session-token-search-param-if-required.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/helpers/handle-client-error.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/helpers/redirect-to-auth-page.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/helpers/redirect-to-bounce-page.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/helpers/redirect-to-install-page.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/helpers/redirect-to-shopify-or-app-root.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/helpers/redirect-with-app-bridge-headers.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/helpers/redirect-with-exitiframe.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/helpers/redirect.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/helpers/render-app-bridge.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/helpers/trigger-after-auth-hook.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/helpers/validate-redirect-url.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/helpers/validate-shop-and-host-params.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/scope/client/fetch-scopes-details.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/scope/client/revoke-scopes.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/scope/factory.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/scope/query.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/scope/request.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/scope/revoke.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/strategies/auth-code-flow.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/strategies/merchant-custom-app.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/strategies/token-exchange.mjs.map +1 -1
- package/dist/esm/server/authenticate/const.mjs.map +1 -1
- package/dist/esm/server/authenticate/flow/authenticate.mjs.map +1 -1
- package/dist/esm/server/authenticate/fulfillment-service/authenticate.mjs.map +1 -1
- package/dist/esm/server/authenticate/helpers/add-response-headers.mjs.map +1 -1
- package/dist/esm/server/authenticate/helpers/app-bridge-url.mjs.map +1 -1
- package/dist/esm/server/authenticate/helpers/create-or-load-offline-session.mjs.map +1 -1
- package/dist/esm/server/authenticate/helpers/ensure-cors-headers.mjs.map +1 -1
- package/dist/esm/server/authenticate/helpers/get-session-token-header.mjs.map +1 -1
- package/dist/esm/server/authenticate/helpers/get-shop-from-request.mjs.map +1 -1
- package/dist/esm/server/authenticate/helpers/idempotent-promise-handler.mjs.map +1 -1
- package/dist/esm/server/authenticate/helpers/invalidate-access-token.mjs.map +1 -1
- package/dist/esm/server/authenticate/helpers/reject-bot-request.mjs.map +1 -1
- package/dist/esm/server/authenticate/helpers/respond-to-invalid-session-token.mjs.map +1 -1
- package/dist/esm/server/authenticate/helpers/respond-to-options-request.mjs.map +1 -1
- package/dist/esm/server/authenticate/helpers/validate-session-token.mjs.map +1 -1
- package/dist/esm/server/authenticate/login/login.mjs.map +1 -1
- package/dist/esm/server/authenticate/public/appProxy/authenticate.mjs.map +1 -1
- package/dist/esm/server/authenticate/public/checkout/authenticate.mjs.map +1 -1
- package/dist/esm/server/authenticate/public/customer-account/authenticate.mjs.map +1 -1
- package/dist/esm/server/authenticate/public/extension/authenticate.mjs.map +1 -1
- package/dist/esm/server/authenticate/public/factory.mjs.map +1 -1
- package/dist/esm/server/authenticate/public/pos/authenticate.mjs.map +1 -1
- package/dist/esm/server/authenticate/webhooks/authenticate.mjs.map +1 -1
- package/dist/esm/server/authenticate/webhooks/register.mjs.map +1 -1
- package/dist/esm/server/boundary/error.mjs.map +1 -1
- package/dist/esm/server/boundary/headers.mjs.map +1 -1
- package/dist/esm/server/boundary/index.mjs.map +1 -1
- package/dist/esm/server/clients/admin/factory.mjs.map +1 -1
- package/dist/esm/server/clients/admin/graphql.mjs.map +1 -1
- package/dist/esm/server/clients/admin/rest.mjs.map +1 -1
- package/dist/esm/server/clients/storefront/factory.mjs.map +1 -1
- package/dist/esm/server/errors.mjs.map +1 -1
- package/dist/esm/server/future/flags.mjs.map +1 -1
- package/dist/esm/server/index.mjs.map +1 -1
- package/dist/esm/server/override-logger.mjs.map +1 -1
- package/dist/esm/server/shopify-app.mjs.map +1 -1
- package/dist/esm/server/test-helpers/test-config.mjs.map +1 -1
- package/dist/esm/server/types.mjs.map +1 -1
- package/dist/esm/server/unauthenticated/admin/factory.mjs.map +1 -1
- package/dist/esm/server/unauthenticated/storefront/factory.mjs.map +1 -1
- package/dist/esm/server/version.mjs +1 -1
- package/dist/esm/server/version.mjs.map +1 -1
- package/dist/esm/session-storage/shopify-app-session-storage-memory/dist/esm/memory.mjs.map +1 -1
- package/dist/ts/server/authenticate/admin/authenticate.admin.doc.d.ts.map +1 -1
- package/dist/ts/server/authenticate/admin/billing/cancel.d.ts.map +1 -1
- package/dist/ts/server/authenticate/admin/billing/check.d.ts.map +1 -1
- package/dist/ts/server/authenticate/admin/billing/create-usage-record.d.ts.map +1 -1
- package/dist/ts/server/authenticate/admin/billing/request.d.ts.map +1 -1
- package/dist/ts/server/authenticate/admin/billing/require.d.ts.map +1 -1
- package/dist/ts/server/authenticate/admin/billing/update-usage-subscription-capped-amount.d.ts.map +1 -1
- package/dist/ts/server/authenticate/admin/helpers/ensure-app-is-embedded-if-required.d.ts.map +1 -1
- package/dist/ts/server/authenticate/admin/helpers/ensure-session-token-search-param-if-required.d.ts.map +1 -1
- package/dist/ts/server/authenticate/admin/helpers/redirect-to-bounce-page.d.ts.map +1 -1
- package/dist/ts/server/authenticate/admin/scope/request.d.ts.map +1 -1
- package/dist/ts/server/authenticate/admin/scope/revoke.d.ts.map +1 -1
- package/dist/ts/server/authenticate/admin/scope/types.d.ts +25 -59
- package/dist/ts/server/authenticate/admin/scope/types.d.ts.map +1 -1
- package/dist/ts/server/authenticate/login/login.d.ts.map +1 -1
- package/dist/ts/server/authenticate/webhooks/register.d.ts.map +1 -1
- package/dist/ts/server/unauthenticated/admin/factory.d.ts.map +1 -1
- package/dist/ts/server/version.d.ts +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +15 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shopify-app.mjs","sources":["../../../../src/server/shopify-app.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAsCA;;;;;;;;;;;;;;;;;;;;AAoBG;AACG,SAAU,UAAU,CAKxB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AS,CAAC,OAA+B;QAClD,MAAM,EAAE,SAAS,CAAC,MAAM;QACxB,wBAAwB,EAAE,IAAI,wBAAwB,EAAE;AACxD,QAAA,eAAe,EAAE,SAAS,CAAC,YAAY,KAAK,eAAe,CAAC,YAAY;AACxE,QAAA,eAAe,EAAE,SAAS,CAAC,eAAe,IAAI,KAAK;AACnD,QAAA,KAAK,EAAE,SAAS,CAAC,KAAK,IAAI,EAAE;QAC5B,cAAc,EAAE,SAAS,CAAC,cAAyB;AACnD,QAAA,MAAM,EAAE,SAAS,CAAC,MAAM,IAAI,EAAE;AAC9B,QAAA,IAAI,EAAE;AACJ,YAAA,IAAI,EAAE,cAAc;YACpB,YAAY,EAAE,CAAG,EAAA,cAAc,CAAW,SAAA,CAAA;YAC1C,qBAAqB,EAAE,CAAG,EAAA,cAAc,CAAgB,cAAA,CAAA;YACxD,cAAc,EAAE,CAAG,EAAA,cAAc,CAAc,YAAA,CAAA;YAC/C,SAAS,EAAE,CAAG,EAAA,cAAc,CAAQ,MAAA,CAAA;AACrC,SAAA;QACD,YAAY,EAAE,SAAS,CAAC,YAAY;KACrC;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"shopify-app.mjs","sources":["../../../../src/server/shopify-app.ts"],"sourcesContent":["import '@shopify/shopify-api/adapters/web-api';\nimport {\n ConfigInterface as ApiConfig,\n LATEST_API_VERSION,\n ShopifyError,\n ShopifyRestResources,\n shopifyApi,\n} from '@shopify/shopify-api';\nimport {SessionStorage} from '@shopify/shopify-app-session-storage';\n\nimport {type AppConfig, type AppConfigArg} from './config-types';\nimport {\n AppDistribution,\n type BasicParams,\n type ShopifyApp,\n type ShopifyAppBase,\n type AdminApp,\n type SingleMerchantApp,\n type AppStoreApp,\n} from './types';\nimport {SHOPIFY_REMIX_LIBRARY_VERSION} from './version';\nimport {registerWebhooksFactory} from './authenticate/webhooks';\nimport {authStrategyFactory} from './authenticate/admin/authenticate';\nimport {authenticateWebhookFactory} from './authenticate/webhooks/authenticate';\nimport {overrideLogger} from './override-logger';\nimport {addDocumentResponseHeadersFactory} from './authenticate/helpers';\nimport {loginFactory} from './authenticate/login/login';\nimport {unauthenticatedAdminContextFactory} from './unauthenticated/admin';\nimport {authenticatePublicFactory} from './authenticate/public';\nimport {unauthenticatedStorefrontContextFactory} from './unauthenticated/storefront';\nimport {AuthCodeFlowStrategy} from './authenticate/admin/strategies/auth-code-flow';\nimport {TokenExchangeStrategy} from './authenticate/admin/strategies/token-exchange';\nimport {MerchantCustomAuth} from './authenticate/admin/strategies/merchant-custom-app';\nimport {IdempotentPromiseHandler} from './authenticate/helpers/idempotent-promise-handler';\nimport {authenticateFlowFactory} from './authenticate/flow/authenticate';\nimport {authenticateFulfillmentServiceFactory} from './authenticate/fulfillment-service/authenticate';\nimport {FutureFlagOptions, logDisabledFutureFlags} from './future/flags';\n\n/**\n * Creates an object your app will use to interact with Shopify.\n *\n * @param appConfig Configuration options for your Shopify app, such as the scopes your app needs.\n * @returns `ShopifyApp` An object constructed using your appConfig. It has methods for interacting with Shopify.\n *\n * @example\n * <caption>The minimum viable configuration</caption>\n * ```ts\n * // /shopify.server.ts\n * import { shopifyApp } from \"@shopify/shopify-app-remix/server\";\n *\n * const 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 * });\n * export default shopify;\n * ```\n */\nexport function shopifyApp<\n Config extends AppConfigArg<Resources, Storage, Future>,\n Resources extends ShopifyRestResources,\n Storage extends SessionStorage,\n Future extends FutureFlagOptions = Config['future'],\n>(appConfig: Readonly<Config>): ShopifyApp<Config> {\n const api = deriveApi(appConfig);\n const config = deriveConfig<Storage>(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\n let strategy;\n if (config.distribution === AppDistribution.ShopifyAdmin) {\n strategy = new MerchantCustomAuth(params);\n } else if (\n config.future.unstable_newEmbeddedAuthStrategy &&\n config.isEmbeddedApp\n ) {\n strategy = new TokenExchangeStrategy(params);\n } else {\n strategy = new AuthCodeFlowStrategy(params);\n }\n\n const authStrategy = authStrategyFactory<Config, Resources>({\n ...params,\n strategy,\n });\n\n const shopify:\n | AdminApp<Config>\n | AppStoreApp<Config>\n | SingleMerchantApp<Config> = {\n sessionStorage: config.sessionStorage,\n addDocumentResponseHeaders: addDocumentResponseHeadersFactory(params),\n registerWebhooks: registerWebhooksFactory(params),\n authenticate: {\n admin: authStrategy,\n flow: authenticateFlowFactory<Config, Resources>(params),\n public: authenticatePublicFactory<Config, Resources>(params),\n fulfillmentService: authenticateFulfillmentServiceFactory<\n Config,\n Resources\n >(params),\n webhook: authenticateWebhookFactory<Config, Resources, string>(params),\n },\n unauthenticated: {\n admin: unauthenticatedAdminContextFactory<Config, Resources>(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 logDisabledFutureFlags(config, logger);\n\n return shopify as ShopifyApp<Config>;\n}\n\nfunction isAppStoreApp<Config extends AppConfigArg>(\n _shopify: ShopifyAppBase<Config>,\n config: Config,\n): _shopify is AppStoreApp<Config> {\n return config.distribution === AppDistribution.AppStore;\n}\n\nfunction isSingleMerchantApp<Config extends AppConfigArg>(\n _shopify: ShopifyAppBase<Config>,\n config: Config,\n): _shopify is SingleMerchantApp<Config> {\n return config.distribution === AppDistribution.SingleMerchant;\n}\n\n// This function is only exported so we can unit test it without having to mock the underlying module.\n// It's not available to consumers of the library because it is not exported in the index module, and never should be.\nexport function deriveApi(appConfig: AppConfigArg): BasicParams['api'] {\n let appUrl: URL;\n try {\n appUrl = new URL(appConfig.appUrl);\n } catch (error) {\n const message =\n appConfig.appUrl === ''\n ? `Detected an empty appUrl configuration, please make sure to set the necessary environment variables.\\n` +\n `If you're deploying your app, you can find more information at https://shopify.dev/docs/apps/launch/deployment/deploy-web-app/deploy-to-hosting-service#step-4-set-up-environment-variables`\n : `Invalid appUrl configuration '${appConfig.appUrl}', please provide a valid URL.`;\n throw new ShopifyError(message);\n }\n\n /* eslint-disable no-process-env */\n if (appUrl.hostname === 'localhost' && !appUrl.port && process.env.PORT) {\n appUrl.port = process.env.PORT;\n }\n /* eslint-enable no-process-env */\n appConfig.appUrl = appUrl.origin;\n\n let userAgentPrefix = `Shopify Remix Library v${SHOPIFY_REMIX_LIBRARY_VERSION}`;\n if (appConfig.userAgentPrefix) {\n userAgentPrefix = `${appConfig.userAgentPrefix} | ${userAgentPrefix}`;\n }\n\n return shopifyApi({\n ...appConfig,\n hostName: appUrl.host,\n hostScheme: appUrl.protocol.replace(':', '') as 'http' | 'https',\n userAgentPrefix,\n isEmbeddedApp: appConfig.isEmbeddedApp ?? true,\n apiVersion: appConfig.apiVersion ?? LATEST_API_VERSION,\n isCustomStoreApp: appConfig.distribution === AppDistribution.ShopifyAdmin,\n billing: appConfig.billing as ApiConfig['billing'],\n future: {\n lineItemBilling: true,\n unstable_managedPricingSupport: true,\n },\n _logDisabledFutureFlags: false,\n });\n}\n\nfunction deriveConfig<Storage extends SessionStorage>(\n appConfig: AppConfigArg,\n apiConfig: ApiConfig,\n): AppConfig<Storage> {\n if (\n !appConfig.sessionStorage &&\n appConfig.distribution !== AppDistribution.ShopifyAdmin\n ) {\n throw new ShopifyError(\n 'Please provide a valid session storage. Refer to https://github.com/Shopify/shopify-app-js/blob/main/README.md#session-storage-options for options.',\n );\n }\n\n const authPathPrefix = appConfig.authPathPrefix || '/auth';\n appConfig.distribution = appConfig.distribution ?? AppDistribution.AppStore;\n\n return {\n ...appConfig,\n ...apiConfig,\n billing: appConfig.billing as ApiConfig['billing'],\n scopes: apiConfig.scopes,\n idempotentPromiseHandler: new IdempotentPromiseHandler(),\n canUseLoginForm: appConfig.distribution !== AppDistribution.ShopifyAdmin,\n useOnlineTokens: appConfig.useOnlineTokens ?? false,\n hooks: appConfig.hooks ?? {},\n sessionStorage: appConfig.sessionStorage as Storage,\n future: appConfig.future ?? {},\n auth: {\n path: authPathPrefix,\n callbackPath: `${authPathPrefix}/callback`,\n patchSessionTokenPath: `${authPathPrefix}/session-token`,\n exitIframePath: `${authPathPrefix}/exit-iframe`,\n loginPath: `${authPathPrefix}/login`,\n },\n distribution: appConfig.distribution,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAsCA;;;;;;;;;;;;;;;;;;;;AAoBG;AACG,SAAU,UAAU,CAKxB,SAA2B,EAAA;AAC3B,IAAA,MAAM,GAAG,GAAG,SAAS,CAAC,SAAS,CAAC;IAChC,MAAM,MAAM,GAAG,YAAY,CAAU,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC;IAC3D,MAAM,MAAM,GAAG,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC;AAEzC,IAAA,IAAI,SAAS,CAAC,QAAQ,EAAE;QACtB,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC;IAC9C;IAEA,MAAM,MAAM,GAAgB,EAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAC;AAEjD,IAAA,IAAI,QAAQ;IACZ,IAAI,MAAM,CAAC,YAAY,KAAK,eAAe,CAAC,YAAY,EAAE;AACxD,QAAA,QAAQ,GAAG,IAAI,kBAAkB,CAAC,MAAM,CAAC;IAC3C;AAAO,SAAA,IACL,MAAM,CAAC,MAAM,CAAC,gCAAgC;QAC9C,MAAM,CAAC,aAAa,EACpB;AACA,QAAA,QAAQ,GAAG,IAAI,qBAAqB,CAAC,MAAM,CAAC;IAC9C;SAAO;AACL,QAAA,QAAQ,GAAG,IAAI,oBAAoB,CAAC,MAAM,CAAC;IAC7C;IAEA,MAAM,YAAY,GAAG,mBAAmB,CAAoB;AAC1D,QAAA,GAAG,M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test-helpers/test-config.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"test-config.mjs","sources":["../../../../../src/server/test-helpers/test-config.ts"],"sourcesContent":["import {LogSeverity, ShopifyRestResources} from '@shopify/shopify-api';\nimport {SessionStorage} from '@shopify/shopify-app-session-storage';\nimport {MemorySessionStorage} from '@shopify/shopify-app-session-storage-memory';\nimport {\n API_KEY,\n API_SECRET_KEY,\n APP_URL,\n} from '@shopify/shopify-api/test-helpers';\n\nimport type {AppConfigArg} from '../config-types';\nimport type {FutureFlagOptions} from '../future/flags';\n\nconst TEST_CONFIG = {\n apiKey: API_KEY,\n apiSecretKey: API_SECRET_KEY,\n scopes: ['testScope'] as any,\n appUrl: APP_URL,\n adminApiAccessToken: API_KEY,\n privateAppStorefrontAccessToken: API_KEY,\n logger: {\n level: LogSeverity.Debug,\n },\n sessionStorage: new MemorySessionStorage(),\n isTesting: true,\n} as const;\n\nexport function testConfig<\n Overrides extends TestOverridesArg,\n Future extends FutureFlagOptions,\n>(\n {future, ...overrides}: Overrides & {future?: Future} = {} as Overrides & {\n future?: Future;\n },\n): TestConfig<Overrides> {\n return {\n ...TEST_CONFIG,\n ...overrides,\n logger: {\n ...TEST_CONFIG.logger,\n ...(overrides as NonNullable<Overrides>).logger,\n },\n future,\n } as any;\n}\n\n/*\n * This type combines both passed in types, by ignoring any keys from Type1 that are present (and not undefined)\n * in Type2, and then adding any keys from Type1 that are not present in Type2.\n *\n * This effectively enables us to create a type that is the const TEST_CONFIG below, plus any overrides passed in with\n * the output being a const object.\n */\ntype Modify<Type1, Type2> = {\n [key in keyof Type2 as Type2[key] extends undefined\n ? never\n : key]: Type2[key];\n} & {\n [key in keyof Type1 as key extends keyof Type2 ? never : key]: Type1[key];\n};\n\n/*\n * We omit the future prop and then redefine it with a partial of that object so we can pass the fully typed object in\n * to AppConfigArg.\n */\ntype TestOverrides = Partial<\n Omit<\n AppConfigArg<ShopifyRestResources, SessionStorage, FutureFlagOptions>,\n 'future'\n > & {\n future: Partial<FutureFlagOptions>;\n }\n>;\n\nexport type TestOverridesArg = undefined | TestOverrides;\n\nexport type TestConfig<Overrides extends TestOverridesArg> = Modify<\n typeof TEST_CONFIG,\n Overrides\n> & {\n future: FutureFlagOptions;\n logger: AppConfigArg['logger'];\n};\n"],"names":[],"mappings":";;;;AAYA,MAAM,WAAW,GAAG;AAClB,IAAA,MAAM,EAAE,OAAO;AACf,IAAA,YAAY,EAAE,cAAc;IAC5B,MAAM,EAAE,CAAC,WAAW,CAAQ;AAC5B,IAAA,MAAM,EAAE,OAAO;AACf,IAAA,mBAAmB,EAAE,OAAO;AAC5B,IAAA,+BAA+B,EAAE,OAAO;AACxC,IAAA,MAAM,EAAE;QACN,KAAK,EAAE,WAAW,CAAC,KAAK;AACzB,KAAA;IACD,cAAc,EAAE,IAAI,oBAAoB,EAAE;AAC1C,IAAA,SAAS,EAAE,IAAI;CACP;AAEJ,SAAU,UAAU,CAIxB,EAAC,MAAM,EAAE,GAAG,SAAS,EAAA,GAAmC,EAEvD,EAAA;IAED,OAAO;AACL,QAAA,GAAG,WAAW;AACd,QAAA,GAAG,SAAS;AACZ,QAAA,MAAM,EAAE;YACN,GAAG,WAAW,CAAC,MAAM;YACrB,GAAI,SAAoC,CAAC,MAAM;AAChD,SAAA;QACD,MAAM;KACA;AACV;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sources":["../../../../src/server/types.ts"],"sourcesContent":[null],"names":[],"mappings":"AAmCA;AACA;IACY;AAAZ,CAAA,UAAY,eAAe,EAAA;AACzB,IAAA,eAAA,CAAA,UAAA,CAAA,GAAA,WAAsB;AACtB,IAAA,eAAA,CAAA,gBAAA,CAAA,GAAA,iBAAkC;AAClC,IAAA,eAAA,CAAA,cAAA,CAAA,GAAA,eAA8B;AAChC,CAAC,EAJW,eAAe,KAAf,eAAe,GAI1B,EAAA,CAAA,CAAA;IAMW;AAAZ,CAAA,UAAY,cAAc,EAAA;AACxB,IAAA,cAAA,CAAA,aAAA,CAAA,GAAA,cAA4B;AAC5B,IAAA,cAAA,CAAA,aAAA,CAAA,GAAA,cAA4B;AAC9B,CAAC,EAHW,cAAc,KAAd,cAAc,GAGzB,EAAA,CAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"types.mjs","sources":["../../../../src/server/types.ts"],"sourcesContent":["import {\n RegisterReturn,\n Shopify,\n ShopifyRestResources,\n} from '@shopify/shopify-api';\nimport {SessionStorage} from '@shopify/shopify-app-session-storage';\n\nimport type {AuthenticateAdmin} from './authenticate/admin/types';\nimport type {AuthenticateFlow} from './authenticate/flow/types';\nimport {AuthenticateFulfillmentService} from './authenticate/fulfillment-service/types';\nimport type {AuthenticatePublic} from './authenticate/public/types';\nimport type {\n AuthenticateWebhook,\n RegisterWebhooksOptions,\n} from './authenticate/webhooks/types';\nimport type {AppConfig, AppConfigArg} from './config-types';\nimport type {\n ApiConfigWithFutureFlags,\n ApiFutureFlags,\n FutureFlagOptions,\n} from './future/flags';\nimport type {Unauthenticated} from './unauthenticated/types';\n\nexport interface BasicParams<\n Future extends FutureFlagOptions = FutureFlagOptions,\n> {\n api: Shopify<\n ApiConfigWithFutureFlags<Future>,\n ShopifyRestResources,\n ApiFutureFlags<Future>\n >;\n config: AppConfig;\n logger: Shopify['logger'];\n}\n\n// eslint-disable-next-line no-warning-comments\n// TODO: Use this enum to replace the isCustomStoreApp config option in shopify-api-js\nexport enum AppDistribution {\n AppStore = 'app_store',\n SingleMerchant = 'single_merchant',\n ShopifyAdmin = 'shopify_admin',\n}\n\ntype RegisterWebhooks = (\n options: RegisterWebhooksOptions,\n) => Promise<RegisterReturn | void>;\n\nexport enum LoginErrorType {\n MissingShop = 'MISSING_SHOP',\n InvalidShop = 'INVALID_SHOP',\n}\n\nexport interface LoginError {\n shop?: LoginErrorType;\n}\n\ntype Login = (request: Request) => Promise<LoginError | never>;\n\ntype AddDocumentResponseHeaders = (request: Request, headers: Headers) => void;\n\ntype RestResourcesType<Config extends AppConfigArg> =\n Config['restResources'] extends ShopifyRestResources\n ? Config['restResources']\n : ShopifyRestResources;\n\ntype SessionStorageType<Config extends AppConfigArg> =\n Config['sessionStorage'] extends SessionStorage\n ? Config['sessionStorage']\n : SessionStorage;\n\ninterface Authenticate<Config extends AppConfigArg> {\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 * <caption>Authenticating a request for an embedded app.</caption>\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 * const response = await admin.graphql(`{ shop { name } }`)\n *\n * return json(await response.json());\n * }\n * ```\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 * export const authenticate = shopify.authenticate;\n * ```\n */\n admin: AuthenticateAdmin<Config, RestResourcesType<Config>>;\n\n /**\n * Authenticate a Flow extension Request and get back an authenticated context, containing an admin context to access\n * the API, and the payload of the request.\n *\n * If there is no session for the Request, this will return an HTTP 400 error.\n *\n * Note that this will always be a POST request.\n *\n * @example\n * <caption>Authenticating a Flow extension request.</caption>\n * ```ts\n * // /app/routes/**\\/*.jsx\n * import { ActionFunctionArgs, json } from \"@remix-run/node\";\n * import { authenticate } from \"../../shopify.server\";\n *\n * export async function action({ request }: ActionFunctionArgs) {\n * const {admin, session, payload} = authenticate.flow(request);\n *\n * // Perform flow extension logic\n *\n * // Return a 200 response\n * return null;\n * }\n * ```\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 * export const authenticate = shopify.authenticate;\n * ```\n */\n flow: AuthenticateFlow<Config, RestResourcesType<Config>>;\n\n /**\n * Authenticate a request from a fulfillment service and get back an authenticated context.\n *\n * @example\n * <caption>Shopify session for the fulfillment service request.</caption>\n * <description>Use the session associated with this request to use the Admin GraphQL API </description>\n * ```ts\n * // /app/routes/fulfillment_order_notification.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, session } = await authenticate.fulfillmentService(request);\n *\n * console.log(session.id)\n *\n * return new Response();\n * }\n * ```\n * */\n fulfillmentService: AuthenticateFulfillmentService<\n Config,\n RestResourcesType<Config>\n >;\n\n /**\n * Authenticate a public request and get back a session token.\n *\n * @example\n * <caption>Authenticating a request from a checkout extension</caption>\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<Config>;\n\n /**\n * Authenticate a Shopify webhook request, get back an authenticated admin context and details on the webhook request\n * \n * @example\n * <caption>Authenticating a webhook request</caption>\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, payload } = await authenticate.webhook(request);\n * \n * // Webhook requests can trigger after an app is uninstalled\n * // If the app is already uninstalled, the session may be undefined.\n * if (!session) {\n * throw new Response();\n * }\n * \n * // Handle the webhook\n * console.log(`${TOPIC} webhook received with payload:`, JSON.stringify(payload))\n *\n * throw new Response();\n * };\n * ```\n * \n * @example\n * <caption>Registering app-specific webhooks (Recommended)</caption>\n * ```toml\n * # shopify.app.toml\n * [webhooks]\n * api_version = \"2024-07\"\n\n * [[webhooks.subscriptions]]\n * topics = [\"products/create\"]\n * uri = \"/webhooks/products/create\"\n * \n * ```\n * \n * @example\n * <caption>Registering shop-specific webhooks.</caption>\n * <description>In many cases you won't need this. Please see: [https://shopify.dev/docs/apps/build/webhooks/subscribe#app-specific-vs-shop-specific-subscriptions](https://shopify.dev/docs/apps/build/webhooks/subscribe#app-specific-vs-shop-specific-subscriptions)\n * </description>\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 * PRODUCTS_CREATE: {\n * deliveryMethod: DeliveryMethod.Http,\n * callbackUrl: \"/webhooks/products/create\",\n * },\n * },\n * hooks: {\n * afterAuth: async ({ session }) => {\n * // Register webhooks for the shop\n * // In this example, every shop will have these webhooks\n * // You could wrap this in some custom shop specific conditional logic if needed\n * shopify.registerWebhooks({ session });\n * },\n * },\n * // ...etc\n * });\n * ```\n */\n webhook: AuthenticateWebhook<Config, RestResourcesType<Config>, string>;\n}\n\nexport interface ShopifyAppBase<Config extends AppConfigArg> {\n /**\n * The `SessionStorage` instance you passed in as a config option.\n *\n * @example\n * <caption>Storing sessions with Prisma.</caption>\n * <description>Import the `@shopify/shopify-app-session-storage-prisma` package to store sessions in your Prisma database.</description>\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 * sessionStorage: new PrismaSessionStorage(prisma),\n * // ...etc\n * })\n *\n * // shopify.sessionStorage is an instance of PrismaSessionStorage\n * ```\n */\n sessionStorage?: SessionStorageType<Config>;\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 * <caption>Return headers on all requests.</caption>\n * <description>Add headers to all HTML requests by calling `shopify.addDocumentResponseHeaders` in `entry.server.tsx`.</description>\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 * <RemixServer context={remixContext} url={request.url} />\n * );\n *\n * responseHeaders.set(\"Content-Type\", \"text/html\");\n * addDocumentResponseHeaders(request, responseHeaders);\n *\n * return new Response(\"<!DOCTYPE html>\" + markup, {\n * status: responseStatusCode,\n * headers: responseHeaders,\n * });\n * }\n * ```\n */\n addDocumentResponseHeaders: AddDocumentResponseHeaders;\n\n /**\n * Register shop-specific webhook subscriptions using the Admin GraphQL API.\n *\n * In many cases defining app-specific webhooks in the `shopify.app.toml` will be sufficient and easier to manage. Please see:\n *\n * {@link https://shopify.dev/docs/apps/build/webhooks/subscribe#app-specific-vs-shop-specific-subscriptions}\n *\n * You should only use this if you need shop-specific webhooks.\n *\n * @example\n * <caption>Registering shop-specific webhooks after install</caption>\n * <description>Trigger the registration to create the shop-specific webhook subscriptions after a merchant installs your app using the `afterAuth` hook. Learn more about [subscribing to webhooks.](https://shopify.dev/docs/api/shopify-app-remix/v3/guide-webhooks)</description>\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 * PRODUCTS_CREATE: {\n * deliveryMethod: DeliveryMethod.Http,\n * callbackUrl: \"/webhooks/products/create\",\n * },\n * },\n * hooks: {\n * afterAuth: async ({ session }) => {\n * // Register webhooks for the shop\n * // In this example, every shop will have these webhooks\n * // You could wrap this in some custom shop specific conditional logic if needed\n * shopify.registerWebhooks({ session });\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 * <caption>Authenticate Shopify requests.</caption>\n * <description>Use the functions in `authenticate` to validate requests coming from Shopify.</description>\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/**\\/*.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 * const response = admin.graphql(`{ shop { name } }`)\n *\n * return json(await response.json());\n * }\n * ```\n */\n authenticate: Authenticate<Config>;\n\n /**\n * Ways to get Contexts from requests that do not originate from Shopify.\n *\n * @example\n * <caption>Using unauthenticated contexts.</caption>\n * <description>Create contexts for requests that don't come from Shopify.</description>\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/**\\/*.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 * const response = admin.graphql(`{ shop { currencyCode } }`)\n *\n * return json(await response.json());\n * }\n * ```\n */\n unauthenticated: Unauthenticated<Config, RestResourcesType<Config>>;\n}\n\nexport 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 * <caption>Creating a login page.</caption>\n * <description>Use `shopify.login` to create a login form, in a route that can handle GET and POST requests.</description>\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<typeof action>();\n * const [shop, setShop] = useState(\"\");\n *\n * return (\n * <Page>\n * <Card>\n * <Form method=\"post\">\n * <FormLayout>\n * <Text variant=\"headingMd\" as=\"h2\">\n * Login\n * </Text>\n * <TextField\n * type=\"text\"\n * name=\"shop\"\n * label=\"Shop domain\"\n * helpText=\"e.g: my-shop-domain.myshopify.com\"\n * value={shop}\n * onChange={setShop}\n * autoComplete=\"on\"\n * error={actionData?.errors.shop}\n * />\n * <Button submit primary>\n * Submit\n * </Button>\n * </FormLayout>\n * </Form>\n * </Card>\n * </Page>\n * );\n * }\n * ```\n */\n login: Login;\n}\n\nexport type AdminApp<Config extends AppConfigArg> = ShopifyAppBase<Config>;\nexport type SingleMerchantApp<Config extends AppConfigArg> =\n ShopifyAppBase<Config> & ShopifyAppLogin;\nexport type AppStoreApp<Config extends AppConfigArg> = ShopifyAppBase<Config> &\n ShopifyAppLogin;\n\ntype EnforceSessionStorage<Config extends AppConfigArg, Base> = Base & {\n sessionStorage: SessionStorageType<Config>;\n};\n\n/**\n * An object your app can use to interact with Shopify.\n *\n * By default, the app's distribution is `AppStore`.\n */\nexport type ShopifyApp<Config extends AppConfigArg> =\n Config['distribution'] extends AppDistribution.ShopifyAdmin\n ? AdminApp<Config>\n : Config['distribution'] extends AppDistribution.SingleMerchant\n ? EnforceSessionStorage<Config, SingleMerchantApp<Config>>\n : Config['distribution'] extends AppDistribution.AppStore\n ? EnforceSessionStorage<Config, AppStoreApp<Config>>\n : EnforceSessionStorage<Config, AppStoreApp<Config>>;\n"],"names":[],"mappings":"AAmCA;AACA;IACY;AAAZ,CAAA,UAAY,eAAe,EAAA;AACzB,IAAA,eAAA,CAAA,UAAA,CAAA,GAAA,WAAsB;AACtB,IAAA,eAAA,CAAA,gBAAA,CAAA,GAAA,iBAAkC;AAClC,IAAA,eAAA,CAAA,cAAA,CAAA,GAAA,eAA8B;AAChC,CAAC,EAJW,eAAe,KAAf,eAAe,GAAA,EAAA,CAAA,CAAA;IAUf;AAAZ,CAAA,UAAY,cAAc,EAAA;AACxB,IAAA,cAAA,CAAA,aAAA,CAAA,GAAA,cAA4B;AAC5B,IAAA,cAAA,CAAA,aAAA,CAAA,GAAA,cAA4B;AAC9B,CAAC,EAHW,cAAc,KAAd,cAAc,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.mjs","sources":["../../../../../../src/server/unauthenticated/admin/factory.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"factory.mjs","sources":["../../../../../../src/server/unauthenticated/admin/factory.ts"],"sourcesContent":["import {ShopifyRestResources} from '@shopify/shopify-api';\n\nimport {AppConfigArg} from '../../config-types';\nimport {createOrLoadOfflineSession} from '../../authenticate/helpers/create-or-load-offline-session';\nimport {SessionNotFoundError} from '../../errors';\nimport {BasicParams} from '../../types';\nimport {adminClientFactory} from '../../clients/admin';\n\nimport {UnauthenticatedAdminContext} from './types';\n\nexport function unauthenticatedAdminContextFactory<\n ConfigArg extends AppConfigArg,\n Resources extends ShopifyRestResources,\n>(params: BasicParams) {\n return async (\n shop: string,\n ): Promise<UnauthenticatedAdminContext<ConfigArg, Resources>> => {\n const session = await createOrLoadOfflineSession(shop, params);\n\n if (!session) {\n throw new SessionNotFoundError(\n `Could not find a session for shop ${shop} when creating unauthenticated admin context`,\n );\n }\n\n return {\n session,\n admin: adminClientFactory<ConfigArg, Resources>({params, session}),\n };\n };\n}\n"],"names":[],"mappings":";;;;AAUM,SAAU,kCAAkC,CAGhD,MAAmB,EAAA;AACnB,IAAA,OAAO,OACL,IAAY,KACkD;QAC9D,MAAM,OAAO,GAAG,MAAM,0BAA0B,CAAC,IAAI,EAAE,MAAM,CAAC;QAE9D,IAAI,CAAC,OAAO,EAAE;AACZ,YAAA,MAAM,IAAI,oBAAoB,CAC5B,qCAAqC,IAAI,CAAA,4CAAA,CAA8C,CACxF;QACH;QAEA,OAAO;YACL,OAAO;YACP,KAAK,EAAE,kBAAkB,CAAuB,EAAC,MAAM,EAAE,OAAO,EAAC,CAAC;SACnE;AACH,IAAA,CAAC;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.mjs","sources":["../../../../../../src/server/unauthenticated/storefront/factory.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"factory.mjs","sources":["../../../../../../src/server/unauthenticated/storefront/factory.ts"],"sourcesContent":["import {createOrLoadOfflineSession} from '../../authenticate/helpers/create-or-load-offline-session';\nimport {SessionNotFoundError} from '../../errors';\nimport {BasicParams} from '../../types';\nimport {storefrontClientFactory} from '../../clients/storefront';\n\nimport {\n UnauthenticatedStorefrontContext,\n GetUnauthenticatedStorefrontContext,\n} from './types';\n\nexport function unauthenticatedStorefrontContextFactory(\n params: BasicParams,\n): GetUnauthenticatedStorefrontContext {\n return async (shop: string): Promise<UnauthenticatedStorefrontContext> => {\n const session = await createOrLoadOfflineSession(shop, params);\n\n if (!session) {\n throw new SessionNotFoundError(\n `Could not find a session for shop ${shop} when creating unauthenticated storefront context`,\n );\n }\n\n return {\n session,\n storefront: storefrontClientFactory({params, session}),\n };\n };\n}\n"],"names":[],"mappings":";;;;AAUM,SAAU,uCAAuC,CACrD,MAAmB,EAAA;AAEnB,IAAA,OAAO,OAAO,IAAY,KAA+C;QACvE,MAAM,OAAO,GAAG,MAAM,0BAA0B,CAAC,IAAI,EAAE,MAAM,CAAC;QAE9D,IAAI,CAAC,OAAO,EAAE;AACZ,YAAA,MAAM,IAAI,oBAAoB,CAC5B,qCAAqC,IAAI,CAAA,iDAAA,CAAmD,CAC7F;QACH;QAEA,OAAO;YACL,OAAO;YACP,UAAU,EAAE,uBAAuB,CAAC,EAAC,MAAM,EAAE,OAAO,EAAC,CAAC;SACvD;AACH,IAAA,CAAC;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sources":["../../../../src/server/version.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../../../../src/server/version.ts"],"sourcesContent":["export const SHOPIFY_REMIX_LIBRARY_VERSION = '3.8.4';\n"],"names":[],"mappings":"AAAO,MAAM,6BAA6B,GAAG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.mjs","sources":["../../../../../../../session-storage/shopify-app-session-storage-memory/dist/esm/memory.mjs"],"sourcesContent":["class MemorySessionStorage {\n sessions = {};\n async storeSession(session) {\n this.sessions[session.id] = session;\n return true;\n }\n async loadSession(id) {\n return this.sessions[id] || undefined;\n }\n async deleteSession(id) {\n if (this.sessions[id]) {\n delete this.sessions[id];\n }\n return true;\n }\n async deleteSessions(ids) {\n ids.forEach((id) => delete this.sessions[id]);\n return true;\n }\n async findSessionsByShop(shop) {\n const results = Object.values(this.sessions).filter((session) => session.shop === shop);\n return results;\n }\n}\n\nexport { MemorySessionStorage };\n//# sourceMappingURL=memory.mjs.map\n"],"names":[],"mappings":"AAAA,MAAM,oBAAoB,CAAC;AAC3B,IAAI,QAAQ,GAAG,EAAE;AACjB,IAAI,MAAM,YAAY,CAAC,OAAO,EAAE;AAChC,QAAQ,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,OAAO;AAC3C,QAAQ,OAAO,IAAI;AACnB;
|
|
1
|
+
{"version":3,"file":"memory.mjs","sources":["../../../../../../../session-storage/shopify-app-session-storage-memory/dist/esm/memory.mjs"],"sourcesContent":["class MemorySessionStorage {\n sessions = {};\n async storeSession(session) {\n this.sessions[session.id] = session;\n return true;\n }\n async loadSession(id) {\n return this.sessions[id] || undefined;\n }\n async deleteSession(id) {\n if (this.sessions[id]) {\n delete this.sessions[id];\n }\n return true;\n }\n async deleteSessions(ids) {\n ids.forEach((id) => delete this.sessions[id]);\n return true;\n }\n async findSessionsByShop(shop) {\n const results = Object.values(this.sessions).filter((session) => session.shop === shop);\n return results;\n }\n}\n\nexport { MemorySessionStorage };\n//# sourceMappingURL=memory.mjs.map\n"],"names":[],"mappings":"AAAA,MAAM,oBAAoB,CAAC;AAC3B,IAAI,QAAQ,GAAG,EAAE;AACjB,IAAI,MAAM,YAAY,CAAC,OAAO,EAAE;AAChC,QAAQ,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,OAAO;AAC3C,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,IAAI,MAAM,WAAW,CAAC,EAAE,EAAE;AAC1B,QAAQ,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,SAAS;AAC7C,IAAI;AACJ,IAAI,MAAM,aAAa,CAAC,EAAE,EAAE;AAC5B,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE;AAC/B,YAAY,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;AACpC,QAAQ;AACR,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,IAAI,MAAM,cAAc,CAAC,GAAG,EAAE;AAC9B,QAAQ,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACrD,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,IAAI,MAAM,kBAAkB,CAAC,IAAI,EAAE;AACnC,QAAQ,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC;AAC/F,QAAQ,OAAO,OAAO;AACtB,IAAI;AACJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticate.admin.doc.d.ts","sourceRoot":"","sources":["../../../../../src/server/authenticate/admin/authenticate.admin.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,QAAA,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"authenticate.admin.doc.d.ts","sourceRoot":"","sources":["../../../../../src/server/authenticate/admin/authenticate.admin.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,QAAA,MAAM,IAAI,EAAE,6BA+CX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancel.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/billing/cancel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAEhE,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAIhD,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,SAAS,CAAC;AAElD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"cancel.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/billing/cancel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAEhE,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAIhD,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,SAAS,CAAC;AAElD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,IAEoB,SAAS,oBAAoB,6DAwBlE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/billing/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAEhE,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAEhD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAGxD,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAEjD,wBAAgB,mBAAmB,CAAC,MAAM,SAAS,YAAY,EAC7D,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/billing/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAEhE,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAEhD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAGxD,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAEjD,wBAAgB,mBAAmB,CAAC,MAAM,SAAS,YAAY,EAC7D,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,IAGd,UAAS,mBAAmB,CAAC,MAAM,CAAM,wEAyB5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-usage-record.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/billing/create-usage-record.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAEhE,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAIhD,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,SAAS,CAAC;AAEtD,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"create-usage-record.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/billing/create-usage-record.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAEhE,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAIhD,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,SAAS,CAAC;AAEtD,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,IAEwB,SAAS,wBAAwB,yDAsB1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/billing/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,OAAO,EACR,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAK3C,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,SAAS,CAAC;AAEnD,wBAAgB,qBAAqB,CAAC,MAAM,SAAS,YAAY,EAC/D,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/billing/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,OAAO,EACR,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAK3C,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,SAAS,CAAC;AAEnD,wBAAgB,qBAAqB,CAAC,MAAM,SAAS,YAAY,EAC/D,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,IAEqB,2CAKlC,qBAAqB,CAAC,MAAM,CAAC,KAAG,OAAO,CAAC,KAAK,CAAC,CAuClD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"require.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/billing/require.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAE1B,OAAO,EACR,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAIxD,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,SAAS,CAAC;AAEnD,wBAAgB,qBAAqB,CAAC,MAAM,SAAS,YAAY,EAC/D,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"require.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/billing/require.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAE1B,OAAO,EACR,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAIxD,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,SAAS,CAAC;AAEnD,wBAAgB,qBAAqB,CAAC,MAAM,SAAS,YAAY,EAC/D,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,IAIqB,SAAS,qBAAqB,CAAC,MAAM,CAAC,yCAqC5E"}
|
package/dist/ts/server/authenticate/admin/billing/update-usage-subscription-capped-amount.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-usage-subscription-capped-amount.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/billing/update-usage-subscription-capped-amount.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,OAAO,EAER,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAIhD,OAAO,EAAC,8BAA8B,EAAC,MAAM,SAAS,CAAC;AAGvD,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"update-usage-subscription-capped-amount.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/billing/update-usage-subscription-capped-amount.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,OAAO,EAER,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAIhD,OAAO,EAAC,8BAA8B,EAAC,MAAM,SAAS,CAAC;AAGvD,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,IAGd,SAAS,8BAA8B,KACtC,OAAO,CAAC,KAAK,CAAC,CAkClB"}
|
package/dist/ts/server/authenticate/admin/helpers/ensure-app-is-embedded-if-required.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensure-app-is-embedded-if-required.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/helpers/ensure-app-is-embedded-if-required.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAI3C,eAAO,MAAM,6BAA6B,
|
|
1
|
+
{"version":3,"file":"ensure-app-is-embedded-if-required.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/helpers/ensure-app-is-embedded-if-required.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAI3C,eAAO,MAAM,6BAA6B,GACxC,QAAQ,WAAW,EACnB,SAAS,OAAO,kBAWjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensure-session-token-search-param-if-required.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/helpers/ensure-session-token-search-param-if-required.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAM3C,eAAO,MAAM,uCAAuC,
|
|
1
|
+
{"version":3,"file":"ensure-session-token-search-param-if-required.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/helpers/ensure-session-token-search-param-if-required.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAM3C,eAAO,MAAM,uCAAuC,GAClD,QAAQ,WAAW,EACnB,SAAS,OAAO,kBAgBjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redirect-to-bounce-page.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/helpers/redirect-to-bounce-page.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAE3C,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"redirect-to-bounce-page.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/helpers/redirect-to-bounce-page.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAE3C,eAAO,MAAM,oBAAoB,GAAI,QAAQ,WAAW,EAAE,KAAK,GAAG,KAAG,KAkBpE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/scope/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAIjD,wBAAgB,oBAAoB,CAAC,SAAS,SAAS,YAAY,EACjE,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,eAAe,CAAC,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/scope/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAIjD,wBAAgB,oBAAoB,CAAC,SAAS,SAAS,YAAY,EACjE,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,eAAe,CAAC,SAAS,CAAC,IAEG,QAAQ,MAAM,EAAE,mBAqBrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revoke.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/scope/revoke.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAE7C,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAIhD,wBAAgB,mBAAmB,CAAC,SAAS,SAAS,YAAY,EAChE,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,eAAe,CAAC,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"revoke.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/scope/revoke.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAE7C,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAIhD,wBAAgB,mBAAmB,CAAC,SAAS,SAAS,YAAY,EAChE,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,eAAe,CAAC,SAAS,CAAC,IAEJ,QAAQ,MAAM,EAAE;;GA6B9C"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export interface ScopesApiContext {
|
|
5
5
|
/**
|
|
6
|
-
* Queries Shopify
|
|
6
|
+
* Queries Shopify to see what scopes have been granted
|
|
7
7
|
*
|
|
8
8
|
* @returns {ScopesDetail} The scope details.
|
|
9
9
|
*
|
|
@@ -12,73 +12,51 @@ export interface ScopesApiContext {
|
|
|
12
12
|
* <description>Call `scopes.query` to get scope details.</description>
|
|
13
13
|
* ```ts
|
|
14
14
|
* // /app._index.tsx
|
|
15
|
-
* import type { LoaderFunctionArgs } from "@remix-run/node";
|
|
16
|
-
* import { useLoaderData } from "@remix-run/react";
|
|
17
15
|
* import { authenticate } from "../shopify.server";
|
|
18
16
|
* import { json } from "@remix-run/node";
|
|
19
17
|
*
|
|
20
|
-
* export const loader = async ({ request }
|
|
18
|
+
* export const loader = async ({ request }) => {
|
|
21
19
|
* const { scopes } = await authenticate.admin(request);
|
|
20
|
+
* const { required, optional, granted } = await scopes.query();
|
|
22
21
|
*
|
|
23
|
-
*
|
|
22
|
+
* if (granted.includes("write_products")) {
|
|
23
|
+
* // do something
|
|
24
|
+
* }
|
|
24
25
|
*
|
|
25
|
-
* return
|
|
26
|
-
* hasWriteProducts: scopesDetail.granted.includes('write_products'),
|
|
27
|
-
* });
|
|
26
|
+
* return null
|
|
28
27
|
* };
|
|
29
28
|
*
|
|
30
|
-
* export default function Index() {
|
|
31
|
-
* const {hasWriteProducts} = useLoaderData<typeof loader>();
|
|
32
|
-
*
|
|
33
|
-
* ...
|
|
34
|
-
* }
|
|
35
29
|
* ```
|
|
36
30
|
*/
|
|
37
31
|
query: () => Promise<ScopesDetail>;
|
|
38
32
|
/**
|
|
39
|
-
* Requests the merchant
|
|
33
|
+
* Requests the merchant grant the provided scopes
|
|
40
34
|
*
|
|
41
|
-
*
|
|
35
|
+
* This method performs a redirect to the grant screen.
|
|
42
36
|
*
|
|
43
37
|
* @example
|
|
44
|
-
* <caption>
|
|
38
|
+
* <caption>Ask the merchant to grant the provided scopes.</caption>
|
|
45
39
|
* <description>Call `scopes.request` to request optional scopes.</description>
|
|
46
40
|
* ```ts
|
|
47
41
|
* // /app/routes/app.request.tsx
|
|
48
|
-
* import type { ActionFunctionArgs } from "@remix-run/node";
|
|
49
|
-
* import { useFetcher } from "@remix-run/react";
|
|
50
42
|
* import { authenticate } from "../shopify.server";
|
|
51
|
-
* import { json } from "@remix-run/node";
|
|
52
43
|
*
|
|
53
|
-
* // Example of an action to
|
|
54
|
-
* export const action = async ({ request }
|
|
44
|
+
* // Example of an action to request optional scopes
|
|
45
|
+
* export const action = async ({ request }) => {
|
|
55
46
|
* const { scopes } = await authenticate.admin(request);
|
|
47
|
+
* const { granted } = await scopes.query();
|
|
56
48
|
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
49
|
+
* if (!granted.includes("write_products")) {
|
|
50
|
+
* await scopes.request(["write_products"]);
|
|
51
|
+
* }
|
|
59
52
|
*
|
|
60
|
-
*
|
|
61
|
-
* await scopes.request(scopesToRequest);
|
|
62
|
-
* // otherwise return an empty response
|
|
63
|
-
* return json({});
|
|
53
|
+
* return null
|
|
64
54
|
* };
|
|
65
|
-
*
|
|
66
|
-
* export default function Index() {
|
|
67
|
-
* const fetcher = useFetcher<typeof action>();
|
|
68
|
-
*
|
|
69
|
-
* const handleRequest = () => {
|
|
70
|
-
* fetcher.submit({scopes: ["write_products"]}, {
|
|
71
|
-
* method: "POST",
|
|
72
|
-
* });
|
|
73
|
-
* };
|
|
74
|
-
*
|
|
75
|
-
* ...
|
|
76
|
-
* }
|
|
77
55
|
* ```
|
|
78
56
|
*/
|
|
79
57
|
request: (scopes: Scope[]) => Promise<void>;
|
|
80
58
|
/**
|
|
81
|
-
* Revokes the provided scopes
|
|
59
|
+
* Revokes the provided scopes
|
|
82
60
|
*
|
|
83
61
|
* Warning: This method throws an [error](https://shopify.dev/docs/api/admin-graphql/unstable/objects/AppRevokeAccessScopesAppRevokeScopeError) if the provided optional scopes contains a required scope.
|
|
84
62
|
*
|
|
@@ -87,34 +65,22 @@ export interface ScopesApiContext {
|
|
|
87
65
|
* <description>Call `scopes.revoke` to revoke optional scopes.</description>
|
|
88
66
|
* ```ts
|
|
89
67
|
* // /app._index.tsx
|
|
90
|
-
* import type { ActionFunctionArgs } from "@remix-run/node";
|
|
91
|
-
* import { useFetcher } from "@remix-run/react";
|
|
92
68
|
* import { authenticate } from "../shopify.server";
|
|
93
69
|
* import { json } from "@remix-run/node";
|
|
94
70
|
*
|
|
95
71
|
* // Example of an action to POST optional scopes to revoke
|
|
96
|
-
* export const action = async ({ request }
|
|
72
|
+
* export const action = async ({ request }) => {
|
|
97
73
|
* const { scopes } = await authenticate.admin(request);
|
|
74
|
+
* const { granted } = await scopes.query();
|
|
98
75
|
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
76
|
+
* if (granted.includes("write_products")) {
|
|
77
|
+
* const revokedResponse = await scopes.revoke(["write_products"]);
|
|
78
|
+
* return json(revokedResponse);
|
|
79
|
+
* }
|
|
103
80
|
*
|
|
104
|
-
* return
|
|
81
|
+
* return null
|
|
105
82
|
* };
|
|
106
83
|
*
|
|
107
|
-
* export default function Index() {
|
|
108
|
-
* const fetcher = useFetcher<typeof action>();
|
|
109
|
-
*
|
|
110
|
-
* const handleRevoke = () => {
|
|
111
|
-
* fetcher.submit({scopes: ["write_products"]}, {
|
|
112
|
-
* method: "POST",
|
|
113
|
-
* });
|
|
114
|
-
* };
|
|
115
|
-
*
|
|
116
|
-
* ...
|
|
117
|
-
* }
|
|
118
84
|
* ```
|
|
119
85
|
*/
|
|
120
86
|
revoke: (scopes: Scope[]) => Promise<ScopesRevokeResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/scope/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/scope/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,KAAK,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;IAEnC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,OAAO,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,MAAM,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAC5D;AAED;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC;AAE3B;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG,cAAc,CAAC;AAExD,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,OAAO,EAAE,KAAK,EAAE,CAAC;IACjB;;OAEG;IACH,QAAQ,EAAE,KAAK,EAAE,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,KAAK,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,OAAO,EAAE,KAAK,EAAE,CAAC;CAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../../../src/server/authenticate/login/login.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,WAAW,EAAE,UAAU,EAAiB,MAAM,aAAa,CAAC;AAEpE,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../../../src/server/authenticate/login/login.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,WAAW,EAAE,UAAU,EAAiB,MAAM,aAAa,CAAC;AAEpE,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,IAGlB,SAAS,OAAO,KAAG,OAAO,CAAC,UAAU,GAAG,KAAK,CAAC,CA6C3E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../src/server/authenticate/webhooks/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,aAAa,CAAC;AAE7C,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,SAAS,CAAC;AAErD,wBAAgB,uBAAuB,CAAC,EAAC,GAAG,EAAE,MAAM,EAAC,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../src/server/authenticate/webhooks/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,aAAa,CAAC;AAE7C,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,SAAS,CAAC;AAErD,wBAAgB,uBAAuB,CAAC,EAAC,GAAG,EAAE,MAAM,EAAC,EAAE,WAAW,IACzB,aAAW,uBAAuB,mEA0C1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../../src/server/unauthenticated/admin/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAC,WAAW,EAAC,MAAM,aAAa,CAAC;AAGxC,OAAO,EAAC,2BAA2B,EAAC,MAAM,SAAS,CAAC;AAEpD,wBAAgB,kCAAkC,CAChD,SAAS,SAAS,YAAY,EAC9B,SAAS,SAAS,oBAAoB,EACtC,MAAM,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../../src/server/unauthenticated/admin/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAC,WAAW,EAAC,MAAM,aAAa,CAAC;AAGxC,OAAO,EAAC,2BAA2B,EAAC,MAAM,SAAS,CAAC;AAEpD,wBAAgB,kCAAkC,CAChD,SAAS,SAAS,YAAY,EAC9B,SAAS,SAAS,oBAAoB,EACtC,MAAM,EAAE,WAAW,IAEjB,MAAM,MAAM,KACX,OAAO,CAAC,2BAA2B,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAc9D"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SHOPIFY_REMIX_LIBRARY_VERSION = "3.8.
|
|
1
|
+
export declare const SHOPIFY_REMIX_LIBRARY_VERSION = "3.8.4";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|