@agnostack/next-shopify 1.3.2-alpha.29 → 1.3.2-alpha.30
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
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.3.2-alpha.30](https://github.com/agnostack/next-shopify/compare/v1.3.2-alpha.29...v1.3.2-alpha.30) (2022-11-19)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add uninstall ([bb6837d](https://github.com/agnostack/next-shopify/commit/bb6837d139ae28d93ebcceceb55fccc072acf442))
|
|
7
|
+
|
|
1
8
|
## [1.3.2-alpha.29](https://github.com/agnostack/next-shopify/compare/v1.3.2-alpha.28...v1.3.2-alpha.29) (2022-11-19)
|
|
2
9
|
|
|
3
10
|
|
package/dist/helpers/index.d.ts
CHANGED
package/dist/helpers/index.js
CHANGED
|
@@ -15,4 +15,5 @@ __exportStar(require("./callback"), exports);
|
|
|
15
15
|
__exportStar(require("./error"), exports);
|
|
16
16
|
__exportStar(require("./graph"), exports);
|
|
17
17
|
__exportStar(require("./rest"), exports);
|
|
18
|
+
__exportStar(require("./uninstall"), exports);
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.js"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAsB;AACtB,6CAA0B;AAC1B,0CAAuB;AACvB,0CAAuB;AACvB,yCAAsB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.js"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAsB;AACtB,6CAA0B;AAC1B,0CAAuB;AACvB,0CAAuB;AACvB,yCAAsB;AACtB,8CAA2B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uninstallHelper = void 0;
|
|
4
|
+
const utils_1 = require("./utils");
|
|
5
|
+
const uninstallHelper = async ({ req, serverRuntimeConfig }) => {
|
|
6
|
+
var _a, _b, _c, _d;
|
|
7
|
+
try {
|
|
8
|
+
const { domain } = req.body;
|
|
9
|
+
const shopify = utils_1.getInitializedShopify(serverRuntimeConfig, domain);
|
|
10
|
+
const existingSessions = await ((_b = (_a = shopify.Context.SESSION_STORAGE) === null || _a === void 0 ? void 0 : _a.findSessionsByShop) === null || _b === void 0 ? void 0 : _b.call(_a, domain));
|
|
11
|
+
if (utils_1.arrayNotEmpty(existingSessions)) {
|
|
12
|
+
await ((_d = (_c = shopify.Context.SESSION_STORAGE) === null || _c === void 0 ? void 0 : _c.deleteSessions) === null || _d === void 0 ? void 0 : _d.call(_c, existingSessions.map((session) => session.id)));
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
statusCode: 200,
|
|
16
|
+
message: 'success',
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
const errorMessage = 'Error handling uninstall route';
|
|
21
|
+
console.error(errorMessage, error);
|
|
22
|
+
return {
|
|
23
|
+
statusCode: 500,
|
|
24
|
+
message: errorMessage,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
exports.uninstallHelper = uninstallHelper;
|
|
29
|
+
//# sourceMappingURL=uninstall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uninstall.js","sourceRoot":"","sources":["../../src/helpers/uninstall.js"],"names":[],"mappings":";;;AAAA,mCAA8D;AAEvD,MAAM,eAAe,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,mBAAmB,EAAE,EAAE,EAAE;;IACpE,IAAI;QACF,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,IAAI,CAAA;QAC3B,MAAM,OAAO,GAAG,6BAAqB,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAA;QAElE,MAAM,gBAAgB,GAAG,MAAM,CAAA,MAAA,MAAA,OAAO,CAAC,OAAO,CAAC,eAAe,0CAAE,kBAAkB,mDAAG,MAAM,CAAC,CAAA,CAAA;QAC5F,IAAI,qBAAa,CAAC,gBAAgB,CAAC,EAAE;YACnC,MAAM,CAAA,MAAA,MAAA,OAAO,CAAC,OAAO,CAAC,eAAe,0CAAE,cAAc,mDAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAA,CAAA;SACvG;QAED,OAAO;YACL,UAAU,EAAE,GAAG;YACf,OAAO,EAAE,SAAS;SACnB,CAAA;KACF;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,YAAY,GAAG,gCAAgC,CAAA;QACrD,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,CAAA;QAElC,OAAO;YACL,UAAU,EAAE,GAAG;YACf,OAAO,EAAE,YAAY;SACtB,CAAA;KACF;AACH,CAAC,CAAA;AAvBY,QAAA,eAAe,mBAuB3B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agnostack/next-shopify",
|
|
3
|
-
"version": "1.3.2-alpha.
|
|
3
|
+
"version": "1.3.2-alpha.30",
|
|
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",
|