@shopify/shopify-app-remix 2.6.1 → 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/fulfillment-service/authenticate.js +70 -0
- 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/future/flags.js +28 -0
- package/build/cjs/server/shopify-app.js +9 -4
- package/build/cjs/server/types.js +0 -4
- 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.admin.doc.d.ts.map +1 -1
- package/build/ts/server/authenticate/admin/authenticate.admin.doc.js +13 -0
- package/build/ts/server/authenticate/admin/authenticate.admin.doc.js.map +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/admin/types.d.ts +27 -27
- package/build/ts/server/authenticate/flow/authenticate.flow.doc.d.ts.map +1 -1
- package/build/ts/server/authenticate/flow/authenticate.flow.doc.js +13 -0
- package/build/ts/server/authenticate/flow/authenticate.flow.doc.js.map +1 -1
- package/build/ts/server/authenticate/flow/types.d.ts +4 -4
- package/build/ts/server/authenticate/fulfillment-service/authenticate.d.ts +5 -0
- package/build/ts/server/authenticate/fulfillment-service/authenticate.d.ts.map +1 -0
- package/build/ts/server/authenticate/fulfillment-service/authenticate.fulfillment-service.doc.d.ts +4 -0
- package/build/ts/server/authenticate/fulfillment-service/authenticate.fulfillment-service.doc.d.ts.map +1 -0
- package/build/ts/server/authenticate/fulfillment-service/authenticate.fulfillment-service.doc.js +46 -0
- package/build/ts/server/authenticate/fulfillment-service/authenticate.fulfillment-service.doc.js.map +1 -0
- package/build/ts/server/authenticate/fulfillment-service/authenticate.js +73 -0
- package/build/ts/server/authenticate/fulfillment-service/authenticate.js.map +1 -0
- package/build/ts/server/authenticate/fulfillment-service/types.d.ts +109 -0
- package/build/ts/server/authenticate/fulfillment-service/types.d.ts.map +1 -0
- package/build/ts/server/authenticate/fulfillment-service/types.js +3 -0
- package/build/ts/server/authenticate/fulfillment-service/types.js.map +1 -0
- 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/authenticate.public.app-proxy.doc.d.ts.map +1 -1
- package/build/ts/server/authenticate/public/appProxy/authenticate.public.app-proxy.doc.js +19 -0
- package/build/ts/server/authenticate/public/appProxy/authenticate.public.app-proxy.doc.js.map +1 -1
- package/build/ts/server/authenticate/public/appProxy/types.d.ts +60 -7
- 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/authenticate/public/checkout/authenticate.public.checkout.doc.d.ts.map +1 -1
- package/build/ts/server/authenticate/public/checkout/authenticate.public.checkout.doc.js +18 -0
- package/build/ts/server/authenticate/public/checkout/authenticate.public.checkout.doc.js.map +1 -1
- package/build/ts/server/authenticate/webhooks/authenticate.webhooks.doc.d.ts.map +1 -1
- package/build/ts/server/authenticate/webhooks/authenticate.webhooks.doc.js +13 -0
- package/build/ts/server/authenticate/webhooks/authenticate.webhooks.doc.js.map +1 -1
- package/build/ts/server/authenticate/webhooks/types.d.ts +13 -14
- package/build/ts/server/authenticate/webhooks/types.d.ts.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/clients/admin/types.d.ts +85 -14
- package/build/ts/server/clients/admin/types.d.ts.map +1 -1
- package/build/ts/server/clients/storefront/types.d.ts +47 -0
- package/build/ts/server/clients/storefront/types.d.ts.map +1 -1
- package/build/ts/server/clients/types.d.ts +14 -1
- package/build/ts/server/clients/types.d.ts.map +1 -1
- package/build/ts/server/future/flags.d.ts +3 -1
- package/build/ts/server/future/flags.d.ts.map +1 -1
- package/build/ts/server/future/flags.js +20 -0
- package/build/ts/server/future/flags.js.map +1 -1
- package/build/ts/server/shopify-app.d.ts.map +1 -1
- package/build/ts/server/shopify-app.js +5 -1
- package/build/ts/server/shopify-app.js.map +1 -1
- package/build/ts/server/types.d.ts +35 -6
- package/build/ts/server/types.d.ts.map +1 -1
- package/build/ts/server/types.js.map +1 -1
- package/build/ts/server/version.d.ts +1 -1
- package/build/ts/server/version.js +1 -1
- package/package.json +9 -8
|
@@ -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","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;wBAE1C,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CA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appProxy/authenticate.public.app-proxy.doc.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
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"}
|
|
@@ -16,6 +16,19 @@ var data = {
|
|
|
16
16
|
type: 'AuthenticateAppProxy',
|
|
17
17
|
},
|
|
18
18
|
],
|
|
19
|
+
defaultExample: {
|
|
20
|
+
description: 'Authenticate and fetch product information',
|
|
21
|
+
codeblock: {
|
|
22
|
+
title: 'Authenticate and fetch product information',
|
|
23
|
+
tabs: [
|
|
24
|
+
{
|
|
25
|
+
title: '/app/routes/**.ts',
|
|
26
|
+
language: 'typescript',
|
|
27
|
+
code: './authenticate.public.app-proxy.doc.example.ts',
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
19
32
|
jsDocTypeExamples: ['AppProxyContextWithSession'],
|
|
20
33
|
related: [
|
|
21
34
|
{
|
|
@@ -28,6 +41,12 @@ var data = {
|
|
|
28
41
|
subtitle: 'Interact with the Storefront API.',
|
|
29
42
|
url: '/docs/api/shopify-app-remix/apis/storefront-api',
|
|
30
43
|
},
|
|
44
|
+
{
|
|
45
|
+
name: 'Liquid reference',
|
|
46
|
+
subtitle: "Use the shop's theme to render a template.",
|
|
47
|
+
url: '/docs/api/liquid',
|
|
48
|
+
type: 'liquid',
|
|
49
|
+
},
|
|
31
50
|
],
|
|
32
51
|
};
|
|
33
52
|
exports.default = data;
|
package/build/ts/server/authenticate/public/appProxy/authenticate.public.app-proxy.doc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticate.public.app-proxy.doc.js","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/appProxy/authenticate.public.app-proxy.doc.ts"],"names":[],"mappings":";;AAEA,IAAM,IAAI,GAAkC;IAC1C,IAAI,EAAE,WAAW;IACjB,WAAW,EACT,yHAAyH;QACzH,8IAA8I;QAC9I,kIAAkI;IACpI,QAAQ,EAAE,cAAc;IACxB,WAAW,EAAE,QAAQ;IACrB,IAAI,EAAE,QAAQ;IACd,iBAAiB,EAAE,KAAK;IACxB,WAAW,EAAE;QACX;YACE,KAAK,EAAE,8BAA8B;YACrC,WAAW,EACT,oEAAoE;YACtE,IAAI,EAAE,sBAAsB;SAC7B;KACF;IACD,iBAAiB,EAAE,CAAC,4BAA4B,CAAC;IACjD,OAAO,EAAE;QACP;YACE,IAAI,EAAE,mBAAmB;YACzB,QAAQ,EAAE,8BAA8B;YACxC,GAAG,EAAE,4CAA4C;SAClD;QACD;YACE,IAAI,EAAE,wBAAwB;YAC9B,QAAQ,EAAE,mCAAmC;YAC7C,GAAG,EAAE,iDAAiD;SACvD;KACF;CACF,CAAC;AAEF,kBAAe,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"authenticate.public.app-proxy.doc.js","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/appProxy/authenticate.public.app-proxy.doc.ts"],"names":[],"mappings":";;AAEA,IAAM,IAAI,GAAkC;IAC1C,IAAI,EAAE,WAAW;IACjB,WAAW,EACT,yHAAyH;QACzH,8IAA8I;QAC9I,kIAAkI;IACpI,QAAQ,EAAE,cAAc;IACxB,WAAW,EAAE,QAAQ;IACrB,IAAI,EAAE,QAAQ;IACd,iBAAiB,EAAE,KAAK;IACxB,WAAW,EAAE;QACX;YACE,KAAK,EAAE,8BAA8B;YACrC,WAAW,EACT,oEAAoE;YACtE,IAAI,EAAE,sBAAsB;SAC7B;KACF;IACD,cAAc,EAAE;QACd,WAAW,EAAE,4CAA4C;QACzD,SAAS,EAAE;YACT,KAAK,EAAE,4CAA4C;YACnD,IAAI,EAAE;gBACJ;oBACE,KAAK,EAAE,mBAAmB;oBAC1B,QAAQ,EAAE,YAAY;oBACtB,IAAI,EAAE,gDAAgD;iBACvD;aACF;SACF;KACF;IACD,iBAAiB,EAAE,CAAC,4BAA4B,CAAC;IACjD,OAAO,EAAE;QACP;YACE,IAAI,EAAE,mBAAmB;YACzB,QAAQ,EAAE,8BAA8B;YACxC,GAAG,EAAE,4CAA4C;SAClD;QACD;YACE,IAAI,EAAE,wBAAwB;YAC9B,QAAQ,EAAE,mCAAmC;YAC7C,GAAG,EAAE,iDAAiD;SACvD;QACD;YACE,IAAI,EAAE,kBAAkB;YACxB,QAAQ,EAAE,4CAA4C;YACtD,GAAG,EAAE,kBAAkB;YACvB,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAC;AAEF,kBAAe,IAAI,CAAC"}
|
|
@@ -14,9 +14,9 @@ interface Context {
|
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* <caption>Rendering liquid content.</caption>
|
|
17
|
-
* <description>Use the `liquid` helper to render a `Response` with Liquid content using the shop's theme.</description>
|
|
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
|
}
|
|
@@ -82,10 +117,13 @@ export interface AppProxyContextWithSession<Resources extends ShopifyRestResourc
|
|
|
82
117
|
*
|
|
83
118
|
* export const loader = async ({ request }) => {
|
|
84
119
|
* // Get the session for the shop that initiated the request to the app proxy.
|
|
85
|
-
* const { session } =
|
|
120
|
+
* const { session } =
|
|
121
|
+
* await authenticate.public.appProxy(request);
|
|
86
122
|
*
|
|
87
123
|
* // Use the session data to make to queries to your database or additional requests.
|
|
88
|
-
* return json(
|
|
124
|
+
* return json(
|
|
125
|
+
* await getMyAppModelData({shop: session.shop})
|
|
126
|
+
* );
|
|
89
127
|
* };
|
|
90
128
|
* ```
|
|
91
129
|
*/
|
|
@@ -113,7 +151,11 @@ export interface AppProxyContextWithSession<Resources extends ShopifyRestResourc
|
|
|
113
151
|
* }
|
|
114
152
|
* }
|
|
115
153
|
* }`,
|
|
116
|
-
* {
|
|
154
|
+
* {
|
|
155
|
+
* variables: {
|
|
156
|
+
* input: { title: "Product Name" }
|
|
157
|
+
* }
|
|
158
|
+
* }
|
|
117
159
|
* );
|
|
118
160
|
*
|
|
119
161
|
* const productData = await response.json();
|
|
@@ -136,7 +178,18 @@ export interface AppProxyContextWithSession<Resources extends ShopifyRestResourc
|
|
|
136
178
|
* export async function action({ request }: ActionFunctionArgs) {
|
|
137
179
|
* const { storefront } = await authenticate.public.appProxy(request);
|
|
138
180
|
*
|
|
139
|
-
* const response = await storefront.graphql(
|
|
181
|
+
* const response = await storefront.graphql(
|
|
182
|
+
* `#graphql
|
|
183
|
+
* query blogIds {
|
|
184
|
+
* blogs(first: 10) {
|
|
185
|
+
* edges {
|
|
186
|
+
* node {
|
|
187
|
+
* id
|
|
188
|
+
* }
|
|
189
|
+
* }
|
|
190
|
+
* }
|
|
191
|
+
* }`
|
|
192
|
+
* );
|
|
140
193
|
*
|
|
141
194
|
* return json(await response.json());
|
|
142
195
|
* }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/appProxy/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,E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nB;;;OAGG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;;OAGG;IACH,UAAU,EAAE,SAAS,CAAC;CACvB;AAED,MAAM,WAAW,0BAA0B,CACzC,SAAS,SAAS,oBAAoB,GAAG,oBAAoB,CAC7D,SAAQ,OAAO;IACf;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,KAAK,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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"}
|
package/build/ts/server/authenticate/public/checkout/authenticate.public.checkout.doc.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,6BAoCX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -14,6 +14,24 @@ var data = {
|
|
|
14
14
|
type: 'AuthenticateCheckout',
|
|
15
15
|
},
|
|
16
16
|
],
|
|
17
|
+
defaultExample: {
|
|
18
|
+
description: 'Authenticate and return offers for the shop',
|
|
19
|
+
codeblock: {
|
|
20
|
+
title: 'Authenticate and return offers for the shop',
|
|
21
|
+
tabs: [
|
|
22
|
+
{
|
|
23
|
+
title: '/app/routes/**.ts',
|
|
24
|
+
language: 'typescript',
|
|
25
|
+
code: './authenticate.public.checkout.doc.example.ts',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
title: '/app/offers.server.ts',
|
|
29
|
+
language: 'typescript',
|
|
30
|
+
code: './authenticate.public.checkout.doc.example.offers.ts',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
17
35
|
jsDocTypeExamples: ['CheckoutContext'],
|
|
18
36
|
related: [],
|
|
19
37
|
};
|
package/build/ts/server/authenticate/public/checkout/authenticate.public.checkout.doc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticate.public.checkout.doc.js","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/checkout/authenticate.public.checkout.doc.ts"],"names":[],"mappings":";;AAEA,IAAM,IAAI,GAAkC;IAC1C,IAAI,EAAE,UAAU;IAChB,WAAW,EACT,wKAAwK;IAC1K,QAAQ,EAAE,cAAc;IACxB,WAAW,EAAE,QAAQ;IACrB,IAAI,EAAE,QAAQ;IACd,iBAAiB,EAAE,KAAK;IACxB,WAAW,EAAE;QACX;YACE,KAAK,EAAE,8BAA8B;YACrC,WAAW,EACT,iEAAiE;YACnE,IAAI,EAAE,sBAAsB;SAC7B;KACF;IACD,iBAAiB,EAAE,CAAC,iBAAiB,CAAC;IACtC,OAAO,EAAE,EAAE;CACZ,CAAC;AAEF,kBAAe,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"authenticate.public.checkout.doc.js","sourceRoot":"","sources":["../../../../../../src/server/authenticate/public/checkout/authenticate.public.checkout.doc.ts"],"names":[],"mappings":";;AAEA,IAAM,IAAI,GAAkC;IAC1C,IAAI,EAAE,UAAU;IAChB,WAAW,EACT,wKAAwK;IAC1K,QAAQ,EAAE,cAAc;IACxB,WAAW,EAAE,QAAQ;IACrB,IAAI,EAAE,QAAQ;IACd,iBAAiB,EAAE,KAAK;IACxB,WAAW,EAAE;QACX;YACE,KAAK,EAAE,8BAA8B;YACrC,WAAW,EACT,iEAAiE;YACnE,IAAI,EAAE,sBAAsB;SAC7B;KACF;IACD,cAAc,EAAE;QACd,WAAW,EAAE,6CAA6C;QAC1D,SAAS,EAAE;YACT,KAAK,EAAE,6CAA6C;YACpD,IAAI,EAAE;gBACJ;oBACE,KAAK,EAAE,mBAAmB;oBAC1B,QAAQ,EAAE,YAAY;oBACtB,IAAI,EAAE,+CAA+C;iBACtD;gBACD;oBACE,KAAK,EAAE,uBAAuB;oBAC9B,QAAQ,EAAE,YAAY;oBACtB,IAAI,EAAE,sDAAsD;iBAC7D;aACF;SACF;KACF;IACD,iBAAiB,EAAE,CAAC,iBAAiB,CAAC;IACtC,OAAO,EAAE,EAAE;CACZ,CAAC;AAEF,kBAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,6BAoCX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -14,6 +14,19 @@ var data = {
|
|
|
14
14
|
type: 'AuthenticateWebhook',
|
|
15
15
|
},
|
|
16
16
|
],
|
|
17
|
+
defaultExample: {
|
|
18
|
+
description: 'Update a metafield when a product is updated',
|
|
19
|
+
codeblock: {
|
|
20
|
+
title: 'Update a metafield when a product is updated',
|
|
21
|
+
tabs: [
|
|
22
|
+
{
|
|
23
|
+
title: '/app/routes/**.ts',
|
|
24
|
+
language: 'typescript',
|
|
25
|
+
code: './authenticate.webhooks.doc.example.ts',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
},
|
|
17
30
|
jsDocTypeExamples: ['WebhookContextWithSession'],
|
|
18
31
|
related: [
|
|
19
32
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticate.webhooks.doc.js","sourceRoot":"","sources":["../../../../../src/server/authenticate/webhooks/authenticate.webhooks.doc.ts"],"names":[],"mappings":";;AAEA,IAAM,IAAI,GAAkC;IAC1C,IAAI,EAAE,SAAS;IACf,WAAW,EACT,oDAAoD;QACpD,4NAA4N;IAC9N,QAAQ,EAAE,cAAc;IACxB,IAAI,EAAE,QAAQ;IACd,iBAAiB,EAAE,KAAK;IACxB,WAAW,EAAE;QACX;YACE,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EAAE,iDAAiD;YAC9D,IAAI,EAAE,qBAAqB;SAC5B;KACF;IACD,iBAAiB,EAAE,CAAC,2BAA2B,CAAC;IAChD,OAAO,EAAE;QACP;YACE,IAAI,EAAE,mBAAmB;YACzB,QAAQ,EAAE,8BAA8B;YACxC,GAAG,EAAE,4CAA4C;SAClD;KACF;CACF,CAAC;AAEF,kBAAe,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"authenticate.webhooks.doc.js","sourceRoot":"","sources":["../../../../../src/server/authenticate/webhooks/authenticate.webhooks.doc.ts"],"names":[],"mappings":";;AAEA,IAAM,IAAI,GAAkC;IAC1C,IAAI,EAAE,SAAS;IACf,WAAW,EACT,oDAAoD;QACpD,4NAA4N;IAC9N,QAAQ,EAAE,cAAc;IACxB,IAAI,EAAE,QAAQ;IACd,iBAAiB,EAAE,KAAK;IACxB,WAAW,EAAE;QACX;YACE,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EAAE,iDAAiD;YAC9D,IAAI,EAAE,qBAAqB;SAC5B;KACF;IACD,cAAc,EAAE;QACd,WAAW,EAAE,8CAA8C;QAC3D,SAAS,EAAE;YACT,KAAK,EAAE,8CAA8C;YACrD,IAAI,EAAE;gBACJ;oBACE,KAAK,EAAE,mBAAmB;oBAC1B,QAAQ,EAAE,YAAY;oBACtB,IAAI,EAAE,wCAAwC;iBAC/C;aACF;SACF;KACF;IACD,iBAAiB,EAAE,CAAC,2BAA2B,CAAC;IAChD,OAAO,EAAE;QACP;YACE,IAAI,EAAE,mBAAmB;YACzB,QAAQ,EAAE,8BAA8B;YACxC,GAAG,EAAE,4CAA4C;SAClD;KACF;CACF,CAAC;AAEF,kBAAe,IAAI,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Session, Shopify, ShopifyRestResources } from '@shopify/shopify-api';
|
|
2
|
-
import type { JSONValue } from '../../types';
|
|
3
2
|
import type { AdminApiContext } from '../../clients';
|
|
4
3
|
import type { FeatureEnabled, FutureFlagOptions } from '../../future/flags';
|
|
5
4
|
export interface RegisterWebhooksOptions {
|
|
@@ -17,10 +16,10 @@ interface Context<Topics = string | number | symbol> {
|
|
|
17
16
|
* <description>Get the API version used for webhook request.</description>
|
|
18
17
|
* ```ts
|
|
19
18
|
* // /app/routes/webhooks.tsx
|
|
20
|
-
* import {
|
|
19
|
+
* import { ActionFunctionArgs } from "@remix-run/node";
|
|
21
20
|
* import { authenticate } from "../shopify.server";
|
|
22
21
|
*
|
|
23
|
-
* export const action
|
|
22
|
+
* export const action = async ({ request }: ActionFunctionArgs) => {
|
|
24
23
|
* const { apiVersion } = await authenticate.webhook(request);
|
|
25
24
|
* return new Response();
|
|
26
25
|
* };
|
|
@@ -35,10 +34,10 @@ interface Context<Topics = string | number | symbol> {
|
|
|
35
34
|
* <description>Get the shop that triggered a webhook.</description>
|
|
36
35
|
* ```ts
|
|
37
36
|
* // /app/routes/webhooks.tsx
|
|
38
|
-
* import {
|
|
37
|
+
* import { ActionFunctionArgs } from "@remix-run/node";
|
|
39
38
|
* import { authenticate } from "../shopify.server";
|
|
40
39
|
*
|
|
41
|
-
* export const action
|
|
40
|
+
* export const action = async ({ request }: ActionFunctionArgs) => {
|
|
42
41
|
* const { shop } = await authenticate.webhook(request);
|
|
43
42
|
* return new Response();
|
|
44
43
|
* };
|
|
@@ -53,10 +52,10 @@ interface Context<Topics = string | number | symbol> {
|
|
|
53
52
|
* <description>Get the event topic for the webhook.</description>
|
|
54
53
|
* ```ts
|
|
55
54
|
* // /app/routes/webhooks.tsx
|
|
56
|
-
* import {
|
|
55
|
+
* import { ActionFunctionArgs } from "@remix-run/node";
|
|
57
56
|
* import { authenticate } from "../shopify.server";
|
|
58
57
|
*
|
|
59
|
-
* export const action
|
|
58
|
+
* export const action = async ({ request }: ActionFunctionArgs) => {
|
|
60
59
|
* const { topic } = await authenticate.webhook(request);
|
|
61
60
|
*
|
|
62
61
|
* switch (topic) {
|
|
@@ -78,10 +77,10 @@ interface Context<Topics = string | number | symbol> {
|
|
|
78
77
|
* <description>Get the webhook ID.</description>
|
|
79
78
|
* ```ts
|
|
80
79
|
* // /app/routes/webhooks.tsx
|
|
81
|
-
* import {
|
|
80
|
+
* import { ActionFunctionArgs } from "@remix-run/node";
|
|
82
81
|
* import { authenticate } from "../shopify.server";
|
|
83
82
|
*
|
|
84
|
-
* export const action
|
|
83
|
+
* export const action = async ({ request }: ActionFunctionArgs) => {
|
|
85
84
|
* const { webhookId } = await authenticate.webhook(request);
|
|
86
85
|
* return new Response();
|
|
87
86
|
* };
|
|
@@ -96,16 +95,16 @@ interface Context<Topics = string | number | symbol> {
|
|
|
96
95
|
* <description>Get the request's POST payload.</description>
|
|
97
96
|
* ```ts
|
|
98
97
|
* // /app/routes/webhooks.tsx
|
|
99
|
-
* import {
|
|
98
|
+
* import { ActionFunctionArgs } from "@remix-run/node";
|
|
100
99
|
* import { authenticate } from "../shopify.server";
|
|
101
100
|
*
|
|
102
|
-
* export const action
|
|
101
|
+
* export const action = async ({ request }: ActionFunctionArgs) => {
|
|
103
102
|
* const { payload } = await authenticate.webhook(request);
|
|
104
103
|
* return new Response();
|
|
105
104
|
* };
|
|
106
105
|
* ```
|
|
107
106
|
*/
|
|
108
|
-
payload:
|
|
107
|
+
payload: Record<string, any>;
|
|
109
108
|
/**
|
|
110
109
|
* The sub-topic of the webhook. This is only available for certain webhooks.
|
|
111
110
|
*
|
|
@@ -114,10 +113,10 @@ interface Context<Topics = string | number | symbol> {
|
|
|
114
113
|
* <description>Get the webhook sub-topic.</description>
|
|
115
114
|
* ```ts
|
|
116
115
|
* // /app/routes/webhooks.tsx
|
|
117
|
-
* import {
|
|
116
|
+
* import { ActionFunctionArgs } from "@remix-run/node";
|
|
118
117
|
* import { authenticate } from "../shopify.server";
|
|
119
118
|
*
|
|
120
|
-
* export const action
|
|
119
|
+
* export const action = async ({ request }: ActionFunctionArgs) => {
|
|
121
120
|
* const { subTopic } = await authenticate.webhook(request);
|
|
122
121
|
* return new Response();
|
|
123
122
|
* };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/server/authenticate/webhooks/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAC,MAAM,sBAAsB,CAAC;AAE5E,OAAO,KAAK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ropriate 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>
|