@blocklet/sdk 1.8.69-beta-b0bb2d67 → 1.8.69-beta-650a290b
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/lib/database/index.js +5 -6
- package/package.json +13 -13
package/lib/database/index.js
CHANGED
|
@@ -5,12 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
6
6
|
const path_1 = __importDefault(require("path"));
|
|
7
7
|
const core_1 = require("@nedb/core");
|
|
8
|
-
// FIXME: 实例创建时才去校验 process.env.BLOCKLET_DATA_DIR
|
|
9
|
-
// if (!process.env.BLOCKLET_DATA_DIR) {
|
|
10
|
-
// throw new Error('Blocklet SDK must be used in blocklet runtime');
|
|
11
|
-
// }
|
|
12
|
-
// const DB_DIR = path.join(process.env.BLOCKLET_DATA_DIR, 'db');
|
|
13
|
-
// fs.ensureDirSync(DB_DIR);
|
|
14
8
|
class DataBase extends core_1.DataStore {
|
|
15
9
|
constructor(name, options = {}) {
|
|
16
10
|
if (!process.env.BLOCKLET_DATA_DIR) {
|
|
@@ -30,6 +24,11 @@ class DataBase extends core_1.DataStore {
|
|
|
30
24
|
},
|
|
31
25
|
...options,
|
|
32
26
|
});
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
const compactInterval = typeof options.compactInterval === 'undefined' ? 60 * 60 * 1000 : +options.compactInterval;
|
|
29
|
+
if (compactInterval > 0) {
|
|
30
|
+
this.persistence.setAutoCompactionInterval(compactInterval, console.warn);
|
|
31
|
+
}
|
|
33
32
|
}
|
|
34
33
|
async exists(...args) {
|
|
35
34
|
const doc = await this.findOne(...args);
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.8.69-beta-
|
|
6
|
+
"version": "1.8.69-beta-650a290b",
|
|
7
7
|
"description": "graphql client to read/write data on abt node",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"typings": "lib/index.d.ts",
|
|
@@ -26,18 +26,18 @@
|
|
|
26
26
|
"author": "linchen1987 <linchen.1987@foxmail.com> (http://github.com/linchen1987)",
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@abtnode/client": "1.8.69-beta-
|
|
30
|
-
"@abtnode/constant": "1.8.69-beta-
|
|
31
|
-
"@arcblock/did-auth": "1.18.
|
|
32
|
-
"@arcblock/jwt": "1.18.
|
|
33
|
-
"@arcblock/ws": "1.18.
|
|
34
|
-
"@blocklet/constant": "1.8.69-beta-
|
|
35
|
-
"@blocklet/meta": "1.8.69-beta-
|
|
36
|
-
"@did-connect/authenticator": "^2.1.
|
|
37
|
-
"@did-connect/handler": "^2.1.
|
|
29
|
+
"@abtnode/client": "1.8.69-beta-650a290b",
|
|
30
|
+
"@abtnode/constant": "1.8.69-beta-650a290b",
|
|
31
|
+
"@arcblock/did-auth": "1.18.59",
|
|
32
|
+
"@arcblock/jwt": "1.18.59",
|
|
33
|
+
"@arcblock/ws": "1.18.59",
|
|
34
|
+
"@blocklet/constant": "1.8.69-beta-650a290b",
|
|
35
|
+
"@blocklet/meta": "1.8.69-beta-650a290b",
|
|
36
|
+
"@did-connect/authenticator": "^2.1.44",
|
|
37
|
+
"@did-connect/handler": "^2.1.44",
|
|
38
38
|
"@nedb/core": "^2.1.5",
|
|
39
|
-
"@ocap/mcrypto": "1.18.
|
|
40
|
-
"@ocap/wallet": "1.18.
|
|
39
|
+
"@ocap/mcrypto": "1.18.59",
|
|
40
|
+
"@ocap/wallet": "1.18.59",
|
|
41
41
|
"axios": "^0.27.2",
|
|
42
42
|
"cheerio": "^1.0.0-rc.12",
|
|
43
43
|
"fs-extra": "^10.1.0",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"ts-node": "^10.9.1",
|
|
71
71
|
"typescript": "^4.8.4"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "a33c9ce6a52b8d522d13860e85809dcbba236712"
|
|
74
74
|
}
|