@abtnode/models 1.16.10-beta-9dc61102 → 1.16.10-beta-b707d07a
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.
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { TBlockletExtra } from '@abtnode/types';
|
|
1
|
+
import { TBlockletController, TBlockletExtra } from '@abtnode/types';
|
|
2
2
|
import { DynamicModel } from '../types';
|
|
3
3
|
export type BlockletExtraState = TBlockletExtra & {
|
|
4
4
|
createdAt: Date;
|
|
5
5
|
updatedAt: Date;
|
|
6
|
+
expiredAt: string;
|
|
7
|
+
controller: TBlockletController;
|
|
6
8
|
};
|
|
7
9
|
export declare function createBlockletExtraModel(): DynamicModel<BlockletExtraState>;
|
package/lib/models/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export * from './webhook';
|
|
|
22
22
|
export * from './connection';
|
|
23
23
|
export * from './backup';
|
|
24
24
|
export declare function createSequelize(dbPath: string, config?: Record<string, any>): any;
|
|
25
|
+
export declare function destroySequelize(dbPath: string): void;
|
|
25
26
|
export declare function getServiceModels(): {
|
|
26
27
|
Message: import("../types").DynamicModel<import("./message").MessageState>;
|
|
27
28
|
};
|
package/lib/models/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.setupModels = exports.getConnectModels = exports.getServerModels = exports.getBlockletModels = exports.getCertificateManagerModels = exports.getServiceModels = exports.createSequelize = void 0;
|
|
17
|
+
exports.setupModels = exports.getConnectModels = exports.getServerModels = exports.getBlockletModels = exports.getCertificateManagerModels = exports.getServiceModels = exports.destroySequelize = exports.createSequelize = void 0;
|
|
18
18
|
const sequelize_1 = require("sequelize");
|
|
19
19
|
const message_1 = require("./message");
|
|
20
20
|
const account_1 = require("./account");
|
|
@@ -78,6 +78,13 @@ function createSequelize(dbPath, config = {
|
|
|
78
78
|
return instances.get(dbPath);
|
|
79
79
|
}
|
|
80
80
|
exports.createSequelize = createSequelize;
|
|
81
|
+
function destroySequelize(dbPath) {
|
|
82
|
+
if (instances.has(dbPath)) {
|
|
83
|
+
instances.get(dbPath).close();
|
|
84
|
+
instances.delete(dbPath);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
exports.destroySequelize = destroySequelize;
|
|
81
88
|
function getServiceModels() {
|
|
82
89
|
const models = {
|
|
83
90
|
Message: (0, message_1.createMessageModel)(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/models",
|
|
3
|
-
"version": "1.16.10-beta-
|
|
3
|
+
"version": "1.16.10-beta-b707d07a",
|
|
4
4
|
"description": "Sequelize models for blocklet server and blocklet service",
|
|
5
5
|
"homepage": "https://github.com/ArcBlock/blocklet-server#readme",
|
|
6
6
|
"publishConfig": {
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"url": "https://github.com/ArcBlock/blocklet-server/issues"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@abtnode/logger": "1.16.10-beta-
|
|
36
|
-
"@abtnode/types": "1.16.10-beta-
|
|
35
|
+
"@abtnode/logger": "1.16.10-beta-b707d07a",
|
|
36
|
+
"@abtnode/types": "1.16.10-beta-b707d07a",
|
|
37
37
|
"@nedb/core": "^2.1.5",
|
|
38
38
|
"lodash.clonedeep": "^4.5.0",
|
|
39
39
|
"lodash.get": "^4.4.2",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"typescript": "^5.0.4"
|
|
55
55
|
},
|
|
56
56
|
"resolutions": {},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "5f5f4d2251c0556c262833536892d0542f85968d"
|
|
58
58
|
}
|