@abtnode/models 1.16.19-beta-340de95d → 1.16.19-beta-7b2db880
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/migrate.d.ts +0 -12
- package/lib/migrate.js +2 -120
- package/lib/migrations/blocklet/{20231012000000-user-session copy.js → 20231012000000-user-session.js} +0 -1
- package/lib/migrations/blocklet/20231031000000-project.js +8 -4
- package/lib/migrations/connect/20231115000000-v2.js +13 -0
- package/lib/models/connection-v2.d.ts +38 -0
- package/lib/models/connection-v2.js +111 -0
- package/lib/models/index.d.ts +2 -0
- package/lib/models/index.js +3 -0
- package/lib/types.d.ts +5 -5
- package/lib/util.d.ts +0 -1
- package/lib/util.js +1 -7
- package/package.json +6 -9
package/lib/migrate.d.ts
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
1
|
export declare function doSchemaMigration(dbFile: string, group: string): Promise<import("umzug").MigrationMeta[]>;
|
|
2
|
-
type DataMigrationArgs = {
|
|
3
|
-
srcDir: string;
|
|
4
|
-
dbFile: string;
|
|
5
|
-
mapping: Record<string, string>;
|
|
6
|
-
models: Record<string, any>;
|
|
7
|
-
printInfo?: Function;
|
|
8
|
-
printError?: Function;
|
|
9
|
-
printSuccess?: Function;
|
|
10
|
-
};
|
|
11
|
-
export declare function doDataMigration({ srcDir, dbFile, mapping, models, printInfo, // eslint-disable-line no-console
|
|
12
|
-
printError, printSuccess, }: DataMigrationArgs): Promise<void>;
|
|
13
|
-
export {};
|
package/lib/migrate.js
CHANGED
|
@@ -3,20 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
/* eslint-disable
|
|
8
|
-
/* eslint-disable no-continue */
|
|
9
|
-
const lodash_get_1 = __importDefault(require("lodash.get"));
|
|
10
|
-
const fs_1 = require("fs");
|
|
11
|
-
const path_1 = require("path");
|
|
12
|
-
const core_1 = require("@nedb/core");
|
|
6
|
+
exports.doSchemaMigration = void 0;
|
|
7
|
+
/* eslint-disable import/prefer-default-export */
|
|
13
8
|
const umzug_1 = require("umzug");
|
|
14
9
|
const logger_1 = __importDefault(require("@abtnode/logger"));
|
|
15
|
-
const constant_1 = require("@blocklet/constant");
|
|
16
|
-
// @ts-ignore
|
|
17
|
-
const user_1 = require("@abtnode/util/lib/user"); // eslint-disable-line
|
|
18
10
|
const models_1 = require("./models");
|
|
19
|
-
const util_1 = require("./util");
|
|
20
11
|
const logger = (0, logger_1.default)('@abtnode/models:migration');
|
|
21
12
|
const MIGRATION_SCRIPT_EXTENSION = process.env.MIGRATION_SCRIPT_EXTENSION || 'js';
|
|
22
13
|
// eslint-disable-next-line require-await
|
|
@@ -35,112 +26,3 @@ async function doSchemaMigration(dbFile, group) {
|
|
|
35
26
|
return umzug.up();
|
|
36
27
|
}
|
|
37
28
|
exports.doSchemaMigration = doSchemaMigration;
|
|
38
|
-
async function doDataMigration({ srcDir, dbFile, mapping, models, printInfo = logger.info, // eslint-disable-line no-console
|
|
39
|
-
printError = logger.error, printSuccess = logger.info, // eslint-disable-line no-console
|
|
40
|
-
}) {
|
|
41
|
-
if ((0, fs_1.existsSync)(srcDir) === false) {
|
|
42
|
-
printError(`Can not scan srcDir ${srcDir}`);
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
const sequelize = (0, models_1.createSequelize)(dbFile);
|
|
46
|
-
Object.values(mapping).forEach((x) => {
|
|
47
|
-
if (models[x]) {
|
|
48
|
-
models[x].initialize(sequelize);
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
// Init hidden models
|
|
52
|
-
['Passport', 'ConnectedAccount'].forEach((x) => {
|
|
53
|
-
if (models[x]) {
|
|
54
|
-
models[x].initialize(sequelize);
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
const files = (0, fs_1.readdirSync)(srcDir).filter((file) => file.endsWith('.db'));
|
|
58
|
-
const dataDir = (0, util_1.getAvatarDir)(srcDir);
|
|
59
|
-
for (const file of files) {
|
|
60
|
-
const tableName = file.slice(0, -3);
|
|
61
|
-
const modelName = mapping[tableName];
|
|
62
|
-
if (!modelName) {
|
|
63
|
-
printInfo(`No mapping found for NeDB file: ${file}. Skipping.`);
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
const model = models[modelName];
|
|
67
|
-
if (!model) {
|
|
68
|
-
printInfo(`No Sequelize model found for NeDB file: ${file}. Skipping.`);
|
|
69
|
-
continue;
|
|
70
|
-
}
|
|
71
|
-
const filename = (0, path_1.join)(srcDir, file);
|
|
72
|
-
try {
|
|
73
|
-
const db = new core_1.DataStore({ filename, autoload: true });
|
|
74
|
-
const docs = await db.find({});
|
|
75
|
-
// Insert data into Sequelize database
|
|
76
|
-
for (const doc of docs) {
|
|
77
|
-
const newData = {
|
|
78
|
-
...doc,
|
|
79
|
-
id: doc._id,
|
|
80
|
-
createdAt: new Date(doc.createdAt || doc.created),
|
|
81
|
-
updatedAt: new Date(doc.updatedAt || doc.updated),
|
|
82
|
-
};
|
|
83
|
-
if (!newData.id) {
|
|
84
|
-
delete newData.id;
|
|
85
|
-
}
|
|
86
|
-
// Hack: 1-time-use data split to multiple tables
|
|
87
|
-
if (modelName === 'User') {
|
|
88
|
-
// rename fields
|
|
89
|
-
newData.sourceProvider =
|
|
90
|
-
newData.sourceProvider || (0, lodash_get_1.default)(newData, 'extraConfigs.sourceProvider') || constant_1.LOGIN_PROVIDER.WALLET;
|
|
91
|
-
// extra avatar
|
|
92
|
-
if (doc.avatar && doc.avatar.startsWith('data:image')) {
|
|
93
|
-
newData.avatar = await (0, user_1.extractUserAvatar)(doc.avatar, { dataDir });
|
|
94
|
-
printInfo('Convert avatar for user', doc.did, newData.avatar);
|
|
95
|
-
}
|
|
96
|
-
// split fields
|
|
97
|
-
const passports = (newData.passports || []).filter((p) => p.id);
|
|
98
|
-
const connectedAccounts = (0, lodash_get_1.default)(newData, 'extraConfigs.connectedAccounts') ||
|
|
99
|
-
[
|
|
100
|
-
{
|
|
101
|
-
provider: constant_1.LOGIN_PROVIDER.WALLET,
|
|
102
|
-
did: newData.did,
|
|
103
|
-
pk: newData.pk,
|
|
104
|
-
lastLoginAt: newData.lastLoginAt,
|
|
105
|
-
firstLoginAt: newData.firstLoginAt,
|
|
106
|
-
},
|
|
107
|
-
].filter((a) => a.provider && a.did);
|
|
108
|
-
try {
|
|
109
|
-
await model.create(newData);
|
|
110
|
-
await Promise.all(passports.map((p) => models.Passport.create({ ...p, userDid: newData.did })));
|
|
111
|
-
await Promise.all(connectedAccounts.map((a) => models.ConnectedAccount.create({ ...a, userDid: newData.did })));
|
|
112
|
-
printInfo(`Import user into sqlite: ${newData.did}`);
|
|
113
|
-
}
|
|
114
|
-
catch (err) {
|
|
115
|
-
printError('Error importing user into sqlite:', err, doc);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
// Hack: 1-time-use data transformation
|
|
120
|
-
if (modelName === 'Site') {
|
|
121
|
-
if (Array.isArray(doc.domainAliases)) {
|
|
122
|
-
newData.domainAliases = doc.domainAliases.map((x) => {
|
|
123
|
-
if (typeof x === 'string') {
|
|
124
|
-
return { value: x, isProtected: false };
|
|
125
|
-
}
|
|
126
|
-
return x;
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
try {
|
|
131
|
-
await model.create(newData);
|
|
132
|
-
printInfo(`Import data into sqlite ${modelName}:`, doc._id);
|
|
133
|
-
}
|
|
134
|
-
catch (err) {
|
|
135
|
-
printError('Error importing data into sqlite:', err);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
printSuccess(`Migrated data from nedb ${filename} to sqlite ${modelName}.`);
|
|
140
|
-
}
|
|
141
|
-
catch (err) {
|
|
142
|
-
printError(`Error reading data from NeDB file ${filename}: ${err.message}`);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
exports.doDataMigration = doDataMigration;
|
|
@@ -4,7 +4,6 @@ exports.down = exports.up = void 0;
|
|
|
4
4
|
const models_1 = require("../../models");
|
|
5
5
|
const models = (0, models_1.getBlockletModels)();
|
|
6
6
|
const up = async ({ context }) => {
|
|
7
|
-
await context.dropTable('user_sessions');
|
|
8
7
|
await context.createTable('user_sessions', models.UserSession.GENESIS_ATTRIBUTES);
|
|
9
8
|
};
|
|
10
9
|
exports.up = up;
|
|
@@ -4,10 +4,14 @@ exports.down = exports.up = void 0;
|
|
|
4
4
|
const sequelize_1 = require("sequelize");
|
|
5
5
|
const up = async ({ context }) => {
|
|
6
6
|
try {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const queryInterface = context;
|
|
8
|
+
const tableDescriptions = await queryInterface.describeTable('projects');
|
|
9
|
+
if (!tableDescriptions?.componentDid) {
|
|
10
|
+
await queryInterface.addColumn('projects', 'componentDid', {
|
|
11
|
+
type: sequelize_1.DataTypes.STRING(40),
|
|
12
|
+
allowNull: true,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
11
15
|
}
|
|
12
16
|
catch (err) {
|
|
13
17
|
if (process.env.NODE_ENV === 'test' && err.message.startsWith('SQLITE_ERROR: duplicate column name')) {
|
|
@@ -0,0 +1,13 @@
|
|
|
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 models = (0, models_1.getConnectModels)();
|
|
6
|
+
const up = async ({ context }) => {
|
|
7
|
+
await context.createTable('connections_v2', models.ConnectionV2.GENESIS_ATTRIBUTES);
|
|
8
|
+
};
|
|
9
|
+
exports.up = up;
|
|
10
|
+
const down = async ({ context }) => {
|
|
11
|
+
await context.dropTable('connections_v2');
|
|
12
|
+
};
|
|
13
|
+
exports.down = down;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { DynamicModel } from '../types';
|
|
2
|
+
export type ConnectionV2State = {
|
|
3
|
+
appInfo: any;
|
|
4
|
+
approveResults: any[];
|
|
5
|
+
approveUrl?: string;
|
|
6
|
+
authUrl: string;
|
|
7
|
+
autoConnect: boolean;
|
|
8
|
+
challenge: string;
|
|
9
|
+
connectUrl?: string;
|
|
10
|
+
currentConnected?: {
|
|
11
|
+
didwallet: any;
|
|
12
|
+
userDid: string;
|
|
13
|
+
userPk: string;
|
|
14
|
+
} | null;
|
|
15
|
+
currentStep: number;
|
|
16
|
+
error?: string;
|
|
17
|
+
forceConnected: boolean;
|
|
18
|
+
onlyConnect: boolean;
|
|
19
|
+
previousConnected?: {
|
|
20
|
+
didwallet: 'ios' | 'android' | 'web' | '';
|
|
21
|
+
userDid: string;
|
|
22
|
+
userPk: string;
|
|
23
|
+
} | null;
|
|
24
|
+
requestedClaims: any;
|
|
25
|
+
responseClaims: any;
|
|
26
|
+
sessionId: string;
|
|
27
|
+
status: string;
|
|
28
|
+
strategy: string | 'default' | 'smart';
|
|
29
|
+
timeout: {
|
|
30
|
+
app: number;
|
|
31
|
+
relay: number;
|
|
32
|
+
wallet: number;
|
|
33
|
+
};
|
|
34
|
+
updaterPk: string;
|
|
35
|
+
withinSession: boolean;
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
};
|
|
38
|
+
export declare function createConnectionV2Model(): DynamicModel<ConnectionV2State>;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createConnectionV2Model = void 0;
|
|
4
|
+
// Storage for did-connect sessions
|
|
5
|
+
const sequelize_1 = require("sequelize");
|
|
6
|
+
function createConnectionV2Model() {
|
|
7
|
+
var _a;
|
|
8
|
+
return _a = class ConnectionV2 extends sequelize_1.Model {
|
|
9
|
+
static initialize(sequelize) {
|
|
10
|
+
this.init({
|
|
11
|
+
...this.GENESIS_ATTRIBUTES,
|
|
12
|
+
}, {
|
|
13
|
+
sequelize,
|
|
14
|
+
modelName: 'ConnectionV2',
|
|
15
|
+
tableName: 'connections_v2',
|
|
16
|
+
timestamps: true,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
_a.GENESIS_ATTRIBUTES = {
|
|
21
|
+
appInfo: {
|
|
22
|
+
type: sequelize_1.DataTypes.JSON,
|
|
23
|
+
},
|
|
24
|
+
approvedResults: {
|
|
25
|
+
type: sequelize_1.DataTypes.JSON,
|
|
26
|
+
},
|
|
27
|
+
approveUrl: {
|
|
28
|
+
type: sequelize_1.DataTypes.TEXT,
|
|
29
|
+
defaultValue: '',
|
|
30
|
+
},
|
|
31
|
+
authUrl: {
|
|
32
|
+
type: sequelize_1.DataTypes.TEXT,
|
|
33
|
+
defaultValue: '',
|
|
34
|
+
},
|
|
35
|
+
autoConnect: {
|
|
36
|
+
type: sequelize_1.DataTypes.BOOLEAN,
|
|
37
|
+
default: false,
|
|
38
|
+
},
|
|
39
|
+
challenge: {
|
|
40
|
+
type: sequelize_1.DataTypes.STRING(32),
|
|
41
|
+
},
|
|
42
|
+
connectUrl: {
|
|
43
|
+
type: sequelize_1.DataTypes.TEXT,
|
|
44
|
+
defaultValue: '',
|
|
45
|
+
},
|
|
46
|
+
currentConnected: {
|
|
47
|
+
type: sequelize_1.DataTypes.JSON,
|
|
48
|
+
},
|
|
49
|
+
currentStep: {
|
|
50
|
+
type: sequelize_1.DataTypes.INTEGER,
|
|
51
|
+
},
|
|
52
|
+
error: {
|
|
53
|
+
type: sequelize_1.DataTypes.TEXT,
|
|
54
|
+
defaultValue: '',
|
|
55
|
+
},
|
|
56
|
+
forceConnected: {
|
|
57
|
+
type: sequelize_1.DataTypes.BOOLEAN,
|
|
58
|
+
default: false,
|
|
59
|
+
},
|
|
60
|
+
onlyConnect: {
|
|
61
|
+
type: sequelize_1.DataTypes.BOOLEAN,
|
|
62
|
+
default: false,
|
|
63
|
+
},
|
|
64
|
+
previousConnected: {
|
|
65
|
+
type: sequelize_1.DataTypes.JSON,
|
|
66
|
+
},
|
|
67
|
+
requestedClaims: {
|
|
68
|
+
type: sequelize_1.DataTypes.JSON,
|
|
69
|
+
},
|
|
70
|
+
responseClaims: {
|
|
71
|
+
type: sequelize_1.DataTypes.JSON,
|
|
72
|
+
},
|
|
73
|
+
sessionId: {
|
|
74
|
+
type: sequelize_1.DataTypes.STRING(40),
|
|
75
|
+
primaryKey: true,
|
|
76
|
+
},
|
|
77
|
+
status: {
|
|
78
|
+
type: sequelize_1.DataTypes.STRING(16),
|
|
79
|
+
index: true,
|
|
80
|
+
},
|
|
81
|
+
strategy: {
|
|
82
|
+
type: sequelize_1.DataTypes.STRING(16),
|
|
83
|
+
},
|
|
84
|
+
timeout: {
|
|
85
|
+
type: sequelize_1.DataTypes.JSON,
|
|
86
|
+
},
|
|
87
|
+
updaterPk: {
|
|
88
|
+
type: sequelize_1.DataTypes.STRING(255),
|
|
89
|
+
},
|
|
90
|
+
withinSession: {
|
|
91
|
+
type: sequelize_1.DataTypes.BOOLEAN,
|
|
92
|
+
default: false,
|
|
93
|
+
},
|
|
94
|
+
__extra: {
|
|
95
|
+
type: sequelize_1.DataTypes.JSON,
|
|
96
|
+
defaultValue: {},
|
|
97
|
+
},
|
|
98
|
+
createdAt: {
|
|
99
|
+
type: sequelize_1.DataTypes.DATE,
|
|
100
|
+
defaultValue: sequelize_1.DataTypes.NOW,
|
|
101
|
+
index: true,
|
|
102
|
+
},
|
|
103
|
+
updatedAt: {
|
|
104
|
+
type: sequelize_1.DataTypes.DATE,
|
|
105
|
+
defaultValue: sequelize_1.DataTypes.NOW,
|
|
106
|
+
index: true,
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
_a;
|
|
110
|
+
}
|
|
111
|
+
exports.createConnectionV2Model = createConnectionV2Model;
|
package/lib/models/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export * from './server';
|
|
|
21
21
|
export * from './site';
|
|
22
22
|
export * from './webhook';
|
|
23
23
|
export * from './connection';
|
|
24
|
+
export * from './connection-v2';
|
|
24
25
|
export * from './backup';
|
|
25
26
|
export * from './traffic-insight';
|
|
26
27
|
export * from './runtime-insight';
|
|
@@ -75,5 +76,6 @@ export declare function getServerModels(): {
|
|
|
75
76
|
};
|
|
76
77
|
export declare function getConnectModels(): {
|
|
77
78
|
Connection: import("../types").DynamicModel<import("./connection").ConnectionState>;
|
|
79
|
+
ConnectionV2: import("../types").DynamicModel<import("./connection-v2").ConnectionV2State>;
|
|
78
80
|
};
|
|
79
81
|
export declare function setupModels(models: any, sequelize: Sequelize): void;
|
package/lib/models/index.js
CHANGED
|
@@ -45,6 +45,7 @@ const tagging_1 = require("./tagging");
|
|
|
45
45
|
const project_1 = require("./project");
|
|
46
46
|
const release_1 = require("./release");
|
|
47
47
|
const user_session_1 = require("./user-session");
|
|
48
|
+
const connection_v2_1 = require("./connection-v2");
|
|
48
49
|
__exportStar(require("./message"), exports);
|
|
49
50
|
__exportStar(require("./account"), exports);
|
|
50
51
|
__exportStar(require("./certificate"), exports);
|
|
@@ -67,6 +68,7 @@ __exportStar(require("./server"), exports);
|
|
|
67
68
|
__exportStar(require("./site"), exports);
|
|
68
69
|
__exportStar(require("./webhook"), exports);
|
|
69
70
|
__exportStar(require("./connection"), exports);
|
|
71
|
+
__exportStar(require("./connection-v2"), exports);
|
|
70
72
|
__exportStar(require("./backup"), exports);
|
|
71
73
|
__exportStar(require("./traffic-insight"), exports);
|
|
72
74
|
__exportStar(require("./runtime-insight"), exports);
|
|
@@ -162,6 +164,7 @@ exports.getServerModels = getServerModels;
|
|
|
162
164
|
function getConnectModels() {
|
|
163
165
|
const models = {
|
|
164
166
|
Connection: (0, connection_1.createConnectionModel)(),
|
|
167
|
+
ConnectionV2: (0, connection_v2_1.createConnectionV2Model)(),
|
|
165
168
|
};
|
|
166
169
|
return models;
|
|
167
170
|
}
|
package/lib/types.d.ts
CHANGED
|
@@ -21,11 +21,6 @@ export type PagingOptions = {
|
|
|
21
21
|
pageSize?: number;
|
|
22
22
|
page?: number;
|
|
23
23
|
};
|
|
24
|
-
export type ApplyBasicQueryCasting<T> = T | T[] | (T extends (infer U)[] ? U : any) | any;
|
|
25
|
-
export type Condition<T> = ApplyBasicQueryCasting<T> | QuerySelector<ApplyBasicQueryCasting<T>>;
|
|
26
|
-
export type ConditionOptions<T> = {
|
|
27
|
-
[P in keyof T]?: Condition<T[P]>;
|
|
28
|
-
} & RootQuerySelector<T>;
|
|
29
24
|
export type QuerySelector<T> = {
|
|
30
25
|
$lt?: T;
|
|
31
26
|
$lte?: T;
|
|
@@ -37,6 +32,11 @@ export type QuerySelector<T> = {
|
|
|
37
32
|
$exists?: boolean;
|
|
38
33
|
$regex?: T extends string ? RegExp | string : never;
|
|
39
34
|
};
|
|
35
|
+
export type ApplyBasicQueryCasting<T> = T | T[] | (T extends (infer U)[] ? U : any) | any;
|
|
36
|
+
export type Condition<T> = ApplyBasicQueryCasting<T> | QuerySelector<ApplyBasicQueryCasting<T>>;
|
|
37
|
+
export type ConditionOptions<T> = {
|
|
38
|
+
[P in keyof T]?: Condition<T[P]>;
|
|
39
|
+
} & RootQuerySelector<T>;
|
|
40
40
|
export type RootQuerySelector<T> = {
|
|
41
41
|
$and?: Array<ConditionOptions<T>>;
|
|
42
42
|
$or?: Array<ConditionOptions<T>>;
|
package/lib/util.d.ts
CHANGED
|
@@ -5,4 +5,3 @@ export declare function formatConditions(conditions: Record<string, any>): Inclu
|
|
|
5
5
|
export declare function formatOrder(sort: Record<string, any>): Order;
|
|
6
6
|
export declare function formatSelection(selection: Record<string, any>): string[];
|
|
7
7
|
export declare function formatParams(params: FindOptions): FindOptions;
|
|
8
|
-
export declare function getAvatarDir(srcDir: any): any;
|
package/lib/util.js
CHANGED
|
@@ -3,9 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.formatParams = exports.formatSelection = exports.formatOrder = exports.formatConditions = exports.generateRandomString = exports.generateId = void 0;
|
|
7
7
|
const uuid_1 = require("uuid");
|
|
8
|
-
const path_1 = require("path");
|
|
9
8
|
const sequelize_1 = require("sequelize");
|
|
10
9
|
const lodash_isempty_1 = __importDefault(require("lodash.isempty"));
|
|
11
10
|
function generateId() {
|
|
@@ -116,8 +115,3 @@ function formatParams(params) {
|
|
|
116
115
|
return params;
|
|
117
116
|
}
|
|
118
117
|
exports.formatParams = formatParams;
|
|
119
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
120
|
-
function getAvatarDir(srcDir) {
|
|
121
|
-
return srcDir.endsWith('/core') ? (0, path_1.join)((0, path_1.dirname)(srcDir), 'data/_abtnode') : srcDir;
|
|
122
|
-
}
|
|
123
|
-
exports.getAvatarDir = getAvatarDir;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/models",
|
|
3
|
-
"version": "1.16.19-beta-
|
|
3
|
+
"version": "1.16.19-beta-7b2db880",
|
|
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,16 +32,13 @@
|
|
|
32
32
|
"url": "https://github.com/ArcBlock/blocklet-server/issues"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@abtnode/logger": "1.16.19-beta-
|
|
36
|
-
"@abtnode/types": "1.16.19-beta-
|
|
37
|
-
"@blocklet/constant": "1.16.19-beta-340de95d",
|
|
38
|
-
"@nedb/core": "^2.1.5",
|
|
35
|
+
"@abtnode/logger": "1.16.19-beta-7b2db880",
|
|
36
|
+
"@abtnode/types": "1.16.19-beta-7b2db880",
|
|
39
37
|
"lodash.clonedeep": "^4.5.0",
|
|
40
|
-
"lodash.get": "^4.4.2",
|
|
41
38
|
"lodash.isempty": "^4.4.0",
|
|
42
|
-
"sequelize": "^6.
|
|
39
|
+
"sequelize": "^6.35.0",
|
|
43
40
|
"sqlite3": "^5.1.6",
|
|
44
|
-
"umzug": "3.
|
|
41
|
+
"umzug": "3.4.0",
|
|
45
42
|
"uuid": "^8.3.2"
|
|
46
43
|
},
|
|
47
44
|
"devDependencies": {
|
|
@@ -55,5 +52,5 @@
|
|
|
55
52
|
"typescript": "^5.0.4"
|
|
56
53
|
},
|
|
57
54
|
"resolutions": {},
|
|
58
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "598b576b97dd7accbfa1bb509b75e423ad27e5e2"
|
|
59
56
|
}
|