@agnostack/next-shopify 1.6.0 → 1.7.0-alpha.2
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 +85 -4
- package/dist/handlers/api.d.ts +5 -0
- package/dist/handlers/api.js +19 -7
- package/dist/handlers/api.js.map +1 -1
- package/dist/handlers/ssr.js +7 -6
- package/dist/handlers/ssr.js.map +1 -1
- package/dist/helpers/auth.js +2 -5
- package/dist/helpers/auth.js.map +1 -1
- package/dist/helpers/callback.d.ts +1 -1
- package/dist/helpers/callback.js +25 -19
- package/dist/helpers/callback.js.map +1 -1
- package/dist/helpers/graph.js +5 -4
- package/dist/helpers/graph.js.map +1 -1
- package/dist/helpers/rest.js +6 -4
- package/dist/helpers/rest.js.map +1 -1
- package/dist/helpers/uninstall.d.ts +4 -5
- package/dist/helpers/uninstall.js +31 -17
- package/dist/helpers/uninstall.js.map +1 -1
- package/dist/utils/billing.d.ts +9 -5
- package/dist/utils/billing.js +70 -23
- package/dist/utils/billing.js.map +1 -1
- package/dist/utils/constants.js +39 -0
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/errors.d.ts +12 -0
- package/dist/utils/errors.js +16 -1
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/firebase.js +6 -0
- package/dist/utils/firebase.js.map +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/session.d.ts +14 -0
- package/dist/utils/session.js +86 -0
- package/dist/utils/session.js.map +1 -0
- package/dist/utils/shopify-api-node/beginAuth.d.ts +2 -5
- package/dist/utils/shopify-api-node/beginAuth.js +17 -10
- package/dist/utils/shopify-api-node/beginAuth.js.map +1 -1
- package/dist/utils/shopify.d.ts +2 -83
- package/dist/utils/shopify.js +13 -99
- package/dist/utils/shopify.js.map +1 -1
- package/dist/utils/webhooks.d.ts +1 -0
- package/dist/utils/webhooks.js +22 -0
- package/dist/utils/webhooks.js.map +1 -0
- package/dist/withShopify.js +12 -8
- package/dist/withShopify.js.map +1 -1
- package/package.json +4 -3
package/dist/utils/shopify.d.ts
CHANGED
|
@@ -1,87 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export function getInitializedShopify(serverRuntimeConfig: any, _shop: any, version: any): {
|
|
3
|
-
Context: import("@shopify/shopify-api/dist/context").ContextInterface;
|
|
4
|
-
Auth: {
|
|
5
|
-
SESSION_COOKIE_NAME: string;
|
|
6
|
-
STATE_COOKIE_NAME: string;
|
|
7
|
-
beginAuth(request: import("http").IncomingMessage, response: import("http").ServerResponse, shop: string, redirectPath: string, isOnline?: boolean): Promise<string>;
|
|
8
|
-
validateAuthCallback(request: import("http").IncomingMessage, response: import("http").ServerResponse, query: import("@shopify/shopify-api").AuthQuery): Promise<import("@shopify/shopify-api").SessionInterface>;
|
|
9
|
-
getCookieSessionId(request: import("http").IncomingMessage, response: import("http").ServerResponse): string;
|
|
10
|
-
getJwtSessionId(shop: string, userId: string): string;
|
|
11
|
-
getOfflineSessionId(shop: string): string;
|
|
12
|
-
getCurrentSessionId(request: import("http").IncomingMessage, response: import("http").ServerResponse, isOnline?: boolean): string;
|
|
13
|
-
};
|
|
14
|
-
Billing: {
|
|
15
|
-
check: typeof import("@shopify/shopify-api/dist/billing/check").check;
|
|
16
|
-
};
|
|
17
|
-
Session: {
|
|
18
|
-
Session: typeof import("@shopify/shopify-api/dist/auth/session/session").Session;
|
|
19
|
-
MemorySessionStorage: typeof import("@shopify/shopify-api/dist/auth/session").MemorySessionStorage;
|
|
20
|
-
CustomSessionStorage: typeof import("@shopify/shopify-api/dist/auth/session").CustomSessionStorage;
|
|
21
|
-
MySQLSessionStorage: typeof import("@shopify/shopify-api/dist/auth/session").MySQLSessionStorage;
|
|
22
|
-
MongoDBSessionStorage: typeof import("@shopify/shopify-api/dist/auth/session").MongoDBSessionStorage;
|
|
23
|
-
PostgreSQLSessionStorage: typeof import("@shopify/shopify-api/dist/auth/session").PostgreSQLSessionStorage;
|
|
24
|
-
RedisSessionStorage: typeof import("@shopify/shopify-api/dist/auth/session").RedisSessionStorage;
|
|
25
|
-
SQLiteSessionStorage: typeof import("@shopify/shopify-api/dist/auth/session").SQLiteSessionStorage;
|
|
26
|
-
};
|
|
27
|
-
Clients: {
|
|
28
|
-
Rest: typeof import("@shopify/shopify-api/dist/clients/rest/rest_client").RestClient;
|
|
29
|
-
Graphql: typeof import("@shopify/shopify-api/dist/clients/graphql").GraphqlClient;
|
|
30
|
-
Storefront: typeof import("@shopify/shopify-api/dist/clients/graphql/storefront_client").StorefrontClient;
|
|
31
|
-
};
|
|
32
|
-
Utils: {
|
|
33
|
-
decodeSessionToken: typeof import("@shopify/shopify-api/dist/utils/decode-session-token").default;
|
|
34
|
-
deleteCurrentSession: typeof import("@shopify/shopify-api/dist/utils/delete-current-session").default;
|
|
35
|
-
deleteOfflineSession: typeof import("@shopify/shopify-api/dist/utils/delete-offline-session").default;
|
|
36
|
-
loadCurrentSession: typeof import("@shopify/shopify-api/dist/utils/load-current-session").default;
|
|
37
|
-
loadOfflineSession: typeof import("@shopify/shopify-api/dist/utils/load-offline-session").default;
|
|
38
|
-
nonce: typeof import("@shopify/shopify-api/dist/utils/nonce").default;
|
|
39
|
-
graphqlProxy: typeof import("@shopify/shopify-api/dist/utils/graphql_proxy").default;
|
|
40
|
-
safeCompare: typeof import("@shopify/shopify-api/dist/utils/safe-compare").default;
|
|
41
|
-
storeSession: typeof import("@shopify/shopify-api/dist/utils/store-session").default;
|
|
42
|
-
validateHmac: typeof import("@shopify/shopify-api/dist/utils/hmac-validator").default;
|
|
43
|
-
sanitizeShop: typeof import("@shopify/shopify-api/dist/utils/shop-validator").sanitizeShop;
|
|
44
|
-
sanitizeHost: typeof import("@shopify/shopify-api/dist/utils/shop-validator").sanitizeHost;
|
|
45
|
-
versionCompatible: typeof import("@shopify/shopify-api/dist/utils/version-compatible").default;
|
|
46
|
-
withSession: typeof import("@shopify/shopify-api/dist/utils/with-session").default;
|
|
47
|
-
getEmbeddedAppUrl: typeof import("@shopify/shopify-api/dist/utils/get-embedded-app-url").default;
|
|
48
|
-
};
|
|
49
|
-
Webhooks: {
|
|
50
|
-
Registry: import("@shopify/shopify-api/dist/webhooks/registry").RegistryInterface;
|
|
51
|
-
};
|
|
52
|
-
Errors: typeof import("@shopify/shopify-api/dist/error");
|
|
53
|
-
};
|
|
54
|
-
export function generatePaymentConfig(paymentConfig: any, data: any): {
|
|
55
|
-
type: any;
|
|
56
|
-
required: boolean;
|
|
57
|
-
test: boolean;
|
|
58
|
-
name: string;
|
|
59
|
-
price: {
|
|
60
|
-
amount: any;
|
|
61
|
-
currencyCode: any;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
export function getVerifiedSession({ req, res, shop, serverRuntimeConfig }: {
|
|
65
|
-
req: any;
|
|
66
|
-
res: any;
|
|
67
|
-
shop: any;
|
|
68
|
-
serverRuntimeConfig: any;
|
|
69
|
-
}): Promise<import("@shopify/shopify-api/dist/auth/session/session").Session>;
|
|
70
|
-
export function registerWebhooks(serverRuntimeConfig: any, webhookRegistry: any, session: any): Promise<[any, any, any, any, any, any, any, any, any, any][]>;
|
|
1
|
+
export function getInitializedShopify(serverRuntimeConfig: any, _shop: any, version: any): Promise<import("@shopify/shopify-api").Shopify<import("@shopify/shopify-api").ShopifyRestResources>>;
|
|
71
2
|
export function getRedirectUrl(props: any, { req, res, query: _query, }: {
|
|
72
3
|
req: any;
|
|
73
4
|
res: any;
|
|
74
5
|
query: any;
|
|
75
|
-
}): string
|
|
76
|
-
export function getAuthErrorResponse({ error, shop, serverRuntimeConfig }: {
|
|
77
|
-
error: any;
|
|
78
|
-
shop: any;
|
|
79
|
-
serverRuntimeConfig: any;
|
|
80
|
-
}): {
|
|
81
|
-
statusCode: number;
|
|
82
|
-
message: any;
|
|
83
|
-
headers: {
|
|
84
|
-
'X-Shopify-API-Request-Failure-Reauthorize': string;
|
|
85
|
-
'X-Shopify-API-Request-Failure-Reauthorize-Url': any;
|
|
86
|
-
};
|
|
87
|
-
};
|
|
6
|
+
}): Promise<string>;
|
package/dist/utils/shopify.js
CHANGED
|
@@ -1,100 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getRedirectUrl = exports.getInitializedShopify = void 0;
|
|
4
|
+
require("@shopify/shopify-api/adapters/node");
|
|
4
5
|
const shopify_api_1 = require("@shopify/shopify-api");
|
|
5
6
|
const shopify_api_node_1 = require("./shopify-api-node");
|
|
6
|
-
const
|
|
7
|
-
const errors_1 = require("./errors");
|
|
7
|
+
const webhooks_1 = require("./webhooks");
|
|
8
8
|
const display_1 = require("./display");
|
|
9
|
-
const firebase_1 = require("./firebase");
|
|
10
9
|
const constants_1 = require("./constants");
|
|
11
|
-
// TODO
|
|
12
|
-
const getInitializedShopify = (serverRuntimeConfig, _shop, version) => {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}), { SESSION_STORAGE: new shopify_api_1.Shopify.Session.CustomSessionStorage((session) => firebase_1.storeCallback(session, data, sessionHandler), (id) => firebase_1.loadCallback(id, data, sessionHandler), (id) => firebase_1.deleteSessionsCallback(id, data, sessionHandler), (ids) => firebase_1.deleteSessionsCallback(ids, data, sessionHandler), (__shop) => firebase_1.findSessionsByShop(shopify_api_1.Shopify.Utils.sanitizeShop(__shop), data, sessionHandler)) }));
|
|
19
|
-
return shopify_api_1.Shopify;
|
|
10
|
+
// TODO cleanup/consolidate getSessionStorage and getInitializedShopify
|
|
11
|
+
const getInitializedShopify = async (serverRuntimeConfig, _shop, version) => {
|
|
12
|
+
const shopify = shopify_api_1.shopifyApi(Object.assign(Object.assign({}, serverRuntimeConfig === null || serverRuntimeConfig === void 0 ? void 0 : serverRuntimeConfig.APP_CONFIG), (display_1.stringNotEmpty(version)) && {
|
|
13
|
+
apiVersion: version,
|
|
14
|
+
}));
|
|
15
|
+
await webhooks_1.addWebhookHandlers(serverRuntimeConfig, shopify);
|
|
16
|
+
return shopify;
|
|
20
17
|
};
|
|
21
18
|
exports.getInitializedShopify = getInitializedShopify;
|
|
22
|
-
const
|
|
23
|
-
const { name, price, currency = 'USD', type = constants_1.BILLING_INTERVALS.ONE_TIME, } = display_1.ensureObject(paymentConfig);
|
|
24
|
-
const { debugMode, environment } = display_1.ensureObject(data);
|
|
25
|
-
if (display_1.objectEmpty(paymentConfig) || display_1.stringEmpty(environment)) {
|
|
26
|
-
return undefined;
|
|
27
|
-
}
|
|
28
|
-
const notProduction = (environment !== 'production');
|
|
29
|
-
// TODO ensure this logic is correct
|
|
30
|
-
let test = (environment !== 'production');
|
|
31
|
-
if (debugMode) {
|
|
32
|
-
test = true;
|
|
33
|
-
}
|
|
34
|
-
const _paymentConfig = {
|
|
35
|
-
type,
|
|
36
|
-
required: (environment !== 'development'),
|
|
37
|
-
test,
|
|
38
|
-
name: `${name}${notProduction ? ` - ${environment}` : ''} - ${display_1.unsnakecase(type)}`,
|
|
39
|
-
price: {
|
|
40
|
-
amount: price,
|
|
41
|
-
currencyCode: currency,
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
return _paymentConfig;
|
|
45
|
-
};
|
|
46
|
-
exports.generatePaymentConfig = generatePaymentConfig;
|
|
47
|
-
const getVerifiedSession = async ({ req, res, shop, serverRuntimeConfig }) => {
|
|
48
|
-
try {
|
|
49
|
-
const shopify = exports.getInitializedShopify(serverRuntimeConfig, shop);
|
|
50
|
-
const { PAYMENT_CONFIG } = serverRuntimeConfig !== null && serverRuntimeConfig !== void 0 ? serverRuntimeConfig : {};
|
|
51
|
-
const session = await shopify.Utils.loadCurrentSession(req, res);
|
|
52
|
-
if (shop && (session === null || session === void 0 ? void 0 : session.shop) !== shop) {
|
|
53
|
-
throw new errors_1.ShopifyAuthenticationError('Invalid shop');
|
|
54
|
-
}
|
|
55
|
-
if (!(session === null || session === void 0 ? void 0 : session.isActive())) {
|
|
56
|
-
throw new errors_1.ShopifyAuthenticationError('Inactive session');
|
|
57
|
-
}
|
|
58
|
-
if (PAYMENT_CONFIG === null || PAYMENT_CONFIG === void 0 ? void 0 : PAYMENT_CONFIG.required) {
|
|
59
|
-
const billingManager = new billing_1.BillingManager(session, serverRuntimeConfig);
|
|
60
|
-
const confirmationUrl = await billingManager.ensureBilling();
|
|
61
|
-
if (display_1.stringNotEmpty(confirmationUrl)) {
|
|
62
|
-
throw new errors_1.ShopifyAuthenticationError('Invalid payment status', { redirectUrl: confirmationUrl });
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
// NOTE making a test call to ensure a valid session for free apps
|
|
67
|
-
const client = new shopify_api_1.Shopify.Clients.Graphql(shop, session.accessToken);
|
|
68
|
-
await client.query({ data: constants_1.SHOP_QUERY });
|
|
69
|
-
}
|
|
70
|
-
return session;
|
|
71
|
-
}
|
|
72
|
-
catch (error) {
|
|
73
|
-
if (error instanceof shopify_api_1.Shopify.Errors.HttpResponseError &&
|
|
74
|
-
error.response.code === 401) {
|
|
75
|
-
throw new errors_1.ShopifyAuthenticationError('Not authenticated');
|
|
76
|
-
}
|
|
77
|
-
throw error;
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
exports.getVerifiedSession = getVerifiedSession;
|
|
81
|
-
const registerTopicWebhook = async (serverRuntimeConfig, webhook, topic, { accessToken, shop }) => {
|
|
82
|
-
const shopify = exports.getInitializedShopify(serverRuntimeConfig, shop);
|
|
83
|
-
const webhookResponse = await shopify.Webhooks.Registry.register(Object.assign(Object.assign({ topic }, webhook), { accessToken,
|
|
84
|
-
shop }));
|
|
85
|
-
if (!webhookResponse[topic].success) {
|
|
86
|
-
throw new Error(`Failed to register ${webhook.path} on topic: ${topic} webhook`, webhookResponse.result);
|
|
87
|
-
}
|
|
88
|
-
return webhookResponse[topic].success;
|
|
89
|
-
};
|
|
90
|
-
const registerWebhooks = async (serverRuntimeConfig, webhookRegistry, session) => (Promise.all(Object.entries(webhookRegistry).map(async ([topic, webhooks]) => (Promise.all(webhooks.map(async (webhook) => registerTopicWebhook(serverRuntimeConfig, webhook, topic, session)))))));
|
|
91
|
-
exports.registerWebhooks = registerWebhooks;
|
|
92
|
-
const getRedirectUrl = (props, { req, res, query: _query, }) => {
|
|
19
|
+
const getRedirectUrl = async (props, { req, res, query: _query, }) => {
|
|
93
20
|
var _a;
|
|
94
21
|
const { API_URLS, PAGE_PATHS } = props;
|
|
95
22
|
const query = (_a = _query !== null && _query !== void 0 ? _query : req.query) !== null && _a !== void 0 ? _a : {};
|
|
96
23
|
const { embedded, host, shop: _shop } = query !== null && query !== void 0 ? query : {};
|
|
97
|
-
const
|
|
24
|
+
const shopify = await exports.getInitializedShopify(props, _shop);
|
|
25
|
+
const shop = shopify.utils.sanitizeShop(_shop);
|
|
98
26
|
if (display_1.stringEmpty(shop)) {
|
|
99
27
|
return `${PAGE_PATHS[constants_1.PAGE_ROUTE_NAMES.ERROR]}?code=no_shop_provided&type=getRedirectUrl`;
|
|
100
28
|
}
|
|
@@ -111,18 +39,4 @@ const getRedirectUrl = (props, { req, res, query: _query, }) => {
|
|
|
111
39
|
return shopify_api_node_1.beginAuth(props, { req, res, shop });
|
|
112
40
|
};
|
|
113
41
|
exports.getRedirectUrl = getRedirectUrl;
|
|
114
|
-
const getAuthErrorResponse = ({ error, shop, serverRuntimeConfig }) => {
|
|
115
|
-
const { message, data } = error;
|
|
116
|
-
const { API_URLS } = serverRuntimeConfig;
|
|
117
|
-
const reauthorizationUrl = (data === null || data === void 0 ? void 0 : data.redirectUrl) || `${API_URLS[constants_1.API_ROUTE_NAMES.AUTH]}?shop=${shop}`;
|
|
118
|
-
return {
|
|
119
|
-
statusCode: 403,
|
|
120
|
-
message,
|
|
121
|
-
headers: {
|
|
122
|
-
'X-Shopify-API-Request-Failure-Reauthorize': '1',
|
|
123
|
-
'X-Shopify-API-Request-Failure-Reauthorize-Url': reauthorizationUrl,
|
|
124
|
-
},
|
|
125
|
-
};
|
|
126
|
-
};
|
|
127
|
-
exports.getAuthErrorResponse = getAuthErrorResponse;
|
|
128
42
|
//# sourceMappingURL=shopify.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shopify.js","sourceRoot":"","sources":["../../src/utils/shopify.js"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"shopify.js","sourceRoot":"","sources":["../../src/utils/shopify.js"],"names":[],"mappings":";;;AAAA,8CAA2C;AAC3C,sDAAiD;AAEjD,yDAA8C;AAC9C,yCAA+C;AAC/C,uCAAuD;AACvD,2CAA+D;AAE/D,uEAAuE;AAChE,MAAM,qBAAqB,GAAG,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;IACjF,MAAM,OAAO,GAAG,wBAAU,iCACrB,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,UAAU,GAC/B,CAAC,wBAAc,CAAC,OAAO,CAAC,CAAC,IAAI;QAC9B,UAAU,EAAE,OAAO;KACpB,EACD,CAAA;IAEF,MAAM,6BAAkB,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAA;IAEtD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAXY,QAAA,qBAAqB,yBAWjC;AAEM,MAAM,cAAc,GAAG,KAAK,EAAE,KAAK,EAAE,EAC1C,GAAG,EACH,GAAG,EACH,KAAK,EAAE,MAAM,GACd,EAAE,EAAE;;IACH,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,KAAK,CAAA;IAEtC,MAAM,KAAK,GAAG,MAAA,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,GAAG,CAAC,KAAK,mCAAI,EAAE,CAAA;IACvC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAA;IAEnD,MAAM,OAAO,GAAG,MAAM,6BAAqB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;IAEzD,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;IAE9C,IAAI,qBAAW,CAAC,IAAI,CAAC,EAAE;QACrB,OAAO,GAAG,UAAU,CAAC,4BAAgB,CAAC,KAAK,CAAC,4CAA4C,CAAA;KACzF;IAED,IAAI,QAAQ,KAAK,GAAG,EAAE;QACpB,oCAAoC;QACpC,MAAM,iBAAiB,GAAG,IAAI,eAAe,CAAC;YAC5C,IAAI;YACJ,IAAI;SACL,CAAC,CAAC,QAAQ,EAAE,CAAA;QAEb,oCAAoC;QACpC,MAAM,WAAW,GAAG,IAAI,eAAe,iCAClC,KAAK,KACR,IAAI,EACJ,WAAW,EAAE,GAAG,QAAQ,CAAC,2BAAe,CAAC,aAAa,CAAC,IAAI,iBAAiB,EAAE,IAC9E,CAAC,QAAQ,EAAE,CAAA;QAEb,OAAO,GAAG,UAAU,CAAC,4BAAgB,CAAC,IAAI,CAAC,IAAI,WAAW,EAAE,CAAA;KAC7D;IAED,OAAO,4BAAS,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAA;AAC7C,CAAC,CAAA;AApCY,QAAA,cAAc,kBAoC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function addWebhookHandlers(serverRuntimeConfig: any, shopify: any): Promise<void>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addWebhookHandlers = void 0;
|
|
4
|
+
const shopify_api_1 = require("@shopify/shopify-api");
|
|
5
|
+
const addWebhookHandlers = async (serverRuntimeConfig, shopify) => {
|
|
6
|
+
const { APP_WEBHOOKS } = serverRuntimeConfig;
|
|
7
|
+
// TODO look for all topics via APP_WEBHOOKS
|
|
8
|
+
const existingHandlers = await shopify.webhooks.getHandlers('APP_UNINSTALLED');
|
|
9
|
+
if (existingHandlers.length === 0) {
|
|
10
|
+
shopify.webhooks.addHandlers(Object.entries(APP_WEBHOOKS).reduce((__payload, [topic, webhooks]) => (Object.assign(Object.assign({}, __payload), { [topic]: webhooks.map((webhook) => ({
|
|
11
|
+
deliveryMethod: shopify_api_1.DeliveryMethod.Http,
|
|
12
|
+
callbackUrl: webhook.path,
|
|
13
|
+
callback: async (topic, shop) => {
|
|
14
|
+
// NOTE our webhook logic is handled in each api route
|
|
15
|
+
console.log(`handleWebhook for ${shop}:${topic}`);
|
|
16
|
+
return true;
|
|
17
|
+
},
|
|
18
|
+
})) })), {}));
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.addWebhookHandlers = addWebhookHandlers;
|
|
22
|
+
//# sourceMappingURL=webhooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../src/utils/webhooks.js"],"names":[],"mappings":";;;AAAA,sDAAqD;AAE9C,MAAM,kBAAkB,GAAG,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,EAAE;IACvE,MAAM,EAAE,YAAY,EAAE,GAAG,mBAAmB,CAAA;IAE5C,4CAA4C;IAC5C,MAAM,gBAAgB,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAA;IAE9E,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE;QACjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,iCAC9F,SAAS,KACZ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBAClC,cAAc,EAAE,4BAAc,CAAC,IAAI;gBACnC,WAAW,EAAE,OAAO,CAAC,IAAI;gBACzB,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;oBAC9B,sDAAsD;oBACtD,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,IAAI,KAAK,EAAE,CAAC,CAAA;oBAEjD,OAAO,IAAI,CAAA;gBACb,CAAC;aACF,CAAC,CAAC,IACH,EAAE,EAAE,CAAC,CAAC,CAAA;KACT;AACH,CAAC,CAAA;AArBY,QAAA,kBAAkB,sBAqB9B"}
|
package/dist/withShopify.js
CHANGED
|
@@ -23,8 +23,12 @@ const withShopify = async (nextPhase, _a) => {
|
|
|
23
23
|
defaultConfig } = _c, // NOTE: This is here in case we need anything from it
|
|
24
24
|
pluginConfig = __rest(_c, ["defaultConfig"]);
|
|
25
25
|
const basePath = utils_1.ensureString(_basePath);
|
|
26
|
-
const { data, interactive, paymentConfig, firebaseConfig, pageRoutes: { [utils_1.PAGE_ROUTE_NAMES.EXIT]: _pageRouteExit = '/exit', [utils_1.PAGE_ROUTE_NAMES.ERROR]: _pageRouteError = '/error', } = {}, apiRoutes: { [utils_1.API_ROUTE_NAMES.AUTH]: _apiRouteAuth = '/api/auth', [utils_1.API_ROUTE_NAMES.AUTH_CALLBACK]: _apiRouteAuthCallback = '/api/auth/callback', [utils_1.API_ROUTE_NAMES.APP_UNINSTALLED]: _apiRouteAppUninstalled = '/api/webhooks/app/uninstalled', } = {}, params: { APP_ID, URL: netlifyUrl, HOST: shopifyCLIUrl, NEXT_PUBLIC_APP_BASE_URL, NEXT_PUBLIC_SHOPIFY_API_KEY, NEXT_PUBLIC_APP_ROUTE_PAGE_EXIT: _pageRouteParamExit, NEXT_PUBLIC_APP_ROUTE_PAGE_ERROR: _pageRouteParamError, NEXT_PUBLIC_APP_ROUTE_API_AUTH: _apiRouteParamAuth, NEXT_PUBLIC_APP_ROUTE_API_AUTH_CALLBACK: _apiRouteParamAuthCallback, NEXT_PUBLIC_APP_ROUTE_API_UNINSTALLED: _apiRouteParamAppUninstalled, NEXT_PUBLIC_FB_ROOT_COLLECTION: FB_ROOT_COLLECTION, SHOPIFY_API_PUBLIC_KEY: _shopifyPublicAPIKey, SHOPIFY_API_VERSION = shopify_api_1.LATEST_API_VERSION, SHOPIFY_API_SCOPES, SHOPIFY_API_KEY, SHOPIFY_RUN_MODE, } = {}, } = pluginConfig !== null && pluginConfig !== void 0 ? pluginConfig : {};
|
|
26
|
+
const { data, interactive, paymentConfig, firebaseConfig, pageRoutes: { [utils_1.PAGE_ROUTE_NAMES.EXIT]: _pageRouteExit = '/exit', [utils_1.PAGE_ROUTE_NAMES.ERROR]: _pageRouteError = '/error', } = {}, apiRoutes: { [utils_1.API_ROUTE_NAMES.AUTH]: _apiRouteAuth = '/api/auth', [utils_1.API_ROUTE_NAMES.AUTH_CALLBACK]: _apiRouteAuthCallback = '/api/auth/callback', [utils_1.API_ROUTE_NAMES.APP_UNINSTALLED]: _apiRouteAppUninstalled = '/api/webhooks/app/uninstalled', } = {}, params: { APP_ID: _appId, URL: netlifyUrl, HOST: shopifyCLIUrl, NEXT_PUBLIC_APP_BASE_URL, NEXT_PUBLIC_SHOPIFY_API_ID, NEXT_PUBLIC_SHOPIFY_API_KEY, NEXT_PUBLIC_APP_ROUTE_PAGE_EXIT: _pageRouteParamExit, NEXT_PUBLIC_APP_ROUTE_PAGE_ERROR: _pageRouteParamError, NEXT_PUBLIC_APP_ROUTE_API_AUTH: _apiRouteParamAuth, NEXT_PUBLIC_APP_ROUTE_API_AUTH_CALLBACK: _apiRouteParamAuthCallback, NEXT_PUBLIC_APP_ROUTE_API_UNINSTALLED: _apiRouteParamAppUninstalled, NEXT_PUBLIC_FB_ROOT_COLLECTION: FB_ROOT_COLLECTION, SHOPIFY_API_PUBLIC_KEY: _shopifyPublicAPIKey, SHOPIFY_API_VERSION = shopify_api_1.LATEST_API_VERSION, SHOPIFY_API_SCOPES, SHOPIFY_API_KEY, SHOPIFY_RUN_MODE, } = {}, } = pluginConfig !== null && pluginConfig !== void 0 ? pluginConfig : {};
|
|
27
|
+
console.log(`>>> > withShopify > _appId:`, _appId);
|
|
27
28
|
const SHOPIFY_API_PUBLIC_KEY = NEXT_PUBLIC_SHOPIFY_API_KEY || _shopifyPublicAPIKey;
|
|
29
|
+
console.log(`>>> > withShopify > SHOPIFY_API_PUBLIC_KEY:`, SHOPIFY_API_PUBLIC_KEY);
|
|
30
|
+
const APP_ID = NEXT_PUBLIC_SHOPIFY_API_ID || _appId || SHOPIFY_API_PUBLIC_KEY;
|
|
31
|
+
console.log(`>>> > withShopify > APP_ID:`, APP_ID);
|
|
28
32
|
const appBaseUrl = NEXT_PUBLIC_APP_BASE_URL || netlifyUrl || shopifyCLIUrl;
|
|
29
33
|
const APP_BASE_URL = `${appBaseUrl}${basePath}`;
|
|
30
34
|
const appUrl = new URL(appBaseUrl);
|
|
@@ -74,13 +78,13 @@ const withShopify = async (nextPhase, _a) => {
|
|
|
74
78
|
const API_URLS = Object.entries(API_PATHS).reduce((_apiUrls, [routeName, routePath]) => (Object.assign(Object.assign({}, _apiUrls), { [routeName]: `${appBaseUrl}${routePath}` })), {});
|
|
75
79
|
const APP_HOST_NAME = appUrl.hostname;
|
|
76
80
|
const APP_CONFIG = {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
apiVersion: SHOPIFY_API_VERSION,
|
|
82
|
+
apiKey: SHOPIFY_API_PUBLIC_KEY,
|
|
83
|
+
apiSecretKey: SHOPIFY_API_KEY,
|
|
84
|
+
hostName: APP_HOST_NAME,
|
|
85
|
+
hostScheme: appUrl.protocol.replace(':', ''),
|
|
86
|
+
scopes: SHOPIFY_API_SCOPES.replace(/, /g, ',').split(','),
|
|
87
|
+
isEmbeddedApp: true,
|
|
84
88
|
};
|
|
85
89
|
const APP_WEBHOOKS = {
|
|
86
90
|
APP_UNINSTALLED: [{
|
package/dist/withShopify.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withShopify.js","sourceRoot":"","sources":["../src/withShopify.js"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,sDAAyD;AAEzD,0DAAoD;AAEpD,mCAOgB;AAET,MAAM,WAAW,GAAG,KAAK,EAAE,SAAS,EAAE,EAAyB,EAAE,EAAE;QAA7B,EAAE,UAAU,OAAa,EAAR,MAAM,cAAvB,cAAyB,CAAF;IAClE,MAAM,KAKF,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,EAAE,EALd,EACJ,QAAQ,EAAE,SAAS,EACnB,mBAAmB,EAAE,oBAAoB,GAAG,EAAE,EAC9C,mBAAmB,EAAE,oBAAoB,GAAG,EAAE,OAE5B,EADf,WAAW,cAJV,0DAKL,CAAmB,CAAA;IAEpB,MAAM,KAIF,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,EAJV;IACJ,6DAA6D;IAC7D,aAAa,OAEC,EAFC,sDAAsD;IAClE,YAAY,cAHX,iBAIL,CAAe,CAAA;IAEhB,MAAM,QAAQ,GAAG,oBAAY,CAAC,SAAS,CAAC,CAAA;IAExC,MAAM,EACJ,IAAI,EACJ,WAAW,EACX,aAAa,EACb,cAAc,EACd,UAAU,EAAE,EACV,CAAC,wBAAgB,CAAC,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,EACjD,CAAC,wBAAgB,CAAC,KAAK,CAAC,EAAE,eAAe,GAAG,QAAQ,GACrD,GAAG,EAAE,EACN,SAAS,EAAE,EACT,CAAC,uBAAe,CAAC,IAAI,CAAC,EAAE,aAAa,GAAG,WAAW,EACnD,CAAC,uBAAe,CAAC,aAAa,CAAC,EAAE,qBAAqB,GAAG,oBAAoB,EAC7E,CAAC,uBAAe,CAAC,eAAe,CAAC,EAAE,uBAAuB,GAAG,+BAA+B,GAC7F,GAAG,EAAE,EACN,MAAM,EAAE,EACN,MAAM,
|
|
1
|
+
{"version":3,"file":"withShopify.js","s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,SAAS,CAAC,uBAAe,CAAC,eAAe,CAAC;aACjD,CAAC;KACH,CAAA;IAED,MAAM,cAAc,GAAG,6BAAqB,CAAC,aAAa,EAAE,IAAI,CAAC,CAAA;IAEjE,MAAM,mBAAmB,mCACpB,oBAAoB,KACvB,sBAAsB;QACtB,gBAAgB;QAChB,YAAY;QACZ,UAAU;QACV,SAAS,GACV,CAAA;IAED,MAAM,mBAAmB,mCACpB,oBAAoB,KACvB,gBAAgB;QAChB,sBAAsB,EACtB,SAAS,EAAE,cAAc,EACzB,kBAAkB;QAClB,cAAc;QACd,UAAU;QACV,YAAY;QACZ,WAAW;QACX,UAAU;QACV,MAAM;QACN,YAAY;QACZ,SAAS;QACT,QAAQ;QACR,UAAU,GACX,CAAA;IAED,uCACK,WAAW,KACd,QAAQ,EAAE,SAAS,EACnB,mBAAmB;QACnB,mBAAmB,IACpB;AACH,CAAC,CAAA;AAnLY,QAAA,WAAW,eAmLvB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agnostack/next-shopify",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0-alpha.2",
|
|
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",
|
|
@@ -48,10 +48,11 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@agnostack/next-plugins": "latest",
|
|
51
|
-
"@shopify/shopify-api": "
|
|
51
|
+
"@shopify/shopify-api": "7.1.0",
|
|
52
52
|
"browser-monads": "1.0.0",
|
|
53
53
|
"cookies": "0.8.0",
|
|
54
|
-
"nextjs-cors": "2.1.1"
|
|
54
|
+
"nextjs-cors": "2.1.1",
|
|
55
|
+
"raw-body": "2.5.2"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
57
58
|
"@babel/core": "7.18.9",
|