@shopify/shopify-app-remix 2.2.0 → 2.4.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/build/cjs/server/adapters/node/index.js +1 -0
- package/build/cjs/server/authenticate/admin/authenticate.js +17 -14
- package/build/cjs/server/authenticate/admin/billing/cancel.js +1 -2
- package/build/cjs/server/authenticate/admin/billing/request.js +0 -1
- package/build/cjs/server/authenticate/admin/billing/require.js +1 -2
- package/build/cjs/server/authenticate/admin/helpers/create-admin-api-context.js +2 -5
- package/build/cjs/server/authenticate/admin/helpers/handle-client-error.js +8 -4
- package/build/cjs/server/authenticate/admin/helpers/redirect-to-bounce-page.js +4 -2
- package/build/cjs/server/authenticate/admin/helpers/redirect.js +1 -5
- package/build/cjs/server/authenticate/admin/helpers/trigger-after-auth-hook.js +2 -2
- package/build/cjs/server/authenticate/admin/strategies/auth-code-flow.js +37 -13
- package/build/cjs/server/authenticate/admin/strategies/token-exchange.js +155 -0
- package/build/cjs/server/authenticate/const.js +4 -0
- package/build/cjs/server/authenticate/helpers/idempotent-promise-handler.js +40 -0
- package/build/cjs/server/authenticate/helpers/respond-to-invalid-session-token.js +33 -0
- package/build/cjs/server/authenticate/login/login.js +5 -1
- package/build/cjs/server/authenticate/public/checkout/authenticate.js +1 -0
- package/build/cjs/server/authenticate/webhooks/authenticate.js +1 -2
- package/build/cjs/server/authenticate/webhooks/register.js +16 -0
- package/build/cjs/server/clients/admin/graphql.js +5 -12
- package/build/cjs/server/clients/storefront/factory.js +5 -12
- package/build/cjs/server/shopify-app.js +12 -6
- package/build/cjs/server/version.js +1 -1
- package/build/ts/react/components/AppProvider/AppProvider.js +1 -1
- package/build/ts/react/components/AppProvider/AppProvider.js.map +1 -1
- package/build/ts/server/__test-helpers/const.d.ts +2 -1
- package/build/ts/server/__test-helpers/const.d.ts.map +1 -1
- package/build/ts/server/__test-helpers/const.js +3 -2
- package/build/ts/server/__test-helpers/const.js.map +1 -1
- package/build/ts/server/__test-helpers/expect-admin-api-client.d.ts.map +1 -1
- package/build/ts/server/__test-helpers/expect-admin-api-client.js +2 -2
- package/build/ts/server/__test-helpers/expect-admin-api-client.js.map +1 -1
- package/build/ts/server/__test-helpers/expect-document-request-headers.js.map +1 -1
- package/build/ts/server/__test-helpers/expect-exit-iframe.js.map +1 -1
- package/build/ts/server/__test-helpers/expect-storefront-api-client.js +1 -1
- package/build/ts/server/__test-helpers/expect-storefront-api-client.js.map +1 -1
- package/build/ts/server/__test-helpers/get-thrown-response.js.map +1 -1
- package/build/ts/server/__test-helpers/request-mock.d.ts.map +1 -1
- package/build/ts/server/__test-helpers/request-mock.js +1 -1
- package/build/ts/server/__test-helpers/request-mock.js.map +1 -1
- package/build/ts/server/__test-helpers/setup-valid-session.d.ts +1 -1
- package/build/ts/server/__test-helpers/setup-valid-session.d.ts.map +1 -1
- package/build/ts/server/__test-helpers/setup-valid-session.js +5 -5
- package/build/ts/server/__test-helpers/setup-valid-session.js.map +1 -1
- package/build/ts/server/__test-helpers/test-config.d.ts +2 -1
- package/build/ts/server/__test-helpers/test-config.d.ts.map +1 -1
- package/build/ts/server/__test-helpers/test-config.js +1 -0
- package/build/ts/server/__test-helpers/test-config.js.map +1 -1
- package/build/ts/server/adapters/node/index.js.map +1 -1
- package/build/ts/server/authenticate/admin/authenticate.d.ts +7 -1
- package/build/ts/server/authenticate/admin/authenticate.d.ts.map +1 -1
- package/build/ts/server/authenticate/admin/authenticate.js +14 -14
- package/build/ts/server/authenticate/admin/authenticate.js.map +1 -1
- package/build/ts/server/authenticate/admin/billing/request.js.map +1 -1
- package/build/ts/server/authenticate/admin/helpers/create-admin-api-context.d.ts +2 -2
- package/build/ts/server/authenticate/admin/helpers/create-admin-api-context.d.ts.map +1 -1
- package/build/ts/server/authenticate/admin/helpers/create-admin-api-context.js +2 -5
- package/build/ts/server/authenticate/admin/helpers/create-admin-api-context.js.map +1 -1
- package/build/ts/server/authenticate/admin/helpers/ensure-session-token-search-param-if-required.js.map +1 -1
- package/build/ts/server/authenticate/admin/helpers/handle-client-error.d.ts +2 -5
- package/build/ts/server/authenticate/admin/helpers/handle-client-error.d.ts.map +1 -1
- package/build/ts/server/authenticate/admin/helpers/handle-client-error.js +6 -5
- package/build/ts/server/authenticate/admin/helpers/handle-client-error.js.map +1 -1
- package/build/ts/server/authenticate/admin/helpers/redirect-to-bounce-page.d.ts.map +1 -1
- package/build/ts/server/authenticate/admin/helpers/redirect-to-bounce-page.js +4 -2
- package/build/ts/server/authenticate/admin/helpers/redirect-to-bounce-page.js.map +1 -1
- package/build/ts/server/authenticate/admin/helpers/redirect-with-exitiframe.js.map +1 -1
- package/build/ts/server/authenticate/admin/helpers/redirect.js +0 -3
- package/build/ts/server/authenticate/admin/helpers/redirect.js.map +1 -1
- package/build/ts/server/authenticate/admin/helpers/render-app-bridge.js.map +1 -1
- package/build/ts/server/authenticate/admin/helpers/trigger-after-auth-hook.d.ts +2 -1
- package/build/ts/server/authenticate/admin/helpers/trigger-after-auth-hook.d.ts.map +1 -1
- package/build/ts/server/authenticate/admin/helpers/trigger-after-auth-hook.js +2 -2
- package/build/ts/server/authenticate/admin/helpers/trigger-after-auth-hook.js.map +1 -1
- package/build/ts/server/authenticate/admin/helpers/validate-shop-and-host-params.js.map +1 -1
- package/build/ts/server/authenticate/admin/strategies/auth-code-flow.d.ts +4 -2
- package/build/ts/server/authenticate/admin/strategies/auth-code-flow.d.ts.map +1 -1
- package/build/ts/server/authenticate/admin/strategies/auth-code-flow.js +27 -7
- package/build/ts/server/authenticate/admin/strategies/auth-code-flow.js.map +1 -1
- package/build/ts/server/authenticate/admin/strategies/token-exchange.d.ts +17 -0
- package/build/ts/server/authenticate/admin/strategies/token-exchange.d.ts.map +1 -0
- package/build/ts/server/authenticate/admin/strategies/token-exchange.js +163 -0
- package/build/ts/server/authenticate/admin/strategies/token-exchange.js.map +1 -0
- package/build/ts/server/authenticate/admin/strategies/types.d.ts +16 -5
- package/build/ts/server/authenticate/admin/strategies/types.d.ts.map +1 -1
- package/build/ts/server/authenticate/admin/types.d.ts +0 -4
- package/build/ts/server/authenticate/admin/types.d.ts.map +1 -1
- package/build/ts/server/authenticate/const.d.ts +3 -0
- package/build/ts/server/authenticate/const.d.ts.map +1 -1
- package/build/ts/server/authenticate/const.js +4 -1
- package/build/ts/server/authenticate/const.js.map +1 -1
- package/build/ts/server/authenticate/helpers/add-response-headers.js.map +1 -1
- package/build/ts/server/authenticate/helpers/ensure-cors-headers.js.map +1 -1
- package/build/ts/server/authenticate/helpers/idempotent-promise-handler.d.ts +12 -0
- package/build/ts/server/authenticate/helpers/idempotent-promise-handler.d.ts.map +1 -0
- package/build/ts/server/authenticate/helpers/idempotent-promise-handler.js +53 -0
- package/build/ts/server/authenticate/helpers/idempotent-promise-handler.js.map +1 -0
- package/build/ts/server/authenticate/helpers/index.d.ts +1 -0
- package/build/ts/server/authenticate/helpers/index.d.ts.map +1 -1
- package/build/ts/server/authenticate/helpers/index.js +1 -0
- package/build/ts/server/authenticate/helpers/index.js.map +1 -1
- package/build/ts/server/authenticate/helpers/reject-bot-request.js.map +1 -1
- package/build/ts/server/authenticate/helpers/respond-to-invalid-session-token.d.ts +9 -0
- package/build/ts/server/authenticate/helpers/respond-to-invalid-session-token.d.ts.map +1 -0
- package/build/ts/server/authenticate/helpers/respond-to-invalid-session-token.js +20 -0
- package/build/ts/server/authenticate/helpers/respond-to-invalid-session-token.js.map +1 -0
- package/build/ts/server/authenticate/helpers/respond-to-options-request.js.map +1 -1
- package/build/ts/server/authenticate/login/login.d.ts.map +1 -1
- package/build/ts/server/authenticate/login/login.js +6 -2
- package/build/ts/server/authenticate/login/login.js.map +1 -1
- package/build/ts/server/authenticate/public/appProxy/authenticate.js.map +1 -1
- package/build/ts/server/authenticate/public/checkout/authenticate.js.map +1 -1
- package/build/ts/server/authenticate/public/factory.js.map +1 -1
- package/build/ts/server/authenticate/webhooks/authenticate.js.map +1 -1
- package/build/ts/server/authenticate/webhooks/register.d.ts +1 -1
- package/build/ts/server/authenticate/webhooks/register.d.ts.map +1 -1
- package/build/ts/server/authenticate/webhooks/register.js +20 -1
- package/build/ts/server/authenticate/webhooks/register.js.map +1 -1
- package/build/ts/server/authenticate/webhooks/types.d.ts +12 -5
- package/build/ts/server/authenticate/webhooks/types.d.ts.map +1 -1
- package/build/ts/server/boundary/error.js.map +1 -1
- package/build/ts/server/boundary/headers.js.map +1 -1
- package/build/ts/server/clients/admin/graphql.d.ts +3 -3
- package/build/ts/server/clients/admin/graphql.d.ts.map +1 -1
- package/build/ts/server/clients/admin/graphql.js +5 -8
- package/build/ts/server/clients/admin/graphql.js.map +1 -1
- package/build/ts/server/clients/admin/rest.js.map +1 -1
- package/build/ts/server/clients/admin/types.d.ts +2 -1
- package/build/ts/server/clients/admin/types.d.ts.map +1 -1
- package/build/ts/server/clients/storefront/factory.d.ts.map +1 -1
- package/build/ts/server/clients/storefront/factory.js +5 -8
- package/build/ts/server/clients/storefront/factory.js.map +1 -1
- package/build/ts/server/clients/storefront/types.d.ts +2 -1
- package/build/ts/server/clients/storefront/types.d.ts.map +1 -1
- package/build/ts/server/clients/types.d.ts +4 -7
- package/build/ts/server/clients/types.d.ts.map +1 -1
- package/build/ts/server/config-types.d.ts +2 -0
- package/build/ts/server/config-types.d.ts.map +1 -1
- package/build/ts/server/future/flags.d.ts +6 -0
- package/build/ts/server/future/flags.d.ts.map +1 -1
- package/build/ts/server/override-logger.js.map +1 -1
- package/build/ts/server/shopify-app.d.ts +1 -0
- package/build/ts/server/shopify-app.d.ts.map +1 -1
- package/build/ts/server/shopify-app.js +11 -5
- package/build/ts/server/shopify-app.js.map +1 -1
- package/build/ts/server/types.d.ts +10 -4
- package/build/ts/server/types.d.ts.map +1 -1
- package/build/ts/server/types.js +2 -2
- package/build/ts/server/types.js.map +1 -1
- package/build/ts/server/unauthenticated/admin/factory.js.map +1 -1
- package/build/ts/server/unauthenticated/storefront/factory.js.map +1 -1
- package/build/ts/server/version.d.ts +1 -1
- package/build/ts/server/version.js +1 -1
- package/package.json +14 -16
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { StorefrontOperations } from '@shopify/storefront-api-client';
|
|
1
2
|
import { GraphQLClient } from '../types';
|
|
2
3
|
export interface StorefrontContext {
|
|
3
4
|
/**
|
|
@@ -24,6 +25,6 @@ export interface StorefrontContext {
|
|
|
24
25
|
* }
|
|
25
26
|
* ```
|
|
26
27
|
*/
|
|
27
|
-
graphql: GraphQLClient
|
|
28
|
+
graphql: GraphQLClient<StorefrontOperations>;
|
|
28
29
|
}
|
|
29
30
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/server/clients/storefront/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AAEvC,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,OAAO,EAAE,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/server/clients/storefront/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AAEvC,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,OAAO,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;CAC9C"}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
+
import type { AllOperations, ReturnData, FetchResponseBody, ApiClientRequestOptions, ResponseWithType } from '@shopify/admin-api-client';
|
|
1
2
|
import { ApiVersion } from '@shopify/shopify-api';
|
|
2
|
-
interface
|
|
3
|
-
[
|
|
4
|
-
}
|
|
5
|
-
export interface GraphQLQueryOptions {
|
|
6
|
-
variables?: QueryVariables;
|
|
3
|
+
export interface GraphQLQueryOptions<Operation extends keyof Operations, Operations extends AllOperations> {
|
|
4
|
+
variables?: ApiClientRequestOptions<Operation, Operations>['variables'];
|
|
7
5
|
apiVersion?: ApiVersion;
|
|
8
6
|
headers?: {
|
|
9
7
|
[key: string]: any;
|
|
10
8
|
};
|
|
11
9
|
tries?: number;
|
|
12
10
|
}
|
|
13
|
-
export type GraphQLClient = (query:
|
|
14
|
-
export {};
|
|
11
|
+
export type GraphQLClient<Operations extends AllOperations> = <Operation extends keyof Operations>(query: Operation, options?: GraphQLQueryOptions<Operation, Operations>) => Promise<ResponseWithType<FetchResponseBody<ReturnData<Operation, Operations>>>>;
|
|
15
12
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/server/clients/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAEhD,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/server/clients/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAEhD,MAAM,WAAW,mBAAmB,CAClC,SAAS,SAAS,MAAM,UAAU,EAClC,UAAU,SAAS,aAAa;IAEhC,SAAS,CAAC,EAAE,uBAAuB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,WAAW,CAAC,CAAC;IACxE,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,OAAO,CAAC,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,aAAa,CAAC,UAAU,SAAS,aAAa,IAAI,CAC5D,SAAS,SAAS,MAAM,UAAU,EAElC,KAAK,EAAE,SAAS,EAChB,OAAO,CAAC,EAAE,mBAAmB,CAAC,SAAS,EAAE,UAAU,CAAC,KACjD,OAAO,CACV,gBAAgB,CAAC,iBAAiB,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,CACvE,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { SessionStorage } from '@shopify/shopify-app-session-storage';
|
|
|
3
3
|
import type { FutureFlagOptions, FutureFlags } from './future/flags';
|
|
4
4
|
import type { AppDistribution } from './types';
|
|
5
5
|
import type { AdminApiContext } from './clients';
|
|
6
|
+
import { IdempotentPromiseHandler } from './authenticate/helpers/idempotent-promise-handler';
|
|
6
7
|
export interface AppConfigArg<Resources extends ShopifyRestResources = ShopifyRestResources, Storage extends SessionStorage = SessionStorage, Future extends FutureFlagOptions = FutureFlagOptions> extends Omit<ApiConfigArg<Resources>, 'hostName' | 'hostScheme' | 'isEmbeddedApp' | 'apiVersion' | 'isCustomStoreApp' | 'future'> {
|
|
7
8
|
/**
|
|
8
9
|
* The URL your app is running on.
|
|
@@ -201,6 +202,7 @@ export interface AppConfig<Storage extends SessionStorage = SessionStorage> exte
|
|
|
201
202
|
useOnlineTokens: boolean;
|
|
202
203
|
hooks: HooksConfig;
|
|
203
204
|
future: FutureFlags;
|
|
205
|
+
idempotentPromiseHandler: IdempotentPromiseHandler;
|
|
204
206
|
}
|
|
205
207
|
export interface AuthConfig {
|
|
206
208
|
path: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-types.d.ts","sourceRoot":"","sources":["../../../src/server/config-types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,IAAI,YAAY,EAC5B,eAAe,IAAI,SAAS,EAC5B,oBAAoB,EACpB,OAAO,EACP,UAAU,EACV,cAAc,EACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAC,cAAc,EAAC,MAAM,sCAAsC,CAAC;AAEpE,OAAO,KAAK,EA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G,oBAAoB;IAErD,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;CAC3B"}
|
|
@@ -11,6 +11,12 @@ export interface FutureFlags {
|
|
|
11
11
|
* @default false
|
|
12
12
|
*/
|
|
13
13
|
v3_authenticatePublic?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* When enabled, embedded apps will fetch access tokens via token exchange. This assumes app are using declarative scopes with Shopify managing installs.
|
|
16
|
+
*
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
unstable_newEmbeddedAuthStrategy?: boolean;
|
|
14
20
|
}
|
|
15
21
|
export type FutureFlagOptions = FutureFlags | undefined;
|
|
16
22
|
export type FeatureEnabled<Future extends FutureFlagOptions, Flag extends keyof FutureFlags> = Future extends FutureFlags ? Future[Flag] extends true ? true : false : false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../../../../src/server/future/flags.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../../../../src/server/future/flags.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;OAIG;IACH,gCAAgC,CAAC,EAAE,OAAO,CAAC;CAC5C;AAED,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,SAAS,CAAC;AAExD,MAAM,MAAM,cAAc,CACxB,MAAM,SAAS,iBAAiB,EAChC,IAAI,SAAS,MAAM,WAAW,IAC5B,MAAM,SAAS,WAAW,GAC1B,MAAM,CAAC,IAAI,CAAC,SAAS,IAAI,GACvB,IAAI,GACJ,KAAK,GACP,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"override-logger.js","sourceRoot":"","sources":["../../../src/server/override-logger.ts"],"names":[],"mappings":";;;;AAAA,0DAA4B;AAC5B,oDAAqE;AAErE,qCAAwD;AAExD,+CAA+C;AAC/C,mGAAmG;AACnG,mFAAmF;AACnF,SAAgB,cAAc,CAAC,MAAyB;IACtD,IAAM,WAAW,GAAG,EAAC,OAAO,EAAE,aAAa,EAAC,CAAC;IAE7C,IAAM,eAAe,GAAiC,UACpD,OAAO,EACP,OAAY;QAAZ,wBAAA,EAAA,YAAY;QACT,OAAA,MAAM,CAAC,OAAO,CAAC,OAAO,wCAAM,WAAW,GAAK,OAAO,EAAE;IAArD,CAAqD,CAAC;IAE3D,SAAS,UAAU,CAAC,eAA6C;QAC/D,OAAO,UAAU,OAAe,EAAE,OAAe;YAC/C,IAAI,gBAAM,CAAC,GAAG,CAAC,uCAA6B,EAAE,OAAO,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"override-logger.js","sourceRoot":"","sources":["../../../src/server/override-logger.ts"],"names":[],"mappings":";;;;AAAA,0DAA4B;AAC5B,oDAAqE;AAErE,qCAAwD;AAExD,+CAA+C;AAC/C,mGAAmG;AACnG,mFAAmF;AACnF,SAAgB,cAAc,CAAC,MAAyB;IACtD,IAAM,WAAW,GAAG,EAAC,OAAO,EAAE,aAAa,EAAC,CAAC;IAE7C,IAAM,eAAe,GAAiC,UACpD,OAAO,EACP,OAAY;QAAZ,wBAAA,EAAA,YAAY;QACT,OAAA,MAAM,CAAC,OAAO,CAAC,OAAO,wCAAM,WAAW,GAAK,OAAO,EAAE;IAArD,CAAqD,CAAC;IAE3D,SAAS,UAAU,CAAC,eAA6C;QAC/D,OAAO,UAAU,OAAe,EAAE,OAAe;YAC/C,IAAI,gBAAM,CAAC,GAAG,CAAC,uCAA6B,EAAE,OAAO,CAAC,E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AAY,EAAC,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAIL,KAAK,UAAU,EAKhB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"shopify-app.d.ts","sourceRoot":"","sources":["../../../src/server/shopify-app.ts"],"names":[],"mappings":"AAAA,OAAO,uCAAuC,CAAC;AAC/C,OAAO,EAIL,oBAAoB,EAErB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAC,cAAc,EAAC,MAAM,sCAAsC,CAAC;AAEpE,OAAO,EAAiB,KAAK,YAAY,EAAC,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAIL,KAAK,UAAU,EAKhB,MAAM,SAAS,CAAC;AAejB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,UAAU,CACxB,MAAM,SAAS,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,EAC/C,SAAS,SAAS,oBAAoB,EACtC,OAAO,SAAS,cAAc,EAC9B,SAAS,EAAE,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAgDvC"}
|
|
@@ -16,6 +16,8 @@ var admin_1 = require("./unauthenticated/admin");
|
|
|
16
16
|
var public_1 = require("./authenticate/public");
|
|
17
17
|
var storefront_1 = require("./unauthenticated/storefront");
|
|
18
18
|
var auth_code_flow_1 = require("./authenticate/admin/strategies/auth-code-flow");
|
|
19
|
+
var token_exchange_1 = require("./authenticate/admin/strategies/token-exchange");
|
|
20
|
+
var idempotent_promise_handler_1 = require("./authenticate/helpers/idempotent-promise-handler");
|
|
19
21
|
/**
|
|
20
22
|
* Creates an object your app will use to interact with Shopify.
|
|
21
23
|
*
|
|
@@ -25,6 +27,7 @@ var auth_code_flow_1 = require("./authenticate/admin/strategies/auth-code-flow")
|
|
|
25
27
|
* @example
|
|
26
28
|
* <caption>The minimum viable configuration</caption>
|
|
27
29
|
* ```ts
|
|
30
|
+
* // /shopify.server.ts
|
|
28
31
|
* import { shopifyApp } from "@shopify/shopify-app-remix/server";
|
|
29
32
|
*
|
|
30
33
|
* const shopify = shopifyApp({
|
|
@@ -44,8 +47,9 @@ function shopifyApp(appConfig) {
|
|
|
44
47
|
api.webhooks.addHandlers(appConfig.webhooks);
|
|
45
48
|
}
|
|
46
49
|
var params = { api: api, config: config, logger: logger };
|
|
47
|
-
var
|
|
48
|
-
|
|
50
|
+
var authStrategy = (0, authenticate_1.authStrategyFactory)(tslib_1.__assign(tslib_1.__assign({}, params), { strategy: config.future.unstable_newEmbeddedAuthStrategy && config.isEmbeddedApp
|
|
51
|
+
? new token_exchange_1.TokenExchangeStrategy(params)
|
|
52
|
+
: new auth_code_flow_1.AuthCodeFlowStrategy(params) }));
|
|
49
53
|
var shopify = {
|
|
50
54
|
sessionStorage: config.sessionStorage,
|
|
51
55
|
addDocumentResponseHeaders: (0, helpers_1.addDocumentResponseHeadersFactory)(params),
|
|
@@ -74,7 +78,7 @@ function isSingleMerchantApp(_shopify, config) {
|
|
|
74
78
|
return config.distribution === types_1.AppDistribution.SingleMerchant;
|
|
75
79
|
}
|
|
76
80
|
function deriveApi(appConfig) {
|
|
77
|
-
var _a, _b;
|
|
81
|
+
var _a, _b, _c;
|
|
78
82
|
var appUrl;
|
|
79
83
|
try {
|
|
80
84
|
appUrl = new URL(appConfig.appUrl);
|
|
@@ -92,7 +96,9 @@ function deriveApi(appConfig) {
|
|
|
92
96
|
if (appConfig.userAgentPrefix) {
|
|
93
97
|
userAgentPrefix = "".concat(appConfig.userAgentPrefix, " | ").concat(userAgentPrefix);
|
|
94
98
|
}
|
|
95
|
-
return (0, shopify_api_1.shopifyApi)(tslib_1.__assign(tslib_1.__assign({}, appConfig), { hostName: appUrl.host, hostScheme: appUrl.protocol.replace(':', ''), userAgentPrefix: userAgentPrefix, isEmbeddedApp: (_a = appConfig.isEmbeddedApp) !== null && _a !== void 0 ? _a : true, apiVersion: (_b = appConfig.apiVersion) !== null && _b !== void 0 ? _b : shopify_api_1.LATEST_API_VERSION, isCustomStoreApp: appConfig.distribution === types_1.AppDistribution.ShopifyAdmin, future: {
|
|
99
|
+
return (0, shopify_api_1.shopifyApi)(tslib_1.__assign(tslib_1.__assign({}, appConfig), { hostName: appUrl.host, hostScheme: appUrl.protocol.replace(':', ''), userAgentPrefix: userAgentPrefix, isEmbeddedApp: (_a = appConfig.isEmbeddedApp) !== null && _a !== void 0 ? _a : true, apiVersion: (_b = appConfig.apiVersion) !== null && _b !== void 0 ? _b : shopify_api_1.LATEST_API_VERSION, isCustomStoreApp: appConfig.distribution === types_1.AppDistribution.ShopifyAdmin, future: {
|
|
100
|
+
unstable_tokenExchange: (_c = appConfig.future) === null || _c === void 0 ? void 0 : _c.unstable_newEmbeddedAuthStrategy,
|
|
101
|
+
} }));
|
|
96
102
|
}
|
|
97
103
|
function deriveConfig(appConfig, apiConfig) {
|
|
98
104
|
var _a, _b, _c, _d;
|
|
@@ -101,7 +107,7 @@ function deriveConfig(appConfig, apiConfig) {
|
|
|
101
107
|
}
|
|
102
108
|
var authPathPrefix = appConfig.authPathPrefix || '/auth';
|
|
103
109
|
appConfig.distribution = (_a = appConfig.distribution) !== null && _a !== void 0 ? _a : types_1.AppDistribution.AppStore;
|
|
104
|
-
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, appConfig), apiConfig), { canUseLoginForm: appConfig.distribution !== types_1.AppDistribution.ShopifyAdmin, useOnlineTokens: (_b = appConfig.useOnlineTokens) !== null && _b !== void 0 ? _b : false, hooks: (_c = appConfig.hooks) !== null && _c !== void 0 ? _c : {}, sessionStorage: appConfig.sessionStorage, future: (_d = appConfig.future) !== null && _d !== void 0 ? _d : {}, auth: {
|
|
110
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, appConfig), apiConfig), { idempotentPromiseHandler: new idempotent_promise_handler_1.IdempotentPromiseHandler(), canUseLoginForm: appConfig.distribution !== types_1.AppDistribution.ShopifyAdmin, useOnlineTokens: (_b = appConfig.useOnlineTokens) !== null && _b !== void 0 ? _b : false, hooks: (_c = appConfig.hooks) !== null && _c !== void 0 ? _c : {}, sessionStorage: appConfig.sessionStorage, future: (_d = appConfig.future) !== null && _d !== void 0 ? _d : {}, auth: {
|
|
105
111
|
path: authPathPrefix,
|
|
106
112
|
callbackPath: "".concat(authPathPrefix, "/callback"),
|
|
107
113
|
patchSessionTokenPath: "".concat(authPathPrefix, "/session-token"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shopify-app.js","sourceRoot":"","sources":["../../../src/server/shopify-app.ts"],"names":[],"mappings":";;;;AAAA,iDAA+C;AAC/C,oDAM8B;AAI9B,iCASiB;AACjB,qCAAwD;AACxD,oDAAgE;AAChE,kEAAsE;AACtE,qEAAgF;AAChF,qDAAiD;AACjD,kDAAyE;AACzE,oDAAwD;AACxD,iDAA2E;AAC3E,gDAAgE;AAChE,2DAAqF;AACrF,iFAAoF;
|
|
1
|
+
{"version":3,"file":"shopify-app.js","sourceRoot":"","sources":["../../../src/server/shopify-app.ts"],"names":[],"mappings":";;;;AAAA,iDAA+C;AAC/C,oDAM8B;AAI9B,iCASiB;AACjB,qCAAwD;AACxD,oDAAgE;AAChE,kEAAsE;AACtE,qEAAgF;AAChF,qDAAiD;AACjD,kDAAyE;AACzE,oDAAwD;AACxD,iDAA2E;AAC3E,gDAAgE;AAChE,2DAAqF;AACrF,iFAAoF;AACpF,iFAAqF;AACrF,gGAA2F;AAE3F;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,UAAU,CAIxB,SAAiB;IACjB,IAAM,GAAG,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;IACjC,IAAM,MAAM,GAAG,YAAY,CAAU,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5D,IAAM,MAAM,GAAG,IAAA,gCAAc,EAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAE1C,IAAI,SAAS,CAAC,QAAQ,EAAE,CAAC;QACvB,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,CAA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B;;IAEpB,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC;QAC9B,MAAM,IAAI,0BAAY,CACpB,qJAAqJ,CACtJ,CAAC;IACJ,CAAC;IAED,IAAM,cAAc,GAAG,SAAS,CAAC,cAAc,IAAI,OAAO,CAAC;IAC3D,SAAS,CAAC,YAAY,GAAG,MAAA,SAAS,CAAC,YAAY,mCAAI,uBAAe,CAAC,QAAQ,CAAC;IAE5E,8DACK,SAAS,GACT,SAAS,KACZ,wBAAwB,EAAE,IAAI,qDAAwB,EAAE,EACxD,eAAe,EAAE,SAAS,CAAC,YAAY,KAAK,uBAAe,CAAC,YAAY,EACxE,eAAe,EAAE,MAAA,SAAS,CAAC,eAAe,mCAAI,KAAK,EACnD,KAAK,EAAE,MAAA,SAAS,CAAC,KAAK,mCAAI,EAAE,EAC5B,cAAc,EAAE,SAAS,CAAC,cAAyB,EACnD,MAAM,EAAE,MAAA,SAAS,CAAC,MAAM,mCAAI,EAAE,EAC9B,IAAI,EAAE;YACJ,IAAI,EAAE,cAAc;YACpB,YAAY,EAAE,UAAG,cAAc,cAAW;YAC1C,qBAAqB,EAAE,UAAG,cAAc,mBAAgB;YACxD,cAAc,EAAE,UAAG,cAAc,iBAAc;YAC/C,SAAS,EAAE,UAAG,cAAc,WAAQ;SACrC,IACD;AACJ,CAAC"}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import { RegisterReturn, Shopify, ShopifyRestResources } from '@shopify/shopify-api';
|
|
1
|
+
import { ConfigParams, RegisterReturn, Shopify, ShopifyRestResources } from '@shopify/shopify-api';
|
|
2
2
|
import { SessionStorage } from '@shopify/shopify-app-session-storage';
|
|
3
3
|
import type { AppConfig, AppConfigArg } from './config-types';
|
|
4
4
|
import type { AuthenticateWebhook, RegisterWebhooksOptions } from './authenticate/webhooks/types';
|
|
5
5
|
import type { AuthenticatePublic } from './authenticate/public/types';
|
|
6
6
|
import type { AdminContext } from './authenticate/admin/types';
|
|
7
7
|
import type { Unauthenticated } from './unauthenticated/types';
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import { FutureFlagOptions, FutureFlags } from './future/flags';
|
|
9
|
+
export interface BasicParams<Future extends FutureFlagOptions = FutureFlagOptions> {
|
|
10
|
+
api: Shopify<ApiConfigWithFutureFlags<Future>, ShopifyRestResources, ApiFutureFlags<Future>>;
|
|
10
11
|
config: AppConfig;
|
|
11
12
|
logger: Shopify['logger'];
|
|
12
13
|
}
|
|
14
|
+
export interface ApiFutureFlags<Future extends FutureFlagOptions> {
|
|
15
|
+
unstable_tokenExchange?: Future extends FutureFlags ? Future['unstable_newEmbeddedAuthStrategy'] : boolean;
|
|
16
|
+
}
|
|
17
|
+
export type ApiConfigWithFutureFlags<Future extends FutureFlagOptions> = ConfigParams<ShopifyRestResources, ApiFutureFlags<Future>>;
|
|
13
18
|
export type JSONValue = string | number | boolean | null | JSONObject | JSONArray;
|
|
14
19
|
export declare enum AppDistribution {
|
|
15
20
|
AppStore = "app_store",
|
|
@@ -22,7 +27,7 @@ interface JSONObject {
|
|
|
22
27
|
}
|
|
23
28
|
interface JSONArray extends Array<JSONValue> {
|
|
24
29
|
}
|
|
25
|
-
type RegisterWebhooks = (options: RegisterWebhooksOptions) => Promise<RegisterReturn>;
|
|
30
|
+
type RegisterWebhooks = (options: RegisterWebhooksOptions) => Promise<RegisterReturn | void>;
|
|
26
31
|
export declare enum LoginErrorType {
|
|
27
32
|
MissingShop = "MISSING_SHOP",
|
|
28
33
|
InvalidShop = "INVALID_SHOP"
|
|
@@ -219,6 +224,7 @@ export interface ShopifyAppBase<Config extends AppConfigArg> {
|
|
|
219
224
|
* <caption>Registering webhooks after install</caption>
|
|
220
225
|
* <description>Trigger the registration to create the webhook subscriptions after a merchant installs your app using the `afterAuth` hook. Learn more about [subscribing to webhooks.](/docs/api/shopify-app-remix/v1/guide-webhooks)</description>
|
|
221
226
|
* ```ts
|
|
227
|
+
* // /app/shopify.server.ts
|
|
222
228
|
* import { DeliveryMethod, shopifyApp } from "@shopify/shopify-app-remix/server";
|
|
223
229
|
*
|
|
224
230
|
* const shopify = shopifyApp({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/server/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,OAAO,EACP,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAC,cAAc,EAAC,MAAM,sCAAsC,CAAC;AAEpE,OAAO,KAAK,EAAC,SAAS,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5D,OAAO,KAAK,EACV,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/server/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,OAAO,EACP,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAC,cAAc,EAAC,MAAM,sCAAsC,CAAC;AAEpE,OAAO,KAAK,EAAC,SAAS,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5D,OAAO,KAAK,EACV,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAC,iBAAiB,EAAE,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAE9D,MAAM,WAAW,WAAW,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] = "app_store";
|
|
9
9
|
AppDistribution["SingleMerchant"] = "single_merchant";
|
|
10
10
|
AppDistribution["ShopifyAdmin"] = "shopify_admin";
|
|
11
|
-
})(AppDistribution
|
|
11
|
+
})(AppDistribution || (exports.AppDistribution = AppDistribution = {}));
|
|
12
12
|
var LoginErrorType;
|
|
13
13
|
(function (LoginErrorType) {
|
|
14
14
|
LoginErrorType["MissingShop"] = "MISSING_SHOP";
|
|
15
15
|
LoginErrorType["InvalidShop"] = "INVALID_SHOP";
|
|
16
|
-
})(LoginErrorType
|
|
16
|
+
})(LoginErrorType || (exports.LoginErrorType = LoginErrorType = {}));
|
|
17
17
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/server/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/server/types.ts"],"names":[],"mappings":";;;AA+CA,+CAA+C;AAC/C,sFAAsF;AACtF,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,yCAAsB,CAAA;IACtB,qDAAkC,CAAA;IAClC,iDAA8B,CAAA;AAChC,CAAC,EAJW,eAAe,+BAAf,eAAe,QAI1B;AAiBD,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,8CAA4B,CAAA;IAC5B,8CAA4B,CAAA;AAC9B,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../../../src/server/unauthenticated/admin/factory.ts"],"names":[],"mappings":";;;;AAAA,oDAAwE;AAGxE,6CAAuD;AACvD,sCAA6C;AAI7C,SAAgB,kCAAkC,CAEhD,MAAmB;IAFrB,iBAmBC;IAhBC,OAAO,UACL,IAAY;;;;wBAEI,qBAAM,IAAA,2BAAiB,EAAC,IAAI,EAAE,MAAM,CAAC,EAAA;;oBAA/C,OAAO,GAAG,SAAqC;oBAErD,IAAI,CAAC,OAAO,EAAE;
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../../../src/server/unauthenticated/admin/factory.ts"],"names":[],"mappings":";;;;AAAA,oDAAwE;AAGxE,6CAAuD;AACvD,sCAA6C;AAI7C,SAAgB,kCAAkC,CAEhD,MAAmB;IAFrB,iBAmBC;IAhBC,OAAO,UACL,IAAY;;;;wBAEI,qBAAM,IAAA,2BAAiB,EAAC,IAAI,EAAE,MAAM,CAAC,EAAA;;oBAA/C,OAAO,GAAG,SAAqC;oBAErD,IAAI,CAAC,OAAO,EAAE,CAAC;wBACb,MAAM,IAAI,0BAAY,CACpB,4CAAqC,IAAI,iDAA8C,CACxF,CAAC;oBACJ,CAAC;oBAED,sBAAO;4BACL,OAAO,SAAA;4BACP,KAAK,EAAE,IAAA,0BAAkB,EAAY,EAAC,MAAM,QAAA,EAAE,OAAO,SAAA,EAAC,CAAC;yBACxD,EAAC;;;SACH,CAAC;AACJ,CAAC;AAnBD,gFAmBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../../../src/server/unauthenticated/storefront/factory.ts"],"names":[],"mappings":";;;;AAAA,oDAAkD;AAGlD,uDAAiE;AACjE,sCAA6C;AAO7C,SAAgB,uCAAuC,CACrD,MAAmB;IADrB,iBAiBC;IAdC,OAAO,UAAO,IAAY;;;;wBACR,qBAAM,IAAA,2BAAiB,EAAC,IAAI,EAAE,MAAM,CAAC,EAAA;;oBAA/C,OAAO,GAAG,SAAqC;oBAErD,IAAI,CAAC,OAAO,EAAE;
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../../../src/server/unauthenticated/storefront/factory.ts"],"names":[],"mappings":";;;;AAAA,oDAAkD;AAGlD,uDAAiE;AACjE,sCAA6C;AAO7C,SAAgB,uCAAuC,CACrD,MAAmB;IADrB,iBAiBC;IAdC,OAAO,UAAO,IAAY;;;;wBACR,qBAAM,IAAA,2BAAiB,EAAC,IAAI,EAAE,MAAM,CAAC,EAAA;;oBAA/C,OAAO,GAAG,SAAqC;oBAErD,IAAI,CAAC,OAAO,EAAE,CAAC;wBACb,MAAM,IAAI,0BAAY,CACpB,4CAAqC,IAAI,sDAAmD,CAC7F,CAAC;oBACJ,CAAC;oBAED,sBAAO;4BACL,OAAO,SAAA;4BACP,UAAU,EAAE,IAAA,oCAAuB,EAAC,EAAC,MAAM,QAAA,EAAE,OAAO,SAAA,EAAC,CAAC;yBACvD,EAAC;;;SACH,CAAC;AACJ,CAAC;AAjBD,0FAiBC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SHOPIFY_REMIX_LIBRARY_VERSION = "2.
|
|
1
|
+
export declare const SHOPIFY_REMIX_LIBRARY_VERSION = "2.4.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopify/shopify-app-remix",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Shopify Remix - to simplify the building of Shopify Apps with Remix",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -50,29 +50,27 @@
|
|
|
50
50
|
"Storefront API"
|
|
51
51
|
],
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@remix-run/react": "^2.
|
|
54
|
-
"@shopify/generate-docs": "^0.
|
|
53
|
+
"@remix-run/react": "^2.5.0",
|
|
54
|
+
"@shopify/generate-docs": "^0.13.1",
|
|
55
55
|
"@shopify/polaris": "^11.8.0",
|
|
56
56
|
"@shopify/react-testing": "^5.1.3",
|
|
57
|
-
"@shopify/shopify-app-session-storage-memory": "^2.0.
|
|
58
|
-
"@types/
|
|
59
|
-
"@types/jsonwebtoken": "^9.0.2",
|
|
57
|
+
"@shopify/shopify-app-session-storage-memory": "^2.0.4",
|
|
58
|
+
"@types/jsonwebtoken": "^9.0.5",
|
|
60
59
|
"@types/react": "^18.2.18",
|
|
61
|
-
"@types/semver": "^7.
|
|
62
|
-
"jest": "^29.5.0",
|
|
60
|
+
"@types/semver": "^7.5.6",
|
|
63
61
|
"jest-fetch-mock": "^3.0.3",
|
|
64
|
-
"jsonwebtoken": "^9.0.
|
|
62
|
+
"jsonwebtoken": "^9.0.2",
|
|
65
63
|
"react": "^18.2.0",
|
|
66
|
-
"react-dom": "^18.2.0"
|
|
67
|
-
"ts-jest": "^29.1.0"
|
|
64
|
+
"react-dom": "^18.2.0"
|
|
68
65
|
},
|
|
69
66
|
"dependencies": {
|
|
70
67
|
"@remix-run/server-runtime": "^2.0.0",
|
|
71
|
-
"@shopify/
|
|
72
|
-
"@shopify/shopify-
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
68
|
+
"@shopify/admin-api-client": "^0.2.1",
|
|
69
|
+
"@shopify/shopify-api": "^9.0.2",
|
|
70
|
+
"@shopify/shopify-app-session-storage": "^2.0.4",
|
|
71
|
+
"@shopify/storefront-api-client": "^0.2.1",
|
|
72
|
+
"isbot": "^3.7.1",
|
|
73
|
+
"semver": "^7.5.4"
|
|
76
74
|
},
|
|
77
75
|
"peerDependencies": {
|
|
78
76
|
"@remix-run/react": "*",
|