@shopify/shopify-app-remix 2.7.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/react/components/AppProvider/AppProvider.js +2 -0
- package/build/cjs/react/components/AppProxyForm/AppProxyForm.js +80 -0
- package/build/cjs/react/components/AppProxyLink/AppProxyLink.js +56 -0
- package/build/cjs/react/components/AppProxyProvider/AppProxyProvider.js +79 -0
- package/build/cjs/react/index.js +7 -0
- package/build/cjs/server/adapters/node/index.js +1 -1
- package/build/cjs/server/authenticate/admin/authenticate.js +1 -5
- package/build/cjs/server/authenticate/admin/strategies/token-exchange.js +1 -1
- package/build/cjs/server/authenticate/helpers/validate-session-token.js +11 -7
- package/build/cjs/server/authenticate/public/appProxy/authenticate.js +49 -20
- package/build/cjs/server/authenticate/public/checkout/authenticate.js +1 -1
- package/build/cjs/server/boundary/index.js +1 -1
- package/build/cjs/server/shopify-app.js +1 -1
- package/build/cjs/server/version.js +1 -1
- package/build/ts/react/components/AppProvider/AppProvider.d.ts +2 -0
- package/build/ts/react/components/AppProvider/AppProvider.d.ts.map +1 -1
- package/build/ts/react/components/AppProvider/AppProvider.js +2 -0
- package/build/ts/react/components/AppProvider/AppProvider.js.map +1 -1
- package/build/ts/react/components/AppProxyForm/AppProxyForm.d.ts +59 -0
- package/build/ts/react/components/AppProxyForm/AppProxyForm.d.ts.map +1 -0
- package/build/ts/react/components/AppProxyForm/AppProxyForm.doc.d.ts +4 -0
- package/build/ts/react/components/AppProxyForm/AppProxyForm.doc.d.ts.map +1 -0
- package/build/ts/react/components/AppProxyForm/AppProxyForm.doc.js +28 -0
- package/build/ts/react/components/AppProxyForm/AppProxyForm.doc.js.map +1 -0
- package/build/ts/react/components/AppProxyForm/AppProxyForm.js +71 -0
- package/build/ts/react/components/AppProxyForm/AppProxyForm.js.map +1 -0
- package/build/ts/react/components/AppProxyForm/index.d.ts +2 -0
- package/build/ts/react/components/AppProxyForm/index.d.ts.map +1 -0
- package/build/ts/react/components/AppProxyForm/index.js +6 -0
- package/build/ts/react/components/AppProxyForm/index.js.map +1 -0
- package/build/ts/react/components/AppProxyLink/AppProxyLink.d.ts +36 -0
- package/build/ts/react/components/AppProxyLink/AppProxyLink.d.ts.map +1 -0
- package/build/ts/react/components/AppProxyLink/AppProxyLink.doc.d.ts +4 -0
- package/build/ts/react/components/AppProxyLink/AppProxyLink.doc.d.ts.map +1 -0
- package/build/ts/react/components/AppProxyLink/AppProxyLink.doc.js +28 -0
- package/build/ts/react/components/AppProxyLink/AppProxyLink.doc.js.map +1 -0
- package/build/ts/react/components/AppProxyLink/AppProxyLink.js +47 -0
- package/build/ts/react/components/AppProxyLink/AppProxyLink.js.map +1 -0
- package/build/ts/react/components/AppProxyLink/index.d.ts +2 -0
- package/build/ts/react/components/AppProxyLink/index.d.ts.map +1 -0
- package/build/ts/react/components/AppProxyLink/index.js +6 -0
- package/build/ts/react/components/AppProxyLink/index.js.map +1 -0
- package/build/ts/react/components/AppProxyProvider/AppProxyProvider.d.ts +55 -0
- package/build/ts/react/components/AppProxyProvider/AppProxyProvider.d.ts.map +1 -0
- package/build/ts/react/components/AppProxyProvider/AppProxyProvider.doc.d.ts +4 -0
- package/build/ts/react/components/AppProxyProvider/AppProxyProvider.doc.d.ts.map +1 -0
- package/build/ts/react/components/AppProxyProvider/AppProxyProvider.doc.js +40 -0
- package/build/ts/react/components/AppProxyProvider/AppProxyProvider.doc.js.map +1 -0
- package/build/ts/react/components/AppProxyProvider/AppProxyProvider.js +65 -0
- package/build/ts/react/components/AppProxyProvider/AppProxyProvider.js.map +1 -0
- package/build/ts/react/components/AppProxyProvider/index.d.ts +2 -0
- package/build/ts/react/components/AppProxyProvider/index.d.ts.map +1 -0
- package/build/ts/react/components/AppProxyProvider/index.js +7 -0
- package/build/ts/react/components/AppProxyProvider/index.js.map +1 -0
- package/build/ts/react/components/index.d.ts +3 -0
- package/build/ts/react/components/index.d.ts.map +1 -1
- package/build/ts/react/components/index.js +3 -0
- package/build/ts/react/components/index.js.map +1 -1
- package/build/ts/server/__test-helpers/const.d.ts +1 -1
- package/build/ts/server/__test-helpers/test-config.d.ts +1 -1
- package/build/ts/server/authenticate/admin/authenticate.js +1 -1
- package/build/ts/server/authenticate/admin/authenticate.js.map +1 -1
- package/build/ts/server/authenticate/helpers/validate-session-token.d.ts +1 -1
- package/build/ts/server/authenticate/helpers/validate-session-token.d.ts.map +1 -1
- package/build/ts/server/authenticate/helpers/validate-session-token.js +12 -14
- package/build/ts/server/authenticate/helpers/validate-session-token.js.map +1 -1
- package/build/ts/server/authenticate/public/appProxy/authenticate.d.ts.map +1 -1
- package/build/ts/server/authenticate/public/appProxy/authenticate.js +59 -22
- package/build/ts/server/authenticate/public/appProxy/authenticate.js.map +1 -1
- package/build/ts/server/authenticate/public/appProxy/types.d.ts +37 -2
- package/build/ts/server/authenticate/public/appProxy/types.d.ts.map +1 -1
- package/build/ts/server/authenticate/public/checkout/authenticate.d.ts.map +1 -1
- package/build/ts/server/authenticate/public/checkout/authenticate.js +1 -3
- package/build/ts/server/authenticate/public/checkout/authenticate.js.map +1 -1
- package/build/ts/server/boundary/index.d.ts +1 -1
- package/build/ts/server/boundary/index.js +1 -1
- package/build/ts/server/version.d.ts +1 -1
- package/build/ts/server/version.js +1 -1
- package/package.json +8 -7
|
@@ -7,39 +7,25 @@ function authenticateAppProxyFactory(params) {
|
|
|
7
7
|
var api = params.api, config = params.config, logger = params.logger;
|
|
8
8
|
return function authenticate(request) {
|
|
9
9
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
10
|
-
var
|
|
10
|
+
var url, shop, sessionId, session, context_1, context;
|
|
11
11
|
return tslib_1.__generator(this, function (_a) {
|
|
12
12
|
switch (_a.label) {
|
|
13
13
|
case 0:
|
|
14
14
|
logger.info('Authenticating app proxy request');
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
isValid = false;
|
|
18
|
-
_a.label = 1;
|
|
15
|
+
url = new URL(request.url);
|
|
16
|
+
return [4 /*yield*/, validateAppProxyHmac(params, url)];
|
|
19
17
|
case 1:
|
|
20
|
-
_a.
|
|
21
|
-
return [4 /*yield*/, api.utils.validateHmac(query, {
|
|
22
|
-
signator: 'appProxy',
|
|
23
|
-
})];
|
|
24
|
-
case 2:
|
|
25
|
-
isValid = _a.sent();
|
|
26
|
-
return [3 /*break*/, 4];
|
|
27
|
-
case 3:
|
|
28
|
-
error_1 = _a.sent();
|
|
29
|
-
logger.info(error_1.message);
|
|
30
|
-
throw new Response(undefined, { status: 400, statusText: 'Bad Request' });
|
|
31
|
-
case 4:
|
|
32
|
-
if (!isValid) {
|
|
18
|
+
if (!(_a.sent())) {
|
|
33
19
|
logger.info('App proxy request has invalid signature');
|
|
34
20
|
throw new Response(undefined, {
|
|
35
21
|
status: 400,
|
|
36
22
|
statusText: 'Bad Request',
|
|
37
23
|
});
|
|
38
24
|
}
|
|
39
|
-
shop = searchParams.get('shop');
|
|
25
|
+
shop = url.searchParams.get('shop');
|
|
40
26
|
sessionId = api.session.getOfflineId(shop);
|
|
41
27
|
return [4 /*yield*/, config.sessionStorage.loadSession(sessionId)];
|
|
42
|
-
case
|
|
28
|
+
case 2:
|
|
43
29
|
session = _a.sent();
|
|
44
30
|
if (!session) {
|
|
45
31
|
context_1 = {
|
|
@@ -64,8 +50,9 @@ function authenticateAppProxyFactory(params) {
|
|
|
64
50
|
}
|
|
65
51
|
exports.authenticateAppProxyFactory = authenticateAppProxyFactory;
|
|
66
52
|
var liquid = function (body, initAndOptions) {
|
|
53
|
+
var processedBody = processLiquidBody(body);
|
|
67
54
|
if (typeof initAndOptions !== 'object') {
|
|
68
|
-
return new Response(
|
|
55
|
+
return new Response(processedBody, {
|
|
69
56
|
status: initAndOptions || 200,
|
|
70
57
|
headers: {
|
|
71
58
|
'Content-Type': 'application/liquid',
|
|
@@ -73,9 +60,59 @@ var liquid = function (body, initAndOptions) {
|
|
|
73
60
|
});
|
|
74
61
|
}
|
|
75
62
|
var _a = initAndOptions || {}, layout = _a.layout, responseInit = tslib_1.__rest(_a, ["layout"]);
|
|
76
|
-
var responseBody = layout === false ? "{% layout none %} ".concat(
|
|
63
|
+
var responseBody = layout === false ? "{% layout none %} ".concat(processedBody) : processedBody;
|
|
77
64
|
var headers = new Headers(responseInit.headers);
|
|
78
65
|
headers.set('Content-Type', 'application/liquid');
|
|
79
66
|
return new Response(responseBody, tslib_1.__assign(tslib_1.__assign({}, responseInit), { headers: headers }));
|
|
80
67
|
};
|
|
68
|
+
function validateAppProxyHmac(params, url) {
|
|
69
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
70
|
+
var api, logger, searchParams, isValid, cleanPath, data, searchParams_1, error_1;
|
|
71
|
+
return tslib_1.__generator(this, function (_a) {
|
|
72
|
+
switch (_a.label) {
|
|
73
|
+
case 0:
|
|
74
|
+
api = params.api, logger = params.logger;
|
|
75
|
+
_a.label = 1;
|
|
76
|
+
case 1:
|
|
77
|
+
_a.trys.push([1, 6, , 7]);
|
|
78
|
+
searchParams = new URLSearchParams(url.search);
|
|
79
|
+
if (!searchParams.get('index')) {
|
|
80
|
+
searchParams.delete('index');
|
|
81
|
+
}
|
|
82
|
+
return [4 /*yield*/, api.utils.validateHmac(Object.fromEntries(searchParams.entries()), { signator: 'appProxy' })];
|
|
83
|
+
case 2:
|
|
84
|
+
isValid = _a.sent();
|
|
85
|
+
if (!!isValid) return [3 /*break*/, 5];
|
|
86
|
+
cleanPath = url.pathname
|
|
87
|
+
.replace(/^\//, '')
|
|
88
|
+
.replace(/\/$/, '')
|
|
89
|
+
.replaceAll('/', '.');
|
|
90
|
+
data = "routes%2F".concat(cleanPath);
|
|
91
|
+
searchParams = new URLSearchParams("?_data=".concat(data, "&").concat(searchParams.toString().replace(/^\?/, '')));
|
|
92
|
+
return [4 /*yield*/, api.utils.validateHmac(Object.fromEntries(searchParams.entries()), { signator: 'appProxy' })];
|
|
93
|
+
case 3:
|
|
94
|
+
isValid = _a.sent();
|
|
95
|
+
if (!!isValid) return [3 /*break*/, 5];
|
|
96
|
+
searchParams_1 = new URLSearchParams("?_data=".concat(data, "._index&").concat(url.search.replace(/^\?/, '')));
|
|
97
|
+
return [4 /*yield*/, api.utils.validateHmac(Object.fromEntries(searchParams_1.entries()), { signator: 'appProxy' })];
|
|
98
|
+
case 4:
|
|
99
|
+
isValid = _a.sent();
|
|
100
|
+
_a.label = 5;
|
|
101
|
+
case 5: return [2 /*return*/, isValid];
|
|
102
|
+
case 6:
|
|
103
|
+
error_1 = _a.sent();
|
|
104
|
+
logger.info(error_1.message);
|
|
105
|
+
throw new Response(undefined, { status: 400, statusText: 'Bad Request' });
|
|
106
|
+
case 7: return [2 /*return*/];
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
function processLiquidBody(body) {
|
|
112
|
+
return (body
|
|
113
|
+
// Add trailing slashes to relative form action URLs
|
|
114
|
+
.replaceAll(/<(form[^>]+)action="(\/[^"?]+)(\?[^"]+)?">/g, '<$1action="$2/$3">')
|
|
115
|
+
// Add trailing slashes to relative link href URLs
|
|
116
|
+
.replaceAll(/<(a[^>]+)href="(\/[^"?]+)(\?[^"]+)?">/g, '<$1href="$2/$3">'));
|
|
117
|
+
}
|
|
81
118
|
//# sourceMappingURL=authenticate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticate.js","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/appProxy/authenticate.ts"],"names":[],"mappings":";;;;AAEA,4CAA6E;AAU7E,SAAgB,2BAA2B,CAEzC,MAAmB;IACZ,IAAA,GAAG,GAAoB,MAAM,IAA1B,EAAE,MAAM,GAAY,MAAM,OAAlB,EAAE,MAAM,GAAI,MAAM,OAAV,CAAW;IAErC,OAAO,SAAe,YAAY,CAChC,OAAO;;;;;;wBAEP,MAAM,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"authenticate.js","source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AAC,OAAK,CAAC,OAAO,CAAC,CAAC;oBAC3B,MAAM,IAAI,QAAQ,CAAC,SAAS,EAAE,EAAC,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,aAAa,EAAC,CAAC,CAAC;;;;;CAE3E;AAED,SAAS,iBAAiB,CAAC,IAAY;IACrC,OAAO,CACL,IAAI;QACF,oDAAoD;SACnD,UAAU,CACT,6CAA6C,EAC7C,oBAAoB,CACrB;QACD,kDAAkD;SACjD,UAAU,CAAC,wCAAwC,EAAE,kBAAkB,CAAC,CAC5E,CAAC;AACJ,CAAC"}
|
|
@@ -16,7 +16,7 @@ interface Context {
|
|
|
16
16
|
* <caption>Rendering liquid content.</caption>
|
|
17
17
|
* <description>Use the `liquid` helper to render a `Response` with Liquid content using the shop's theme. See the [Liquid reference](https://shopify.dev/docs/api/liquid) for all the features it enables.</description>
|
|
18
18
|
* ```ts
|
|
19
|
-
* // app/routes
|
|
19
|
+
* // /app/routes/**\/*.ts
|
|
20
20
|
* import {authenticate} from "~/shopify.server"
|
|
21
21
|
*
|
|
22
22
|
* export async function loader({ request }) {
|
|
@@ -30,7 +30,7 @@ interface Context {
|
|
|
30
30
|
* <caption>Rendering liquid content without a layout.</caption>
|
|
31
31
|
* <description>Set the `layout` option to `false` to render the Liquid content without a theme.</description>
|
|
32
32
|
* ```ts
|
|
33
|
-
* // app/routes
|
|
33
|
+
* // /app/routes/**\/*.ts
|
|
34
34
|
* import {authenticate} from "~/shopify.server"
|
|
35
35
|
*
|
|
36
36
|
* export async function loader({ request }) {
|
|
@@ -42,6 +42,41 @@ interface Context {
|
|
|
42
42
|
* );
|
|
43
43
|
* }
|
|
44
44
|
* ```
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* <caption>Rendering a form in a Liquid response.</caption>
|
|
48
|
+
* <description>Handle form submissions through an app proxy.</description>
|
|
49
|
+
* ```ts
|
|
50
|
+
* // app/routes/apps.proxy.my-action.tsx
|
|
51
|
+
* import { redirect } from "@remix-run/node";
|
|
52
|
+
* import { authenticate } from "~/shopify.server";
|
|
53
|
+
*
|
|
54
|
+
* export async function loader({ request }) {
|
|
55
|
+
* const { liquid } = await authenticate.public.appProxy(request);
|
|
56
|
+
*
|
|
57
|
+
* return liquid(`
|
|
58
|
+
* <form method="post" action="/apps/proxy/my-action">
|
|
59
|
+
* <input type="text" name="field" />
|
|
60
|
+
* <button type="submit">Submit</button>
|
|
61
|
+
* </form>
|
|
62
|
+
* `);
|
|
63
|
+
* }
|
|
64
|
+
*
|
|
65
|
+
* export async function action({ request }) {
|
|
66
|
+
* await authenticate.public.appProxy(request);
|
|
67
|
+
*
|
|
68
|
+
* const formData = await request.formData();
|
|
69
|
+
* const field = formData.get("field")?.toString();
|
|
70
|
+
*
|
|
71
|
+
* // Perform actions here
|
|
72
|
+
* if (field) {
|
|
73
|
+
* console.log("Field:", field);
|
|
74
|
+
* }
|
|
75
|
+
*
|
|
76
|
+
* // Return to the form page
|
|
77
|
+
* return redirect("/apps/proxy/my-action");
|
|
78
|
+
* }
|
|
79
|
+
* ```
|
|
45
80
|
*/
|
|
46
81
|
liquid: LiquidResponseFunction;
|
|
47
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/appProxy/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAAC,eAAe,EAAE,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAEpE,MAAM,MAAM,oBAAoB,GAAG,CACjC,OAAO,EAAE,OAAO,KACb,OAAO,CAAC,eAAe,GAAG,0BAA0B,CAAC,CAAC;AAE3D,UAAU,OAAO;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,sBAAsB,GAAG,CACnC,IAAI,EAAE,MAAM,EACZ,cAAc,CAAC,EAAE,MAAM,G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;;;;;;;;;;;;;;;;;OA8BG;IACH,UAAU,EAAE,iBAAiB,CAAC;CAC/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticate.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/checkout/authenticate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAShD,OAAO,KAAK,EAAC,oBAAoB,EAAkB,MAAM,SAAS,CAAC;AAEnE,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,WAAW,GAClB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"authenticate.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/checkout/authenticate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAShD,OAAO,KAAK,EAAC,oBAAoB,EAAkB,MAAM,SAAS,CAAC;AAEnE,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,WAAW,GAClB,oBAAoB,CAkCtB"}
|
|
@@ -27,9 +27,7 @@ function authenticateCheckoutFactory(params) {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
_b = {};
|
|
30
|
-
return [4 /*yield*/, (0, helpers_1.validateSessionToken)(params, sessionTokenHeader, {
|
|
31
|
-
checkAudience: false,
|
|
32
|
-
})];
|
|
30
|
+
return [4 /*yield*/, (0, helpers_1.validateSessionToken)(params, request, sessionTokenHeader, { checkAudience: false })];
|
|
33
31
|
case 1: return [2 /*return*/, (_b.sessionToken = _c.sent(),
|
|
34
32
|
_b.cors = (0, helpers_1.ensureCORSHeadersFactory)(params, request, corsHeaders),
|
|
35
33
|
_b)];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticate.js","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/checkout/authenticate.ts"],"names":[],"mappings":";;;;AACA,yCAMuB;AAIvB,SAAgB,2BAA2B,CACzC,MAAmB;IAEnB,OAAO,SAAe,oBAAoB,CACxC,OAAO,EACP,OAAY;;QAAZ,wBAAA,EAAA,YAAY;;;;;;;wBAEL,MAAM,GAAI,MAAM,OAAV,CAAW;wBAElB,WAAW,GAAG,MAAA,OAAO,CAAC,WAAW,mCAAI,EAAE,CAAC;wBAE9C,IAAA,6BAAmB,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;wBACrC,IAAA,iCAAuB,EAAC,MAAM,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;wBAEhD,kBAAkB,GAAG,IAAA,+BAAqB,EAAC,OAAO,CAAC,CAAC;wBAE1D,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;wBAE/C,IAAI,CAAC,kBAAkB,EAAE,CAAC;4BACxB,MAAM,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;4BACxD,MAAM,IAAI,QAAQ,CAAC,SAAS,EAAE;gCAC5B,MAAM,EAAE,GAAG;gCACX,UAAU,EAAE,cAAc;6BAC3B,CAAC,CAAC;wBACL,CAAC;;wBAGe,qBAAM,IAAA,8BAAoB,
|
|
1
|
+
{"version":3,"file":"authenticate.js","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/checkout/authenticate.ts"],"names":[],"mappings":";;;;AACA,yCAMuB;AAIvB,SAAgB,2BAA2B,CACzC,MAAmB;IAEnB,OAAO,SAAe,oBAAoB,CACxC,OAAO,EACP,OAAY;;QAAZ,wBAAA,EAAA,YAAY;;;;;;;wBAEL,MAAM,GAAI,MAAM,OAAV,CAAW;wBAElB,WAAW,GAAG,MAAA,OAAO,CAAC,WAAW,mCAAI,EAAE,CAAC;wBAE9C,IAAA,6BAAmB,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;wBACrC,IAAA,iCAAuB,EAAC,MAAM,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;wBAEhD,kBAAkB,GAAG,IAAA,+BAAqB,EAAC,OAAO,CAAC,CAAC;wBAE1D,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;wBAE/C,IAAI,CAAC,kBAAkB,EAAE,CAAC;4BACxB,MAAM,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;4BACxD,MAAM,IAAI,QAAQ,CAAC,SAAS,EAAE;gCAC5B,MAAM,EAAE,GAAG;gCACX,UAAU,EAAE,cAAc;6BAC3B,CAAC,CAAC;wBACL,CAAC;;wBAGe,qBAAM,IAAA,8BAAoB,EACtC,MAAM,EACN,OAAO,EACP,kBAAkB,EAClB,EAAC,aAAa,EAAE,KAAK,EAAC,CACvB,EAAA;4BANH,uBACE,eAAY,GAAE,SAKb;4BACD,OAAI,GAAE,IAAA,kCAAwB,EAAC,MAAM,EAAE,OAAO,EAAE,WAAW,CAAC;iCAC5D;;;;KACH,CAAC;AACJ,CAAC;AApCD,kEAoCC"}
|
|
@@ -20,7 +20,7 @@ export declare const boundary: {
|
|
|
20
20
|
*/
|
|
21
21
|
error: typeof errorBoundary;
|
|
22
22
|
/**
|
|
23
|
-
* A function that sets the appropriate document
|
|
23
|
+
* A function that sets the appropriate document response headers.
|
|
24
24
|
*
|
|
25
25
|
* @example
|
|
26
26
|
* <caption>Catching errors in a route</caption>
|
|
@@ -23,7 +23,7 @@ exports.boundary = {
|
|
|
23
23
|
*/
|
|
24
24
|
error: error_1.errorBoundary,
|
|
25
25
|
/**
|
|
26
|
-
* A function that sets the appropriate document
|
|
26
|
+
* A function that sets the appropriate document response headers.
|
|
27
27
|
*
|
|
28
28
|
* @example
|
|
29
29
|
* <caption>Catching errors in a route</caption>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SHOPIFY_REMIX_LIBRARY_VERSION = "2.
|
|
1
|
+
export declare const SHOPIFY_REMIX_LIBRARY_VERSION = "2.8.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopify/shopify-app-remix",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "Shopify Remix - to simplify the building of Shopify Apps with Remix",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -50,25 +50,26 @@
|
|
|
50
50
|
"Storefront API"
|
|
51
51
|
],
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@remix-run/react": "^2.
|
|
53
|
+
"@remix-run/react": "^2.8.1",
|
|
54
54
|
"@shopify/generate-docs": "^0.13.2",
|
|
55
55
|
"@shopify/polaris": "^12.18.0",
|
|
56
56
|
"@shopify/react-testing": "^5.1.3",
|
|
57
|
-
"@shopify/shopify-app-session-storage-memory": "^3.0.
|
|
57
|
+
"@shopify/shopify-app-session-storage-memory": "^3.0.3",
|
|
58
58
|
"@types/jsonwebtoken": "^9.0.5",
|
|
59
59
|
"@types/react": "^18.2.18",
|
|
60
|
-
"@types/semver": "^7.5.
|
|
60
|
+
"@types/semver": "^7.5.8",
|
|
61
61
|
"jest-fetch-mock": "^3.0.3",
|
|
62
62
|
"jsonwebtoken": "^9.0.2",
|
|
63
63
|
"react": "^18.2.0",
|
|
64
|
-
"react-dom": "^18.2.0"
|
|
64
|
+
"react-dom": "^18.2.0",
|
|
65
|
+
"react-router-dom": "^6.22.3"
|
|
65
66
|
},
|
|
66
67
|
"dependencies": {
|
|
67
68
|
"@remix-run/node": "^2.6.0",
|
|
68
69
|
"@remix-run/server-runtime": "^2.5.1",
|
|
69
70
|
"@shopify/admin-api-client": "^0.2.3",
|
|
70
|
-
"@shopify/shopify-api": "^9.
|
|
71
|
-
"@shopify/shopify-app-session-storage": "^2.1.
|
|
71
|
+
"@shopify/shopify-api": "^9.7.1",
|
|
72
|
+
"@shopify/shopify-app-session-storage": "^2.1.3",
|
|
72
73
|
"@shopify/storefront-api-client": "^0.2.3",
|
|
73
74
|
"isbot": "^3.7.1",
|
|
74
75
|
"semver": "^7.6.0"
|