@shopify/shopify-app-remix 2.8.2 → 3.0.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/dist/cjs/server/authenticate/admin/billing/cancel.js +4 -2
- package/dist/cjs/server/authenticate/admin/billing/cancel.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/billing/check.js +4 -2
- package/dist/cjs/server/authenticate/admin/billing/check.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/billing/request.js +4 -2
- package/dist/cjs/server/authenticate/admin/billing/request.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/billing/require.js +4 -2
- package/dist/cjs/server/authenticate/admin/billing/require.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/strategies/auth-code-flow.js +3 -0
- package/dist/cjs/server/authenticate/admin/strategies/auth-code-flow.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/strategies/token-exchange.js +7 -2
- package/dist/cjs/server/authenticate/admin/strategies/token-exchange.js.map +1 -1
- package/dist/cjs/server/authenticate/helpers/idempotent-promise-handler.js +1 -0
- package/dist/cjs/server/authenticate/helpers/idempotent-promise-handler.js.map +1 -1
- package/dist/cjs/server/authenticate/helpers/invalidate-access-token.js +11 -0
- package/dist/cjs/server/authenticate/helpers/invalidate-access-token.js.map +1 -0
- package/dist/cjs/server/authenticate/public/appProxy/authenticate.js +4 -0
- package/dist/cjs/server/authenticate/public/appProxy/authenticate.js.map +1 -1
- package/dist/cjs/server/authenticate/public/checkout/authenticate.js +2 -25
- package/dist/cjs/server/authenticate/public/checkout/authenticate.js.map +1 -1
- package/dist/cjs/server/authenticate/public/customer-account/authenticate.js +10 -0
- package/dist/cjs/server/authenticate/public/customer-account/authenticate.js.map +1 -0
- package/dist/cjs/server/authenticate/public/extension/authenticate.js +33 -0
- package/dist/cjs/server/authenticate/public/extension/authenticate.js.map +1 -0
- package/dist/cjs/server/authenticate/public/factory.js +7 -14
- package/dist/cjs/server/authenticate/public/factory.js.map +1 -1
- package/dist/cjs/server/authenticate/webhooks/authenticate.js +6 -26
- package/dist/cjs/server/authenticate/webhooks/authenticate.js.map +1 -1
- package/dist/cjs/server/clients/admin/rest.js +4 -1
- package/dist/cjs/server/clients/admin/rest.js.map +1 -1
- package/dist/cjs/server/future/flags.js +0 -10
- package/dist/cjs/server/future/flags.js.map +1 -1
- package/dist/cjs/server/index.js +4 -0
- package/dist/cjs/server/index.js.map +1 -1
- package/dist/cjs/server/shopify-app.js +3 -1
- package/dist/cjs/server/shopify-app.js.map +1 -1
- package/dist/cjs/server/version.js +1 -1
- package/dist/esm/react/components/AppProvider/AppProvider.mjs +1 -1
- package/dist/esm/server/authenticate/admin/billing/cancel.mjs +4 -2
- package/dist/esm/server/authenticate/admin/billing/cancel.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/billing/check.mjs +4 -2
- package/dist/esm/server/authenticate/admin/billing/check.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/billing/request.mjs +4 -2
- package/dist/esm/server/authenticate/admin/billing/request.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/billing/require.mjs +4 -2
- package/dist/esm/server/authenticate/admin/billing/require.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/strategies/auth-code-flow.mjs +3 -0
- package/dist/esm/server/authenticate/admin/strategies/auth-code-flow.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/strategies/token-exchange.mjs +7 -2
- package/dist/esm/server/authenticate/admin/strategies/token-exchange.mjs.map +1 -1
- package/dist/esm/server/authenticate/helpers/idempotent-promise-handler.mjs +1 -0
- package/dist/esm/server/authenticate/helpers/idempotent-promise-handler.mjs.map +1 -1
- package/dist/esm/server/authenticate/helpers/invalidate-access-token.mjs +9 -0
- package/dist/esm/server/authenticate/helpers/invalidate-access-token.mjs.map +1 -0
- package/dist/esm/server/authenticate/public/appProxy/authenticate.mjs +4 -0
- package/dist/esm/server/authenticate/public/appProxy/authenticate.mjs.map +1 -1
- package/dist/esm/server/authenticate/public/checkout/authenticate.mjs +2 -25
- package/dist/esm/server/authenticate/public/checkout/authenticate.mjs.map +1 -1
- package/dist/esm/server/authenticate/public/customer-account/authenticate.mjs +8 -0
- package/dist/esm/server/authenticate/public/customer-account/authenticate.mjs.map +1 -0
- package/dist/esm/server/authenticate/public/extension/authenticate.mjs +31 -0
- package/dist/esm/server/authenticate/public/extension/authenticate.mjs.map +1 -0
- package/dist/esm/server/authenticate/public/factory.mjs +7 -14
- package/dist/esm/server/authenticate/public/factory.mjs.map +1 -1
- package/dist/esm/server/authenticate/webhooks/authenticate.mjs +6 -26
- package/dist/esm/server/authenticate/webhooks/authenticate.mjs.map +1 -1
- package/dist/esm/server/clients/admin/rest.mjs +4 -1
- package/dist/esm/server/clients/admin/rest.mjs.map +1 -1
- package/dist/esm/server/future/flags.mjs +0 -10
- package/dist/esm/server/future/flags.mjs.map +1 -1
- package/dist/esm/server/index.mjs +1 -1
- package/dist/esm/server/shopify-app.mjs +3 -1
- package/dist/esm/server/shopify-app.mjs.map +1 -1
- package/dist/esm/server/version.mjs +1 -1
- package/dist/ts/react/components/AppProvider/AppProvider.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/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/types.d.ts +44 -82
- package/dist/ts/server/authenticate/admin/billing/types.d.ts.map +1 -1
- package/dist/ts/server/authenticate/admin/strategies/token-exchange.d.ts.map +1 -1
- package/dist/ts/server/authenticate/fulfillment-service/types.d.ts +4 -3
- package/dist/ts/server/authenticate/fulfillment-service/types.d.ts.map +1 -1
- package/dist/ts/server/authenticate/helpers/index.d.ts +1 -0
- package/dist/ts/server/authenticate/helpers/index.d.ts.map +1 -1
- package/dist/ts/server/authenticate/helpers/invalidate-access-token.d.ts +4 -0
- package/dist/ts/server/authenticate/helpers/invalidate-access-token.d.ts.map +1 -0
- package/dist/ts/server/authenticate/public/appProxy/authenticate.d.ts.map +1 -1
- package/dist/ts/server/authenticate/public/checkout/authenticate.d.ts.map +1 -1
- package/dist/ts/server/authenticate/public/checkout/authenticate.public.checkout.doc.d.ts.map +1 -1
- package/dist/ts/server/authenticate/public/customer-account/authenticate.d.ts +4 -0
- package/dist/ts/server/authenticate/public/customer-account/authenticate.d.ts.map +1 -0
- package/dist/ts/server/authenticate/public/customer-account/authenticate.public.customerAccount.doc.d.ts +4 -0
- package/dist/ts/server/authenticate/public/customer-account/authenticate.public.customerAccount.doc.d.ts.map +1 -0
- package/dist/ts/server/authenticate/public/customer-account/types.d.ts +58 -0
- package/dist/ts/server/authenticate/public/customer-account/types.d.ts.map +1 -0
- package/dist/ts/server/authenticate/public/extension/authenticate.d.ts +4 -0
- package/dist/ts/server/authenticate/public/extension/authenticate.d.ts.map +1 -0
- package/dist/ts/server/authenticate/public/extension/types.d.ts +7 -0
- package/dist/ts/server/authenticate/public/extension/types.d.ts.map +1 -0
- package/dist/ts/server/authenticate/public/factory.d.ts +1 -2
- package/dist/ts/server/authenticate/public/factory.d.ts.map +1 -1
- package/dist/ts/server/authenticate/public/types.d.ts +21 -17
- package/dist/ts/server/authenticate/public/types.d.ts.map +1 -1
- package/dist/ts/server/authenticate/webhooks/authenticate.d.ts +1 -2
- package/dist/ts/server/authenticate/webhooks/authenticate.d.ts.map +1 -1
- package/dist/ts/server/authenticate/webhooks/authenticate.webhooks.doc.d.ts.map +1 -1
- package/dist/ts/server/authenticate/webhooks/types.d.ts +7 -45
- package/dist/ts/server/authenticate/webhooks/types.d.ts.map +1 -1
- package/dist/ts/server/future/flags.d.ts +2 -18
- package/dist/ts/server/future/flags.d.ts.map +1 -1
- package/dist/ts/server/index.d.ts +2 -1
- package/dist/ts/server/index.d.ts.map +1 -1
- package/dist/ts/server/shopify-app.d.ts.map +1 -1
- package/dist/ts/server/types-contexts.d.ts +35 -0
- package/dist/ts/server/types-contexts.d.ts.map +1 -0
- package/dist/ts/server/types.d.ts +2 -2
- package/dist/ts/server/types.d.ts.map +1 -1
- package/dist/ts/server/unauthenticated/storefront/types.d.ts +66 -0
- package/dist/ts/server/unauthenticated/storefront/types.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 -21
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Session,
|
|
1
|
+
import { Session, ShopifyRestResources } from '@shopify/shopify-api';
|
|
2
2
|
import type { AdminApiContext } from '../../clients';
|
|
3
|
-
import type { FeatureEnabled, FutureFlagOptions } from '../../future/flags';
|
|
4
3
|
export interface RegisterWebhooksOptions {
|
|
5
4
|
/**
|
|
6
5
|
* The Shopify session used to register webhooks using the Admin API.
|
|
@@ -129,14 +128,7 @@ export interface WebhookContextWithoutSession<Topics = string | number | symbol>
|
|
|
129
128
|
session: undefined;
|
|
130
129
|
admin: undefined;
|
|
131
130
|
}
|
|
132
|
-
export interface
|
|
133
|
-
/** A REST client. */
|
|
134
|
-
rest: InstanceType<Shopify['clients']['Rest']> & Resources;
|
|
135
|
-
/** A GraphQL client. */
|
|
136
|
-
graphql: InstanceType<Shopify['clients']['Graphql']>;
|
|
137
|
-
}
|
|
138
|
-
export type WebhookAdminContext<Future extends FutureFlagOptions, Resources extends ShopifyRestResources> = FeatureEnabled<Future, 'v3_webhookAdminContext'> extends true ? AdminApiContext<Resources> : LegacyWebhookAdminApiContext<Resources>;
|
|
139
|
-
export interface WebhookContextWithSession<Future extends FutureFlagOptions, Resources extends ShopifyRestResources, Topics = string | number | symbol> extends Context<Topics> {
|
|
131
|
+
export interface WebhookContextWithSession<Resources extends ShopifyRestResources, Topics = string | number | symbol> extends Context<Topics> {
|
|
140
132
|
/**
|
|
141
133
|
* A session with an offline token for the shop.
|
|
142
134
|
*
|
|
@@ -149,8 +141,8 @@ export interface WebhookContextWithSession<Future extends FutureFlagOptions, Res
|
|
|
149
141
|
* Returned only if there is a session for the shop.
|
|
150
142
|
*
|
|
151
143
|
* @example
|
|
152
|
-
* <caption>
|
|
153
|
-
* <description>
|
|
144
|
+
* <caption>Webhook admin context.</caption>
|
|
145
|
+
* <description>Use the `admin` object in the context to interact with the Admin API.</description>
|
|
154
146
|
* ```ts
|
|
155
147
|
* // /app/routes/webhooks.tsx
|
|
156
148
|
* import { ActionFunctionArgs } from "@remix-run/node";
|
|
@@ -175,40 +167,10 @@ export interface WebhookContextWithSession<Future extends FutureFlagOptions, Res
|
|
|
175
167
|
* return json({ data: productData.data });
|
|
176
168
|
* }
|
|
177
169
|
* ```
|
|
178
|
-
*
|
|
179
|
-
* @example
|
|
180
|
-
* <caption>Webhook admin context.</caption>
|
|
181
|
-
* <description>Use the `admin` object in the context to interact with the Admin API. This format will be removed in V3 of the package.</description>
|
|
182
|
-
* ```ts
|
|
183
|
-
* // /app/routes/webhooks.tsx
|
|
184
|
-
* import { json, ActionFunctionArgs } from "@remix-run/node";
|
|
185
|
-
* import { authenticate } from "../shopify.server";
|
|
186
|
-
*
|
|
187
|
-
* export async function action({ request }: ActionFunctionArgs) {
|
|
188
|
-
* const { admin } = await authenticate.webhook(request);
|
|
189
|
-
*
|
|
190
|
-
* const response = await admin?.graphql.query<any>({
|
|
191
|
-
* data: {
|
|
192
|
-
* query: `#graphql
|
|
193
|
-
* mutation populateProduct($input: ProductInput!) {
|
|
194
|
-
* productCreate(input: $input) {
|
|
195
|
-
* product {
|
|
196
|
-
* id
|
|
197
|
-
* }
|
|
198
|
-
* }
|
|
199
|
-
* }`,
|
|
200
|
-
* variables: { input: { title: "Product Name" } },
|
|
201
|
-
* },
|
|
202
|
-
* });
|
|
203
|
-
*
|
|
204
|
-
* const productData = response?.body.data;
|
|
205
|
-
* return json({ data: productData.data });
|
|
206
|
-
* }
|
|
207
|
-
* ```
|
|
208
170
|
*/
|
|
209
|
-
admin:
|
|
171
|
+
admin: AdminApiContext<Resources>;
|
|
210
172
|
}
|
|
211
|
-
export type WebhookContext<
|
|
212
|
-
export type AuthenticateWebhook<
|
|
173
|
+
export type WebhookContext<Resources extends ShopifyRestResources, Topics = string | number | symbol> = WebhookContextWithoutSession<Topics> | WebhookContextWithSession<Resources, Topics>;
|
|
174
|
+
export type AuthenticateWebhook<Resources extends ShopifyRestResources, Topics = string | number | symbol> = (request: Request) => Promise<WebhookContext<Resources, Topics>>;
|
|
213
175
|
export {};
|
|
214
176
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/server/authenticate/webhooks/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/server/authenticate/webhooks/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AAEnE,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAEnD,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,UAAU,OAAO,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM;IACjD;;;;;;;;;;;;;;;;OAgBG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;;;;;;;;;;;OAgBG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE7B;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,4BAA4B,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAC7E,SAAQ,OAAO,CAAC,MAAM,CAAC;IACvB,OAAO,EAAE,SAAS,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,WAAW,yBAAyB,CACxC,SAAS,SAAS,oBAAoB,EACtC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CACjC,SAAQ,OAAO,CAAC,MAAM,CAAC;IACvB;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,KAAK,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;CACnC;AAED,MAAM,MAAM,cAAc,CACxB,SAAS,SAAS,oBAAoB,EACtC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,IAE/B,4BAA4B,CAAC,MAAM,CAAC,GACpC,yBAAyB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AAEjD,MAAM,MAAM,mBAAmB,CAC7B,SAAS,SAAS,oBAAoB,EACtC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,IAC/B,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,cAAc,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC"}
|
|
@@ -1,22 +1,6 @@
|
|
|
1
1
|
import type { ConfigParams, Shopify, ShopifyRestResources } from '@shopify/shopify-api';
|
|
2
2
|
import { AppConfig } from '../config-types';
|
|
3
3
|
export interface FutureFlags {
|
|
4
|
-
/**
|
|
5
|
-
* When enabled, returns the same `admin` context (`AdminApiContext`) from `authenticate.webhook` that is returned from `authenticate.admin`.
|
|
6
|
-
*
|
|
7
|
-
* @default false
|
|
8
|
-
*/
|
|
9
|
-
v3_webhookAdminContext?: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* When enabled authenticate.public() will not work. Use authenticate.public.checkout() instead.
|
|
12
|
-
*
|
|
13
|
-
* @default false
|
|
14
|
-
*/
|
|
15
|
-
v3_authenticatePublic?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* When enabled allows you to pass billing plans with line items when creating a new app subscriptions.
|
|
18
|
-
*/
|
|
19
|
-
v3_lineItemBilling?: boolean;
|
|
20
4
|
/**
|
|
21
5
|
* When enabled, embedded apps will fetch access tokens via [token exchange](https://shopify.dev/docs/apps/auth/get-access-tokens/token-exchange).
|
|
22
6
|
* This assumes the app has scopes declared for [Shopify managing installation](https://shopify.dev/docs/apps/auth/installation#shopify-managed-installation).
|
|
@@ -27,8 +11,8 @@ export interface FutureFlags {
|
|
|
27
11
|
*/
|
|
28
12
|
unstable_newEmbeddedAuthStrategy?: boolean;
|
|
29
13
|
}
|
|
30
|
-
export interface ApiFutureFlags<
|
|
31
|
-
lineItemBilling:
|
|
14
|
+
export interface ApiFutureFlags<_Future extends FutureFlagOptions> {
|
|
15
|
+
lineItemBilling: true;
|
|
32
16
|
}
|
|
33
17
|
export type ApiConfigWithFutureFlags<Future extends FutureFlagOptions> = ConfigParams<ShopifyRestResources, ApiFutureFlags<Future>>;
|
|
34
18
|
export type FutureFlagOptions = FutureFlags | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../../../../src/server/future/flags.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../../../../src/server/future/flags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,OAAO,EACP,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAI1C,MAAM,WAAW,WAAW;IAC1B;;;;;;;OAOG;IACH,gCAAgC,CAAC,EAAE,OAAO,CAAC;CAC5C;AAID,MAAM,WAAW,cAAc,CAAC,OAAO,SAAS,iBAAiB;IAE/D,eAAe,EAAE,IAAI,CAAC;CACvB;AAED,MAAM,MAAM,wBAAwB,CAAC,MAAM,SAAS,iBAAiB,IACnE,YAAY,CAAC,oBAAoB,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;AAE7D,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;AAEV,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,QAY1B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import '@shopify/shopify-api/adapters/web-api';
|
|
2
|
-
export { LATEST_API_VERSION, LogSeverity, DeliveryMethod, BillingInterval, ApiVersion, } from '@shopify/shopify-api';
|
|
2
|
+
export { LATEST_API_VERSION, LogSeverity, DeliveryMethod, BillingInterval, ApiVersion, JwtPayload, Session, } from '@shopify/shopify-api';
|
|
3
|
+
export type * from './types-contexts';
|
|
3
4
|
export type { ShopifyApp, LoginError } from './types';
|
|
4
5
|
export { LoginErrorType, AppDistribution } from './types';
|
|
5
6
|
export { boundary } from './boundary';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,uCAAuC,CAAC;AAO/C,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,eAAe,EACf,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,uCAAuC,CAAC;AAO/C,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,eAAe,EACf,UAAU,EACV,UAAU,EACV,OAAO,GACR,MAAM,sBAAsB,CAAC;AAE9B,mBAAmB,kBAAkB,CAAC;AACtC,YAAY,EAAC,UAAU,EAAE,UAAU,EAAC,MAAM,SAAS,CAAC;AACpD,OAAO,EAAC,cAAc,EAAE,eAAe,EAAC,MAAM,SAAS,CAAC;AACxD,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,cAAc,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
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,EAEL,KAAK,WAAW,EAEhB,KAAK,UAAU,EAKhB,MAAM,SAAS,CAAC;AAgBjB,OAAO,EAAC,iBAAiB,EAAyB,MAAM,gBAAgB,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,UAAU,CACxB,MAAM,SAAS,YAAY,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,EACvD,SAAS,SAAS,oBAAoB,EACtC,OAAO,SAAS,cAAc,EAC9B,MAAM,SAAS,iBAAiB,GAAG,MAAM,CAAC,QAAQ,CAAC,EACnD,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,MAAM,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,EAEL,KAAK,WAAW,EAEhB,KAAK,UAAU,EAKhB,MAAM,SAAS,CAAC;AAgBjB,OAAO,EAAC,iBAAiB,EAAyB,MAAM,gBAAgB,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,UAAU,CACxB,MAAM,SAAS,YAAY,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,EACvD,SAAS,SAAS,oBAAoB,EACtC,OAAO,SAAS,cAAc,EAC9B,MAAM,SAAS,iBAAiB,GAAG,MAAM,CAAC,QAAQ,CAAC,EACnD,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,CAoDjD;AAkBD,wBAAgB,SAAS,CAAC,SAAS,EAAE,YAAY,GAAG,WAAW,CAAC,KAAK,CAAC,CAoCrE"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { AppConfigArg } from './config-types';
|
|
2
|
+
import type { MandatoryTopics, ShopifyApp } from './types';
|
|
3
|
+
import type { AdminContext as IAdminContext } from './authenticate/admin/types';
|
|
4
|
+
import type { UnauthenticatedAdminContext as IUnauthenticatedAdminContext } from './unauthenticated/admin/types';
|
|
5
|
+
import type { UnauthenticatedStorefrontContext as IUnauthenticatedStorefrontContext } from './unauthenticated/storefront/types';
|
|
6
|
+
import type { WebhookContext as IWebhookContext } from './authenticate/webhooks/types';
|
|
7
|
+
import type { FlowContext as IFlowContext } from './authenticate/flow/types';
|
|
8
|
+
import type { FulfillmentServiceContext as IFulfillmentServiceContext } from './authenticate/fulfillment-service/types';
|
|
9
|
+
import type { AppProxyContext as IAppProxyContext, AppProxyContextWithSession as IAppProxyContextWithSession } from './authenticate/public/appProxy/types';
|
|
10
|
+
import type { CheckoutContext as ICheckoutContext } from './authenticate/public/checkout/types';
|
|
11
|
+
import type { CustomerAccountContext as ICustomerAccountContext } from './authenticate/public/customer-account/types';
|
|
12
|
+
import type { AdminApiContext as IAdminApiContext, StorefrontContext as IStorefrontContext } from './clients';
|
|
13
|
+
type ShopifyConfig<App> = App extends ShopifyApp<infer Config extends AppConfigArg> ? Config : never;
|
|
14
|
+
type ConfigComponents<Config> = Config extends AppConfigArg<infer Resources, infer Storage, infer Future> ? {
|
|
15
|
+
resources: Resources;
|
|
16
|
+
storage: Storage;
|
|
17
|
+
future: Future;
|
|
18
|
+
} : never;
|
|
19
|
+
type DefaultApp = ShopifyApp<AppConfigArg>;
|
|
20
|
+
export type UnauthenticatedAdminContext<App = DefaultApp> = IUnauthenticatedAdminContext<ConfigComponents<ShopifyConfig<App>>['resources']>;
|
|
21
|
+
export type AdminContext<App = DefaultApp> = IAdminContext<ShopifyConfig<App>, ConfigComponents<ShopifyConfig<App>>['resources']>;
|
|
22
|
+
export type UnauthenticatedStorefrontContext<_App = DefaultApp> = IUnauthenticatedStorefrontContext;
|
|
23
|
+
export type FlowContext<App = DefaultApp> = IFlowContext<ConfigComponents<ShopifyConfig<App>>['resources']>;
|
|
24
|
+
export type FulfillmentServiceContext<App = DefaultApp> = IFulfillmentServiceContext<ConfigComponents<ShopifyConfig<App>>['resources']>;
|
|
25
|
+
export type AppProxyContext<_App = DefaultApp> = IAppProxyContext | IAppProxyContextWithSession;
|
|
26
|
+
export type CheckoutContext<_App = DefaultApp> = ICheckoutContext;
|
|
27
|
+
export type CustomerAccountContext<_App = DefaultApp> = ICustomerAccountContext;
|
|
28
|
+
export type WebhookContext<App = DefaultApp> = IWebhookContext<ConfigComponents<ShopifyConfig<App>>['resources'], keyof ShopifyConfig<App>['webhooks'] | MandatoryTopics>;
|
|
29
|
+
export type AdminApiContext<App = DefaultApp> = IAdminApiContext<ConfigComponents<ShopifyConfig<App>>['resources']>;
|
|
30
|
+
export type AdminRestClient<App = DefaultApp> = AdminApiContext<App>['rest'];
|
|
31
|
+
export type AdminGraphqlClient<App = DefaultApp> = AdminApiContext<App>['graphql'];
|
|
32
|
+
export type StorefrontApiContext<_App = DefaultApp> = IStorefrontContext;
|
|
33
|
+
export type StorefrontGraphqlClient<App = DefaultApp> = StorefrontApiContext<App>['graphql'];
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=types-contexts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-contexts.d.ts","sourceRoot":"","sources":["../../../src/server/types-contexts.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAC,eAAe,EAAE,UAAU,EAAC,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,EAAC,YAAY,IAAI,aAAa,EAAC,MAAM,4BAA4B,CAAC;AAC9E,OAAO,KAAK,EAAC,2BAA2B,IAAI,4BAA4B,EAAC,MAAM,+BAA+B,CAAC;AAC/G,OAAO,KAAK,EAAC,gCAAgC,IAAI,iCAAiC,EAAC,MAAM,oCAAoC,CAAC;AAC9H,OAAO,KAAK,EAAC,cAAc,IAAI,eAAe,EAAC,MAAM,+BAA+B,CAAC;AACrF,OAAO,KAAK,EAAC,WAAW,IAAI,YAAY,EAAC,MAAM,2BAA2B,CAAC;AAC3E,OAAO,KAAK,EAAC,yBAAyB,IAAI,0BAA0B,EAAC,MAAM,0CAA0C,CAAC;AACtH,OAAO,KAAK,EACV,eAAe,IAAI,gBAAgB,EACnC,0BAA0B,IAAI,2BAA2B,EAC1D,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAC,eAAe,IAAI,gBAAgB,EAAC,MAAM,sCAAsC,CAAC;AAC9F,OAAO,KAAK,EAAC,sBAAsB,IAAI,uBAAuB,EAAC,MAAM,8CAA8C,CAAC;AACpH,OAAO,KAAK,EACV,eAAe,IAAI,gBAAgB,EACnC,iBAAiB,IAAI,kBAAkB,EACxC,MAAM,WAAW,CAAC;A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I,gBAAgB,CAAC;AAElE,MAAM,MAAM,sBAAsB,CAAC,IAAI,GAAG,UAAU,IAAI,uBAAuB,CAAC;AAEhF,MAAM,MAAM,cAAc,CAAC,GAAG,GAAG,UAAU,IAAI,eAAe,CAC5D,gBAAgB,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,EACjD,MAAM,aAAa,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,GAAG,eAAe,CACvD,CAAC;AAGF,MAAM,MAAM,eAAe,CAAC,GAAG,GAAG,UAAU,IAAI,gBAAgB,CAC9D,gBAAgB,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,CAClD,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,GAAG,GAAG,UAAU,IAAI,eAAe,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7E,MAAM,MAAM,kBAAkB,CAAC,GAAG,GAAG,UAAU,IAC7C,eAAe,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC;AAGlC,MAAM,MAAM,oBAAoB,CAAC,IAAI,GAAG,UAAU,IAAI,kBAAkB,CAAC;AAEzE,MAAM,MAAM,uBAAuB,CAAC,GAAG,GAAG,UAAU,IAClD,oBAAoB,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -157,7 +157,7 @@ interface Authenticate<Config extends AppConfigArg> {
|
|
|
157
157
|
* }
|
|
158
158
|
* ```
|
|
159
159
|
*/
|
|
160
|
-
public: AuthenticatePublic
|
|
160
|
+
public: AuthenticatePublic;
|
|
161
161
|
/**
|
|
162
162
|
* Authenticate a Shopify webhook request, get back an authenticated admin context and details on the webhook request
|
|
163
163
|
*
|
|
@@ -211,7 +211,7 @@ interface Authenticate<Config extends AppConfigArg> {
|
|
|
211
211
|
* };
|
|
212
212
|
* ```
|
|
213
213
|
*/
|
|
214
|
-
webhook: AuthenticateWebhook<
|
|
214
|
+
webhook: AuthenticateWebhook<RestResourcesType<Config>, keyof Config['webhooks'] | MandatoryTopics>;
|
|
215
215
|
}
|
|
216
216
|
export interface ShopifyAppBase<Config extends AppConfigArg> {
|
|
217
217
|
/**
|
|
@@ -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,iBAAiB,EAAC,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EACV,wBAAwB,EACxB,cAAc,EACd,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAC,8BAA8B,EAAC,MAAM,0CAA0C,CAAC;AAExF,MAAM,WAAW,WAAW,CAC1B,MAAM,SAAS,iBAAiB,GAAG,iBAAiB;IAEpD,GAAG,EAAE,OAAO,CACV,wBAAwB,CAAC,MAAM,CAAC,EAChC,oBAAoB,EACpB,cAAc,CAAC,MAAM,CAAC,CACvB,CAAC;IACF,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC3B;AAID,oBAAY,eAAe;IACzB,QAAQ,cAAc;IACtB,cAAc,oBAAoB;IAClC,YAAY,kBAAkB;CAC/B;AAED,MAAM,MAAM,eAAe,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AAc,GAC3D,iBAAiB,CAAC,MAAM,CAAC,GACzB,MAAM,CAAC,cAAc,CAAC,SAAS,eAAe,CAAC,QAAQ,GACrD,WAAW,CAAC,MAAM,CAAC,GACnB,WAAW,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -27,6 +27,72 @@ export interface UnauthenticatedStorefrontContext {
|
|
|
27
27
|
session: Session;
|
|
28
28
|
/**
|
|
29
29
|
* Method for interacting with the Shopify GraphQL Storefront API for the given store.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* <caption>Querying the GraphQL API.</caption>
|
|
33
|
+
* <description>Use `storefront.graphql` to make query / mutation requests.</description>
|
|
34
|
+
* ```ts
|
|
35
|
+
* // app/routes/**\/.ts
|
|
36
|
+
* import { json } from "@remix-run/node";
|
|
37
|
+
* import { authenticate } from "../shopify.server";
|
|
38
|
+
*
|
|
39
|
+
* export async function action({ request }: ActionFunctionArgs) {
|
|
40
|
+
* const shop = getShopFromExternalRequest(request);
|
|
41
|
+
* const { storefront } = await unauthenticated.storefront(shop);
|
|
42
|
+
*
|
|
43
|
+
* const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);
|
|
44
|
+
*
|
|
45
|
+
* return json(await response.json());
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* <caption>Handling GraphQL errors.</caption>
|
|
51
|
+
* <description>Catch `GraphqlQueryError` errors to see error messages from the API.</description>
|
|
52
|
+
* ```ts
|
|
53
|
+
* // /app/routes/**\/*.ts
|
|
54
|
+
* import { ActionFunctionArgs } from "@remix-run/node";
|
|
55
|
+
* import { authenticate } from "../shopify.server";
|
|
56
|
+
*
|
|
57
|
+
* export const action = async ({ request }: ActionFunctionArgs) => {
|
|
58
|
+
* const shop = getShopFromExternalRequest(request);
|
|
59
|
+
* const { storefront } = await unauthenticated.storefront(shop);
|
|
60
|
+
*
|
|
61
|
+
* try {
|
|
62
|
+
* const response = await storefront.graphql(
|
|
63
|
+
* `#graphql
|
|
64
|
+
* query incorrectQuery {
|
|
65
|
+
* products(first: 10) {
|
|
66
|
+
* nodes {
|
|
67
|
+
* not_a_field
|
|
68
|
+
* }
|
|
69
|
+
* }
|
|
70
|
+
* }`,
|
|
71
|
+
* );
|
|
72
|
+
*
|
|
73
|
+
* return json({ data: await response.json() });
|
|
74
|
+
* } catch (error) {
|
|
75
|
+
* if (error instanceof GraphqlQueryError) {
|
|
76
|
+
* // { errors: { graphQLErrors: [
|
|
77
|
+
* // { message: "Field 'not_a_field' doesn't exist on type 'Product'" }
|
|
78
|
+
* // ] } }
|
|
79
|
+
* return json({ errors: error.body?.errors }, { status: 500 });
|
|
80
|
+
* }
|
|
81
|
+
* return json({ message: "An error occurred" }, { status: 500 });
|
|
82
|
+
* }
|
|
83
|
+
* }
|
|
84
|
+
* ```
|
|
85
|
+
*
|
|
86
|
+
* ```ts
|
|
87
|
+
* // /app/shopify.server.ts
|
|
88
|
+
* import { shopifyApp } from "@shopify/shopify-app-remix/server";
|
|
89
|
+
*
|
|
90
|
+
* const shopify = shopifyApp({
|
|
91
|
+
* // ...
|
|
92
|
+
* });
|
|
93
|
+
* export default shopify;
|
|
94
|
+
* export const unauthenticated = shopify.unauthenticated;
|
|
95
|
+
* ```
|
|
30
96
|
*/
|
|
31
97
|
storefront: StorefrontContext;
|
|
32
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/server/unauthenticated/storefront/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAE7C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAErD,MAAM,WAAW,gCAAgC;IAC/C;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/server/unauthenticated/storefront/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAE7C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAErD,MAAM,WAAW,gCAAgC;IAC/C;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoEG;IACH,UAAU,EAAE,iBAAiB,CAAC;CAC/B;AAED,MAAM,MAAM,mCAAmC,GAAG,CAChD,IAAI,EAAE,MAAM,KACT,OAAO,CAAC,gCAAgC,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SHOPIFY_REMIX_LIBRARY_VERSION = "
|
|
1
|
+
export declare const SHOPIFY_REMIX_LIBRARY_VERSION = "3.0.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|