@abtnode/models 1.16.53 → 1.16.54-beta-20251017-133309-7d40faa6
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.
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.down = exports.up = void 0;
|
|
4
|
+
const models_1 = require("../../models");
|
|
5
|
+
const migrate_1 = require("../../migrate");
|
|
6
|
+
const models = (0, models_1.getBlockletModels)();
|
|
7
|
+
const up = async ({ context }) => {
|
|
8
|
+
await (0, migrate_1.createTableIfNotExists)(context, 'audit_logs', models.AuditLog.GENESIS_ATTRIBUTES);
|
|
9
|
+
await (0, migrate_1.safeAddIndex)(context, 'audit_logs', ['scope', 'category']);
|
|
10
|
+
await (0, migrate_1.safeAddIndex)(context, 'audit_logs', ['scope', 'actor']);
|
|
11
|
+
await (0, migrate_1.safeAddIndex)(context, 'audit_logs', ['category']);
|
|
12
|
+
await (0, migrate_1.safeAddIndex)(context, 'audit_logs', ['scope', 'createdAt']);
|
|
13
|
+
await (0, migrate_1.safeAddIndex)(context, 'audit_logs', ['createdAt']);
|
|
14
|
+
await (0, migrate_1.safeAddIndex)(context, 'audit_logs', ['action']);
|
|
15
|
+
};
|
|
16
|
+
exports.up = up;
|
|
17
|
+
const down = async ({ context }) => {
|
|
18
|
+
await context.removeIndex('audit_logs', ['scope', 'category']);
|
|
19
|
+
await context.removeIndex('audit_logs', ['scope', 'actor']);
|
|
20
|
+
await context.removeIndex('audit_logs', ['category']);
|
|
21
|
+
await context.removeIndex('audit_logs', ['scope', 'createdAt']);
|
|
22
|
+
await context.removeIndex('audit_logs', ['createdAt']);
|
|
23
|
+
await context.removeIndex('audit_logs', ['action']);
|
|
24
|
+
await (0, migrate_1.dropTableIfExists)(context, 'audit_logs');
|
|
25
|
+
};
|
|
26
|
+
exports.down = down;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.down = exports.up = void 0;
|
|
4
|
+
const sequelize_1 = require("sequelize");
|
|
5
|
+
const migrate_1 = require("../../migrate");
|
|
6
|
+
const up = async ({ context }) => {
|
|
7
|
+
await (0, migrate_1.safeApplyColumnChanges)(context, {
|
|
8
|
+
audit_logs: [{ name: 'componentDid', field: { type: sequelize_1.DataTypes.STRING(80) } }],
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
exports.up = up;
|
|
12
|
+
const down = async ({ context }) => {
|
|
13
|
+
await (0, migrate_1.removeColumnIfExists)(context, 'audit_logs', 'componentDid');
|
|
14
|
+
};
|
|
15
|
+
exports.down = down;
|
package/lib/models/index.d.ts
CHANGED
|
@@ -83,6 +83,7 @@ export declare function getBlockletModels(): {
|
|
|
83
83
|
UserOrg: import("../types").DynamicModel<import("./user-orgs").UserOrgsState>;
|
|
84
84
|
Org: import("../types").DynamicModel<import("./orgs").OrgsState>;
|
|
85
85
|
OrgResource: import("../types").DynamicModel<import("@abtnode/types").TOrgResources>;
|
|
86
|
+
AuditLog: import("../types").DynamicModel<import("./audit-log").AuditLogState>;
|
|
86
87
|
};
|
|
87
88
|
export declare function getServerModels(): {
|
|
88
89
|
AccessKey: import("../types").DynamicModel<import("@abtnode/types").TAccessKey>;
|
package/lib/models/index.js
CHANGED
|
@@ -236,6 +236,7 @@ function getBlockletModels() {
|
|
|
236
236
|
UserOrg: (0, user_orgs_1.createUserOrgsModel)(),
|
|
237
237
|
Org: (0, orgs_1.createOrgsModel)(),
|
|
238
238
|
OrgResource: (0, org_resource_1.createOrgResourceModel)(),
|
|
239
|
+
AuditLog: (0, audit_log_1.createAuditLogModel)(),
|
|
239
240
|
};
|
|
240
241
|
return models;
|
|
241
242
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/models",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.54-beta-20251017-133309-7d40faa6",
|
|
4
4
|
"description": "Sequelize models for blocklet server and blocklet service",
|
|
5
5
|
"homepage": "https://github.com/ArcBlock/blocklet-server#readme",
|
|
6
6
|
"publishConfig": {
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"url": "https://github.com/ArcBlock/blocklet-server/issues"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@abtnode/constant": "1.16.
|
|
37
|
-
"@abtnode/db-cache": "1.16.
|
|
38
|
-
"@abtnode/logger": "1.16.
|
|
39
|
-
"@abtnode/types": "1.16.
|
|
40
|
-
"@abtnode/util": "1.16.
|
|
36
|
+
"@abtnode/constant": "1.16.54-beta-20251017-133309-7d40faa6",
|
|
37
|
+
"@abtnode/db-cache": "1.16.54-beta-20251017-133309-7d40faa6",
|
|
38
|
+
"@abtnode/logger": "1.16.54-beta-20251017-133309-7d40faa6",
|
|
39
|
+
"@abtnode/types": "1.16.54-beta-20251017-133309-7d40faa6",
|
|
40
|
+
"@abtnode/util": "1.16.54-beta-20251017-133309-7d40faa6",
|
|
41
41
|
"@arcblock/did": "1.25.6",
|
|
42
42
|
"@arcblock/validator": "1.25.6",
|
|
43
43
|
"lodash.clonedeep": "^4.5.0",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"typescript": "^5.6.3"
|
|
61
61
|
},
|
|
62
62
|
"resolutions": {},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "78c11632ed47a75502a20c257568fc9e1655ca05"
|
|
64
64
|
}
|