@agnostack/next-shopify 1.1.1-alpha.7 → 1.1.1-alpha.8
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/CHANGELOG.md +7 -0
- package/dist/apiHandlers.d.ts +1 -1
- package/dist/apiHandlers.js +7 -7
- package/dist/apiHelpers.d.ts +1 -1
- package/dist/apiHelpers.js +6 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.1.1-alpha.8](https://github.com/agnostack/next-shopify/compare/v1.1.1-alpha.7...v1.1.1-alpha.8) (2022-11-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* renamed query to graph ([af40892](https://github.com/agnostack/next-shopify/commit/af40892835e72c1c39e0f4983e0758a12ada4245))
|
|
7
|
+
|
|
1
8
|
## [1.1.1-alpha.7](https://github.com/agnostack/next-shopify/compare/v1.1.1-alpha.6...v1.1.1-alpha.7) (2022-11-10)
|
|
2
9
|
|
|
3
10
|
|
package/dist/apiHandlers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function handleRest(props: any): (req: any, res: any, params: any) => Promise<any>;
|
|
2
|
-
export function
|
|
2
|
+
export function handleGraph(props: any): (req: any, res: any, params: any) => Promise<any>;
|
|
3
3
|
export function handleAuth(props: any): (req: any, res: any) => Promise<any>;
|
|
4
4
|
export function handleCallback(props: any): (req: any, res: any) => Promise<any>;
|
|
5
5
|
export function handleAppUninstalled(props: any): (req: any, res: any) => Promise<any>;
|
package/dist/apiHandlers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handleAppUninstalled = exports.handleCallback = exports.handleAuth = exports.
|
|
3
|
+
exports.handleAppUninstalled = exports.handleCallback = exports.handleAuth = exports.handleGraph = exports.handleRest = void 0;
|
|
4
4
|
// NOTE: api routes do NOT work in `next export`
|
|
5
5
|
const shopify_api_1 = require("@shopify/shopify-api");
|
|
6
6
|
const utils_1 = require("./utils");
|
|
@@ -24,14 +24,14 @@ const handleRest = (props) => async (req, res, params) => {
|
|
|
24
24
|
return res.status(statusCode).json(response);
|
|
25
25
|
};
|
|
26
26
|
exports.handleRest = handleRest;
|
|
27
|
-
const
|
|
28
|
-
console.warn(`>>> >
|
|
29
|
-
console.warn(`>>> >
|
|
27
|
+
const handleGraph = (props) => async (req, res, params) => {
|
|
28
|
+
console.warn(`>>> > handleGraph > res`, res);
|
|
29
|
+
console.warn(`>>> > handleGraph > params`, params);
|
|
30
30
|
const { PAGE_PATHS } = props;
|
|
31
|
-
const { message, response, statusCode = 302, redirectUrl = `${PAGE_PATHS[utils_1.PAGE_ROUTE_NAMES.ERROR]}?invalid_query_response`, } = await utils_1.
|
|
31
|
+
const { message, response, statusCode = 302, redirectUrl = `${PAGE_PATHS[utils_1.PAGE_ROUTE_NAMES.ERROR]}?invalid_query_response`, } = await utils_1.graphHelper(Object.assign({ req,
|
|
32
32
|
res,
|
|
33
33
|
params }, props));
|
|
34
|
-
console.warn(`>>> >
|
|
34
|
+
console.warn(`>>> > handleGraph > response`, response);
|
|
35
35
|
if (statusCode >= 300 && statusCode < 400) {
|
|
36
36
|
return res.redirect(statusCode, redirectUrl);
|
|
37
37
|
}
|
|
@@ -40,7 +40,7 @@ const handleQuery = (props) => async (req, res, params) => {
|
|
|
40
40
|
}
|
|
41
41
|
return res.status(statusCode).json(response.body);
|
|
42
42
|
};
|
|
43
|
-
exports.
|
|
43
|
+
exports.handleGraph = handleGraph;
|
|
44
44
|
// NOTE: typically handling: "/api/auth"
|
|
45
45
|
const handleAuth = (props) => async (req, res) => {
|
|
46
46
|
const { PAGE_PATHS } = props;
|
package/dist/apiHelpers.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export function restHelper({ req, res, params: _params, ...props }: {
|
|
|
19
19
|
message?: undefined;
|
|
20
20
|
response?: undefined;
|
|
21
21
|
}>;
|
|
22
|
-
export function
|
|
22
|
+
export function graphHelper({ req, res, params: _params, ...props }: {
|
|
23
23
|
[x: string]: any;
|
|
24
24
|
req: any;
|
|
25
25
|
res: any;
|
package/dist/apiHelpers.js
CHANGED
|
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.uninstallHelper = exports.callbackHelper = exports.authHelper = exports.
|
|
14
|
+
exports.uninstallHelper = exports.callbackHelper = exports.authHelper = exports.graphHelper = exports.restHelper = void 0;
|
|
15
15
|
const shopify_api_1 = require("@shopify/shopify-api");
|
|
16
16
|
const utils_1 = require("./utils");
|
|
17
17
|
const restHelper = async (_a) => {
|
|
@@ -84,7 +84,7 @@ const restHelper = async (_a) => {
|
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
86
|
exports.restHelper = restHelper;
|
|
87
|
-
const
|
|
87
|
+
const graphHelper = async (_a) => {
|
|
88
88
|
var { req, res, params: _params } = _a, props = __rest(_a, ["req", "res", "params"]);
|
|
89
89
|
const { body, query: _query } = req;
|
|
90
90
|
const { shop } = _query !== null && _query !== void 0 ? _query : {};
|
|
@@ -92,12 +92,12 @@ const queryHelper = async (_a) => {
|
|
|
92
92
|
const _b = _params !== null && _params !== void 0 ? _params : {}, { data: dataParam, query: queryParam } = _b, params = __rest(_b, ["data", "query"]);
|
|
93
93
|
const data = dataParam !== null && dataParam !== void 0 ? dataParam : _data;
|
|
94
94
|
let query = queryParam !== null && queryParam !== void 0 ? queryParam : _query;
|
|
95
|
-
console.warn(`>>> >
|
|
96
|
-
console.warn(`>>> >
|
|
95
|
+
console.warn(`>>> > graphHelper > params`, params);
|
|
96
|
+
console.warn(`>>> > graphHelper > data`, data);
|
|
97
97
|
if (utils_1.isType(query, 'string')) {
|
|
98
98
|
query = utils_1.querystringToObject(query);
|
|
99
99
|
}
|
|
100
|
-
console.warn(`>>> >
|
|
100
|
+
console.warn(`>>> > graphHelper > query`, query);
|
|
101
101
|
if (!shop || !data) {
|
|
102
102
|
return {
|
|
103
103
|
statusCode: 400,
|
|
@@ -149,7 +149,7 @@ const queryHelper = async (_a) => {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
|
-
exports.
|
|
152
|
+
exports.graphHelper = graphHelper;
|
|
153
153
|
const authHelper = async (_a) => {
|
|
154
154
|
var { req, res } = _a, props = __rest(_a, ["req", "res"]);
|
|
155
155
|
const { query } = req;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agnostack/next-shopify",
|
|
3
|
-
"version": "1.1.1-alpha.
|
|
3
|
+
"version": "1.1.1-alpha.8",
|
|
4
4
|
"author": "agnoStack Dev <developers@agnostack.com> (https://agnostack.com)",
|
|
5
5
|
"owner": "agnoStack",
|
|
6
6
|
"description": "Please contact agnoStack via info@agnostack.com for any questions",
|