@shopify/shopify-app-session-storage-mongodb 0.0.0-experimental-20240118200208
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/LICENSE.md +9 -0
- package/README.md +30 -0
- package/build/cjs/mongodb.js +117 -0
- package/build/ts/mongodb.d.ts +25 -0
- package/build/ts/mongodb.d.ts.map +1 -0
- package/build/ts/mongodb.js +182 -0
- package/build/ts/mongodb.js.map +1 -0
- package/package.json +57 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022-present, Shopify Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Session Storage Adapter for MongoDB
|
|
2
|
+
|
|
3
|
+
This package implements the `SessionStorage` interface that works with an instance of [MongoDB](https://www.mongodb.com/home).
|
|
4
|
+
|
|
5
|
+
```js
|
|
6
|
+
import {shopifyApp} from '@shopify/shopify-app-express';
|
|
7
|
+
import {MongoDBSessionStorage} from '@shopify/shopify-app-session-storage-mongodb';
|
|
8
|
+
|
|
9
|
+
const shopify = shopifyApp({
|
|
10
|
+
sessionStorage: new MongoDBSessionStorage(
|
|
11
|
+
'mongodb://username:password@host/',
|
|
12
|
+
'database',
|
|
13
|
+
),
|
|
14
|
+
// ...
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// OR
|
|
18
|
+
|
|
19
|
+
const shopify = shopifyApp({
|
|
20
|
+
sessionStorage: MongoDBSessionStorage.withCredentials(
|
|
21
|
+
'host.com',
|
|
22
|
+
'thedatabase',
|
|
23
|
+
'username',
|
|
24
|
+
'password',
|
|
25
|
+
),
|
|
26
|
+
// ...
|
|
27
|
+
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
If you prefer to use your own implementation of a session storage mechanism that is compatible with the `@shopify/shopify-app-express` package, see the [implementing session storage guide](https://github.com/Shopify/shopify-app-js/blob/main/packages/shopify-app-session-storage/implementing-session-storage.md).
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var mongodb = require('mongodb');
|
|
6
|
+
var shopifyApi = require('@shopify/shopify-api');
|
|
7
|
+
|
|
8
|
+
function _interopNamespace(e) {
|
|
9
|
+
if (e && e.__esModule) return e;
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n["default"] = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var mongodb__namespace = /*#__PURE__*/_interopNamespace(mongodb);
|
|
27
|
+
|
|
28
|
+
const defaultMongoDBSessionStorageOptions = {
|
|
29
|
+
sessionCollectionName: 'shopify_sessions'
|
|
30
|
+
};
|
|
31
|
+
class MongoDBSessionStorage {
|
|
32
|
+
static withCredentials(host, dbName, username, password, opts) {
|
|
33
|
+
return new MongoDBSessionStorage(new URL(`mongodb://${encodeURIComponent(username)}:${encodeURIComponent(password)}@${host}/`), dbName, opts);
|
|
34
|
+
}
|
|
35
|
+
constructor(dbUrl, dbName, opts = {}) {
|
|
36
|
+
this.dbUrl = dbUrl;
|
|
37
|
+
this.dbName = dbName;
|
|
38
|
+
this.ready = void 0;
|
|
39
|
+
this.options = void 0;
|
|
40
|
+
// `mongodb` has no types for `MongoClient`???!
|
|
41
|
+
this.client = void 0;
|
|
42
|
+
if (typeof this.dbUrl === 'string') {
|
|
43
|
+
this.dbUrl = new URL(this.dbUrl);
|
|
44
|
+
}
|
|
45
|
+
this.options = {
|
|
46
|
+
...defaultMongoDBSessionStorageOptions,
|
|
47
|
+
...opts
|
|
48
|
+
};
|
|
49
|
+
this.ready = this.init();
|
|
50
|
+
}
|
|
51
|
+
async storeSession(session) {
|
|
52
|
+
await this.ready;
|
|
53
|
+
await this.collection.findOneAndReplace({
|
|
54
|
+
id: session.id
|
|
55
|
+
}, session.toObject(), {
|
|
56
|
+
upsert: true
|
|
57
|
+
});
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
async loadSession(id) {
|
|
61
|
+
await this.ready;
|
|
62
|
+
const result = await this.collection.findOne({
|
|
63
|
+
id
|
|
64
|
+
});
|
|
65
|
+
return result ? new shopifyApi.Session(result) : undefined;
|
|
66
|
+
}
|
|
67
|
+
async deleteSession(id) {
|
|
68
|
+
await this.ready;
|
|
69
|
+
await this.collection.deleteOne({
|
|
70
|
+
id
|
|
71
|
+
});
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
async deleteSessions(ids) {
|
|
75
|
+
await this.ready;
|
|
76
|
+
await this.collection.deleteMany({
|
|
77
|
+
id: {
|
|
78
|
+
$in: ids
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
async findSessionsByShop(shop) {
|
|
84
|
+
await this.ready;
|
|
85
|
+
const rawResults = await this.collection.find({
|
|
86
|
+
shop
|
|
87
|
+
}).toArray();
|
|
88
|
+
if (!rawResults || (rawResults === null || rawResults === void 0 ? void 0 : rawResults.length) === 0) return [];
|
|
89
|
+
return rawResults.map(rawResult => new shopifyApi.Session(rawResult));
|
|
90
|
+
}
|
|
91
|
+
async disconnect() {
|
|
92
|
+
await this.client.close();
|
|
93
|
+
}
|
|
94
|
+
get collection() {
|
|
95
|
+
return this.client.db(this.dbName).collection(this.options.sessionCollectionName);
|
|
96
|
+
}
|
|
97
|
+
async init() {
|
|
98
|
+
this.client = new mongodb__namespace.MongoClient(this.dbUrl.toString());
|
|
99
|
+
await this.client.connect();
|
|
100
|
+
await this.client.db().command({
|
|
101
|
+
ping: 1
|
|
102
|
+
});
|
|
103
|
+
await this.createCollection();
|
|
104
|
+
}
|
|
105
|
+
async hasSessionCollection() {
|
|
106
|
+
const collections = await this.client.db().collections();
|
|
107
|
+
return collections.map(collection => collection.collectionName).includes(this.options.sessionCollectionName);
|
|
108
|
+
}
|
|
109
|
+
async createCollection() {
|
|
110
|
+
const hasSessionCollection = await this.hasSessionCollection();
|
|
111
|
+
if (!hasSessionCollection) {
|
|
112
|
+
await this.client.db().collection(this.options.sessionCollectionName);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
exports.MongoDBSessionStorage = MongoDBSessionStorage;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Session } from '@shopify/shopify-api';
|
|
2
|
+
import { SessionStorage } from '@shopify/shopify-app-session-storage';
|
|
3
|
+
export interface MongoDBSessionStorageOptions {
|
|
4
|
+
sessionCollectionName: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class MongoDBSessionStorage implements SessionStorage {
|
|
7
|
+
private dbUrl;
|
|
8
|
+
private dbName;
|
|
9
|
+
static withCredentials(host: string, dbName: string, username: string, password: string, opts: Partial<MongoDBSessionStorageOptions>): MongoDBSessionStorage;
|
|
10
|
+
readonly ready: Promise<void>;
|
|
11
|
+
private options;
|
|
12
|
+
private client;
|
|
13
|
+
constructor(dbUrl: URL, dbName: string, opts?: Partial<MongoDBSessionStorageOptions>);
|
|
14
|
+
storeSession(session: Session): Promise<boolean>;
|
|
15
|
+
loadSession(id: string): Promise<Session | undefined>;
|
|
16
|
+
deleteSession(id: string): Promise<boolean>;
|
|
17
|
+
deleteSessions(ids: string[]): Promise<boolean>;
|
|
18
|
+
findSessionsByShop(shop: string): Promise<Session[]>;
|
|
19
|
+
disconnect(): Promise<void>;
|
|
20
|
+
private get collection();
|
|
21
|
+
private init;
|
|
22
|
+
private hasSessionCollection;
|
|
23
|
+
private createCollection;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=mongodb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongodb.d.ts","sourceRoot":"","sources":["../../src/mongodb.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAC,cAAc,EAAC,MAAM,sCAAsC,CAAC;AAEpE,MAAM,WAAW,4BAA4B;IAC3C,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAKD,qBAAa,qBAAsB,YAAW,cAAc;IAyBxD,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,MAAM;IAzBhB,MAAM,CAAC,eAAe,CACpB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,OAAO,CAAC,4BAA4B,CAAC;IAa7C,SAAgB,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,OAAO,CAAC,OAAO,CAA+B;IAE9C,OAAO,CAAC,MAAM,CAAM;gBAGV,KAAK,EAAE,GAAG,EACV,MAAM,EAAE,MAAM,EACtB,IAAI,GAAE,OAAO,CAAC,4BAA4B,CAAM;IASrC,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAahD,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;IAQrD,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAM3C,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAM/C,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IASpD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxC,OAAO,KAAK,UAAU,GAIrB;YAEa,IAAI;YAOJ,oBAAoB;YAOpB,gBAAgB;CAM/B"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MongoDBSessionStorage = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var mongodb = tslib_1.__importStar(require("mongodb"));
|
|
6
|
+
var shopify_api_1 = require("@shopify/shopify-api");
|
|
7
|
+
var defaultMongoDBSessionStorageOptions = {
|
|
8
|
+
sessionCollectionName: 'shopify_sessions',
|
|
9
|
+
};
|
|
10
|
+
var MongoDBSessionStorage = /** @class */ (function () {
|
|
11
|
+
function MongoDBSessionStorage(dbUrl, dbName, opts) {
|
|
12
|
+
if (opts === void 0) { opts = {}; }
|
|
13
|
+
this.dbUrl = dbUrl;
|
|
14
|
+
this.dbName = dbName;
|
|
15
|
+
if (typeof this.dbUrl === 'string') {
|
|
16
|
+
this.dbUrl = new URL(this.dbUrl);
|
|
17
|
+
}
|
|
18
|
+
this.options = tslib_1.__assign(tslib_1.__assign({}, defaultMongoDBSessionStorageOptions), opts);
|
|
19
|
+
this.ready = this.init();
|
|
20
|
+
}
|
|
21
|
+
MongoDBSessionStorage.withCredentials = function (host, dbName, username, password, opts) {
|
|
22
|
+
return new MongoDBSessionStorage(new URL("mongodb://".concat(encodeURIComponent(username), ":").concat(encodeURIComponent(password), "@").concat(host, "/")), dbName, opts);
|
|
23
|
+
};
|
|
24
|
+
MongoDBSessionStorage.prototype.storeSession = function (session) {
|
|
25
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
26
|
+
return tslib_1.__generator(this, function (_a) {
|
|
27
|
+
switch (_a.label) {
|
|
28
|
+
case 0: return [4 /*yield*/, this.ready];
|
|
29
|
+
case 1:
|
|
30
|
+
_a.sent();
|
|
31
|
+
return [4 /*yield*/, this.collection.findOneAndReplace({ id: session.id }, session.toObject(), {
|
|
32
|
+
upsert: true,
|
|
33
|
+
})];
|
|
34
|
+
case 2:
|
|
35
|
+
_a.sent();
|
|
36
|
+
return [2 /*return*/, true];
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
MongoDBSessionStorage.prototype.loadSession = function (id) {
|
|
42
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
43
|
+
var result;
|
|
44
|
+
return tslib_1.__generator(this, function (_a) {
|
|
45
|
+
switch (_a.label) {
|
|
46
|
+
case 0: return [4 /*yield*/, this.ready];
|
|
47
|
+
case 1:
|
|
48
|
+
_a.sent();
|
|
49
|
+
return [4 /*yield*/, this.collection.findOne({ id: id })];
|
|
50
|
+
case 2:
|
|
51
|
+
result = _a.sent();
|
|
52
|
+
return [2 /*return*/, result ? new shopify_api_1.Session(result) : undefined];
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
MongoDBSessionStorage.prototype.deleteSession = function (id) {
|
|
58
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
59
|
+
return tslib_1.__generator(this, function (_a) {
|
|
60
|
+
switch (_a.label) {
|
|
61
|
+
case 0: return [4 /*yield*/, this.ready];
|
|
62
|
+
case 1:
|
|
63
|
+
_a.sent();
|
|
64
|
+
return [4 /*yield*/, this.collection.deleteOne({ id: id })];
|
|
65
|
+
case 2:
|
|
66
|
+
_a.sent();
|
|
67
|
+
return [2 /*return*/, true];
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
MongoDBSessionStorage.prototype.deleteSessions = function (ids) {
|
|
73
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
74
|
+
return tslib_1.__generator(this, function (_a) {
|
|
75
|
+
switch (_a.label) {
|
|
76
|
+
case 0: return [4 /*yield*/, this.ready];
|
|
77
|
+
case 1:
|
|
78
|
+
_a.sent();
|
|
79
|
+
return [4 /*yield*/, this.collection.deleteMany({ id: { $in: ids } })];
|
|
80
|
+
case 2:
|
|
81
|
+
_a.sent();
|
|
82
|
+
return [2 /*return*/, true];
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
MongoDBSessionStorage.prototype.findSessionsByShop = function (shop) {
|
|
88
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
89
|
+
var rawResults;
|
|
90
|
+
return tslib_1.__generator(this, function (_a) {
|
|
91
|
+
switch (_a.label) {
|
|
92
|
+
case 0: return [4 /*yield*/, this.ready];
|
|
93
|
+
case 1:
|
|
94
|
+
_a.sent();
|
|
95
|
+
return [4 /*yield*/, this.collection.find({ shop: shop }).toArray()];
|
|
96
|
+
case 2:
|
|
97
|
+
rawResults = _a.sent();
|
|
98
|
+
if (!rawResults || (rawResults === null || rawResults === void 0 ? void 0 : rawResults.length) === 0)
|
|
99
|
+
return [2 /*return*/, []];
|
|
100
|
+
return [2 /*return*/, rawResults.map(function (rawResult) { return new shopify_api_1.Session(rawResult); })];
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
MongoDBSessionStorage.prototype.disconnect = function () {
|
|
106
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
107
|
+
return tslib_1.__generator(this, function (_a) {
|
|
108
|
+
switch (_a.label) {
|
|
109
|
+
case 0: return [4 /*yield*/, this.client.close()];
|
|
110
|
+
case 1:
|
|
111
|
+
_a.sent();
|
|
112
|
+
return [2 /*return*/];
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
Object.defineProperty(MongoDBSessionStorage.prototype, "collection", {
|
|
118
|
+
get: function () {
|
|
119
|
+
return this.client
|
|
120
|
+
.db(this.dbName)
|
|
121
|
+
.collection(this.options.sessionCollectionName);
|
|
122
|
+
},
|
|
123
|
+
enumerable: false,
|
|
124
|
+
configurable: true
|
|
125
|
+
});
|
|
126
|
+
MongoDBSessionStorage.prototype.init = function () {
|
|
127
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
128
|
+
return tslib_1.__generator(this, function (_a) {
|
|
129
|
+
switch (_a.label) {
|
|
130
|
+
case 0:
|
|
131
|
+
this.client = new mongodb.MongoClient(this.dbUrl.toString());
|
|
132
|
+
return [4 /*yield*/, this.client.connect()];
|
|
133
|
+
case 1:
|
|
134
|
+
_a.sent();
|
|
135
|
+
return [4 /*yield*/, this.client.db().command({ ping: 1 })];
|
|
136
|
+
case 2:
|
|
137
|
+
_a.sent();
|
|
138
|
+
return [4 /*yield*/, this.createCollection()];
|
|
139
|
+
case 3:
|
|
140
|
+
_a.sent();
|
|
141
|
+
return [2 /*return*/];
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
MongoDBSessionStorage.prototype.hasSessionCollection = function () {
|
|
147
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
148
|
+
var collections;
|
|
149
|
+
return tslib_1.__generator(this, function (_a) {
|
|
150
|
+
switch (_a.label) {
|
|
151
|
+
case 0: return [4 /*yield*/, this.client.db().collections()];
|
|
152
|
+
case 1:
|
|
153
|
+
collections = _a.sent();
|
|
154
|
+
return [2 /*return*/, collections
|
|
155
|
+
.map(function (collection) { return collection.collectionName; })
|
|
156
|
+
.includes(this.options.sessionCollectionName)];
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
MongoDBSessionStorage.prototype.createCollection = function () {
|
|
162
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
163
|
+
var hasSessionCollection;
|
|
164
|
+
return tslib_1.__generator(this, function (_a) {
|
|
165
|
+
switch (_a.label) {
|
|
166
|
+
case 0: return [4 /*yield*/, this.hasSessionCollection()];
|
|
167
|
+
case 1:
|
|
168
|
+
hasSessionCollection = _a.sent();
|
|
169
|
+
if (!!hasSessionCollection) return [3 /*break*/, 3];
|
|
170
|
+
return [4 /*yield*/, this.client.db().collection(this.options.sessionCollectionName)];
|
|
171
|
+
case 2:
|
|
172
|
+
_a.sent();
|
|
173
|
+
_a.label = 3;
|
|
174
|
+
case 3: return [2 /*return*/];
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
return MongoDBSessionStorage;
|
|
180
|
+
}());
|
|
181
|
+
exports.MongoDBSessionStorage = MongoDBSessionStorage;
|
|
182
|
+
//# sourceMappingURL=mongodb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongodb.js","sourceRoot":"","sources":["../../src/mongodb.ts"],"names":[],"mappings":";;;;AAAA,uDAAmC;AACnC,oDAA6C;AAM7C,IAAM,mCAAmC,GAAiC;IACxE,qBAAqB,EAAE,kBAAkB;CAC1C,CAAC;AA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4GC;AA5GY,sDAAqB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@shopify/shopify-app-session-storage-mongodb",
|
|
3
|
+
"version": "0.0.0-experimental-20240118200208",
|
|
4
|
+
"description": "Shopify App Session Storage for MongoDB",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/Shopify/shopify-app-js.git"
|
|
8
|
+
},
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/Shopify/shopify-app-js/issues"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/Shopify/shopify-app-js/tree/main/packages/shopify-app-session-storage-mongodb",
|
|
13
|
+
"author": "Shopify Inc.",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"main": "./build/cjs/mongodb.js",
|
|
16
|
+
"types": "./build/ts/mongodb.d.ts",
|
|
17
|
+
"scripts": {},
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"shopify",
|
|
23
|
+
"node",
|
|
24
|
+
"app",
|
|
25
|
+
"graphql",
|
|
26
|
+
"rest",
|
|
27
|
+
"webhook",
|
|
28
|
+
"Admin API",
|
|
29
|
+
"Storefront API",
|
|
30
|
+
"MongoDB",
|
|
31
|
+
"session storage"
|
|
32
|
+
],
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"mongodb": "^6.3.0",
|
|
35
|
+
"tslib": "^2.6.2"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"@shopify/shopify-api": "^9.0.2",
|
|
39
|
+
"@shopify/shopify-app-session-storage": "0.0.0-experimental-20240118200208"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@shopify/eslint-plugin": "^42.1.0",
|
|
43
|
+
"@shopify/prettier-config": "^1.1.2",
|
|
44
|
+
"@shopify/shopify-app-session-storage-test-utils": "0.0.0-experimental-20240118200208",
|
|
45
|
+
"@types/jest": "^29.5.1",
|
|
46
|
+
"eslint": "^8.55.0",
|
|
47
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
48
|
+
"prettier": "^2.8.8",
|
|
49
|
+
"typescript": "4.9.5"
|
|
50
|
+
},
|
|
51
|
+
"files": [
|
|
52
|
+
"build/*",
|
|
53
|
+
"!bundle/*",
|
|
54
|
+
"!tsconfig.tsbuildinfo",
|
|
55
|
+
"!node_modules"
|
|
56
|
+
]
|
|
57
|
+
}
|