mirror of
https://github.com/whyour/qinglong.git
synced 2026-11-06 07:10:41 +08:00
Use MikroORM's official Node SQLite dialect with bounded database isolation, preserve legacy schema and data for rollback, and require Node 22.17 or newer. Update Debian runtimes and retain ARMv6 musl compatibility without a SQLite addon. Complete short archive writes, stop orphaned SQL workers after owner death, preserve buffered startup requests, and prestart the archived backend on every platform. Cover real package installation, migration, failure recovery, and legacy database compatibility.
51 lines
1.1 KiB
TypeScript
51 lines
1.1 KiB
TypeScript
import { Repository, RecordRow } from './repository';
|
|
|
|
export class Dependence {
|
|
timestamp?: string;
|
|
id?: number;
|
|
status: DependenceStatus;
|
|
type: DependenceTypes;
|
|
name: string;
|
|
log?: string[];
|
|
remark?: string;
|
|
|
|
constructor(options: Dependence) {
|
|
this.id = options.id;
|
|
this.status =
|
|
typeof options.status === 'number' && DependenceStatus[options.status]
|
|
? options.status
|
|
: DependenceStatus.queued;
|
|
this.type = options.type || DependenceTypes.nodejs;
|
|
this.timestamp = new Date().toString();
|
|
this.name = options.name.trim();
|
|
this.log = options.log || [];
|
|
this.remark = options.remark || '';
|
|
}
|
|
}
|
|
|
|
export enum DependenceStatus {
|
|
'installing',
|
|
'installed',
|
|
'installFailed',
|
|
'removing',
|
|
'removed',
|
|
'removeFailed',
|
|
'queued',
|
|
'cancelled',
|
|
}
|
|
|
|
export enum DependenceTypes {
|
|
'nodejs',
|
|
'python3',
|
|
'linux',
|
|
}
|
|
|
|
export enum versionDependenceCommandTypes {
|
|
'@',
|
|
'==',
|
|
'=',
|
|
}
|
|
|
|
export type DependenceInstance = RecordRow<Dependence>;
|
|
export const DependenceModel = new Repository<Dependence>('Dependence');
|