feat: marketplace modules and isolated container management
This commit is contained in:
@@ -17,10 +17,13 @@ interface ModuleRow {
|
||||
enabled: boolean;
|
||||
created_at: Date;
|
||||
updated_at: Date;
|
||||
compose_file: string | null;
|
||||
app_service: string | null;
|
||||
}
|
||||
|
||||
const MODULE_COLUMNS = `id, module_id, name, slug, version, description, author, path,
|
||||
status, internal_port, healthcheck_url, enabled, created_at, updated_at`;
|
||||
status, internal_port, healthcheck_url, enabled, created_at, updated_at,
|
||||
compose_file, app_service`;
|
||||
|
||||
/**
|
||||
* Modul-Repository (Infrastructure): Datenbankzugriffe für die Modul-Registry.
|
||||
@@ -80,8 +83,9 @@ export class ModuleRepository {
|
||||
async create(manifest: ModuleManifest, directory: string): Promise<ModuleRecord> {
|
||||
const result = await this.database.query<ModuleRow>(
|
||||
`INSERT INTO modules
|
||||
(module_id, name, slug, version, description, author, path, status, internal_port, healthcheck_url)
|
||||
VALUES ($1, $2, $3, $4, $5, $6, $7, 'INSTALLED', $8, $9)
|
||||
(module_id, name, slug, version, description, author, path, status, internal_port, healthcheck_url,
|
||||
compose_file, app_service)
|
||||
VALUES ($1, $2, $3, $4, $5, $6, $7, 'INSTALLED', $8, $9, $10, $11)
|
||||
RETURNING ${MODULE_COLUMNS}`,
|
||||
[
|
||||
manifest.id,
|
||||
@@ -93,6 +97,8 @@ export class ModuleRepository {
|
||||
directory,
|
||||
manifest.port,
|
||||
manifest.healthcheck,
|
||||
manifest.composeFile ?? null,
|
||||
manifest.appService ?? null,
|
||||
],
|
||||
);
|
||||
return this.mapRow(result.rows[0]);
|
||||
@@ -132,6 +138,8 @@ export class ModuleRepository {
|
||||
enabled: row.enabled,
|
||||
createdAt: row.created_at,
|
||||
updatedAt: row.updated_at,
|
||||
composeFile: row.compose_file,
|
||||
appService: row.app_service,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user