@sqlml/ui 0.3.4
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 +21 -0
- package/README.md +36 -0
- package/client/dist/assets/index-CpRgSqWF.js +672 -0
- package/client/dist/assets/index-DMcl7wPy.css +1 -0
- package/client/dist/favicon.svg +17 -0
- package/client/dist/index.html +14 -0
- package/package.json +66 -0
- package/server/dist/app.module.d.ts +2 -0
- package/server/dist/app.module.js +55 -0
- package/server/dist/app.module.js.map +1 -0
- package/server/dist/common/entities/workspace.entity.d.ts +42 -0
- package/server/dist/common/entities/workspace.entity.js +48 -0
- package/server/dist/common/entities/workspace.entity.js.map +1 -0
- package/server/dist/core/core.module.d.ts +2 -0
- package/server/dist/core/core.module.js +31 -0
- package/server/dist/core/core.module.js.map +1 -0
- package/server/dist/core/health.controller.d.ts +7 -0
- package/server/dist/core/health.controller.js +37 -0
- package/server/dist/core/health.controller.js.map +1 -0
- package/server/dist/core/root.controller.d.ts +4 -0
- package/server/dist/core/root.controller.js +95 -0
- package/server/dist/core/root.controller.js.map +1 -0
- package/server/dist/core/sqlml.service.d.ts +80 -0
- package/server/dist/core/sqlml.service.js +237 -0
- package/server/dist/core/sqlml.service.js.map +1 -0
- package/server/dist/main.d.ts +1 -0
- package/server/dist/main.js +45 -0
- package/server/dist/main.js.map +1 -0
- package/server/dist/modules/config/config.controller.d.ts +18 -0
- package/server/dist/modules/config/config.controller.js +76 -0
- package/server/dist/modules/config/config.controller.js.map +1 -0
- package/server/dist/modules/config/config.module.d.ts +2 -0
- package/server/dist/modules/config/config.module.js +27 -0
- package/server/dist/modules/config/config.module.js.map +1 -0
- package/server/dist/modules/config/config.service.d.ts +31 -0
- package/server/dist/modules/config/config.service.js +376 -0
- package/server/dist/modules/config/config.service.js.map +1 -0
- package/server/dist/modules/database/database-connection.entity.d.ts +17 -0
- package/server/dist/modules/database/database-connection.entity.js +78 -0
- package/server/dist/modules/database/database-connection.entity.js.map +1 -0
- package/server/dist/modules/database/database.controller.d.ts +103 -0
- package/server/dist/modules/database/database.controller.js +236 -0
- package/server/dist/modules/database/database.controller.js.map +1 -0
- package/server/dist/modules/database/database.module.d.ts +2 -0
- package/server/dist/modules/database/database.module.js +26 -0
- package/server/dist/modules/database/database.module.js.map +1 -0
- package/server/dist/modules/database/database.service.d.ts +102 -0
- package/server/dist/modules/database/database.service.js +415 -0
- package/server/dist/modules/database/database.service.js.map +1 -0
- package/server/dist/modules/migration/migration-history.entity.d.ts +14 -0
- package/server/dist/modules/migration/migration-history.entity.js +66 -0
- package/server/dist/modules/migration/migration-history.entity.js.map +1 -0
- package/server/dist/modules/migration/migration-template.entity.d.ts +10 -0
- package/server/dist/modules/migration/migration-template.entity.js +52 -0
- package/server/dist/modules/migration/migration-template.entity.js.map +1 -0
- package/server/dist/modules/migration/migration.controller.d.ts +60 -0
- package/server/dist/modules/migration/migration.controller.js +159 -0
- package/server/dist/modules/migration/migration.controller.js.map +1 -0
- package/server/dist/modules/migration/migration.module.d.ts +2 -0
- package/server/dist/modules/migration/migration.module.js +27 -0
- package/server/dist/modules/migration/migration.module.js.map +1 -0
- package/server/dist/modules/migration/migration.service.d.ts +65 -0
- package/server/dist/modules/migration/migration.service.js +195 -0
- package/server/dist/modules/migration/migration.service.js.map +1 -0
- package/server/dist/modules/schema/dbml-diff.util.d.ts +42 -0
- package/server/dist/modules/schema/dbml-diff.util.js +193 -0
- package/server/dist/modules/schema/dbml-diff.util.js.map +1 -0
- package/server/dist/modules/schema/schema-snapshot.entity.d.ts +13 -0
- package/server/dist/modules/schema/schema-snapshot.entity.js +62 -0
- package/server/dist/modules/schema/schema-snapshot.entity.js.map +1 -0
- package/server/dist/modules/schema/schema.controller.d.ts +62 -0
- package/server/dist/modules/schema/schema.controller.js +188 -0
- package/server/dist/modules/schema/schema.controller.js.map +1 -0
- package/server/dist/modules/schema/schema.module.d.ts +2 -0
- package/server/dist/modules/schema/schema.module.js +30 -0
- package/server/dist/modules/schema/schema.module.js.map +1 -0
- package/server/dist/modules/schema/schema.service.d.ts +53 -0
- package/server/dist/modules/schema/schema.service.js +276 -0
- package/server/dist/modules/schema/schema.service.js.map +1 -0
- package/server/dist/modules/system/process-info.entity.d.ts +8 -0
- package/server/dist/modules/system/process-info.entity.js +44 -0
- package/server/dist/modules/system/process-info.entity.js.map +1 -0
- package/server/dist/modules/system/system.controller.d.ts +25 -0
- package/server/dist/modules/system/system.controller.js +64 -0
- package/server/dist/modules/system/system.controller.js.map +1 -0
- package/server/dist/modules/system/system.module.d.ts +2 -0
- package/server/dist/modules/system/system.module.js +26 -0
- package/server/dist/modules/system/system.module.js.map +1 -0
- package/server/dist/modules/system/system.service.d.ts +25 -0
- package/server/dist/modules/system/system.service.js +100 -0
- package/server/dist/modules/system/system.service.js.map +1 -0
- package/server/dist/modules/workspace/workspace.controller.d.ts +35 -0
- package/server/dist/modules/workspace/workspace.controller.js +132 -0
- package/server/dist/modules/workspace/workspace.controller.js.map +1 -0
- package/server/dist/modules/workspace/workspace.dto.d.ts +9 -0
- package/server/dist/modules/workspace/workspace.dto.js +39 -0
- package/server/dist/modules/workspace/workspace.dto.js.map +1 -0
- package/server/dist/modules/workspace/workspace.module.d.ts +2 -0
- package/server/dist/modules/workspace/workspace.module.js +26 -0
- package/server/dist/modules/workspace/workspace.module.js.map +1 -0
- package/server/dist/modules/workspace/workspace.service.d.ts +44 -0
- package/server/dist/modules/workspace/workspace.service.js +93 -0
- package/server/dist/modules/workspace/workspace.service.js.map +1 -0
- package/server/dist/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SchemaService = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
|
+
const typeorm_2 = require("typeorm");
|
|
19
|
+
const crypto = require("crypto");
|
|
20
|
+
const schema_snapshot_entity_1 = require("./schema-snapshot.entity");
|
|
21
|
+
const sqlml_service_1 = require("../../core/sqlml.service");
|
|
22
|
+
const workspace_service_1 = require("../workspace/workspace.service");
|
|
23
|
+
const dbml_diff_util_1 = require("./dbml-diff.util");
|
|
24
|
+
let SchemaService = class SchemaService {
|
|
25
|
+
constructor(snapshotRepository, sqlmlService, workspaceService) {
|
|
26
|
+
this.snapshotRepository = snapshotRepository;
|
|
27
|
+
this.sqlmlService = sqlmlService;
|
|
28
|
+
this.workspaceService = workspaceService;
|
|
29
|
+
}
|
|
30
|
+
async listSchemaFiles() {
|
|
31
|
+
return this.sqlmlService.listSchemaFiles();
|
|
32
|
+
}
|
|
33
|
+
async getSchemaContent(filename) {
|
|
34
|
+
return this.sqlmlService.readSchemaFile(filename);
|
|
35
|
+
}
|
|
36
|
+
async saveSchemaContent(filename, content) {
|
|
37
|
+
return this.sqlmlService.writeSchemaFile(filename, content);
|
|
38
|
+
}
|
|
39
|
+
async createSchemaFile(filename, content) {
|
|
40
|
+
const finalName = filename.endsWith('.dbml') ? filename : `${filename}.dbml`;
|
|
41
|
+
return this.sqlmlService.writeSchemaFile(finalName, content);
|
|
42
|
+
}
|
|
43
|
+
async syncCliSnapshots(workspaceId) {
|
|
44
|
+
const cliSnapshots = this.sqlmlService.listCliSnapshots();
|
|
45
|
+
if (cliSnapshots.length === 0)
|
|
46
|
+
return;
|
|
47
|
+
const existing = await this.snapshotRepository.find({
|
|
48
|
+
where: { workspaceId },
|
|
49
|
+
select: ['version'],
|
|
50
|
+
});
|
|
51
|
+
const existingVersions = new Set(existing.map(s => s.version));
|
|
52
|
+
for (const cli of cliSnapshots) {
|
|
53
|
+
if (existingVersions.has(cli.version))
|
|
54
|
+
continue;
|
|
55
|
+
const checksum = cli.meta.checksum ||
|
|
56
|
+
crypto.createHash('sha256').update(cli.dbmlContent).digest('hex');
|
|
57
|
+
const tableCount = (cli.dbmlContent.match(/Table\s+/gi) || []).length;
|
|
58
|
+
const snapshot = this.snapshotRepository.create({
|
|
59
|
+
workspaceId,
|
|
60
|
+
version: cli.version,
|
|
61
|
+
name: cli.meta.description || `Snapshot ${cli.version}`,
|
|
62
|
+
description: cli.meta.migrationGenerated
|
|
63
|
+
? `Migration: ${cli.meta.migrationGenerated}`
|
|
64
|
+
: undefined,
|
|
65
|
+
dbmlContent: cli.dbmlContent,
|
|
66
|
+
checksum,
|
|
67
|
+
tableCount,
|
|
68
|
+
});
|
|
69
|
+
if (cli.meta.createdAt) {
|
|
70
|
+
snapshot.createdAt = new Date(cli.meta.createdAt);
|
|
71
|
+
}
|
|
72
|
+
await this.snapshotRepository.save(snapshot);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
async listSnapshots(workspaceId) {
|
|
76
|
+
const workspace = await this.workspaceService.getOrCreateCurrent();
|
|
77
|
+
const wsId = workspaceId || workspace.id;
|
|
78
|
+
await this.syncCliSnapshots(wsId);
|
|
79
|
+
const where = wsId ? { workspaceId: wsId } : {};
|
|
80
|
+
return this.snapshotRepository.find({
|
|
81
|
+
where,
|
|
82
|
+
order: { createdAt: 'DESC' },
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
async getSnapshot(id) {
|
|
86
|
+
return this.snapshotRepository.findOne({ where: { id } });
|
|
87
|
+
}
|
|
88
|
+
async createSnapshot(data) {
|
|
89
|
+
let workspaceId = data.workspaceId;
|
|
90
|
+
if (!workspaceId) {
|
|
91
|
+
const currentWorkspace = await this.workspaceService.getOrCreateCurrent();
|
|
92
|
+
workspaceId = currentWorkspace.id;
|
|
93
|
+
}
|
|
94
|
+
let version = data.version;
|
|
95
|
+
if (!version) {
|
|
96
|
+
await this.syncCliSnapshots(workspaceId);
|
|
97
|
+
const allSnapshots = await this.snapshotRepository.find({
|
|
98
|
+
where: { workspaceId },
|
|
99
|
+
select: ['version'],
|
|
100
|
+
});
|
|
101
|
+
let maxVersion = -1;
|
|
102
|
+
for (const s of allSnapshots) {
|
|
103
|
+
const num = parseInt(s.version, 10);
|
|
104
|
+
if (!isNaN(num) && num > maxVersion)
|
|
105
|
+
maxVersion = num;
|
|
106
|
+
}
|
|
107
|
+
const cliSnapshots = this.sqlmlService.listCliSnapshots();
|
|
108
|
+
for (const cli of cliSnapshots) {
|
|
109
|
+
const num = parseInt(cli.version, 10);
|
|
110
|
+
if (!isNaN(num) && num > maxVersion)
|
|
111
|
+
maxVersion = num;
|
|
112
|
+
}
|
|
113
|
+
version = String(maxVersion + 1).padStart(6, '0');
|
|
114
|
+
}
|
|
115
|
+
let dbmlContent = data.dbmlContent;
|
|
116
|
+
if (!dbmlContent) {
|
|
117
|
+
const schemaFiles = await this.listSchemaFiles();
|
|
118
|
+
if (schemaFiles.length > 0) {
|
|
119
|
+
const contents = await Promise.all(schemaFiles.map(async (file) => {
|
|
120
|
+
const content = await this.getSchemaContent(file);
|
|
121
|
+
return content || '';
|
|
122
|
+
}));
|
|
123
|
+
dbmlContent = contents.join('\n\n');
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
dbmlContent = '// No schema files found';
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
const checksum = crypto
|
|
130
|
+
.createHash('sha256')
|
|
131
|
+
.update(dbmlContent)
|
|
132
|
+
.digest('hex');
|
|
133
|
+
const tableCount = (dbmlContent.match(/Table\s+/gi) || []).length;
|
|
134
|
+
let name = data.name;
|
|
135
|
+
if (!name) {
|
|
136
|
+
const schemaFiles = await this.listSchemaFiles();
|
|
137
|
+
if (schemaFiles.length > 0) {
|
|
138
|
+
const fileNames = schemaFiles.map(f => f.replace('.dbml', '')).join(', ');
|
|
139
|
+
name = `Snapshot ${fileNames}`;
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
name = `Snapshot v${version}`;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
const schemaFiles = await this.listSchemaFiles();
|
|
146
|
+
this.sqlmlService.writeSnapshotToDisk({
|
|
147
|
+
version,
|
|
148
|
+
dbmlContent,
|
|
149
|
+
name,
|
|
150
|
+
description: data.description,
|
|
151
|
+
checksum,
|
|
152
|
+
sourceFile: schemaFiles.length > 0 ? schemaFiles[0] : undefined,
|
|
153
|
+
});
|
|
154
|
+
this.sqlmlService.addHistoryEntry({
|
|
155
|
+
action: 'snapshot:create',
|
|
156
|
+
version,
|
|
157
|
+
description: name || data.description,
|
|
158
|
+
});
|
|
159
|
+
const snapshot = this.snapshotRepository.create({
|
|
160
|
+
workspaceId,
|
|
161
|
+
version,
|
|
162
|
+
name,
|
|
163
|
+
description: data.description,
|
|
164
|
+
dbmlContent,
|
|
165
|
+
checksum,
|
|
166
|
+
tableCount,
|
|
167
|
+
});
|
|
168
|
+
return this.snapshotRepository.save(snapshot);
|
|
169
|
+
}
|
|
170
|
+
async getSnapshotDeleteRisk(id) {
|
|
171
|
+
const snapshot = await this.snapshotRepository.findOne({ where: { id } });
|
|
172
|
+
if (!snapshot)
|
|
173
|
+
throw new Error('Snapshot not found');
|
|
174
|
+
const allSnapshots = await this.snapshotRepository.find({
|
|
175
|
+
where: { workspaceId: snapshot.workspaceId },
|
|
176
|
+
order: { version: 'DESC' },
|
|
177
|
+
take: 1,
|
|
178
|
+
});
|
|
179
|
+
const isLatest = allSnapshots.length > 0 && allSnapshots[0].id === id;
|
|
180
|
+
const hasMigration = !!(snapshot.description && snapshot.description.startsWith('Migration:'));
|
|
181
|
+
const migrationName = hasMigration
|
|
182
|
+
? snapshot.description.replace('Migration: ', '')
|
|
183
|
+
: undefined;
|
|
184
|
+
const warnings = [];
|
|
185
|
+
if (isLatest) {
|
|
186
|
+
warnings.push('This is the latest snapshot. Deleting it will affect migration generation — the next "sqlml migration:generate" will diff against an older snapshot and may produce incorrect migrations.');
|
|
187
|
+
}
|
|
188
|
+
if (hasMigration) {
|
|
189
|
+
warnings.push(`This snapshot is linked to migration "${migrationName}". Deleting it breaks the snapshot-to-migration chain and may make future diffs inaccurate.`);
|
|
190
|
+
}
|
|
191
|
+
return { isLatest, hasMigration, migrationName, version: snapshot.version, warnings };
|
|
192
|
+
}
|
|
193
|
+
async deleteSnapshot(id, force = false) {
|
|
194
|
+
if (!force) {
|
|
195
|
+
const risk = await this.getSnapshotDeleteRisk(id);
|
|
196
|
+
if (risk.warnings.length > 0) {
|
|
197
|
+
const error = new Error('Snapshot has delete risks');
|
|
198
|
+
error.risks = risk;
|
|
199
|
+
throw error;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
const snapshot = await this.snapshotRepository.findOne({ where: { id } });
|
|
203
|
+
if (snapshot) {
|
|
204
|
+
this.sqlmlService.deleteSnapshotFromDisk(snapshot.version);
|
|
205
|
+
this.sqlmlService.addHistoryEntry({
|
|
206
|
+
action: 'snapshot:delete',
|
|
207
|
+
version: snapshot.version,
|
|
208
|
+
description: `Deleted: ${snapshot.name || snapshot.version}`,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
await this.snapshotRepository.delete(id);
|
|
212
|
+
}
|
|
213
|
+
async compareSnapshots(snapshotId1, snapshotId2) {
|
|
214
|
+
const snapshot1 = await this.getSnapshot(snapshotId1);
|
|
215
|
+
const snapshot2 = await this.getSnapshot(snapshotId2);
|
|
216
|
+
if (!snapshot1 || !snapshot2) {
|
|
217
|
+
throw new Error('Snapshot not found');
|
|
218
|
+
}
|
|
219
|
+
const diff = (0, dbml_diff_util_1.diffSchemas)(snapshot1.dbmlContent || '', snapshot2.dbmlContent || '');
|
|
220
|
+
return {
|
|
221
|
+
hasChanges: snapshot1.checksum !== snapshot2.checksum,
|
|
222
|
+
snapshot1,
|
|
223
|
+
snapshot2,
|
|
224
|
+
diff,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
async diffSchemas(params) {
|
|
228
|
+
let oldContent;
|
|
229
|
+
let newContent;
|
|
230
|
+
if (params.snapshotId1 && params.snapshotId2) {
|
|
231
|
+
const snapshot1 = await this.getSnapshot(params.snapshotId1);
|
|
232
|
+
const snapshot2 = await this.getSnapshot(params.snapshotId2);
|
|
233
|
+
if (!snapshot1 || !snapshot2)
|
|
234
|
+
throw new Error('Snapshot not found');
|
|
235
|
+
oldContent = snapshot1.dbmlContent || '';
|
|
236
|
+
newContent = snapshot2.dbmlContent || '';
|
|
237
|
+
}
|
|
238
|
+
else if (params.snapshotId1 && !params.snapshotId2) {
|
|
239
|
+
const snapshot1 = await this.getSnapshot(params.snapshotId1);
|
|
240
|
+
if (!snapshot1)
|
|
241
|
+
throw new Error('Snapshot not found');
|
|
242
|
+
oldContent = snapshot1.dbmlContent || '';
|
|
243
|
+
newContent = await this.sqlmlService.readCurrentSchema();
|
|
244
|
+
}
|
|
245
|
+
else if (params.content1 !== undefined && params.content2 !== undefined) {
|
|
246
|
+
oldContent = params.content1;
|
|
247
|
+
newContent = params.content2;
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
throw new Error('Provide {snapshotId1, snapshotId2}, {snapshotId1} (compares to current), or {content1, content2}');
|
|
251
|
+
}
|
|
252
|
+
const result = (0, dbml_diff_util_1.diffSchemas)(oldContent, newContent);
|
|
253
|
+
return { ...result, oldContent, newContent };
|
|
254
|
+
}
|
|
255
|
+
async generateEntities(schemaName) {
|
|
256
|
+
const command = schemaName ? `generate ${schemaName}` : 'generate';
|
|
257
|
+
const { stdout, stderr } = await this.sqlmlService.execCli(command);
|
|
258
|
+
const hasError = stderr.length > 0 &&
|
|
259
|
+
!stderr.toLowerCase().includes('warn') &&
|
|
260
|
+
!stderr.toLowerCase().includes('notice');
|
|
261
|
+
return {
|
|
262
|
+
success: !hasError,
|
|
263
|
+
output: stdout,
|
|
264
|
+
error: hasError ? stderr : undefined,
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
exports.SchemaService = SchemaService;
|
|
269
|
+
exports.SchemaService = SchemaService = __decorate([
|
|
270
|
+
(0, common_1.Injectable)(),
|
|
271
|
+
__param(0, (0, typeorm_1.InjectRepository)(schema_snapshot_entity_1.SchemaSnapshot)),
|
|
272
|
+
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
273
|
+
sqlml_service_1.SqlmlService,
|
|
274
|
+
workspace_service_1.WorkspaceService])
|
|
275
|
+
], SchemaService);
|
|
276
|
+
//# sourceMappingURL=schema.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.service.js","sourceRoot":"","sources":["../../../src/modules/schema/schema.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AACnD,qCAAqC;AACrC,iCAAiC;AACjC,qEAA0D;AAC1D,4DAAwD;AACxD,sEAAkE;AAClE,qDAAoF;AAG7E,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YAEU,kBAA8C,EAC9C,YAA0B,EAC1B,gBAAkC;QAFlC,uBAAkB,GAAlB,kBAAkB,CAA4B;QAC9C,iBAAY,GAAZ,YAAY,CAAc;QAC1B,qBAAgB,GAAhB,gBAAgB,CAAkB;IACzC,CAAC;IAKJ,KAAK,CAAC,eAAe;QACnB,OAAO,I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,CAAC;YAC7B,UAAU,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC/B,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CACb,kGAAkG,CACnG,CAAC;QACJ,CAAC;QAED,MAAM,MAAM,GAAG,IAAA,4BAAe,EAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QACvD,OAAO,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;IAC/C,CAAC;IAKD,KAAK,CAAC,gBAAgB,CAAC,UAAmB;QAKxC,MAAM,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,YAAY,UAAU,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;QACnE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAEpE,MAAM,QAAQ,GACZ,MAAM,CAAC,MAAM,GAAG,CAAC;YACjB,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC;YACtC,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAE3C,OAAO;YACL,OAAO,EAAE,CAAC,QAAQ;YAClB,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;SACrC,CAAC;IACJ,CAAC;CACF,CAAA;AApXY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,uCAAc,CAAC,CAAA;qCACL,oBAAU;QAChB,4BAAY;QACR,oCAAgB;GALjC,aAAa,CAoXzB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ProcessInfo = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
let ProcessInfo = class ProcessInfo {
|
|
15
|
+
};
|
|
16
|
+
exports.ProcessInfo = ProcessInfo;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
19
|
+
__metadata("design:type", String)
|
|
20
|
+
], ProcessInfo.prototype, "id", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.Column)(),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], ProcessInfo.prototype, "pid", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], ProcessInfo.prototype, "type", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], ProcessInfo.prototype, "name", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
35
|
+
__metadata("design:type", Date)
|
|
36
|
+
], ProcessInfo.prototype, "startedAt", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ default: true }),
|
|
39
|
+
__metadata("design:type", Boolean)
|
|
40
|
+
], ProcessInfo.prototype, "isActive", void 0);
|
|
41
|
+
exports.ProcessInfo = ProcessInfo = __decorate([
|
|
42
|
+
(0, typeorm_1.Entity)('process_info')
|
|
43
|
+
], ProcessInfo);
|
|
44
|
+
//# sourceMappingURL=process-info.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-info.entity.js","sourceRoot":"","sources":["../../../src/modules/system/process-info.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAmF;AAG5E,IAAM,WAAW,GAAjB,MAAM,WAAW;CAkBvB,CAAA;AAlBY,kCAAW;AAEtB;IADC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;uCACpB;AAGX;IADC,IAAA,gBAAM,GAAE;;wCACG;AAGZ;IADC,IAAA,gBAAM,GAAE;;yCACI;AAGb;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACd;AAGb;IADC,IAAA,0BAAgB,GAAE;8BACR,IAAI;8CAAC;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;6CACR;sBAjBP,WAAW;IADvB,IAAA,gBAAM,EAAC,cAAc,CAAC;GACV,WAAW,CAkBvB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SystemService } from './system.service';
|
|
2
|
+
export declare class SystemController {
|
|
3
|
+
private readonly systemService;
|
|
4
|
+
constructor(systemService: SystemService);
|
|
5
|
+
getStatus(): Promise<{
|
|
6
|
+
status: string;
|
|
7
|
+
pid: number;
|
|
8
|
+
uptime: number;
|
|
9
|
+
memory: NodeJS.MemoryUsage;
|
|
10
|
+
platform: NodeJS.Platform;
|
|
11
|
+
nodeVersion: string;
|
|
12
|
+
managedProcesses: import("./process-info.entity").ProcessInfo[];
|
|
13
|
+
}>;
|
|
14
|
+
registerProcess(data: {
|
|
15
|
+
pid: number;
|
|
16
|
+
type: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
}): Promise<import("./process-info.entity").ProcessInfo>;
|
|
19
|
+
shutdown(): Promise<{
|
|
20
|
+
message: string;
|
|
21
|
+
killed: number[];
|
|
22
|
+
failed: number[];
|
|
23
|
+
selfPid: number;
|
|
24
|
+
}>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SystemController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
+
const system_service_1 = require("./system.service");
|
|
19
|
+
let SystemController = class SystemController {
|
|
20
|
+
constructor(systemService) {
|
|
21
|
+
this.systemService = systemService;
|
|
22
|
+
}
|
|
23
|
+
getStatus() {
|
|
24
|
+
return this.systemService.getStatus();
|
|
25
|
+
}
|
|
26
|
+
registerProcess(data) {
|
|
27
|
+
return this.systemService.registerProcess(data.pid, data.type, data.name);
|
|
28
|
+
}
|
|
29
|
+
shutdown() {
|
|
30
|
+
return this.systemService.shutdown();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.SystemController = SystemController;
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, common_1.Get)('status'),
|
|
36
|
+
(0, swagger_1.ApiOperation)({ summary: 'Get system status' }),
|
|
37
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'System status' }),
|
|
38
|
+
__metadata("design:type", Function),
|
|
39
|
+
__metadata("design:paramtypes", []),
|
|
40
|
+
__metadata("design:returntype", void 0)
|
|
41
|
+
], SystemController.prototype, "getStatus", null);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, common_1.Post)('register'),
|
|
44
|
+
(0, swagger_1.ApiOperation)({ summary: 'Register a process' }),
|
|
45
|
+
(0, swagger_1.ApiResponse)({ status: 201, description: 'Process registered' }),
|
|
46
|
+
__param(0, (0, common_1.Body)()),
|
|
47
|
+
__metadata("design:type", Function),
|
|
48
|
+
__metadata("design:paramtypes", [Object]),
|
|
49
|
+
__metadata("design:returntype", void 0)
|
|
50
|
+
], SystemController.prototype, "registerProcess", null);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, common_1.Post)('shutdown'),
|
|
53
|
+
(0, swagger_1.ApiOperation)({ summary: 'Shutdown the UI server and client' }),
|
|
54
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: 'Shutdown initiated' }),
|
|
55
|
+
__metadata("design:type", Function),
|
|
56
|
+
__metadata("design:paramtypes", []),
|
|
57
|
+
__metadata("design:returntype", void 0)
|
|
58
|
+
], SystemController.prototype, "shutdown", null);
|
|
59
|
+
exports.SystemController = SystemController = __decorate([
|
|
60
|
+
(0, swagger_1.ApiTags)('system'),
|
|
61
|
+
(0, common_1.Controller)('system'),
|
|
62
|
+
__metadata("design:paramtypes", [system_service_1.SystemService])
|
|
63
|
+
], SystemController);
|
|
64
|
+
//# sourceMappingURL=system.controller.js.map
|
|
@@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WAAW,EAAE,oBAAoB,EAAE,CAAC;;;;gDAG/D;2BAxBU,gBAAgB;IAF5B,IAAA,iBAAO,EAAC,QAAQ,CAAC;IACjB,IAAA,mBAAU,EAAC,QAAQ,CAAC;qCAEyB,8BAAa;GAD9C,gBAAgB,CAyB5B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.SystemModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
12
|
+
const system_controller_1 = require("./system.controller");
|
|
13
|
+
const system_service_1 = require("./system.service");
|
|
14
|
+
const process_info_entity_1 = require("./process-info.entity");
|
|
15
|
+
let SystemModule = class SystemModule {
|
|
16
|
+
};
|
|
17
|
+
exports.SystemModule = SystemModule;
|
|
18
|
+
exports.SystemModule = SystemModule = __decorate([
|
|
19
|
+
(0, common_1.Module)({
|
|
20
|
+
imports: [typeorm_1.TypeOrmModule.forFeature([process_info_entity_1.ProcessInfo])],
|
|
21
|
+
controllers: [system_controller_1.SystemController],
|
|
22
|
+
providers: [system_service_1.SystemService],
|
|
23
|
+
exports: [system_service_1.SystemService],
|
|
24
|
+
})
|
|
25
|
+
], SystemModule);
|
|
26
|
+
//# sourceMappingURL=system.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.module.js","sourceRoot":"","sources":["../../../src/modules/system/system.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,2DAAuD;AACvD,qDAAiD;AACjD,+DAAoD;AAQ7C,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IANxB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,iCAAW,CAAC,CAAC,CAAC;QAClD,WAAW,EAAE,CAAC,oCAAgB,CAAC;QAC/B,SAAS,EAAE,CAAC,8BAAa,CAAC;QAC1B,OAAO,EAAE,CAAC,8BAAa,CAAC;KACzB,CAAC;GACW,YAAY,CAAG"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { OnModuleInit } from '@nestjs/common';
|
|
2
|
+
import { Repository } from 'typeorm';
|
|
3
|
+
import { ProcessInfo } from './process-info.entity';
|
|
4
|
+
export declare class SystemService implements OnModuleInit {
|
|
5
|
+
private processRepository;
|
|
6
|
+
constructor(processRepository: Repository<ProcessInfo>);
|
|
7
|
+
onModuleInit(): Promise<void>;
|
|
8
|
+
registerProcess(pid: number, type: string, name?: string): Promise<ProcessInfo>;
|
|
9
|
+
getStatus(): Promise<{
|
|
10
|
+
status: string;
|
|
11
|
+
pid: number;
|
|
12
|
+
uptime: number;
|
|
13
|
+
memory: NodeJS.MemoryUsage;
|
|
14
|
+
platform: NodeJS.Platform;
|
|
15
|
+
nodeVersion: string;
|
|
16
|
+
managedProcesses: ProcessInfo[];
|
|
17
|
+
}>;
|
|
18
|
+
private isProcessRunning;
|
|
19
|
+
shutdown(): Promise<{
|
|
20
|
+
message: string;
|
|
21
|
+
killed: number[];
|
|
22
|
+
failed: number[];
|
|
23
|
+
selfPid: number;
|
|
24
|
+
}>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SystemService = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
|
+
const typeorm_2 = require("typeorm");
|
|
19
|
+
const os = require("os");
|
|
20
|
+
const process_info_entity_1 = require("./process-info.entity");
|
|
21
|
+
let SystemService = class SystemService {
|
|
22
|
+
constructor(processRepository) {
|
|
23
|
+
this.processRepository = processRepository;
|
|
24
|
+
}
|
|
25
|
+
async onModuleInit() {
|
|
26
|
+
await this.processRepository.update({ isActive: true }, { isActive: false });
|
|
27
|
+
await this.registerProcess(process.pid, 'server', 'NestJS API Server');
|
|
28
|
+
}
|
|
29
|
+
async registerProcess(pid, type, name) {
|
|
30
|
+
const processInfo = this.processRepository.create({
|
|
31
|
+
pid,
|
|
32
|
+
type,
|
|
33
|
+
name,
|
|
34
|
+
isActive: true,
|
|
35
|
+
});
|
|
36
|
+
return this.processRepository.save(processInfo);
|
|
37
|
+
}
|
|
38
|
+
async getStatus() {
|
|
39
|
+
const processes = await this.processRepository.find({
|
|
40
|
+
where: { isActive: true },
|
|
41
|
+
order: { startedAt: 'DESC' },
|
|
42
|
+
});
|
|
43
|
+
return {
|
|
44
|
+
status: 'running',
|
|
45
|
+
pid: process.pid,
|
|
46
|
+
uptime: process.uptime(),
|
|
47
|
+
memory: process.memoryUsage(),
|
|
48
|
+
platform: os.platform(),
|
|
49
|
+
nodeVersion: process.version,
|
|
50
|
+
managedProcesses: processes,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
isProcessRunning(pid) {
|
|
54
|
+
try {
|
|
55
|
+
process.kill(pid, 0);
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async shutdown() {
|
|
63
|
+
const processes = await this.processRepository.find({
|
|
64
|
+
where: { isActive: true },
|
|
65
|
+
});
|
|
66
|
+
const killed = [];
|
|
67
|
+
const failed = [];
|
|
68
|
+
for (const proc of processes) {
|
|
69
|
+
if (proc.pid === process.pid)
|
|
70
|
+
continue;
|
|
71
|
+
try {
|
|
72
|
+
if (this.isProcessRunning(proc.pid)) {
|
|
73
|
+
process.kill(proc.pid, 'SIGTERM');
|
|
74
|
+
killed.push(proc.pid);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
failed.push(proc.pid);
|
|
79
|
+
}
|
|
80
|
+
proc.isActive = false;
|
|
81
|
+
await this.processRepository.save(proc);
|
|
82
|
+
}
|
|
83
|
+
setTimeout(() => {
|
|
84
|
+
process.exit(0);
|
|
85
|
+
}, 500);
|
|
86
|
+
return {
|
|
87
|
+
message: 'Shutdown initiated',
|
|
88
|
+
killed,
|
|
89
|
+
failed,
|
|
90
|
+
selfPid: process.pid,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
exports.SystemService = SystemService;
|
|
95
|
+
exports.SystemService = SystemService = __decorate([
|
|
96
|
+
(0, common_1.Injectable)(),
|
|
97
|
+
__param(0, (0, typeorm_1.InjectRepository)(process_info_entity_1.ProcessInfo)),
|
|
98
|
+
__metadata("design:paramtypes", [typeorm_2.Repository])
|
|
99
|
+
], SystemService);
|
|
100
|
+
//# sourceMappingURL=system.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.service.js","sourceRoot":"","sources":["../../../src/modules/system/system.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA0D;AAC1D,6CAAmD;AACnD,qCAAqC;AACrC,yBAAyB;AACzB,+DAAoD;AAG7C,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YAEU,iBAA0C;QAA1C,sBAAiB,GAAjB,iBAAiB,CAAyB;IACjD,CAAC;IAKJ,KAAK,CAAC,YAAY;QAEhB,MAAM,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;QAG7E,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,mBAAmB,CAAC,CAAC;IACzE,CAAC;IAKD,KAAK,CAAC,eAAe,CAAC,GAAW,EAAE,IAAY,EAAE,IAAa;QAC5D,MAAM,WAAW,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC;YAChD,GAAG;YACH,IAAI;YACJ,IAAI;YACJ,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAClD,CAAC;IAKD,KAAK,CAAC,SAAS;QACb,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC;YAClD,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YACzB,KAAK,EAAE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CAAC;YAGD,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YACtB,MAAM,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1C,CAAC;QAGD,UAAU,CAAC,GAAG,EAAE;YACd,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,EAAE,GAAG,CAAC,CAAC;QAER,OAAO;YACL,OAAO,EAAE,oBAAoB;YAC7B,MAAM;YACN,MAAM;YACN,OAAO,EAAE,OAAO,CAAC,GAAG;SACrB,CAAC;IACJ,CAAC;CACF,CAAA;AAvGY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,iCAAW,CAAC,CAAA;qCACH,oBAAU;GAH5B,aAAa,CAuGzB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { WorkspaceService } from './workspace.service';
|
|
2
|
+
import { CreateWorkspaceDto, UpdateWorkspaceDto } from './workspace.dto';
|
|
3
|
+
export declare class WorkspaceController {
|
|
4
|
+
private readonly workspaceService;
|
|
5
|
+
constructor(workspaceService: WorkspaceService);
|
|
6
|
+
findAll(): Promise<import("../../common/entities/workspace.entity").Workspace[]>;
|
|
7
|
+
getCurrent(): Promise<import("../../common/entities/workspace.entity").Workspace>;
|
|
8
|
+
findOne(id: string): Promise<import("../../common/entities/workspace.entity").Workspace>;
|
|
9
|
+
getInfo(id: string): Promise<{
|
|
10
|
+
info: {
|
|
11
|
+
path: string;
|
|
12
|
+
hasConfig: boolean;
|
|
13
|
+
config: import("../../common/entities/workspace.entity").WorkspaceConfig;
|
|
14
|
+
migrations: {
|
|
15
|
+
count: number;
|
|
16
|
+
files: string[];
|
|
17
|
+
};
|
|
18
|
+
schemas: {
|
|
19
|
+
count: number;
|
|
20
|
+
files: string[];
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
path: string;
|
|
26
|
+
config: import("../../common/entities/workspace.entity").WorkspaceConfig;
|
|
27
|
+
createdAt: Date;
|
|
28
|
+
updatedAt: Date;
|
|
29
|
+
lastAccessed: Date;
|
|
30
|
+
}>;
|
|
31
|
+
create(createDto: CreateWorkspaceDto): Promise<import("../../common/entities/workspace.entity").Workspace>;
|
|
32
|
+
switchTo(id: string): Promise<import("../../common/entities/workspace.entity").Workspace>;
|
|
33
|
+
update(id: string, updateDto: UpdateWorkspaceDto): Promise<import("../../common/entities/workspace.entity").Workspace>;
|
|
34
|
+
delete(id: string): Promise<void>;
|
|
35
|
+
}
|