@shopify/shopify-app-remix 1.0.3 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -23
- package/build/cjs/react/components/AppProvider/AppProvider.js +67 -0
- package/build/cjs/react/components/RemixPolarisLink.js +22 -0
- package/build/cjs/react/const.js +7 -0
- package/build/cjs/react/index.js +9 -0
- package/build/cjs/{adapters → server/adapters}/node/index.js +1 -3
- package/build/cjs/{auth → server/authenticate}/admin/authenticate.js +35 -86
- package/build/cjs/{billing → server/authenticate/admin/billing}/cancel.js +1 -2
- package/build/cjs/{billing → server/authenticate/admin/billing}/request.js +2 -3
- package/build/cjs/{billing → server/authenticate/admin/billing}/require.js +1 -2
- package/build/cjs/server/authenticate/admin/helpers/handle-client-error.js +39 -0
- package/build/cjs/{auth → server/authenticate/admin}/helpers/redirect-to-auth-page.js +6 -1
- package/build/cjs/{auth → server/authenticate/admin}/helpers/redirect-with-app-bridge-headers.js +2 -6
- package/build/cjs/server/authenticate/admin/helpers/redirect.js +67 -0
- package/build/cjs/server/authenticate/admin/helpers/render-app-bridge.js +30 -0
- package/build/cjs/{auth → server/authenticate}/helpers/add-response-headers.js +1 -1
- package/build/cjs/{auth → server/authenticate}/helpers/ensure-cors-headers.js +3 -2
- package/build/cjs/{auth → server/authenticate}/helpers/respond-to-options-request.js +2 -2
- package/build/cjs/{auth → server/authenticate}/helpers/validate-session-token.js +6 -2
- package/build/cjs/{auth → server/authenticate}/public/authenticate.js +8 -6
- package/build/cjs/{boundary → server/boundary}/error.js +7 -1
- package/build/cjs/server/boundary/index.js +44 -0
- package/build/cjs/server/clients/admin/factory.js +27 -0
- package/build/cjs/{auth/admin/graphql-client.js → server/clients/admin/graphql.js} +10 -18
- package/build/cjs/{auth/admin/rest-client.js → server/clients/admin/rest.js} +54 -33
- package/build/cjs/server/index.js +39 -0
- package/build/cjs/{index.js → server/shopify-app.js} +10 -69
- package/build/cjs/server/unauthenticated/admin/factory.js +25 -0
- package/build/cjs/{version.js → server/version.js} +1 -1
- package/build/ts/react/components/AppProvider/AppProvider.d.ts +50 -0
- package/build/ts/react/components/AppProvider/AppProvider.d.ts.map +1 -0
- package/build/ts/react/components/AppProvider/AppProvider.js +44 -0
- package/build/ts/react/components/AppProvider/AppProvider.js.map +1 -0
- package/build/ts/react/components/AppProvider/index.d.ts +2 -0
- package/build/ts/react/components/AppProvider/index.d.ts.map +1 -0
- package/build/ts/react/components/AppProvider/index.js +5 -0
- package/build/ts/react/components/AppProvider/index.js.map +1 -0
- package/build/ts/react/components/RemixPolarisLink.d.ts +3 -0
- package/build/ts/react/components/RemixPolarisLink.d.ts.map +1 -0
- package/build/ts/react/components/RemixPolarisLink.js +12 -0
- package/build/ts/react/components/RemixPolarisLink.js.map +1 -0
- package/build/ts/react/components/index.d.ts +2 -0
- package/build/ts/react/components/index.d.ts.map +1 -0
- package/build/ts/react/components/index.js +5 -0
- package/build/ts/react/components/index.js.map +1 -0
- package/build/ts/react/const.d.ts +2 -0
- package/build/ts/react/const.d.ts.map +1 -0
- package/build/ts/react/const.js +5 -0
- package/build/ts/react/const.js.map +1 -0
- package/build/ts/react/index.d.ts +2 -0
- package/build/ts/react/index.d.ts.map +1 -0
- package/build/ts/react/index.js +5 -0
- package/build/ts/react/index.js.map +1 -0
- package/build/ts/server/adapters/node/index.d.ts.map +1 -0
- package/build/ts/{adapters → server/adapters}/node/index.js +1 -1
- package/build/ts/server/adapters/node/index.js.map +1 -0
- package/build/ts/{auth → server/authenticate}/admin/authenticate.d.ts +0 -2
- package/build/ts/server/authenticate/admin/authenticate.d.ts.map +1 -0
- package/build/ts/{auth → server/authenticate}/admin/authenticate.js +26 -70
- package/build/ts/server/authenticate/admin/authenticate.js.map +1 -0
- package/build/ts/{billing → server/authenticate/admin/billing}/cancel.d.ts +1 -1
- package/build/ts/server/authenticate/admin/billing/cancel.d.ts.map +1 -0
- package/build/ts/{billing → server/authenticate/admin/billing}/cancel.js +1 -1
- package/build/ts/server/authenticate/admin/billing/cancel.js.map +1 -0
- package/build/ts/server/authenticate/admin/billing/index.d.ts.map +1 -0
- package/build/ts/server/authenticate/admin/billing/index.js.map +1 -0
- package/build/ts/{billing → server/authenticate/admin/billing}/request.d.ts +2 -2
- package/build/ts/server/authenticate/admin/billing/request.d.ts.map +1 -0
- package/build/ts/{billing → server/authenticate/admin/billing}/request.js +2 -3
- package/build/ts/server/authenticate/admin/billing/request.js.map +1 -0
- package/build/ts/{billing → server/authenticate/admin/billing}/require.d.ts +2 -2
- package/build/ts/server/authenticate/admin/billing/require.d.ts.map +1 -0
- package/build/ts/{billing → server/authenticate/admin/billing}/require.js +1 -1
- package/build/ts/server/authenticate/admin/billing/require.js.map +1 -0
- package/build/ts/{billing → server/authenticate/admin/billing}/types.d.ts +1 -1
- package/build/ts/server/authenticate/admin/billing/types.d.ts.map +1 -0
- package/build/ts/server/authenticate/admin/billing/types.js.map +1 -0
- package/build/ts/{auth → server/authenticate/admin}/helpers/begin-auth.d.ts +1 -1
- package/build/ts/server/authenticate/admin/helpers/begin-auth.d.ts.map +1 -0
- package/build/ts/server/authenticate/admin/helpers/begin-auth.js.map +1 -0
- package/build/ts/server/authenticate/admin/helpers/handle-client-error.d.ts +7 -0
- package/build/ts/server/authenticate/admin/helpers/handle-client-error.d.ts.map +1 -0
- package/build/ts/server/authenticate/admin/helpers/handle-client-error.js +41 -0
- package/build/ts/server/authenticate/admin/helpers/handle-client-error.js.map +1 -0
- package/build/ts/server/authenticate/admin/helpers/index.d.ts +8 -0
- package/build/ts/server/authenticate/admin/helpers/index.d.ts.map +1 -0
- package/build/ts/server/authenticate/admin/helpers/index.js +11 -0
- package/build/ts/server/authenticate/admin/helpers/index.js.map +1 -0
- package/build/ts/{auth → server/authenticate/admin}/helpers/redirect-to-auth-page.d.ts +1 -1
- package/build/ts/server/authenticate/admin/helpers/redirect-to-auth-page.d.ts.map +1 -0
- package/build/ts/{auth → server/authenticate/admin}/helpers/redirect-to-auth-page.js +5 -2
- package/build/ts/server/authenticate/admin/helpers/redirect-to-auth-page.js.map +1 -0
- package/build/ts/server/authenticate/admin/helpers/redirect-with-app-bridge-headers.d.ts +3 -0
- package/build/ts/server/authenticate/admin/helpers/redirect-with-app-bridge-headers.d.ts.map +1 -0
- package/build/ts/{auth → server/authenticate/admin}/helpers/redirect-with-app-bridge-headers.js +2 -4
- package/build/ts/server/authenticate/admin/helpers/redirect-with-app-bridge-headers.js.map +1 -0
- package/build/ts/{auth → server/authenticate/admin}/helpers/redirect-with-exitiframe.d.ts +1 -1
- package/build/ts/server/authenticate/admin/helpers/redirect-with-exitiframe.d.ts.map +1 -0
- package/build/ts/server/authenticate/admin/helpers/redirect-with-exitiframe.js.map +1 -0
- package/build/ts/server/authenticate/admin/helpers/redirect.d.ts +9 -0
- package/build/ts/server/authenticate/admin/helpers/redirect.d.ts.map +1 -0
- package/build/ts/server/authenticate/admin/helpers/redirect.js +64 -0
- package/build/ts/server/authenticate/admin/helpers/redirect.js.map +1 -0
- package/build/ts/server/authenticate/admin/helpers/render-app-bridge.d.ts +8 -0
- package/build/ts/server/authenticate/admin/helpers/render-app-bridge.d.ts.map +1 -0
- package/build/ts/server/authenticate/admin/helpers/render-app-bridge.js +22 -0
- package/build/ts/server/authenticate/admin/helpers/render-app-bridge.js.map +1 -0
- package/build/ts/{auth → server/authenticate}/admin/types.d.ts +22 -2
- package/build/ts/server/authenticate/admin/types.d.ts.map +1 -0
- package/build/ts/server/authenticate/admin/types.js.map +1 -0
- package/build/ts/server/authenticate/const.d.ts.map +1 -0
- package/build/ts/server/authenticate/const.js.map +1 -0
- package/build/ts/server/authenticate/helpers/add-response-headers.d.ts.map +1 -0
- package/build/ts/{auth → server/authenticate}/helpers/add-response-headers.js +1 -1
- package/build/ts/server/authenticate/helpers/add-response-headers.js.map +1 -0
- package/build/ts/server/authenticate/helpers/app-bridge-url.d.ts.map +1 -0
- package/build/ts/server/authenticate/helpers/app-bridge-url.js.map +1 -0
- package/build/ts/{auth → server/authenticate}/helpers/ensure-cors-headers.d.ts +1 -1
- package/build/ts/server/authenticate/helpers/ensure-cors-headers.d.ts.map +1 -0
- package/build/ts/{auth → server/authenticate}/helpers/ensure-cors-headers.js +8 -2
- package/build/ts/server/authenticate/helpers/ensure-cors-headers.js.map +1 -0
- package/build/ts/server/authenticate/helpers/get-session-token-header.d.ts.map +1 -0
- package/build/ts/server/authenticate/helpers/get-session-token-header.js.map +1 -0
- package/build/ts/{auth → server/authenticate}/helpers/index.d.ts +0 -4
- package/build/ts/server/authenticate/helpers/index.d.ts.map +1 -0
- package/build/ts/{auth → server/authenticate}/helpers/index.js +0 -4
- package/build/ts/server/authenticate/helpers/index.js.map +1 -0
- package/build/ts/server/authenticate/helpers/reject-bot-request.d.ts.map +1 -0
- package/build/ts/server/authenticate/helpers/reject-bot-request.js.map +1 -0
- package/build/ts/server/authenticate/helpers/respond-to-options-request.d.ts +3 -0
- package/build/ts/server/authenticate/helpers/respond-to-options-request.d.ts.map +1 -0
- package/build/ts/{auth → server/authenticate}/helpers/respond-to-options-request.js +2 -2
- package/build/ts/server/authenticate/helpers/respond-to-options-request.js.map +1 -0
- package/build/ts/server/authenticate/helpers/validate-session-token.d.ts +8 -0
- package/build/ts/server/authenticate/helpers/validate-session-token.d.ts.map +1 -0
- package/build/ts/{auth → server/authenticate}/helpers/validate-session-token.js +11 -8
- package/build/ts/server/authenticate/helpers/validate-session-token.js.map +1 -0
- package/build/ts/server/authenticate/login/login.d.ts.map +1 -0
- package/build/ts/server/authenticate/login/login.js.map +1 -0
- package/build/ts/server/authenticate/public/authenticate.d.ts +4 -0
- package/build/ts/server/authenticate/public/authenticate.d.ts.map +1 -0
- package/build/ts/{auth → server/authenticate}/public/authenticate.js +16 -11
- package/build/ts/server/authenticate/public/authenticate.js.map +1 -0
- package/build/ts/{auth → server/authenticate}/public/types.d.ts +7 -2
- package/build/ts/server/authenticate/public/types.d.ts.map +1 -0
- package/build/ts/server/authenticate/public/types.js.map +1 -0
- package/build/ts/server/authenticate/webhooks/authenticate.d.ts.map +1 -0
- package/build/ts/server/authenticate/webhooks/authenticate.js.map +1 -0
- package/build/ts/server/authenticate/webhooks/index.d.ts.map +1 -0
- package/build/ts/server/authenticate/webhooks/index.js.map +1 -0
- package/build/ts/server/authenticate/webhooks/register.d.ts.map +1 -0
- package/build/ts/server/authenticate/webhooks/register.js.map +1 -0
- package/build/ts/server/authenticate/webhooks/types.d.ts.map +1 -0
- package/build/ts/server/authenticate/webhooks/types.js.map +1 -0
- package/build/ts/server/boundary/error.d.ts +2 -0
- package/build/ts/server/boundary/error.d.ts.map +1 -0
- package/build/ts/{boundary → server/boundary}/error.js +2 -1
- package/build/ts/server/boundary/error.js.map +1 -0
- package/build/ts/server/boundary/headers.d.ts.map +1 -0
- package/build/ts/server/boundary/headers.js.map +1 -0
- package/build/ts/server/boundary/index.d.ts +38 -0
- package/build/ts/server/boundary/index.d.ts.map +1 -0
- package/build/ts/server/boundary/index.js +41 -0
- package/build/ts/server/boundary/index.js.map +1 -0
- package/build/ts/server/boundary/types.d.ts.map +1 -0
- package/build/ts/{auth/admin → server/boundary}/types.js.map +1 -1
- package/build/ts/server/clients/admin/factory.d.ts +11 -0
- package/build/ts/server/clients/admin/factory.d.ts.map +1 -0
- package/build/ts/server/clients/admin/factory.js +18 -0
- package/build/ts/server/clients/admin/factory.js.map +1 -0
- package/build/ts/server/clients/admin/graphql.d.ts +17 -0
- package/build/ts/server/clients/admin/graphql.d.ts.map +1 -0
- package/build/ts/{auth/admin/graphql-client.js → server/clients/admin/graphql.js} +9 -14
- package/build/ts/server/clients/admin/graphql.js.map +1 -0
- package/build/ts/server/clients/admin/index.d.ts +2 -0
- package/build/ts/server/clients/admin/index.d.ts.map +1 -0
- package/build/ts/server/clients/admin/index.js +5 -0
- package/build/ts/server/clients/admin/index.js.map +1 -0
- package/build/ts/{auth/admin/rest-client.d.ts → server/clients/admin/rest.d.ts} +10 -13
- package/build/ts/server/clients/admin/rest.d.ts.map +1 -0
- package/build/ts/{auth/admin/rest-client.js → server/clients/admin/rest.js} +56 -25
- package/build/ts/server/clients/admin/rest.js.map +1 -0
- package/build/ts/server/clients/admin/types.d.ts +13 -0
- package/build/ts/server/clients/admin/types.d.ts.map +1 -0
- package/build/ts/server/clients/admin/types.js +3 -0
- package/build/ts/server/clients/admin/types.js.map +1 -0
- package/build/ts/{config-types.d.ts → server/config-types.d.ts} +3 -3
- package/build/ts/server/config-types.d.ts.map +1 -0
- package/build/ts/server/config-types.js.map +1 -0
- package/build/ts/server/index.d.ts +7 -0
- package/build/ts/server/index.d.ts.map +1 -0
- package/build/ts/server/index.js +22 -0
- package/build/ts/server/index.js.map +1 -0
- package/build/ts/server/override-logger.d.ts.map +1 -0
- package/build/ts/server/override-logger.js.map +1 -0
- package/build/ts/server/shopify-app.d.ts +27 -0
- package/build/ts/server/shopify-app.d.ts.map +1 -0
- package/build/ts/{index.js → server/shopify-app.js} +12 -57
- package/build/ts/server/shopify-app.js.map +1 -0
- package/build/ts/{types.d.ts → server/types.d.ts} +46 -13
- package/build/ts/server/types.d.ts.map +1 -0
- package/build/ts/server/types.js.map +1 -0
- package/build/ts/server/unauthenticated/admin/factory.d.ts +5 -0
- package/build/ts/server/unauthenticated/admin/factory.d.ts.map +1 -0
- package/build/ts/server/unauthenticated/admin/factory.js +30 -0
- package/build/ts/server/unauthenticated/admin/factory.js.map +1 -0
- package/build/ts/server/unauthenticated/admin/index.d.ts +2 -0
- package/build/ts/server/unauthenticated/admin/index.d.ts.map +1 -0
- package/build/ts/server/unauthenticated/admin/index.js +5 -0
- package/build/ts/server/unauthenticated/admin/index.js.map +1 -0
- package/build/ts/server/unauthenticated/admin/types.d.ts +32 -0
- package/build/ts/server/unauthenticated/admin/types.d.ts.map +1 -0
- package/build/ts/server/unauthenticated/admin/types.js +3 -0
- package/build/ts/server/unauthenticated/admin/types.js.map +1 -0
- package/build/ts/server/version.d.ts +2 -0
- package/build/ts/server/version.d.ts.map +1 -0
- package/build/ts/{version.js → server/version.js} +1 -1
- package/build/ts/server/version.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +34 -10
- package/build/cjs/auth/helpers/handle-client-error.js +0 -37
- package/build/ts/adapters/node/index.d.ts.map +0 -1
- package/build/ts/adapters/node/index.js.map +0 -1
- package/build/ts/auth/admin/authenticate.d.ts.map +0 -1
- package/build/ts/auth/admin/authenticate.js.map +0 -1
- package/build/ts/auth/admin/graphql-client.d.ts +0 -22
- package/build/ts/auth/admin/graphql-client.d.ts.map +0 -1
- package/build/ts/auth/admin/graphql-client.js.map +0 -1
- package/build/ts/auth/admin/rest-client.d.ts.map +0 -1
- package/build/ts/auth/admin/rest-client.js.map +0 -1
- package/build/ts/auth/admin/types.d.ts.map +0 -1
- package/build/ts/auth/const.d.ts.map +0 -1
- package/build/ts/auth/const.js.map +0 -1
- package/build/ts/auth/helpers/add-response-headers.d.ts.map +0 -1
- package/build/ts/auth/helpers/add-response-headers.js.map +0 -1
- package/build/ts/auth/helpers/app-bridge-url.d.ts.map +0 -1
- package/build/ts/auth/helpers/app-bridge-url.js.map +0 -1
- package/build/ts/auth/helpers/begin-auth.d.ts.map +0 -1
- package/build/ts/auth/helpers/begin-auth.js.map +0 -1
- package/build/ts/auth/helpers/ensure-cors-headers.d.ts.map +0 -1
- package/build/ts/auth/helpers/ensure-cors-headers.js.map +0 -1
- package/build/ts/auth/helpers/get-session-token-header.d.ts.map +0 -1
- package/build/ts/auth/helpers/get-session-token-header.js.map +0 -1
- package/build/ts/auth/helpers/handle-client-error.d.ts +0 -11
- package/build/ts/auth/helpers/handle-client-error.d.ts.map +0 -1
- package/build/ts/auth/helpers/handle-client-error.js +0 -40
- package/build/ts/auth/helpers/handle-client-error.js.map +0 -1
- package/build/ts/auth/helpers/index.d.ts.map +0 -1
- package/build/ts/auth/helpers/index.js.map +0 -1
- package/build/ts/auth/helpers/redirect-to-auth-page.d.ts.map +0 -1
- package/build/ts/auth/helpers/redirect-to-auth-page.js.map +0 -1
- package/build/ts/auth/helpers/redirect-with-app-bridge-headers.d.ts +0 -4
- package/build/ts/auth/helpers/redirect-with-app-bridge-headers.d.ts.map +0 -1
- package/build/ts/auth/helpers/redirect-with-app-bridge-headers.js.map +0 -1
- package/build/ts/auth/helpers/redirect-with-exitiframe.d.ts.map +0 -1
- package/build/ts/auth/helpers/redirect-with-exitiframe.js.map +0 -1
- package/build/ts/auth/helpers/reject-bot-request.d.ts.map +0 -1
- package/build/ts/auth/helpers/reject-bot-request.js.map +0 -1
- package/build/ts/auth/helpers/respond-to-options-request.d.ts +0 -3
- package/build/ts/auth/helpers/respond-to-options-request.d.ts.map +0 -1
- package/build/ts/auth/helpers/respond-to-options-request.js.map +0 -1
- package/build/ts/auth/helpers/validate-session-token.d.ts +0 -4
- package/build/ts/auth/helpers/validate-session-token.d.ts.map +0 -1
- package/build/ts/auth/helpers/validate-session-token.js.map +0 -1
- package/build/ts/auth/login/login.d.ts.map +0 -1
- package/build/ts/auth/login/login.js.map +0 -1
- package/build/ts/auth/public/authenticate.d.ts +0 -4
- package/build/ts/auth/public/authenticate.d.ts.map +0 -1
- package/build/ts/auth/public/authenticate.js.map +0 -1
- package/build/ts/auth/public/types.d.ts.map +0 -1
- package/build/ts/auth/public/types.js.map +0 -1
- package/build/ts/auth/webhooks/authenticate.d.ts.map +0 -1
- package/build/ts/auth/webhooks/authenticate.js.map +0 -1
- package/build/ts/auth/webhooks/index.d.ts.map +0 -1
- package/build/ts/auth/webhooks/index.js.map +0 -1
- package/build/ts/auth/webhooks/register.d.ts.map +0 -1
- package/build/ts/auth/webhooks/register.js.map +0 -1
- package/build/ts/auth/webhooks/types.d.ts.map +0 -1
- package/build/ts/auth/webhooks/types.js.map +0 -1
- package/build/ts/billing/cancel.d.ts.map +0 -1
- package/build/ts/billing/cancel.js.map +0 -1
- package/build/ts/billing/index.d.ts.map +0 -1
- package/build/ts/billing/index.js.map +0 -1
- package/build/ts/billing/request.d.ts.map +0 -1
- package/build/ts/billing/request.js.map +0 -1
- package/build/ts/billing/require.d.ts.map +0 -1
- package/build/ts/billing/require.js.map +0 -1
- package/build/ts/billing/types.d.ts.map +0 -1
- package/build/ts/billing/types.js.map +0 -1
- package/build/ts/boundary/error.d.ts +0 -2
- package/build/ts/boundary/error.d.ts.map +0 -1
- package/build/ts/boundary/error.js.map +0 -1
- package/build/ts/boundary/headers.d.ts.map +0 -1
- package/build/ts/boundary/headers.js.map +0 -1
- package/build/ts/boundary/types.d.ts.map +0 -1
- package/build/ts/boundary/types.js.map +0 -1
- package/build/ts/config-types.d.ts.map +0 -1
- package/build/ts/config-types.js.map +0 -1
- package/build/ts/index.d.ts +0 -67
- package/build/ts/index.d.ts.map +0 -1
- package/build/ts/index.js.map +0 -1
- package/build/ts/override-logger.d.ts.map +0 -1
- package/build/ts/override-logger.js.map +0 -1
- package/build/ts/types.d.ts.map +0 -1
- package/build/ts/types.js.map +0 -1
- package/build/ts/version.d.ts +0 -2
- package/build/ts/version.d.ts.map +0 -1
- package/build/ts/version.js.map +0 -1
- /package/build/cjs/{auth → server/authenticate/admin}/helpers/begin-auth.js +0 -0
- /package/build/cjs/{auth → server/authenticate/admin}/helpers/redirect-with-exitiframe.js +0 -0
- /package/build/cjs/{auth → server/authenticate}/const.js +0 -0
- /package/build/cjs/{auth → server/authenticate}/helpers/app-bridge-url.js +0 -0
- /package/build/cjs/{auth → server/authenticate}/helpers/get-session-token-header.js +0 -0
- /package/build/cjs/{auth → server/authenticate}/helpers/reject-bot-request.js +0 -0
- /package/build/cjs/{auth → server/authenticate}/login/login.js +0 -0
- /package/build/cjs/{auth → server/authenticate}/webhooks/authenticate.js +0 -0
- /package/build/cjs/{auth → server/authenticate}/webhooks/register.js +0 -0
- /package/build/cjs/{boundary → server/boundary}/headers.js +0 -0
- /package/build/cjs/{override-logger.js → server/override-logger.js} +0 -0
- /package/build/cjs/{types.js → server/types.js} +0 -0
- /package/build/ts/{adapters → server/adapters}/node/index.d.ts +0 -0
- /package/build/ts/{billing → server/authenticate/admin/billing}/index.d.ts +0 -0
- /package/build/ts/{billing → server/authenticate/admin/billing}/index.js +0 -0
- /package/build/ts/{auth/admin → server/authenticate/admin/billing}/types.js +0 -0
- /package/build/ts/{auth → server/authenticate/admin}/helpers/begin-auth.js +0 -0
- /package/build/ts/{auth → server/authenticate/admin}/helpers/redirect-with-exitiframe.js +0 -0
- /package/build/ts/{auth/public → server/authenticate/admin}/types.js +0 -0
- /package/build/ts/{auth → server/authenticate}/const.d.ts +0 -0
- /package/build/ts/{auth → server/authenticate}/const.js +0 -0
- /package/build/ts/{auth → server/authenticate}/helpers/add-response-headers.d.ts +0 -0
- /package/build/ts/{auth → server/authenticate}/helpers/app-bridge-url.d.ts +0 -0
- /package/build/ts/{auth → server/authenticate}/helpers/app-bridge-url.js +0 -0
- /package/build/ts/{auth → server/authenticate}/helpers/get-session-token-header.d.ts +0 -0
- /package/build/ts/{auth → server/authenticate}/helpers/get-session-token-header.js +0 -0
- /package/build/ts/{auth → server/authenticate}/helpers/reject-bot-request.d.ts +0 -0
- /package/build/ts/{auth → server/authenticate}/helpers/reject-bot-request.js +0 -0
- /package/build/ts/{auth → server/authenticate}/login/login.d.ts +0 -0
- /package/build/ts/{auth → server/authenticate}/login/login.js +0 -0
- /package/build/ts/{auth/webhooks → server/authenticate/public}/types.js +0 -0
- /package/build/ts/{auth → server/authenticate}/webhooks/authenticate.d.ts +0 -0
- /package/build/ts/{auth → server/authenticate}/webhooks/authenticate.js +0 -0
- /package/build/ts/{auth → server/authenticate}/webhooks/index.d.ts +0 -0
- /package/build/ts/{auth → server/authenticate}/webhooks/index.js +0 -0
- /package/build/ts/{auth → server/authenticate}/webhooks/register.d.ts +0 -0
- /package/build/ts/{auth → server/authenticate}/webhooks/register.js +0 -0
- /package/build/ts/{auth → server/authenticate}/webhooks/types.d.ts +0 -0
- /package/build/ts/{billing → server/authenticate/webhooks}/types.js +0 -0
- /package/build/ts/{boundary → server/boundary}/headers.d.ts +0 -0
- /package/build/ts/{boundary → server/boundary}/headers.js +0 -0
- /package/build/ts/{boundary → server/boundary}/types.d.ts +0 -0
- /package/build/ts/{boundary → server/boundary}/types.js +0 -0
- /package/build/ts/{config-types.js → server/config-types.js} +0 -0
- /package/build/ts/{override-logger.d.ts → server/override-logger.d.ts} +0 -0
- /package/build/ts/{override-logger.js → server/override-logger.js} +0 -0
- /package/build/ts/{types.js → server/types.js} +0 -0
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('@remix-run/server-runtime');
|
|
6
5
|
var ensureCorsHeaders = require('../helpers/ensure-cors-headers.js');
|
|
7
6
|
var validateSessionToken = require('../helpers/validate-session-token.js');
|
|
8
7
|
var getSessionTokenHeader = require('../helpers/get-session-token-header.js');
|
|
9
8
|
var rejectBotRequest = require('../helpers/reject-bot-request.js');
|
|
10
9
|
var respondToOptionsRequest = require('../helpers/respond-to-options-request.js');
|
|
11
|
-
require('@shopify/shopify-api');
|
|
12
10
|
|
|
13
11
|
function authenticatePublicFactory(params) {
|
|
14
|
-
return async function authenticatePublic(request) {
|
|
12
|
+
return async function authenticatePublic(request, options = {}) {
|
|
13
|
+
var _options$corsHeaders;
|
|
15
14
|
const {
|
|
16
15
|
logger
|
|
17
16
|
} = params;
|
|
17
|
+
const corsHeaders = (_options$corsHeaders = options.corsHeaders) !== null && _options$corsHeaders !== void 0 ? _options$corsHeaders : [];
|
|
18
18
|
rejectBotRequest.rejectBotRequest(params, request);
|
|
19
|
-
respondToOptionsRequest.respondToOptionsRequest(params, request);
|
|
19
|
+
respondToOptionsRequest.respondToOptionsRequest(params, request, corsHeaders);
|
|
20
20
|
const sessionTokenHeader = getSessionTokenHeader.getSessionTokenHeader(request);
|
|
21
21
|
logger.info('Authenticating public request');
|
|
22
22
|
if (!sessionTokenHeader) {
|
|
@@ -27,8 +27,10 @@ function authenticatePublicFactory(params) {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
return {
|
|
30
|
-
sessionToken: await validateSessionToken.validateSessionToken(params, sessionTokenHeader
|
|
31
|
-
|
|
30
|
+
sessionToken: await validateSessionToken.validateSessionToken(params, sessionTokenHeader, {
|
|
31
|
+
checkAudience: false
|
|
32
|
+
}),
|
|
33
|
+
cors: ensureCorsHeaders.ensureCORSHeadersFactory(params, request, corsHeaders)
|
|
32
34
|
};
|
|
33
35
|
};
|
|
34
36
|
}
|
|
@@ -2,9 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
5
7
|
function errorBoundary(error) {
|
|
6
8
|
if (error.constructor.name === 'ErrorResponse') {
|
|
7
|
-
return
|
|
9
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
10
|
+
dangerouslySetInnerHTML: {
|
|
11
|
+
__html: error.data || 'Handling response'
|
|
12
|
+
}
|
|
13
|
+
});
|
|
8
14
|
}
|
|
9
15
|
throw error;
|
|
10
16
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var headers = require('./headers.js');
|
|
6
|
+
var error = require('./error.js');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A collection of functions that handle the necessary code for error boundaries in routes using authenticate.admin.
|
|
10
|
+
*/
|
|
11
|
+
const boundary = {
|
|
12
|
+
/**
|
|
13
|
+
* A function that handles errors or thrown responses.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* Catching errors in a route
|
|
17
|
+
* ```ts
|
|
18
|
+
* // app/routes/admin/widgets.ts
|
|
19
|
+
* import { boundary } from "@shopify/shopify-app-remix";
|
|
20
|
+
*
|
|
21
|
+
* export function ErrorBoundary() {
|
|
22
|
+
* return boundary.error(useRouteError());
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
error: error.errorBoundary,
|
|
27
|
+
/**
|
|
28
|
+
* A function that sets the appropriate document repsonse headers.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* Catching errors in a route
|
|
32
|
+
* ```ts
|
|
33
|
+
* // app/routes/admin/widgets.ts
|
|
34
|
+
* import { boundary } from "@shopify/shopify-app-remix";
|
|
35
|
+
*
|
|
36
|
+
* export const headers = (headersArgs) => {
|
|
37
|
+
* return boundary.headers(headersArgs);
|
|
38
|
+
* };
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
headers: headers.headersBoundary
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
exports.boundary = boundary;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var graphql = require('./graphql.js');
|
|
6
|
+
var rest = require('./rest.js');
|
|
7
|
+
|
|
8
|
+
function adminClientFactory({
|
|
9
|
+
params,
|
|
10
|
+
handleClientError,
|
|
11
|
+
session
|
|
12
|
+
}) {
|
|
13
|
+
return {
|
|
14
|
+
rest: rest.restClientFactory({
|
|
15
|
+
params,
|
|
16
|
+
session,
|
|
17
|
+
handleClientError
|
|
18
|
+
}),
|
|
19
|
+
graphql: graphql.graphqlClientFactory({
|
|
20
|
+
params,
|
|
21
|
+
session,
|
|
22
|
+
handleClientError
|
|
23
|
+
})
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
exports.adminClientFactory = adminClientFactory;
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var runtime = require('@shopify/shopify-api/runtime');
|
|
6
|
-
var handleClientError = require('../helpers/handle-client-error.js');
|
|
7
6
|
|
|
8
7
|
// eslint-disable-next-line no-warning-comments
|
|
9
8
|
// TODO: This is actually just a call through to the Shopify API client, but with a different API. We should eventually
|
|
@@ -11,17 +10,12 @@ var handleClientError = require('../helpers/handle-client-error.js');
|
|
|
11
10
|
// client request calls.
|
|
12
11
|
function graphqlClientFactory({
|
|
13
12
|
params,
|
|
14
|
-
|
|
13
|
+
handleClientError,
|
|
15
14
|
session
|
|
16
15
|
}) {
|
|
17
16
|
return async function query(query, options) {
|
|
18
17
|
var _options;
|
|
19
|
-
const {
|
|
20
|
-
api,
|
|
21
|
-
config,
|
|
22
|
-
logger
|
|
23
|
-
} = params;
|
|
24
|
-
const client = new api.clients.Graphql({
|
|
18
|
+
const client = new params.api.clients.Graphql({
|
|
25
19
|
session,
|
|
26
20
|
apiVersion: (_options = options) === null || _options === void 0 ? void 0 : _options.apiVersion
|
|
27
21
|
});
|
|
@@ -40,16 +34,14 @@ function graphqlClientFactory({
|
|
|
40
34
|
headers: runtime.flatHeaders(apiResponse.headers)
|
|
41
35
|
});
|
|
42
36
|
} catch (error) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
shop: session.shop
|
|
52
|
-
});
|
|
37
|
+
if (handleClientError) {
|
|
38
|
+
throw await handleClientError({
|
|
39
|
+
error,
|
|
40
|
+
params,
|
|
41
|
+
session
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
throw error;
|
|
53
45
|
}
|
|
54
46
|
};
|
|
55
47
|
}
|
|
@@ -2,22 +2,48 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
function restClientFactory({
|
|
6
|
+
params,
|
|
7
|
+
handleClientError,
|
|
8
|
+
session
|
|
9
|
+
}) {
|
|
10
|
+
const {
|
|
11
|
+
api
|
|
12
|
+
} = params;
|
|
13
|
+
const client = new RemixRestClient({
|
|
14
|
+
params,
|
|
15
|
+
handleClientError,
|
|
16
|
+
session
|
|
17
|
+
});
|
|
18
|
+
if (api.rest) {
|
|
19
|
+
client.resources = {};
|
|
20
|
+
const RestResourceClient = restResourceClientFactory({
|
|
21
|
+
params,
|
|
22
|
+
handleClientError,
|
|
23
|
+
session
|
|
24
|
+
});
|
|
25
|
+
Object.entries(api.rest).forEach(([name, resource]) => {
|
|
26
|
+
class RemixResource extends resource {}
|
|
27
|
+
RemixResource.Client = RestResourceClient;
|
|
28
|
+
Reflect.defineProperty(RemixResource, 'name', {
|
|
29
|
+
value: name
|
|
30
|
+
});
|
|
31
|
+
Reflect.set(client.resources, name, RemixResource);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return client;
|
|
35
|
+
}
|
|
9
36
|
class RemixRestClient {
|
|
10
37
|
constructor({
|
|
11
38
|
params,
|
|
12
|
-
|
|
13
|
-
|
|
39
|
+
session,
|
|
40
|
+
handleClientError
|
|
14
41
|
}) {
|
|
15
42
|
this.session = void 0;
|
|
16
|
-
this.resources = void 0;
|
|
17
43
|
this.params = void 0;
|
|
18
|
-
this.
|
|
44
|
+
this.handleClientError = void 0;
|
|
19
45
|
this.params = params;
|
|
20
|
-
this.
|
|
46
|
+
this.handleClientError = handleClientError;
|
|
21
47
|
this.session = session;
|
|
22
48
|
}
|
|
23
49
|
|
|
@@ -74,28 +100,27 @@ class RemixRestClient {
|
|
|
74
100
|
headers: apiResponse.headers
|
|
75
101
|
});
|
|
76
102
|
} catch (error) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
103
|
+
if (this.handleClientError) {
|
|
104
|
+
throw await this.handleClientError({
|
|
105
|
+
error,
|
|
106
|
+
session: this.session,
|
|
107
|
+
params: this.params
|
|
108
|
+
});
|
|
109
|
+
} else throw new Error(error);
|
|
83
110
|
}
|
|
84
111
|
}
|
|
85
112
|
}
|
|
86
113
|
function restResourceClientFactory({
|
|
87
114
|
params,
|
|
88
|
-
|
|
115
|
+
handleClientError,
|
|
89
116
|
session
|
|
90
117
|
}) {
|
|
91
118
|
const {
|
|
92
|
-
api
|
|
93
|
-
config,
|
|
94
|
-
logger
|
|
119
|
+
api
|
|
95
120
|
} = params;
|
|
96
121
|
const ApiClient = api.clients.Rest;
|
|
97
122
|
return class RestResourceClient extends ApiClient {
|
|
98
|
-
async request(
|
|
123
|
+
async request(requestParams) {
|
|
99
124
|
const originalClient = new api.clients.Rest({
|
|
100
125
|
session
|
|
101
126
|
});
|
|
@@ -103,22 +128,18 @@ function restResourceClientFactory({
|
|
|
103
128
|
try {
|
|
104
129
|
// We just call through to the API library client, and handle the error response here, so that data parsing
|
|
105
130
|
// behaves the same way.
|
|
106
|
-
return await originalRequest.call(originalClient,
|
|
131
|
+
return await originalRequest.call(originalClient, requestParams);
|
|
107
132
|
} catch (error) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
shop: session.shop,
|
|
116
|
-
error
|
|
117
|
-
});
|
|
133
|
+
if (handleClientError) {
|
|
134
|
+
throw await handleClientError({
|
|
135
|
+
error,
|
|
136
|
+
params,
|
|
137
|
+
session
|
|
138
|
+
});
|
|
139
|
+
} else throw new Error(error);
|
|
118
140
|
}
|
|
119
141
|
}
|
|
120
142
|
};
|
|
121
143
|
}
|
|
122
144
|
|
|
123
|
-
exports.
|
|
124
|
-
exports.restResourceClientFactory = restResourceClientFactory;
|
|
145
|
+
exports.restClientFactory = restClientFactory;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('@shopify/shopify-api/adapters/web-api');
|
|
6
|
+
var runtime = require('@shopify/shopify-api/runtime');
|
|
7
|
+
var shopifyApi = require('@shopify/shopify-api');
|
|
8
|
+
var types = require('./types.js');
|
|
9
|
+
var index = require('./boundary/index.js');
|
|
10
|
+
var shopifyApp = require('./shopify-app.js');
|
|
11
|
+
|
|
12
|
+
runtime.setAbstractRuntimeString(() => {
|
|
13
|
+
return `Remix`;
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
Object.defineProperty(exports, 'ApiVersion', {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return shopifyApi.ApiVersion; }
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, 'BillingInterval', {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return shopifyApi.BillingInterval; }
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, 'DeliveryMethod', {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return shopifyApi.DeliveryMethod; }
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports, 'LATEST_API_VERSION', {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () { return shopifyApi.LATEST_API_VERSION; }
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports, 'LogSeverity', {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () { return shopifyApi.LogSeverity; }
|
|
35
|
+
});
|
|
36
|
+
exports.AppDistribution = types.AppDistribution;
|
|
37
|
+
exports.LoginErrorType = types.LoginErrorType;
|
|
38
|
+
exports.boundary = index.boundary;
|
|
39
|
+
exports.shopifyApp = shopifyApp.shopifyApp;
|
|
@@ -4,24 +4,17 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
require('@shopify/shopify-api/adapters/web-api');
|
|
6
6
|
var shopifyApi = require('@shopify/shopify-api');
|
|
7
|
-
var runtime = require('@shopify/shopify-api/runtime');
|
|
8
7
|
var types = require('./types.js');
|
|
9
8
|
var version = require('./version.js');
|
|
10
|
-
var register = require('./
|
|
11
|
-
var authenticate$2 = require('./
|
|
12
|
-
var authenticate$1 = require('./
|
|
13
|
-
var authenticate = require('./
|
|
9
|
+
var register = require('./authenticate/webhooks/register.js');
|
|
10
|
+
var authenticate$2 = require('./authenticate/admin/authenticate.js');
|
|
11
|
+
var authenticate$1 = require('./authenticate/webhooks/authenticate.js');
|
|
12
|
+
var authenticate = require('./authenticate/public/authenticate.js');
|
|
14
13
|
var overrideLogger = require('./override-logger.js');
|
|
15
|
-
var addResponseHeaders = require('./
|
|
16
|
-
require('@remix-run/server-runtime');
|
|
14
|
+
var addResponseHeaders = require('./authenticate/helpers/add-response-headers.js');
|
|
17
15
|
require('isbot');
|
|
18
|
-
var login = require('./
|
|
19
|
-
var
|
|
20
|
-
var error = require('./boundary/error.js');
|
|
21
|
-
|
|
22
|
-
runtime.setAbstractRuntimeString(() => {
|
|
23
|
-
return `Remix`;
|
|
24
|
-
});
|
|
16
|
+
var login = require('./authenticate/login/login.js');
|
|
17
|
+
var factory = require('./unauthenticated/admin/factory.js');
|
|
25
18
|
|
|
26
19
|
/**
|
|
27
20
|
* Creates an object your app will use to interact with Shopify.
|
|
@@ -64,6 +57,9 @@ function shopifyApp(appConfig) {
|
|
|
64
57
|
admin: oauth.authenticateAdmin.bind(oauth),
|
|
65
58
|
public: authenticate.authenticatePublicFactory(params),
|
|
66
59
|
webhook: authenticate$1.authenticateWebhookFactory(params)
|
|
60
|
+
},
|
|
61
|
+
unauthenticated: {
|
|
62
|
+
admin: factory.unauthenticatedAdminContextFactory(params)
|
|
67
63
|
}
|
|
68
64
|
};
|
|
69
65
|
if (isAppStoreApp(shopify, appConfig) || isSingleMerchantApp(shopify, appConfig)) {
|
|
@@ -71,42 +67,6 @@ function shopifyApp(appConfig) {
|
|
|
71
67
|
}
|
|
72
68
|
return shopify;
|
|
73
69
|
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* A collection of functions that handle the necessary code for error boundaries in routes using authenticate.admin.
|
|
77
|
-
*/
|
|
78
|
-
const boundary = {
|
|
79
|
-
/**
|
|
80
|
-
* A function that handles errors or thrown responses.
|
|
81
|
-
*
|
|
82
|
-
* @example
|
|
83
|
-
* Catching errors in a route
|
|
84
|
-
* ```ts
|
|
85
|
-
* // app/routes/admin/widgets.ts
|
|
86
|
-
* import { boundary } from "@shopify/shopify-app-remix";
|
|
87
|
-
*
|
|
88
|
-
* export function ErrorBoundary() {
|
|
89
|
-
* return boundary.error(useRouteError());
|
|
90
|
-
* }
|
|
91
|
-
* ```
|
|
92
|
-
*/
|
|
93
|
-
error: error.errorBoundary,
|
|
94
|
-
/**
|
|
95
|
-
* A function that sets the appropriate document repsonse headers.
|
|
96
|
-
*
|
|
97
|
-
* @example
|
|
98
|
-
* Catching errors in a route
|
|
99
|
-
* ```ts
|
|
100
|
-
* // app/routes/admin/widgets.ts
|
|
101
|
-
* import { boundary } from "@shopify/shopify-app-remix";
|
|
102
|
-
*
|
|
103
|
-
* export const headers = (headersArgs) => {
|
|
104
|
-
* return boundary.headers(headersArgs);
|
|
105
|
-
* };
|
|
106
|
-
* ```
|
|
107
|
-
*/
|
|
108
|
-
headers: headers.headersBoundary
|
|
109
|
-
};
|
|
110
70
|
function isAppStoreApp(_shopify, config) {
|
|
111
71
|
return config.distribution === types.AppDistribution.AppStore;
|
|
112
72
|
}
|
|
@@ -167,23 +127,4 @@ function deriveConfig(appConfig, apiConfig) {
|
|
|
167
127
|
};
|
|
168
128
|
}
|
|
169
129
|
|
|
170
|
-
Object.defineProperty(exports, 'BillingInterval', {
|
|
171
|
-
enumerable: true,
|
|
172
|
-
get: function () { return shopifyApi.BillingInterval; }
|
|
173
|
-
});
|
|
174
|
-
Object.defineProperty(exports, 'DeliveryMethod', {
|
|
175
|
-
enumerable: true,
|
|
176
|
-
get: function () { return shopifyApi.DeliveryMethod; }
|
|
177
|
-
});
|
|
178
|
-
Object.defineProperty(exports, 'LATEST_API_VERSION', {
|
|
179
|
-
enumerable: true,
|
|
180
|
-
get: function () { return shopifyApi.LATEST_API_VERSION; }
|
|
181
|
-
});
|
|
182
|
-
Object.defineProperty(exports, 'LogSeverity', {
|
|
183
|
-
enumerable: true,
|
|
184
|
-
get: function () { return shopifyApi.LogSeverity; }
|
|
185
|
-
});
|
|
186
|
-
exports.AppDistribution = types.AppDistribution;
|
|
187
|
-
exports.LoginErrorType = types.LoginErrorType;
|
|
188
|
-
exports.boundary = boundary;
|
|
189
130
|
exports.shopifyApp = shopifyApp;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var shopifyApi = require('@shopify/shopify-api');
|
|
6
|
+
var factory = require('../../clients/admin/factory.js');
|
|
7
|
+
|
|
8
|
+
function unauthenticatedAdminContextFactory(params) {
|
|
9
|
+
return async shop => {
|
|
10
|
+
const offlineSessionId = params.api.session.getOfflineId(shop);
|
|
11
|
+
const session = await params.config.sessionStorage.loadSession(offlineSessionId);
|
|
12
|
+
if (!session) {
|
|
13
|
+
throw new shopifyApi.ShopifyError(`Could not find a session for shop ${shop} when creating unauthenticated admin context`);
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
session,
|
|
17
|
+
admin: factory.adminClientFactory({
|
|
18
|
+
params,
|
|
19
|
+
session
|
|
20
|
+
})
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
exports.unauthenticatedAdminContextFactory = unauthenticatedAdminContextFactory;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AppProviderProps as PolarisAppProviderProps } from '@shopify/polaris';
|
|
3
|
+
export interface AppProviderProps extends Omit<PolarisAppProviderProps, 'linkComponent' | 'i18n'> {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* The API key for your Shopify app.
|
|
7
|
+
*/
|
|
8
|
+
apiKey: string;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the app is embedded or not. Defaults to `true`.
|
|
11
|
+
*/
|
|
12
|
+
isEmbeddedApp?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* The i18n configuration for your Polaris provider.
|
|
15
|
+
*
|
|
16
|
+
* {@link https://polaris.shopify.com/components/utilities/app-provider}
|
|
17
|
+
*/
|
|
18
|
+
i18n?: PolarisAppProviderProps['i18n'];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Sets up the Polaris AppProvider and injects the App Bridge script.
|
|
22
|
+
*
|
|
23
|
+
* {@link https://polaris.shopify.com/components/utilities/app-provider}
|
|
24
|
+
* {@link https://shopify.dev/tools/app-bridge}
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* Wrap your app in the `AppProvider` component and pass in your API key.
|
|
28
|
+
* ```ts
|
|
29
|
+
* import {authenticate} from '~/shopify.server';
|
|
30
|
+
* import {AppProvider} from '@shopify/shopify-app-remix/react';
|
|
31
|
+
*
|
|
32
|
+
* export async function loader({ request }) {
|
|
33
|
+
* await authenticate.admin(request);
|
|
34
|
+
*
|
|
35
|
+
* return json({ apiKey: process.env.SHOPIFY_API_KEY });
|
|
36
|
+
* }
|
|
37
|
+
*
|
|
38
|
+
* export default function App() {
|
|
39
|
+
* const { apiKey } = useLoaderData();
|
|
40
|
+
*
|
|
41
|
+
* return (
|
|
42
|
+
* <AppProvider apiKey={apiKey}>
|
|
43
|
+
* <Outlet />
|
|
44
|
+
* </AppProvider>
|
|
45
|
+
* );
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare function AppProvider(props: AppProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
//# sourceMappingURL=AppProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppProvider.d.ts","sourceRoot":"","sources":["../../../../../src/react/components/AppProvider/AppProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,gBAAgB,IAAI,uBAAuB,EAC5C,MAAM,kBAAkB,CAAC;AAM1B,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,uBAAuB,EAAE,eAAe,GAAG,MAAM,CAAC;IAC/D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,IAAI,CAAC,EAAE,uBAAuB,CAAC,MAAM,CAAC,CAAC;CAMxC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAsBlD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppProvider = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var polaris_1 = require("@shopify/polaris");
|
|
7
|
+
var en_json_1 = tslib_1.__importDefault(require("@shopify/polaris/locales/en.json"));
|
|
8
|
+
var const_1 = require("../../const");
|
|
9
|
+
var RemixPolarisLink_1 = require("../RemixPolarisLink");
|
|
10
|
+
/**
|
|
11
|
+
* Sets up the Polaris AppProvider and injects the App Bridge script.
|
|
12
|
+
*
|
|
13
|
+
* {@link https://polaris.shopify.com/components/utilities/app-provider}
|
|
14
|
+
* {@link https://shopify.dev/tools/app-bridge}
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* Wrap your app in the `AppProvider` component and pass in your API key.
|
|
18
|
+
* ```ts
|
|
19
|
+
* import {authenticate} from '~/shopify.server';
|
|
20
|
+
* import {AppProvider} from '@shopify/shopify-app-remix/react';
|
|
21
|
+
*
|
|
22
|
+
* export async function loader({ request }) {
|
|
23
|
+
* await authenticate.admin(request);
|
|
24
|
+
*
|
|
25
|
+
* return json({ apiKey: process.env.SHOPIFY_API_KEY });
|
|
26
|
+
* }
|
|
27
|
+
*
|
|
28
|
+
* export default function App() {
|
|
29
|
+
* const { apiKey } = useLoaderData();
|
|
30
|
+
*
|
|
31
|
+
* return (
|
|
32
|
+
* <AppProvider apiKey={apiKey}>
|
|
33
|
+
* <Outlet />
|
|
34
|
+
* </AppProvider>
|
|
35
|
+
* );
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
function AppProvider(props) {
|
|
40
|
+
var children = props.children, apiKey = props.apiKey, i18n = props.i18n, _a = props.isEmbeddedApp, isEmbeddedApp = _a === void 0 ? true : _a, _b = props.__APP_BRIDGE_URL, __APP_BRIDGE_URL = _b === void 0 ? const_1.APP_BRIDGE_URL : _b, polarisProps = tslib_1.__rest(props, ["children", "apiKey", "i18n", "isEmbeddedApp", "__APP_BRIDGE_URL"]);
|
|
41
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEmbeddedApp && (0, jsx_runtime_1.jsx)("script", { src: __APP_BRIDGE_URL, "data-api-key": apiKey }), (0, jsx_runtime_1.jsx)(polaris_1.AppProvider, tslib_1.__assign({}, polarisProps, { linkComponent: RemixPolarisLink_1.RemixPolarisLink, i18n: i18n || en_json_1.default }, { children: children }))] }));
|
|
42
|
+
}
|
|
43
|
+
exports.AppProvider = AppProvider;
|
|
44
|
+
//# sourceMappingURL=AppProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppProvider.js","sourceRoot":"","sources":["../../../../../src/react/components/AppProvider/AppProvider.tsx"],"names":[],"mappings":";;;;;AACA,4CAG0B;AAC1B,qFAA2D;AAE3D,qCAA2C;AAC3C,wDAAqD;AA0BrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,SAAgB,WAAW,CAAC,KAAuB;IAE/C,IAAA,QAAQ,GAMN,KAAK,SANC,EACR,MAAM,GAKJ,KAAK,OALD,EACN,IAAI,GAIF,KAAK,KAJH,EACJ,KAGE,KAAK,cAHa,EAApB,aAAa,mBAAG,IAAI,KAAA,EACpB,KAEE,KAAK,iBAF0B,EAAjC,gBAAgB,mBAAG,sBAAc,KAAA,EAC9B,YAAY,kBACb,KAAK,EAPH,mEAOL,CADgB,CACP;IAEV,OAAO,CACL,6DACG,aAAa,IAAI,mCAAQ,GAAG,EAAE,gBAAgB,kBAAgB,MAAM,GAAI,EACzE,uBAAC,qBAAkB,uBACb,YAAY,IAChB,aAAa,EAAE,mCAAgB,EAC/B,IAAI,EAAE,IAAI,IAAI,iBAAW,gBAExB,QAAQ,IACU,IACpB,CACJ,CAAC;AACJ,CAAC;AAtBD,kCAsBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/react/components/AppProvider/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/react/components/AppProvider/index.ts"],"names":[],"mappings":";;;AAAA,wDAA8B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RemixPolarisLink.d.ts","sourceRoot":"","sources":["../../../../src/react/components/RemixPolarisLink.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,iBAAiB,EAElB,MAAM,8CAA8C,CAAC;AAEtD,eAAO,MAAM,gBAAgB,mBAKN,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RemixPolarisLink = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var react_1 = tslib_1.__importDefault(require("react"));
|
|
7
|
+
var react_2 = require("@remix-run/react");
|
|
8
|
+
exports.RemixPolarisLink = react_1.default.forwardRef(function (props, ref) {
|
|
9
|
+
var _a;
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)(react_2.Link, tslib_1.__assign({}, props, { to: (_a = props.url) !== null && _a !== void 0 ? _a : props.to, ref: ref })));
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=RemixPolarisLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RemixPolarisLink.js","sourceRoot":"","sources":["../../../../src/react/components/RemixPolarisLink.tsx"],"names":[],"mappings":";;;;;AAAA,wDAA0B;AAC1B,0CAAsC;AAOzB,QAAA,gBAAgB,GAAG,eAAK,CAAC,UAAU,CAG9C,UAAC,KAAK,EAAE,GAAG;;IAAK,OAAA,CAChB,uBAAC,YAAI,uBAAK,KAAK,IAAE,EAAE,EAAE,MAAA,KAAK,CAAC,GAAG,mCAAI,KAAK,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,CACzD,CAAA;CAAA,CAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/react/components/index.ts"],"names":[],"mappings":";;;AAAA,wDAA8B"}
|