@shopify/shopify-app-remix 1.0.0-rc.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.
Files changed (161) hide show
  1. package/LICENSE.md +9 -0
  2. package/README.md +373 -0
  3. package/build/cjs/adapters/node/index.js +13 -0
  4. package/build/cjs/auth/admin/authenticate.js +599 -0
  5. package/build/cjs/auth/admin/graphql-client.js +57 -0
  6. package/build/cjs/auth/admin/rest-client.js +124 -0
  7. package/build/cjs/auth/const.js +17 -0
  8. package/build/cjs/auth/helpers/add-response-headers.js +69 -0
  9. package/build/cjs/auth/helpers/begin-auth.js +18 -0
  10. package/build/cjs/auth/helpers/get-session-token-header.js +10 -0
  11. package/build/cjs/auth/helpers/handle-client-error.js +37 -0
  12. package/build/cjs/auth/helpers/redirect-to-auth-page.js +22 -0
  13. package/build/cjs/auth/helpers/redirect-with-app-bridge-headers.js +31 -0
  14. package/build/cjs/auth/helpers/redirect-with-exitiframe.js +23 -0
  15. package/build/cjs/auth/helpers/reject-bot-request.js +23 -0
  16. package/build/cjs/auth/helpers/validate-session-token.js +25 -0
  17. package/build/cjs/auth/login/login.js +54 -0
  18. package/build/cjs/auth/public/authenticate.js +32 -0
  19. package/build/cjs/auth/webhooks/authenticate.js +68 -0
  20. package/build/cjs/auth/webhooks/register.js +40 -0
  21. package/build/cjs/billing/cancel.js +40 -0
  22. package/build/cjs/billing/request.js +83 -0
  23. package/build/cjs/billing/require.js +47 -0
  24. package/build/cjs/index.js +140 -0
  25. package/build/cjs/override-logger.js +55 -0
  26. package/build/cjs/types.js +25 -0
  27. package/build/cjs/version.js +7 -0
  28. package/build/ts/adapters/node/index.d.ts +2 -0
  29. package/build/ts/adapters/node/index.d.ts.map +1 -0
  30. package/build/ts/adapters/node/index.js +10 -0
  31. package/build/ts/adapters/node/index.js.map +1 -0
  32. package/build/ts/auth/admin/authenticate.d.ts +32 -0
  33. package/build/ts/auth/admin/authenticate.d.ts.map +1 -0
  34. package/build/ts/auth/admin/authenticate.js +571 -0
  35. package/build/ts/auth/admin/authenticate.js.map +1 -0
  36. package/build/ts/auth/admin/graphql-client.d.ts +22 -0
  37. package/build/ts/auth/admin/graphql-client.d.ts.map +1 -0
  38. package/build/ts/auth/admin/graphql-client.js +53 -0
  39. package/build/ts/auth/admin/graphql-client.js.map +1 -0
  40. package/build/ts/auth/admin/rest-client.d.ts +34 -0
  41. package/build/ts/auth/admin/rest-client.d.ts.map +1 -0
  42. package/build/ts/auth/admin/rest-client.js +134 -0
  43. package/build/ts/auth/admin/rest-client.js.map +1 -0
  44. package/build/ts/auth/admin/types.d.ts +100 -0
  45. package/build/ts/auth/admin/types.d.ts.map +1 -0
  46. package/build/ts/auth/admin/types.js +3 -0
  47. package/build/ts/auth/admin/types.js.map +1 -0
  48. package/build/ts/auth/const.d.ts +9 -0
  49. package/build/ts/auth/const.d.ts.map +1 -0
  50. package/build/ts/auth/const.js +12 -0
  51. package/build/ts/auth/const.js.map +1 -0
  52. package/build/ts/auth/helpers/add-response-headers.d.ts +5 -0
  53. package/build/ts/auth/helpers/add-response-headers.d.ts.map +1 -0
  54. package/build/ts/auth/helpers/add-response-headers.js +60 -0
  55. package/build/ts/auth/helpers/add-response-headers.js.map +1 -0
  56. package/build/ts/auth/helpers/begin-auth.d.ts +3 -0
  57. package/build/ts/auth/helpers/begin-auth.d.ts.map +1 -0
  58. package/build/ts/auth/helpers/begin-auth.js +24 -0
  59. package/build/ts/auth/helpers/begin-auth.js.map +1 -0
  60. package/build/ts/auth/helpers/get-session-token-header.d.ts +2 -0
  61. package/build/ts/auth/helpers/get-session-token-header.d.ts.map +1 -0
  62. package/build/ts/auth/helpers/get-session-token-header.js +9 -0
  63. package/build/ts/auth/helpers/get-session-token-header.js.map +1 -0
  64. package/build/ts/auth/helpers/handle-client-error.d.ts +11 -0
  65. package/build/ts/auth/helpers/handle-client-error.d.ts.map +1 -0
  66. package/build/ts/auth/helpers/handle-client-error.js +40 -0
  67. package/build/ts/auth/helpers/handle-client-error.js.map +1 -0
  68. package/build/ts/auth/helpers/index.d.ts +8 -0
  69. package/build/ts/auth/helpers/index.d.ts.map +1 -0
  70. package/build/ts/auth/helpers/index.js +18 -0
  71. package/build/ts/auth/helpers/index.js.map +1 -0
  72. package/build/ts/auth/helpers/redirect-to-auth-page.d.ts +3 -0
  73. package/build/ts/auth/helpers/redirect-to-auth-page.d.ts.map +1 -0
  74. package/build/ts/auth/helpers/redirect-to-auth-page.js +33 -0
  75. package/build/ts/auth/helpers/redirect-to-auth-page.js.map +1 -0
  76. package/build/ts/auth/helpers/redirect-with-app-bridge-headers.d.ts +4 -0
  77. package/build/ts/auth/helpers/redirect-with-app-bridge-headers.d.ts.map +1 -0
  78. package/build/ts/auth/helpers/redirect-with-app-bridge-headers.js +24 -0
  79. package/build/ts/auth/helpers/redirect-with-app-bridge-headers.js.map +1 -0
  80. package/build/ts/auth/helpers/redirect-with-exitiframe.d.ts +3 -0
  81. package/build/ts/auth/helpers/redirect-with-exitiframe.d.ts.map +1 -0
  82. package/build/ts/auth/helpers/redirect-with-exitiframe.js +18 -0
  83. package/build/ts/auth/helpers/redirect-with-exitiframe.js.map +1 -0
  84. package/build/ts/auth/helpers/reject-bot-request.d.ts +3 -0
  85. package/build/ts/auth/helpers/reject-bot-request.d.ts.map +1 -0
  86. package/build/ts/auth/helpers/reject-bot-request.js +14 -0
  87. package/build/ts/auth/helpers/reject-bot-request.js.map +1 -0
  88. package/build/ts/auth/helpers/validate-session-token.d.ts +4 -0
  89. package/build/ts/auth/helpers/validate-session-token.d.ts.map +1 -0
  90. package/build/ts/auth/helpers/validate-session-token.js +36 -0
  91. package/build/ts/auth/helpers/validate-session-token.js.map +1 -0
  92. package/build/ts/auth/login/login.d.ts +3 -0
  93. package/build/ts/auth/login/login.d.ts.map +1 -0
  94. package/build/ts/auth/login/login.js +56 -0
  95. package/build/ts/auth/login/login.js.map +1 -0
  96. package/build/ts/auth/public/authenticate.d.ts +4 -0
  97. package/build/ts/auth/public/authenticate.d.ts.map +1 -0
  98. package/build/ts/auth/public/authenticate.js +35 -0
  99. package/build/ts/auth/public/authenticate.js.map +1 -0
  100. package/build/ts/auth/public/types.d.ts +27 -0
  101. package/build/ts/auth/public/types.d.ts.map +1 -0
  102. package/build/ts/auth/public/types.js +3 -0
  103. package/build/ts/auth/public/types.js.map +1 -0
  104. package/build/ts/auth/webhooks/authenticate.d.ts +5 -0
  105. package/build/ts/auth/webhooks/authenticate.d.ts.map +1 -0
  106. package/build/ts/auth/webhooks/authenticate.js +71 -0
  107. package/build/ts/auth/webhooks/authenticate.js.map +1 -0
  108. package/build/ts/auth/webhooks/index.d.ts +2 -0
  109. package/build/ts/auth/webhooks/index.d.ts.map +1 -0
  110. package/build/ts/auth/webhooks/index.js +6 -0
  111. package/build/ts/auth/webhooks/index.js.map +1 -0
  112. package/build/ts/auth/webhooks/register.d.ts +4 -0
  113. package/build/ts/auth/webhooks/register.d.ts.map +1 -0
  114. package/build/ts/auth/webhooks/register.js +39 -0
  115. package/build/ts/auth/webhooks/register.js.map +1 -0
  116. package/build/ts/auth/webhooks/types.d.ts +18 -0
  117. package/build/ts/auth/webhooks/types.d.ts.map +1 -0
  118. package/build/ts/auth/webhooks/types.js +3 -0
  119. package/build/ts/auth/webhooks/types.js.map +1 -0
  120. package/build/ts/billing/cancel.d.ts +5 -0
  121. package/build/ts/billing/cancel.d.ts.map +1 -0
  122. package/build/ts/billing/cancel.js +43 -0
  123. package/build/ts/billing/cancel.js.map +1 -0
  124. package/build/ts/billing/index.d.ts +4 -0
  125. package/build/ts/billing/index.d.ts.map +1 -0
  126. package/build/ts/billing/index.js +10 -0
  127. package/build/ts/billing/index.js.map +1 -0
  128. package/build/ts/billing/request.d.ts +6 -0
  129. package/build/ts/billing/request.d.ts.map +1 -0
  130. package/build/ts/billing/request.js +84 -0
  131. package/build/ts/billing/request.js.map +1 -0
  132. package/build/ts/billing/require.d.ts +6 -0
  133. package/build/ts/billing/require.d.ts.map +1 -0
  134. package/build/ts/billing/require.js +55 -0
  135. package/build/ts/billing/require.js.map +1 -0
  136. package/build/ts/billing/types.d.ts +228 -0
  137. package/build/ts/billing/types.d.ts.map +1 -0
  138. package/build/ts/billing/types.js +3 -0
  139. package/build/ts/billing/types.js.map +1 -0
  140. package/build/ts/config-types.d.ts +325 -0
  141. package/build/ts/config-types.d.ts.map +1 -0
  142. package/build/ts/config-types.js +3 -0
  143. package/build/ts/config-types.js.map +1 -0
  144. package/build/ts/index.d.ts +29 -0
  145. package/build/ts/index.d.ts.map +1 -0
  146. package/build/ts/index.js +108 -0
  147. package/build/ts/index.js.map +1 -0
  148. package/build/ts/override-logger.d.ts +3 -0
  149. package/build/ts/override-logger.d.ts.map +1 -0
  150. package/build/ts/override-logger.js +40 -0
  151. package/build/ts/override-logger.js.map +1 -0
  152. package/build/ts/types.d.ts +353 -0
  153. package/build/ts/types.d.ts.map +1 -0
  154. package/build/ts/types.js +17 -0
  155. package/build/ts/types.js.map +1 -0
  156. package/build/ts/version.d.ts +2 -0
  157. package/build/ts/version.d.ts.map +1 -0
  158. package/build/ts/version.js +5 -0
  159. package/build/ts/version.js.map +1 -0
  160. package/build/tsconfig.tsbuildinfo +1 -0
  161. package/package.json +65 -0
@@ -0,0 +1,325 @@
1
+ import { ConfigParams as ApiConfigArg, ConfigInterface as ApiConfig, ShopifyRestResources, Session, ApiVersion, WebhookHandler } from '@shopify/shopify-api';
2
+ import { SessionStorage } from '@shopify/shopify-app-session-storage';
3
+ import type { GraphqlQueryFunction } from './auth/admin/graphql-client';
4
+ import type { RemixRestClient } from './auth/admin/rest-client';
5
+ import { AppDistribution } from './types';
6
+ export interface AppConfigArg<Resources extends ShopifyRestResources = ShopifyRestResources, Storage extends SessionStorage = SessionStorage> extends Omit<ApiConfigArg<Resources>, 'hostName' | 'hostScheme' | 'isEmbeddedApp' | 'apiVersion' | 'isCustomStoreApp'> {
7
+ /**
8
+ * The URL your app is running on.
9
+ *
10
+ * The `@shopify/cli` provides this URL as `process.env.SHOPIFY_APP_URL`. For development this is probably a tunnel URL that points to your local machine. If production this is your production URL.
11
+ */
12
+ appUrl: string;
13
+ /**
14
+ * An adaptor for storing sessions in your database of choice.
15
+ *
16
+ * Shopify provides multiple session storage adaptors and you can create your own. {@link https://github.com/Shopify/shopify-app-js/blob/main/README.md#session-storage-options}
17
+ *
18
+ * @example
19
+ * Using Prisma
20
+ * ```ts
21
+ * import { shopifyApp } from "@shopify/shopify-app-remix";
22
+ * import { PrismaSessionStorage } from "@shopify/shopify-app-session-storage-prisma";
23
+ *
24
+ * import prisma from "~/db.server";
25
+ *
26
+ * export const shopify = shopifyApp({
27
+ * // ... etc
28
+ * sessionStorage: new PrismaSessionStorage(prisma),
29
+ * });
30
+ * ```
31
+ */
32
+ sessionStorage: Storage;
33
+ /**
34
+ * Does your app use online or just offline tokens.
35
+ *
36
+ * If your app uses online tokens both online and offline tokens will be saved to your database. This ensures your app can perform background jobs
37
+ *
38
+ * {@link https://shopify.dev/docs/apps/auth/oauth/access-modes}
39
+ *
40
+ * @defaultValue `false`
41
+ */
42
+ useOnlineTokens?: boolean;
43
+ /**
44
+ * The config for the webhook topics your app would like to subscribe to.
45
+ *
46
+ * {@link https://shopify.dev/docs/apps/webhooks}
47
+ *
48
+ * This can be in used in conjunction with the afterAuth hook to register webhook topics when a user installs your app. Or you can use this function in other processes such as background jobs.
49
+ *
50
+ * @example
51
+ * Registering for a webhook when a merchant uninstalls your app.
52
+ * ```ts
53
+ * // app/shopify.server.ts
54
+ * import { DeliveryMethod, shopifyApp } from "@shopify/shopify-app-remix";
55
+ *
56
+ * export const shopify = shopifyApp({
57
+ * webhooks: {
58
+ * APP_UNINSTALLED: {
59
+ * deliveryMethod: DeliveryMethod.Http,
60
+ * callbackUrl: "/webhooks",
61
+ * },
62
+ * },
63
+ * hooks: {
64
+ * afterAuth: async ({ session }) => {
65
+ * shopify.registerWebhooks({ session });
66
+ * }
67
+ * },
68
+ * // ...etc
69
+ * });
70
+ *
71
+ * // app/routes/webhooks.jsx
72
+ * import { ActionArgs } from "@remix-run/node";
73
+ *
74
+ * import { shopify } from "../shopify.server";
75
+ * import db from "../db.server";
76
+ *
77
+ * export const action = async ({ request }: ActionArgs) => {
78
+ * const { topic, shop } = await shopify.authenticate.webhook(request);
79
+ *
80
+ * switch (topic) {
81
+ * case "APP_UNINSTALLED":
82
+ * await db.session.deleteMany({ where: { shop } });
83
+ * break;
84
+ * case "CUSTOMERS_DATA_REQUEST":
85
+ * case "CUSTOMERS_REDACT":
86
+ * case "SHOP_REDACT":
87
+ * default:
88
+ * throw new Response("Unhandled webhook topic", { status: 404 });
89
+ * }
90
+ * throw new Response();
91
+ * };
92
+ * ```
93
+ */
94
+ webhooks?: WebhookConfig;
95
+ /**
96
+ * Functions to call at key places during your apps lifecycle.
97
+ *
98
+ * These functions are called in the context of the request that triggered them. This means you can access the session.
99
+ *
100
+ * @example
101
+ * Seeding your database custom data when a merchant installs your app.
102
+ * ```ts
103
+ * import { DeliveryMethod, shopifyApp } from "@shopify/shopify-app-remix";
104
+ * import { seedStoreData } from "~/db/seeds"
105
+ *
106
+ * export const shopify = shopifyApp({
107
+ * hooks: {
108
+ * afterAuth: async ({ session }) => {
109
+ * seedStoreData({session})
110
+ * }
111
+ * },
112
+ * // ...etc
113
+ * });
114
+ * ```
115
+ */
116
+ hooks?: HooksConfig;
117
+ /**
118
+ * Does your app render embedded inside the Shopify Admin or on its own.
119
+ *
120
+ * Unless you have very specific needs, this should be true.
121
+ *
122
+ * @defaultValue `true`
123
+ */
124
+ isEmbeddedApp?: boolean;
125
+ /**
126
+ * How your app is distributed. Defaults to app store.
127
+ *
128
+ * {@link https://shopify.dev/docs/apps/distribution}
129
+ */
130
+ distribution?: AppDistribution;
131
+ /**
132
+ * What version of Shopify's Admin API's would you like to use.
133
+ *
134
+ * {@link https://shopify.dev/docs/api/}
135
+ *
136
+ * @defaultValue `LATEST_API_VERSION` from `@shopify/shopify-app-remix`
137
+ *
138
+ * @example
139
+ * Using the latest API Version (Recommended)
140
+ * ```ts
141
+ * import { LATEST_API_VERSION, shopifyApp } from "@shopify/shopify-app-remix";
142
+ *
143
+ * export const shopify = shopifyApp({
144
+ * // ...etc
145
+ * apiVersion: LATEST_API_VERSION,
146
+ * });
147
+ * ```
148
+ */
149
+ apiVersion?: ApiVersion;
150
+ /**
151
+ * A path that Shopify can reserve for auth related endpoints.
152
+ *
153
+ * This must match a $ route in your Remix app. That route must export a loader function that calls `shopify.authenticate.admin(request)`.
154
+ *
155
+ * @default `"/auth"`
156
+ *
157
+ * @example
158
+ * Using the latest API Version (Recommended)
159
+ * ```ts
160
+ * // app/shopify.server.ts
161
+ * import { LATEST_API_VERSION, shopifyApp } from "@shopify/shopify-app-remix";
162
+ *
163
+ * export const shopify = shopifyApp({
164
+ * // ...etc
165
+ * apiVersion: LATEST_API_VERSION,
166
+ * });
167
+ *
168
+ * // app/routes/auth/$.jsx
169
+ * import { LoaderArgs } from "@remix-run/node";
170
+ * import { shopify } from "../../shopify.server";
171
+ *
172
+ * export async function loader({ request }: LoaderArgs) {
173
+ * await shopify.authenticate.admin(request);
174
+ *
175
+ * return null
176
+ * }
177
+ * ```
178
+ */
179
+ authPathPrefix?: string;
180
+ }
181
+ export interface AppConfig<Storage extends SessionStorage = SessionStorage> extends ApiConfig {
182
+ canUseLoginForm: boolean;
183
+ appUrl: string;
184
+ auth: AuthConfig;
185
+ sessionStorage: Storage;
186
+ useOnlineTokens: boolean;
187
+ hooks: HooksConfig;
188
+ }
189
+ interface AuthConfig {
190
+ path: string;
191
+ callbackPath: string;
192
+ exitIframePath: string;
193
+ patchSessionTokenPath: string;
194
+ loginPath: string;
195
+ }
196
+ export interface WebhookConfig {
197
+ [key: string]: WebhookHandler | WebhookHandler[];
198
+ }
199
+ interface HooksConfig {
200
+ /**
201
+ * A function to call after a merchant installs your app
202
+ *
203
+ * @param context - An object with context about the request that triggered the hook.
204
+ * @param context.session - The session of the merchant that installed your app. This is the output of sessionStorage.loadSession in case people want to load their own.
205
+ * @param context.admin - An object with access to the Shopify Admin API's.
206
+ *
207
+ * @example
208
+ * Registering webhooks and seeding data when a merchant installs your app.
209
+ * ```ts
210
+ * import { DeliveryMethod, shopifyApp } from "@shopify/shopify-app-remix";
211
+ * import { seedStoreData } from "~/db/seeds"
212
+ *
213
+ * export const shopify = shopifyApp({
214
+ * hooks: {
215
+ * afterAuth: async ({ session }) => {
216
+ * shopify.registerWebhooks({ session });
217
+ * seedStoreData({session})
218
+ * }
219
+ * },
220
+ * webhooks: {
221
+ * APP_UNINSTALLED: {
222
+ * deliveryMethod: DeliveryMethod.Http,
223
+ * callbackUrl: "/webhooks",
224
+ * },
225
+ * },
226
+ * // ...etc
227
+ * });
228
+ * ```
229
+ */
230
+ afterAuth?: (options: AfterAuthOptions) => void | Promise<void>;
231
+ }
232
+ export interface AfterAuthOptions<R extends ShopifyRestResources = ShopifyRestResources> {
233
+ session: Session;
234
+ admin: AdminApiContext<R>;
235
+ }
236
+ export interface AdminApiContext<Resources extends ShopifyRestResources = ShopifyRestResources> {
237
+ /**
238
+ * Methods for interacting with the Shopify Admin REST API
239
+ *
240
+ * There are methods for interacting with individual REST resources. You can also make plain `GET`, `POST`, `PUT` and `DELETE` requests should the REST resources not meet your needs.
241
+ *
242
+ * {@link https://shopify.dev/docs/api/admin-rest}
243
+ *
244
+ * @example
245
+ * Getting the number of orders in a store using rest resources
246
+ * ```ts
247
+ * // app/shopify.server.ts
248
+ * import { shopifyApp } from "@shopify/shopify-app-remix";
249
+ * import { restResources } from "@shopify/shopify-api/rest/admin/2023-04";
250
+ *
251
+ * export const shopify = shopifyApp({
252
+ * restResources,
253
+ * // ...etc
254
+ * });
255
+ *
256
+ * // app/routes/**\/.ts
257
+ * import { LoaderArgs, json } from "@remix-run/node";
258
+ * import { shopify } from "../shopify.server";
259
+ *
260
+ * export const loader = async ({ request }: LoaderArgs) => {
261
+ * const { admin, session } = await shopify.authenticate.admin(request);
262
+ * return json(admin.rest.resources.Order.count({ session }));
263
+ * };
264
+ * ```
265
+ *
266
+ * @example
267
+ * Making a GET request to the REST API
268
+ * ```ts
269
+ * // app/shopify.server.ts
270
+ * import { shopifyApp } from "@shopify/shopify-app-remix";
271
+ * import { restResources } from "@shopify/shopify-api/rest/admin/2023-04";
272
+ *
273
+ * export const shopify = shopifyApp({
274
+ * restResources,
275
+ * // ...etc
276
+ * });
277
+ *
278
+ * // app/routes/**\/.ts
279
+ * import { LoaderArgs, json } from "@remix-run/node";
280
+ * import { shopify } from "../shopify.server";
281
+ *
282
+ * export const loader = async ({ request }: LoaderArgs) => {
283
+ * const response = await admin.rest.get({ path: "/customers/count.json" });
284
+ * const customers = await response.json();
285
+ * return json({ customers });
286
+ * };
287
+ * ```
288
+ */
289
+ rest: RemixRestClient<Resources>;
290
+ /**
291
+ * Methods for interacting with the Shopify Admin GraphQL API
292
+ *
293
+ * {@link https://shopify.dev/docs/api/admin-graphql}
294
+ * {@link https://github.com/Shopify/shopify-api-js/blob/main/docs/reference/clients/Graphql.md}
295
+ *
296
+ * @example
297
+ * Creating a new product
298
+ * ```ts
299
+ * import { ActionArgs } from "@remix-run/node";
300
+ * import { shopify } from "../shopify.server";
301
+ *
302
+ * export async function action({ request }: ActionArgs) {
303
+ * const { admin } = await shopify.authenticate.admin(request);
304
+ *
305
+ * const response = await admin.graphql(
306
+ * `#graphql
307
+ * mutation populateProduct($input: ProductInput!) {
308
+ * productCreate(input: $input) {
309
+ * product {
310
+ * id
311
+ * }
312
+ * }
313
+ * }`,
314
+ * { variables: { input: { title: "Product Name" } } }
315
+ * );
316
+ *
317
+ * const productData = await response.json();
318
+ * return json({ data: productData.data });
319
+ * }
320
+ * ```
321
+ */
322
+ graphql: GraphqlQueryFunction;
323
+ }
324
+ export {};
325
+ //# sourceMappingURL=config-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-types.d.ts","sourceRoot":"","sources":["../../src/config-types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,IAAI,YAA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EAAE,OAAO,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,UAAU,CAAC;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,KAAK,EAAE,WAAW,CAAC;CACpB;AAED,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,cAAc,EAAE,CAAC;CAClD;AAED,UAAU,WAAW;IACnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjE;AAED,MAAM,WAAW,gBAAgB,CAC/B,CAAC,SAAS,oBAAoB,GAAG,oBAAoB;IAErD,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;CAC3B;AAED,MAAM,WAAW,eAAe,CAC9B,SAAS,SAAS,oBAAoB,GAAG,oBAAoB;IAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmDG;IACH,IAAI,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IAEjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,OAAO,EAAE,oBAAoB,CAAC;CAC/B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=config-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-types.js","sourceRoot":"","sources":["../../src/config-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,29 @@
1
+ import '@shopify/shopify-api/adapters/web-api';
2
+ import { ShopifyRestResources } from '@shopify/shopify-api';
3
+ import { SessionStorage } from '@shopify/shopify-app-session-storage';
4
+ import { type AppConfigArg } from './config-types';
5
+ import { type ShopifyApp } from './types';
6
+ export type { ShopifyApp, LoginError } from './types';
7
+ export { LoginErrorType, AppDistribution } from './types';
8
+ export { LATEST_API_VERSION, LogSeverity, DeliveryMethod, BillingInterval, } from '@shopify/shopify-api';
9
+ /**
10
+ * Creates an object your app will use to interact with Shopify.
11
+ *
12
+ * @param appConfig Configuration options for your shopify app. For example, the scopes your app needs.
13
+ * @returns `ShopifyApp` An object constructed using your appConfig. It has methods for interacting with Shopify.
14
+ *
15
+ * @example
16
+ * The minimum viable configuration
17
+ * ```ts
18
+ * import { shopifyApp } from "@shopify/shopify-app-remix";
19
+ *
20
+ * export const shopify = shopifyApp({
21
+ * apiKey: process.env.SHOPIFY_API_KEY!,
22
+ * apiSecretKey: process.env.SHOPIFY_API_SECRET!,
23
+ * scopes: process.env.SCOPES?.split(",")!,
24
+ * appUrl: process.env.SHOPIFY_APP_URL!,
25
+ * });
26
+ * ```
27
+ */
28
+ export declare function shopifyApp<Config extends AppConfigArg<Resources, Storage>, Resources extends ShopifyRestResources, Storage extends SessionStorage>(appConfig: Config): ShopifyApp<Config>;
29
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,uCAAuC,CAAC;AAC/C,OAAO,EAML,oBAAoB,EAErB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAC,cAAc,EAAC,MAAM,sCAAsC,CAAC;AAEpE,OAAO,EAAiB,KAAK,YAAY,EAAC,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,SAAS,CAAC;AAajB,YAAY,EAAC,UAAU,EAAE,UAAU,EAAC,MAAM,SAAS,CAAC;AACpD,OAAO,EAAC,cAAc,EAAE,eAAe,EAAC,MAAM,SAAS,CAAC;AAExD,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAM9B;;;;;;;;;;;;;;;;;;GAkBG;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,CA6BvC"}
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.shopifyApp = exports.BillingInterval = exports.DeliveryMethod = exports.LogSeverity = exports.LATEST_API_VERSION = exports.AppDistribution = exports.LoginErrorType = void 0;
4
+ var tslib_1 = require("tslib");
5
+ require("@shopify/shopify-api/adapters/web-api");
6
+ var shopify_api_1 = require("@shopify/shopify-api");
7
+ var runtime_1 = require("@shopify/shopify-api/runtime");
8
+ var types_1 = require("./types");
9
+ var version_1 = require("./version");
10
+ var webhooks_1 = require("./auth/webhooks");
11
+ var authenticate_1 = require("./auth/admin/authenticate");
12
+ var authenticate_2 = require("./auth/webhooks/authenticate");
13
+ var authenticate_3 = require("./auth/public/authenticate");
14
+ var override_logger_1 = require("./override-logger");
15
+ var add_response_headers_1 = require("./auth/helpers/add-response-headers");
16
+ var login_1 = require("./auth/login/login");
17
+ var types_2 = require("./types");
18
+ Object.defineProperty(exports, "LoginErrorType", { enumerable: true, get: function () { return types_2.LoginErrorType; } });
19
+ Object.defineProperty(exports, "AppDistribution", { enumerable: true, get: function () { return types_2.AppDistribution; } });
20
+ var shopify_api_2 = require("@shopify/shopify-api");
21
+ Object.defineProperty(exports, "LATEST_API_VERSION", { enumerable: true, get: function () { return shopify_api_2.LATEST_API_VERSION; } });
22
+ Object.defineProperty(exports, "LogSeverity", { enumerable: true, get: function () { return shopify_api_2.LogSeverity; } });
23
+ Object.defineProperty(exports, "DeliveryMethod", { enumerable: true, get: function () { return shopify_api_2.DeliveryMethod; } });
24
+ Object.defineProperty(exports, "BillingInterval", { enumerable: true, get: function () { return shopify_api_2.BillingInterval; } });
25
+ (0, runtime_1.setAbstractRuntimeString)(function () {
26
+ return "Remix";
27
+ });
28
+ /**
29
+ * Creates an object your app will use to interact with Shopify.
30
+ *
31
+ * @param appConfig Configuration options for your shopify app. For example, the scopes your app needs.
32
+ * @returns `ShopifyApp` An object constructed using your appConfig. It has methods for interacting with Shopify.
33
+ *
34
+ * @example
35
+ * The minimum viable configuration
36
+ * ```ts
37
+ * import { shopifyApp } from "@shopify/shopify-app-remix";
38
+ *
39
+ * export const shopify = shopifyApp({
40
+ * apiKey: process.env.SHOPIFY_API_KEY!,
41
+ * apiSecretKey: process.env.SHOPIFY_API_SECRET!,
42
+ * scopes: process.env.SCOPES?.split(",")!,
43
+ * appUrl: process.env.SHOPIFY_APP_URL!,
44
+ * });
45
+ * ```
46
+ */
47
+ function shopifyApp(appConfig) {
48
+ var api = deriveApi(appConfig);
49
+ var config = deriveConfig(appConfig, api.config);
50
+ var logger = (0, override_logger_1.overrideLogger)(api.logger);
51
+ (0, add_response_headers_1.installGlobalResponseHeaders)(config.isEmbeddedApp);
52
+ if (appConfig.webhooks) {
53
+ api.webhooks.addHandlers(appConfig.webhooks);
54
+ }
55
+ var params = { api: api, config: config, logger: logger };
56
+ var oauth = new authenticate_1.AuthStrategy(params);
57
+ return {
58
+ sessionStorage: config.sessionStorage,
59
+ canUseLoginForm: config.canUseLoginForm,
60
+ addResponseHeaders: (0, add_response_headers_1.addResponseHeadersFactory)(params),
61
+ registerWebhooks: (0, webhooks_1.registerWebhooksFactory)(params),
62
+ login: (0, login_1.loginFactory)(params),
63
+ authenticate: {
64
+ admin: oauth.authenticateAdmin.bind(oauth),
65
+ public: (0, authenticate_3.authenticatePublicFactory)(params),
66
+ webhook: (0, authenticate_2.authenticateWebhookFactory)(params),
67
+ },
68
+ };
69
+ }
70
+ exports.shopifyApp = shopifyApp;
71
+ function deriveApi(appConfig) {
72
+ var _a, _b;
73
+ var appUrl;
74
+ try {
75
+ appUrl = new URL(appConfig.appUrl);
76
+ }
77
+ catch (error) {
78
+ throw new shopify_api_1.ShopifyError('Invalid appUrl provided. Please provide a valid URL.');
79
+ }
80
+ /* eslint-disable no-process-env */
81
+ if (appUrl.hostname === 'localhost' && !appUrl.port && process.env.PORT) {
82
+ appUrl.port = process.env.PORT;
83
+ }
84
+ /* eslint-enable no-process-env */
85
+ appConfig.appUrl = appUrl.origin;
86
+ var userAgentPrefix = "Shopify Remix Library v".concat(version_1.SHOPIFY_REMIX_LIBRARY_VERSION);
87
+ if (appConfig.userAgentPrefix) {
88
+ userAgentPrefix = "".concat(appConfig.userAgentPrefix, " | ").concat(userAgentPrefix);
89
+ }
90
+ var cleanApiConfig = 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 });
91
+ return (0, shopify_api_1.shopifyApi)(cleanApiConfig);
92
+ }
93
+ function deriveConfig(appConfig, apiConfig) {
94
+ var _a, _b, _c;
95
+ if (!appConfig.sessionStorage) {
96
+ throw new shopify_api_1.ShopifyError('Please provide a valid session storage. See https://github.com/Shopify/shopify-app-js/blob/main/README.md#session-storage-options for options.');
97
+ }
98
+ var authPathPrefix = appConfig.authPathPrefix || '/auth';
99
+ var distribution = (_a = appConfig.distribution) !== null && _a !== void 0 ? _a : types_1.AppDistribution.AppStore;
100
+ return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, appConfig), apiConfig), { canUseLoginForm: 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, auth: {
101
+ path: authPathPrefix,
102
+ callbackPath: "".concat(authPathPrefix, "/callback"),
103
+ patchSessionTokenPath: "".concat(authPathPrefix, "/session-token"),
104
+ exitIframePath: "".concat(authPathPrefix, "/exit-iframe"),
105
+ loginPath: "".concat(authPathPrefix, "/login"),
106
+ } });
107
+ }
108
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,iDAA+C;AAC/C,oDAQ8B;AAC9B,wDAAsE;AAItE,iCAKiB;AACjB,qCAAwD;AACxD,4CAAwD;AACxD,0DAAuD;AACvD,6DAAwE;AACxE,2DAAqE;AACrE,qDAAiD;AACjD,4EAG6C;AAC7C,4CAAgD;AAGhD,iCAAwD;AAAhD,uGAAA,cAAc,OAAA;AAAE,wGAAA,eAAe,OAAA;AAEvC,oDAK8B;AAJ5B,iHAAA,kBAAkB,OAAA;AAClB,0GAAA,WAAW,OAAA;AACX,6GAAA,cAAc,OAAA;AACd,8GAAA,eAAe,OAAA;AAGjB,IAAA,kCAAwB,EAAC;IACvB,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,UAAU,CAIxB,SAAiB;IACjB,IAAM,GAAG,GAAG,SAAS,CAAY,SAAS,CAAC,CAAC;IAC5C,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,IAAA,mDAA4B,EAAC,MAAM,CAAC,aAAa,CAAC,CAAC;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AAc,EAAE,UAAG,cAAc,iBAAc;YAC/C,SAAS,EAAE,UAAG,cAAc,WAAQ;SACrC,IACD;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Shopify } from '@shopify/shopify-api';
2
+ export declare function overrideLogger(logger: Shopify['logger']): Shopify['logger'];
3
+ //# sourceMappingURL=override-logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"override-logger.d.ts","sourceRoot":"","sources":["../../src/override-logger.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAOrE,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAiC3E"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.overrideLogger = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var semver_1 = tslib_1.__importDefault(require("semver"));
6
+ var shopify_api_1 = require("@shopify/shopify-api");
7
+ var version_1 = require("./version");
8
+ // eslint-disable-next-line no-warning-comments
9
+ // TODO This has been copied from shopify-app-express, it should be extracted into a shared package
10
+ // https://github.com/orgs/Shopify/projects/6899/views/1?pane=issue&itemId=28358070
11
+ function overrideLogger(logger) {
12
+ var baseContext = { package: 'shopify-app' };
13
+ var warningFunction = function (message, context) {
14
+ if (context === void 0) { context = {}; }
15
+ return logger.warning(message, tslib_1.__assign(tslib_1.__assign({}, baseContext), context));
16
+ };
17
+ function deprecated(warningFunction) {
18
+ return function (version, message) {
19
+ if (semver_1.default.gte(version_1.SHOPIFY_REMIX_LIBRARY_VERSION, version)) {
20
+ throw new shopify_api_1.FeatureDeprecatedError("Feature was deprecated in version ".concat(version));
21
+ }
22
+ return warningFunction("[Deprecated | ".concat(version, "] ").concat(message));
23
+ };
24
+ }
25
+ return tslib_1.__assign(tslib_1.__assign({}, logger), { log: function (severity, message, context) {
26
+ if (context === void 0) { context = {}; }
27
+ return logger.log(severity, message, tslib_1.__assign(tslib_1.__assign({}, baseContext), context));
28
+ }, debug: function (message, context) {
29
+ if (context === void 0) { context = {}; }
30
+ return logger.debug(message, tslib_1.__assign(tslib_1.__assign({}, baseContext), context));
31
+ }, info: function (message, context) {
32
+ if (context === void 0) { context = {}; }
33
+ return logger.info(message, tslib_1.__assign(tslib_1.__assign({}, baseContext), context));
34
+ }, warning: warningFunction, error: function (message, context) {
35
+ if (context === void 0) { context = {}; }
36
+ return logger.error(message, tslib_1.__assign(tslib_1.__assign({}, baseContext), context));
37
+ }, deprecated: deprecated(warningFunction) });
38
+ }
39
+ exports.overrideLogger = overrideLogger;
40
+ //# sourceMappingURL=override-logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"override-logger.js","sourceRoot":"","sources":["../../src/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;gBACtD,MAAM,IAAI,oCAAsB,CAC9B,4CAAqC,OAAO,CAAE,CAC/C,CAAC;aACH;YAED,OAAO,eAAe,CAAC,wBAAiB,OAAO,eAAK,OAAO,CAAE,CAAC,CAAC;QACjE,CAAC,CAAC;IACJ,CAAC;IAED,6CACK,MAAM,KACT,GAAG,EAAE,UAA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