@shopify/shopify-app-remix 4.2.0 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/react/components/AppProvider/AppProvider.js.map +1 -1
- package/dist/cjs/react/components/AppProxyForm/AppProxyForm.js +4 -3
- package/dist/cjs/react/components/AppProxyForm/AppProxyForm.js.map +1 -1
- package/dist/cjs/react/components/AppProxyLink/AppProxyLink.js +4 -3
- package/dist/cjs/react/components/AppProxyLink/AppProxyLink.js.map +1 -1
- package/dist/cjs/react/components/AppProxyProvider/AppProxyProvider.js.map +1 -1
- package/dist/cjs/server/authenticate/admin/helpers/redirect.js +2 -2
- package/dist/cjs/server/authenticate/admin/helpers/redirect.js.map +1 -1
- package/dist/cjs/server/authenticate/webhooks/authenticate.js +1 -1
- package/dist/cjs/server/authenticate/webhooks/authenticate.js.map +1 -1
- package/dist/cjs/server/future/flags.js.map +1 -1
- package/dist/cjs/server/shopify-app.js +1 -0
- package/dist/cjs/server/shopify-app.js.map +1 -1
- package/dist/cjs/server/version.js +1 -1
- package/dist/cjs/server/version.js.map +1 -1
- package/dist/esm/react/components/AppProvider/AppProvider.mjs.map +1 -1
- package/dist/esm/react/components/AppProxyForm/AppProxyForm.mjs +5 -4
- package/dist/esm/react/components/AppProxyForm/AppProxyForm.mjs.map +1 -1
- package/dist/esm/react/components/AppProxyLink/AppProxyLink.mjs +5 -4
- package/dist/esm/react/components/AppProxyLink/AppProxyLink.mjs.map +1 -1
- package/dist/esm/react/components/AppProxyProvider/AppProxyProvider.mjs.map +1 -1
- package/dist/esm/server/authenticate/admin/helpers/redirect.mjs +2 -2
- package/dist/esm/server/authenticate/admin/helpers/redirect.mjs.map +1 -1
- package/dist/esm/server/authenticate/webhooks/authenticate.mjs +1 -1
- package/dist/esm/server/authenticate/webhooks/authenticate.mjs.map +1 -1
- package/dist/esm/server/future/flags.mjs.map +1 -1
- package/dist/esm/server/shopify-app.mjs +1 -0
- package/dist/esm/server/shopify-app.mjs.map +1 -1
- package/dist/esm/server/version.mjs +1 -1
- package/dist/esm/server/version.mjs.map +1 -1
- package/dist/ts/react/components/AppProvider/AppProvider.d.ts +5 -1
- package/dist/ts/react/components/AppProvider/AppProvider.d.ts.map +1 -1
- package/dist/ts/react/components/AppProxyForm/AppProxyForm.d.ts +2 -1
- package/dist/ts/react/components/AppProxyForm/AppProxyForm.d.ts.map +1 -1
- package/dist/ts/react/components/AppProxyLink/AppProxyLink.d.ts +2 -1
- package/dist/ts/react/components/AppProxyLink/AppProxyLink.d.ts.map +1 -1
- package/dist/ts/react/components/AppProxyProvider/AppProxyProvider.d.ts +5 -1
- package/dist/ts/react/components/AppProxyProvider/AppProxyProvider.d.ts.map +1 -1
- package/dist/ts/server/authenticate/admin/billing/types.d.ts +4 -0
- package/dist/ts/server/authenticate/admin/billing/types.d.ts.map +1 -1
- package/dist/ts/server/authenticate/admin/scope/types.d.ts +2 -1
- package/dist/ts/server/authenticate/admin/scope/types.d.ts.map +1 -1
- package/dist/ts/server/authenticate/admin/types.d.ts +10 -0
- package/dist/ts/server/authenticate/admin/types.d.ts.map +1 -1
- package/dist/ts/server/authenticate/flow/types.d.ts +4 -0
- package/dist/ts/server/authenticate/flow/types.d.ts.map +1 -1
- package/dist/ts/server/authenticate/fulfillment-service/types.d.ts +4 -0
- package/dist/ts/server/authenticate/fulfillment-service/types.d.ts.map +1 -1
- package/dist/ts/server/authenticate/public/appProxy/types.d.ts +4 -0
- package/dist/ts/server/authenticate/public/appProxy/types.d.ts.map +1 -1
- package/dist/ts/server/authenticate/public/checkout/types.d.ts +4 -0
- package/dist/ts/server/authenticate/public/checkout/types.d.ts.map +1 -1
- package/dist/ts/server/authenticate/public/customer-account/types.d.ts +4 -0
- package/dist/ts/server/authenticate/public/customer-account/types.d.ts.map +1 -1
- package/dist/ts/server/authenticate/webhooks/types.d.ts +6 -5
- package/dist/ts/server/authenticate/webhooks/types.d.ts.map +1 -1
- package/dist/ts/server/boundary/error.d.ts +1 -1
- package/dist/ts/server/boundary/error.d.ts.map +1 -1
- package/dist/ts/server/clients/admin/types.d.ts +4 -0
- package/dist/ts/server/clients/admin/types.d.ts.map +1 -1
- package/dist/ts/server/clients/storefront/types.d.ts +4 -0
- package/dist/ts/server/clients/storefront/types.d.ts.map +1 -1
- package/dist/ts/server/future/flags.d.ts +6 -0
- package/dist/ts/server/future/flags.d.ts.map +1 -1
- package/dist/ts/server/shopify-app.d.ts +1 -0
- package/dist/ts/server/shopify-app.d.ts.map +1 -1
- package/dist/ts/server/unauthenticated/admin/types.d.ts +4 -0
- package/dist/ts/server/unauthenticated/admin/types.d.ts.map +1 -1
- package/dist/ts/server/unauthenticated/storefront/types.d.ts +4 -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 +12 -12
- package/src/react/components/AppProvider/AppProvider.tsx +4 -0
- package/src/react/components/AppProxyForm/AppProxyForm.tsx +18 -15
- package/src/react/components/AppProxyLink/AppProxyLink.tsx +18 -15
- package/src/react/components/AppProxyProvider/AppProxyProvider.tsx +4 -0
- package/src/server/__test-helpers/setup-non-embedded-flow.ts +1 -1
- package/src/server/__test-helpers/sign-request-cookie.ts +21 -10
- package/src/server/authenticate/admin/billing/types.ts +4 -0
- package/src/server/authenticate/admin/helpers/redirect.ts +2 -2
- package/src/server/authenticate/admin/scope/types.ts +2 -1
- package/src/server/authenticate/admin/types.ts +10 -0
- package/src/server/authenticate/flow/types.ts +4 -0
- package/src/server/authenticate/fulfillment-service/types.ts +4 -0
- package/src/server/authenticate/public/appProxy/types.ts +4 -0
- package/src/server/authenticate/public/checkout/types.ts +4 -0
- package/src/server/authenticate/public/customer-account/types.ts +4 -0
- package/src/server/authenticate/webhooks/authenticate.ts +1 -1
- package/src/server/authenticate/webhooks/types.ts +6 -5
- package/src/server/clients/admin/types.ts +4 -0
- package/src/server/clients/storefront/types.ts +4 -0
- package/src/server/future/flags.ts +6 -0
- package/src/server/shopify-app.ts +1 -0
- package/src/server/unauthenticated/admin/types.ts +4 -0
- package/src/server/unauthenticated/storefront/types.ts +4 -0
- package/src/server/version.ts +1 -1
- package/dist/ts/react/components/AppProvider/AppProvider.doc.d.ts +0 -4
- package/dist/ts/react/components/AppProvider/AppProvider.doc.d.ts.map +0 -1
- package/dist/ts/react/components/AppProxyForm/AppProxyForm.doc.d.ts +0 -4
- package/dist/ts/react/components/AppProxyForm/AppProxyForm.doc.d.ts.map +0 -1
- package/dist/ts/react/components/AppProxyLink/AppProxyLink.doc.d.ts +0 -4
- package/dist/ts/react/components/AppProxyLink/AppProxyLink.doc.d.ts.map +0 -1
- package/dist/ts/react/components/AppProxyProvider/AppProxyProvider.doc.d.ts +0 -4
- package/dist/ts/react/components/AppProxyProvider/AppProxyProvider.doc.d.ts.map +0 -1
- package/dist/ts/server/authenticate/admin/authenticate.admin.doc.d.ts +0 -4
- package/dist/ts/server/authenticate/admin/authenticate.admin.doc.d.ts.map +0 -1
- package/dist/ts/server/authenticate/admin/billing/authenticate.admin.billing.doc.d.ts +0 -4
- package/dist/ts/server/authenticate/admin/billing/authenticate.admin.billing.doc.d.ts.map +0 -1
- package/dist/ts/server/authenticate/admin/scope/authenticate.admin.scopes.doc.d.ts +0 -4
- package/dist/ts/server/authenticate/admin/scope/authenticate.admin.scopes.doc.d.ts.map +0 -1
- package/dist/ts/server/authenticate/flow/authenticate.flow.doc.d.ts +0 -4
- package/dist/ts/server/authenticate/flow/authenticate.flow.doc.d.ts.map +0 -1
- package/dist/ts/server/authenticate/fulfillment-service/authenticate.fulfillment-service.doc.d.ts +0 -4
- package/dist/ts/server/authenticate/fulfillment-service/authenticate.fulfillment-service.doc.d.ts.map +0 -1
- package/dist/ts/server/authenticate/public/appProxy/authenticate.public.app-proxy.doc.d.ts +0 -4
- package/dist/ts/server/authenticate/public/appProxy/authenticate.public.app-proxy.doc.d.ts.map +0 -1
- package/dist/ts/server/authenticate/public/checkout/authenticate.public.checkout.doc.d.ts +0 -4
- package/dist/ts/server/authenticate/public/checkout/authenticate.public.checkout.doc.d.ts.map +0 -1
- package/dist/ts/server/authenticate/public/customer-account/authenticate.public.customerAccount.doc.d.ts +0 -4
- package/dist/ts/server/authenticate/public/customer-account/authenticate.public.customerAccount.doc.d.ts.map +0 -1
- package/dist/ts/server/authenticate/webhooks/authenticate.webhooks.doc.d.ts +0 -4
- package/dist/ts/server/authenticate/webhooks/authenticate.webhooks.doc.d.ts.map +0 -1
- package/dist/ts/server/clients/admin/authenticate.admin.api.doc.d.ts +0 -4
- package/dist/ts/server/clients/admin/authenticate.admin.api.doc.d.ts.map +0 -1
- package/dist/ts/server/clients/storefront/authenticate.storefront.api.doc.d.ts +0 -4
- package/dist/ts/server/clients/storefront/authenticate.storefront.api.doc.d.ts.map +0 -1
- package/dist/ts/server/shopify-app.doc.d.ts +0 -4
- package/dist/ts/server/shopify-app.doc.d.ts.map +0 -1
- package/dist/ts/server/unauthenticated/admin/unauthenticated.admin.doc.d.ts +0 -4
- package/dist/ts/server/unauthenticated/admin/unauthenticated.admin.doc.d.ts.map +0 -1
- package/dist/ts/server/unauthenticated/storefront/unauthenticated.storefront.doc.d.ts +0 -4
- package/dist/ts/server/unauthenticated/storefront/unauthenticated.storefront.doc.d.ts.map +0 -1
- package/src/react/components/AppProvider/AppProvider.doc.ts +0 -35
- package/src/react/components/AppProxyForm/AppProxyForm.doc.ts +0 -28
- package/src/react/components/AppProxyLink/AppProxyLink.doc.ts +0 -28
- package/src/react/components/AppProxyProvider/AppProxyProvider.doc.ts +0 -40
- package/src/server/authenticate/admin/authenticate.admin.doc.ts +0 -51
- package/src/server/authenticate/admin/billing/authenticate.admin.billing.doc.ts +0 -29
- package/src/server/authenticate/admin/scope/authenticate.admin.scopes.doc.ts +0 -28
- package/src/server/authenticate/flow/authenticate.flow.doc.ts +0 -47
- package/src/server/authenticate/fulfillment-service/authenticate.fulfillment-service.doc.ts +0 -48
- package/src/server/authenticate/public/appProxy/authenticate.public.app-proxy.doc.ts +0 -55
- package/src/server/authenticate/public/checkout/authenticate.public.checkout.doc.ts +0 -49
- package/src/server/authenticate/public/customer-account/authenticate.public.customerAccount.doc.ts +0 -49
- package/src/server/authenticate/webhooks/authenticate.webhooks.doc.ts +0 -39
- package/src/server/clients/admin/authenticate.admin.api.doc.ts +0 -34
- package/src/server/clients/storefront/authenticate.storefront.api.doc.ts +0 -34
- package/src/server/shopify-app.doc.ts +0 -45
- package/src/server/unauthenticated/admin/unauthenticated.admin.doc.ts +0 -40
- package/src/server/unauthenticated/storefront/unauthenticated.storefront.doc.ts +0 -40
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopify/shopify-app-remix",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.1",
|
|
4
4
|
"description": "Shopify Remix - to simplify the building of Shopify Apps with Remix",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20.10.0"
|
|
@@ -66,25 +66,25 @@
|
|
|
66
66
|
"Storefront API"
|
|
67
67
|
],
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@babel/preset-env": "^7.
|
|
70
|
-
"@remix-run/node": "^2.17.
|
|
71
|
-
"@remix-run/react": "^2.17.
|
|
72
|
-
"@remix-run/testing": "^2.17.
|
|
73
|
-
"@shopify/generate-docs": "^
|
|
69
|
+
"@babel/preset-env": "^7.29.7",
|
|
70
|
+
"@remix-run/node": "^2.17.5",
|
|
71
|
+
"@remix-run/react": "^2.17.5",
|
|
72
|
+
"@remix-run/testing": "^2.17.5",
|
|
73
|
+
"@shopify/generate-docs": "^1.2.0",
|
|
74
74
|
"@shopify/polaris": "^12.18.0",
|
|
75
75
|
"@shopify/react-testing": "^6.0.0",
|
|
76
|
-
"@shopify/shopify-app-session-storage-memory": "^6.0.
|
|
77
|
-
"@types/react": "^19.2.
|
|
76
|
+
"@shopify/shopify-app-session-storage-memory": "^6.0.1",
|
|
77
|
+
"@types/react": "^19.2.16",
|
|
78
78
|
"jest-fetch-mock": "^3.0.3"
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"@remix-run/server-runtime": "^2.17.
|
|
81
|
+
"@remix-run/server-runtime": "^2.17.5",
|
|
82
82
|
"@shopify/admin-api-client": "^1.1.2",
|
|
83
|
-
"@shopify/shopify-api": "^13.
|
|
84
|
-
"@shopify/shopify-app-session-storage": "^5.0.
|
|
83
|
+
"@shopify/shopify-api": "^13.1.0",
|
|
84
|
+
"@shopify/shopify-app-session-storage": "^5.0.1",
|
|
85
85
|
"@shopify/storefront-api-client": "^1.0.10",
|
|
86
86
|
"compare-versions": "^6.1.1",
|
|
87
|
-
"isbot": "^5.1.
|
|
87
|
+
"isbot": "^5.1.40"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
90
|
"@remix-run/node": "*",
|
|
@@ -12,6 +12,10 @@ import {useEffect} from 'react';
|
|
|
12
12
|
import {APP_BRIDGE_URL} from '../../const';
|
|
13
13
|
import {RemixPolarisLink} from '../RemixPolarisLink';
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Props for the `AppProvider` component.
|
|
17
|
+
* @publicDocs
|
|
18
|
+
*/
|
|
15
19
|
export interface AppProviderProps extends Omit<
|
|
16
20
|
PolarisAppProviderProps,
|
|
17
21
|
'linkComponent' | 'i18n'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {useContext} from 'react';
|
|
1
|
+
import {forwardRef, useContext} from 'react';
|
|
2
2
|
import {Form, type FormProps} from '@remix-run/react';
|
|
3
3
|
|
|
4
4
|
import {AppProxyProviderContext} from '../AppProxyProvider';
|
|
@@ -62,21 +62,24 @@ export interface AppProxyFormProps extends FormProps {
|
|
|
62
62
|
* );
|
|
63
63
|
* }
|
|
64
64
|
* ```
|
|
65
|
+
* @publicDocs
|
|
65
66
|
*/
|
|
66
|
-
export
|
|
67
|
-
|
|
67
|
+
export const AppProxyForm = forwardRef<HTMLFormElement, AppProxyFormProps>(
|
|
68
|
+
function AppProxyForm(props, ref) {
|
|
69
|
+
const context = useContext(AppProxyProviderContext);
|
|
68
70
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
if (!context) {
|
|
72
|
+
throw new Error(
|
|
73
|
+
'AppProxyForm must be used within an AppProxyProvider component',
|
|
74
|
+
);
|
|
75
|
+
}
|
|
74
76
|
|
|
75
|
-
|
|
77
|
+
const {children, action, ...otherProps} = props;
|
|
76
78
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
79
|
+
return (
|
|
80
|
+
<Form action={context.formatUrl(action, false)} {...otherProps} ref={ref}>
|
|
81
|
+
{children}
|
|
82
|
+
</Form>
|
|
83
|
+
);
|
|
84
|
+
},
|
|
85
|
+
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {useContext} from 'react';
|
|
1
|
+
import {forwardRef, useContext} from 'react';
|
|
2
2
|
|
|
3
3
|
import {AppProxyProviderContext} from '../AppProxyProvider';
|
|
4
4
|
|
|
@@ -38,21 +38,24 @@ export interface AppProxyLinkProps extends React.DetailedHTMLProps<
|
|
|
38
38
|
* );
|
|
39
39
|
* }
|
|
40
40
|
* ```
|
|
41
|
+
* @publicDocs
|
|
41
42
|
*/
|
|
42
|
-
export
|
|
43
|
-
|
|
43
|
+
export const AppProxyLink = forwardRef<HTMLAnchorElement, AppProxyLinkProps>(
|
|
44
|
+
function AppProxyLink(props, ref) {
|
|
45
|
+
const context = useContext(AppProxyProviderContext);
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
if (!context) {
|
|
48
|
+
throw new Error(
|
|
49
|
+
'AppProxyLink must be used within an AppProxyProvider component',
|
|
50
|
+
);
|
|
51
|
+
}
|
|
50
52
|
|
|
51
|
-
|
|
53
|
+
const {children, href, ...otherProps} = props;
|
|
52
54
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
55
|
+
return (
|
|
56
|
+
<a href={context.formatUrl(href)} {...otherProps} ref={ref}>
|
|
57
|
+
{children}
|
|
58
|
+
</a>
|
|
59
|
+
);
|
|
60
|
+
},
|
|
61
|
+
);
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import {createContext, useEffect, useState} from 'react';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Props for the `AppProxyProvider` component.
|
|
5
|
+
* @publicDocs
|
|
6
|
+
*/
|
|
3
7
|
export interface AppProxyProviderProps {
|
|
4
8
|
/**
|
|
5
9
|
* The URL where the app is hosted. You can set this from the `SHOPIFY_APP_URL` environment variable.
|
|
@@ -14,7 +14,7 @@ export async function setUpNonEmbeddedFlow() {
|
|
|
14
14
|
const session = await setUpValidSession(shopify.sessionStorage);
|
|
15
15
|
|
|
16
16
|
const request = new Request(`${APP_URL}?shop=${TEST_SHOP}`);
|
|
17
|
-
signRequestCookie({
|
|
17
|
+
await signRequestCookie({
|
|
18
18
|
request,
|
|
19
19
|
cookieName: SESSION_COOKIE_NAME,
|
|
20
20
|
cookieValue: session.id,
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Cookies,
|
|
3
|
+
NormalizedRequest,
|
|
4
|
+
NormalizedResponse,
|
|
5
|
+
} from '@shopify/shopify-api/runtime';
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
import {API_SECRET_KEY} from './const';
|
|
8
|
+
|
|
9
|
+
export async function signRequestCookie({
|
|
4
10
|
request,
|
|
5
11
|
cookieName,
|
|
6
12
|
cookieValue,
|
|
@@ -9,13 +15,18 @@ export function signRequestCookie({
|
|
|
9
15
|
cookieName: string;
|
|
10
16
|
cookieValue: string;
|
|
11
17
|
}) {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
[
|
|
17
|
-
`${cookieName}=${cookieValue}`,
|
|
18
|
-
`${cookieName}.sig=${signedCookieValue}`,
|
|
19
|
-
].join(';'),
|
|
18
|
+
const cookies = new Cookies(
|
|
19
|
+
{headers: {}} as NormalizedRequest,
|
|
20
|
+
{} as NormalizedResponse,
|
|
21
|
+
{keys: [API_SECRET_KEY]},
|
|
20
22
|
);
|
|
23
|
+
|
|
24
|
+
await cookies.setAndSign(cookieName, cookieValue);
|
|
25
|
+
|
|
26
|
+
const cookieHeader = cookies
|
|
27
|
+
.toHeaders()
|
|
28
|
+
.map((cookie) => cookie.split(';')[0])
|
|
29
|
+
.join(';');
|
|
30
|
+
|
|
31
|
+
request.headers.set('Cookie', cookieHeader);
|
|
21
32
|
}
|
|
@@ -118,6 +118,10 @@ export interface UpdateUsageCappedAmountOptions {
|
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
+
/**
|
|
122
|
+
* Provides utilities that apps can use to request billing for the app using the Admin API.
|
|
123
|
+
* @publicDocs
|
|
124
|
+
*/
|
|
121
125
|
export interface BillingContext<Config extends AppConfigArg> {
|
|
122
126
|
/**
|
|
123
127
|
* Checks if the shop has an active payment for any plan defined in the `billing` config option.
|
|
@@ -48,8 +48,8 @@ export function redirectFactory(
|
|
|
48
48
|
|
|
49
49
|
logger.debug('Redirecting', {shop, url: parsedUrl.toString()});
|
|
50
50
|
|
|
51
|
-
const isSameOrigin = parsedUrl.origin === config.appUrl;
|
|
52
|
-
if (isSameOrigin
|
|
51
|
+
const isSameOrigin = parsedUrl.origin === new URL(config.appUrl).origin;
|
|
52
|
+
if (isSameOrigin) {
|
|
53
53
|
searchParams.forEach((value, key) => {
|
|
54
54
|
if (!parsedUrl.searchParams.has(key)) {
|
|
55
55
|
parsedUrl.searchParams.set(key, value);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Provides utilities that apps can use to [manage scopes](https://shopify.dev/docs/apps/build/authentication-authorization/app-installation/manage-access-scopes) for the app using the Admin API.
|
|
3
|
+
* @publicDocs
|
|
3
4
|
*/
|
|
4
5
|
export interface ScopesApiContext {
|
|
5
6
|
/**
|
|
@@ -148,6 +148,10 @@ export interface EmbeddedAdminContext<
|
|
|
148
148
|
*
|
|
149
149
|
* Returned only if `isEmbeddedApp` is `true`.
|
|
150
150
|
*
|
|
151
|
+
* Request parameters (including `id_token`, `shop`, `host`, and `embedded`) are only copied to the destination when
|
|
152
|
+
* it resolves to the same origin as `appUrl`. This helper does not validate the destination URL — avoid passing
|
|
153
|
+
* unvalidated user input (for example, a raw `?next=` query parameter) and use an allow-list of paths instead.
|
|
154
|
+
*
|
|
151
155
|
* @example
|
|
152
156
|
* <caption>Redirecting to an app route.</caption>
|
|
153
157
|
* <description>Use the `redirect` helper to safely redirect between pages.</description>
|
|
@@ -211,6 +215,12 @@ export interface ScopesContext {
|
|
|
211
215
|
export type AdminContext<Config extends AppConfigArg> =
|
|
212
216
|
EmbeddedTypedAdminContext<Config> & ScopesContext;
|
|
213
217
|
|
|
218
|
+
/**
|
|
219
|
+
* Authenticates requests coming from the Shopify admin.
|
|
220
|
+
*
|
|
221
|
+
* The shape of the returned object changes depending on the `isEmbeddedApp` config.
|
|
222
|
+
* @publicDocs
|
|
223
|
+
*/
|
|
214
224
|
export type AuthenticateAdmin<Config extends AppConfigArg> = (
|
|
215
225
|
request: Request,
|
|
216
226
|
) => Promise<AdminContext<Config>>;
|
|
@@ -77,6 +77,10 @@ export interface FulfillmentServiceContext {
|
|
|
77
77
|
payload: FulfillmentServicePayload;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Verifies requests coming from Shopify to fulfillment service apps.
|
|
82
|
+
* @publicDocs
|
|
83
|
+
*/
|
|
80
84
|
export type AuthenticateFulfillmentService = (
|
|
81
85
|
request: Request,
|
|
82
86
|
) => Promise<FulfillmentServiceContext>;
|
|
@@ -2,6 +2,10 @@ import {Session} from '@shopify/shopify-api';
|
|
|
2
2
|
|
|
3
3
|
import {AdminApiContext, StorefrontContext} from '../../../clients';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Authenticates requests coming to the app from Shopify app proxies.
|
|
7
|
+
* @publicDocs
|
|
8
|
+
*/
|
|
5
9
|
export type AuthenticateAppProxy = (
|
|
6
10
|
request: Request,
|
|
7
11
|
) => Promise<AppProxyContext | AppProxyContextWithSession>;
|
|
@@ -2,6 +2,10 @@ import {JwtPayload} from '@shopify/shopify-api';
|
|
|
2
2
|
|
|
3
3
|
import {EnsureCORSFunction} from '../../helpers/ensure-cors-headers';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Authenticates requests coming from Shopify checkout extensions.
|
|
7
|
+
* @publicDocs
|
|
8
|
+
*/
|
|
5
9
|
export type AuthenticateCheckout = (
|
|
6
10
|
request: Request,
|
|
7
11
|
options?: AuthenticateCheckoutOptions,
|
|
@@ -2,6 +2,10 @@ import {JwtPayload} from '@shopify/shopify-api';
|
|
|
2
2
|
|
|
3
3
|
import {EnsureCORSFunction} from '../../helpers/ensure-cors-headers';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Authenticates requests coming from Shopify customer account extensions.
|
|
7
|
+
* @publicDocs
|
|
8
|
+
*/
|
|
5
9
|
export type AuthenticateCustomerAccount = (
|
|
6
10
|
request: Request,
|
|
7
11
|
options?: AuthenticateCustomerAccountOptions,
|
|
@@ -73,7 +73,7 @@ export function authenticateWebhookFactory<Topics extends string>(
|
|
|
73
73
|
apiVersion: check.apiVersion,
|
|
74
74
|
shop: check.domain,
|
|
75
75
|
topic: check.topic as Topics,
|
|
76
|
-
webhookId: check.
|
|
76
|
+
webhookId: check.webhookId,
|
|
77
77
|
payload: JSON.parse(rawBody),
|
|
78
78
|
session: undefined,
|
|
79
79
|
admin: undefined,
|
|
@@ -75,11 +75,8 @@ interface Context<Topics = string | number | symbol> {
|
|
|
75
75
|
topic: Topics;
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
* A unique ID for the webhook.
|
|
79
|
-
*
|
|
80
|
-
* For events webhooks (`webhookType === 'events'`), this is set to the `eventId` value for
|
|
81
|
-
* backwards compatibility. Prefer using `eventId` directly for events webhooks — `webhookId`
|
|
82
|
-
* will be removed from events webhooks in the next major version.
|
|
78
|
+
* A unique ID for the webhook. This is the idempotency key — useful to keep track of which
|
|
79
|
+
* events your app has already processed.
|
|
83
80
|
*
|
|
84
81
|
* @example
|
|
85
82
|
* <caption>Webhook ID.</caption>
|
|
@@ -261,6 +258,10 @@ export type WebhookContext<Topics = string | number | symbol> =
|
|
|
261
258
|
| WebhookContextWithoutSession<Topics>
|
|
262
259
|
| WebhookContextWithSession<Topics>;
|
|
263
260
|
|
|
261
|
+
/**
|
|
262
|
+
* Verifies requests coming from Shopify webhooks.
|
|
263
|
+
* @publicDocs
|
|
264
|
+
*/
|
|
264
265
|
export type AuthenticateWebhook<Topics = string | number | symbol> = (
|
|
265
266
|
request: Request,
|
|
266
267
|
) => Promise<WebhookContext<Topics>>;
|
|
@@ -16,6 +16,10 @@ export type HandleAdminClientError = (arg: {
|
|
|
16
16
|
session: Session;
|
|
17
17
|
}) => Promise<void>;
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Provides utilities that apps can use to make requests to the Admin API.
|
|
21
|
+
* @publicDocs
|
|
22
|
+
*/
|
|
19
23
|
export interface AdminApiContext {
|
|
20
24
|
/**
|
|
21
25
|
* Methods for interacting with the Shopify Admin GraphQL API
|
|
@@ -2,6 +2,10 @@ import {StorefrontOperations} from '@shopify/storefront-api-client';
|
|
|
2
2
|
|
|
3
3
|
import {GraphQLClient} from '../types';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Provides utilities that apps can use to make requests to the Storefront API.
|
|
7
|
+
* @publicDocs
|
|
8
|
+
*/
|
|
5
9
|
export interface StorefrontContext {
|
|
6
10
|
/**
|
|
7
11
|
* Method for interacting with the Shopify Storefront GraphQL API
|
|
@@ -4,6 +4,12 @@ import {AppConfig} from '../config-types';
|
|
|
4
4
|
|
|
5
5
|
// When adding new flags, you should also add them to the `TEST_FUTURE_FLAGS` object in `test-config.ts` to ensure that
|
|
6
6
|
// it doesn't cause regressions.
|
|
7
|
+
/**
|
|
8
|
+
* Set future flags using the `future` configuration field to opt in to upcoming breaking changes.
|
|
9
|
+
*
|
|
10
|
+
* With this feature, you can prepare for major releases ahead of time, as well as try out new features before they are released.
|
|
11
|
+
* @publicDocs
|
|
12
|
+
*/
|
|
7
13
|
export interface FutureFlags {
|
|
8
14
|
/**
|
|
9
15
|
* When enabled, embedded apps will fetch access tokens via [token exchange](https://shopify.dev/docs/apps/auth/get-access-tokens/token-exchange).
|
|
@@ -39,6 +39,7 @@ import {FutureFlagOptions, logDisabledFutureFlags} from './future/flags';
|
|
|
39
39
|
*
|
|
40
40
|
* @param appConfig Configuration options for your Shopify app, such as the scopes your app needs.
|
|
41
41
|
* @returns `ShopifyApp` An object constructed using your appConfig. It has methods for interacting with Shopify.
|
|
42
|
+
* @publicDocs
|
|
42
43
|
*
|
|
43
44
|
* @example
|
|
44
45
|
* <caption>The minimum viable configuration</caption>
|
|
@@ -74,6 +74,10 @@ export interface UnauthenticatedAdminContext {
|
|
|
74
74
|
admin: AdminApiContext;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Creates an unauthenticated Admin context.
|
|
79
|
+
* @publicDocs
|
|
80
|
+
*/
|
|
77
81
|
export type GetUnauthenticatedAdminContext = (
|
|
78
82
|
shop: string,
|
|
79
83
|
) => Promise<UnauthenticatedAdminContext>;
|
|
@@ -100,6 +100,10 @@ export interface UnauthenticatedStorefrontContext {
|
|
|
100
100
|
storefront: StorefrontContext;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Creates an unauthenticated Storefront context.
|
|
105
|
+
* @publicDocs
|
|
106
|
+
*/
|
|
103
107
|
export type GetUnauthenticatedStorefrontContext = (
|
|
104
108
|
shop: string,
|
|
105
109
|
) => Promise<UnauthenticatedStorefrontContext>;
|
package/src/server/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SHOPIFY_REMIX_LIBRARY_VERSION = '4.2.
|
|
1
|
+
export const SHOPIFY_REMIX_LIBRARY_VERSION = '4.2.1';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppProvider.doc.d.ts","sourceRoot":"","sources":["../../../../../src/react/components/AppProvider/AppProvider.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,QAAA,MAAM,IAAI,EAAE,6BA8BX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppProxyForm.doc.d.ts","sourceRoot":"","sources":["../../../../../src/react/components/AppProxyForm/AppProxyForm.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,QAAA,MAAM,IAAI,EAAE,6BAuBX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppProxyLink.doc.d.ts","sourceRoot":"","sources":["../../../../../src/react/components/AppProxyLink/AppProxyLink.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,QAAA,MAAM,IAAI,EAAE,6BAuBX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppProxyProvider.doc.d.ts","sourceRoot":"","sources":["../../../../../src/react/components/AppProxyProvider/AppProxyProvider.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,QAAA,MAAM,IAAI,EAAE,6BAmCX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authenticate.admin.doc.d.ts","sourceRoot":"","sources":["../../../../../src/server/authenticate/admin/authenticate.admin.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,QAAA,MAAM,IAAI,EAAE,6BA8CX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authenticate.admin.billing.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/billing/authenticate.admin.billing.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,QAAA,MAAM,IAAI,EAAE,6BAwBX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authenticate.admin.scopes.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/admin/scope/authenticate.admin.scopes.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,QAAA,MAAM,IAAI,EAAE,6BAuBX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authenticate.flow.doc.d.ts","sourceRoot":"","sources":["../../../../../src/server/authenticate/flow/authenticate.flow.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,QAAA,MAAM,IAAI,EAAE,6BA0CX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authenticate.fulfillment-service.doc.d.ts","sourceRoot":"","sources":["../../../../../src/server/authenticate/fulfillment-service/authenticate.fulfillment-service.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,QAAA,MAAM,IAAI,EAAE,6BA2CX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
package/dist/ts/server/authenticate/public/appProxy/authenticate.public.app-proxy.doc.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authenticate.public.app-proxy.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/appProxy/authenticate.public.app-proxy.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,QAAA,MAAM,IAAI,EAAE,6BAkDX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
package/dist/ts/server/authenticate/public/checkout/authenticate.public.checkout.doc.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authenticate.public.checkout.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/checkout/authenticate.public.checkout.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,QAAA,MAAM,IAAI,EAAE,6BA4CX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authenticate.public.customerAccount.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/customer-account/authenticate.public.customerAccount.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,QAAA,MAAM,IAAI,EAAE,6BA4CX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authenticate.webhooks.doc.d.ts","sourceRoot":"","sources":["../../../../../src/server/authenticate/webhooks/authenticate.webhooks.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,QAAA,MAAM,IAAI,EAAE,6BAkCX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authenticate.admin.api.doc.d.ts","sourceRoot":"","sources":["../../../../../src/server/clients/admin/authenticate.admin.api.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,QAAA,MAAM,IAAI,EAAE,6BA6BX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authenticate.storefront.api.doc.d.ts","sourceRoot":"","sources":["../../../../../src/server/clients/storefront/authenticate.storefront.api.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,QAAA,MAAM,IAAI,EAAE,6BA6BX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shopify-app.doc.d.ts","sourceRoot":"","sources":["../../../src/server/shopify-app.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,QAAA,MAAM,IAAI,EAAE,6BAwCX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unauthenticated.admin.doc.d.ts","sourceRoot":"","sources":["../../../../../src/server/unauthenticated/admin/unauthenticated.admin.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,QAAA,MAAM,IAAI,EAAE,6BAmCX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unauthenticated.storefront.doc.d.ts","sourceRoot":"","sources":["../../../../../src/server/unauthenticated/storefront/unauthenticated.storefront.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,wBAAwB,CAAC;AAErE,QAAA,MAAM,IAAI,EAAE,6BAmCX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|