添加依赖管理

This commit is contained in:
whyour
2021-10-23 18:23:32 +08:00
parent bad247c51c
commit 795d1b938d
19 changed files with 1170 additions and 17 deletions
+45
View File
@@ -0,0 +1,45 @@
export class Dependence {
timestamp?: string;
created?: number;
_id?: string;
status?: DependenceStatus;
type?: DependenceTypes;
name?: number;
log?: string[];
remark?: string;
constructor(options: Dependence) {
this._id = options._id;
this.created = options.created || new Date().valueOf();
this.status = options.status || DependenceStatus.installing;
this.type = options.type || DependenceTypes.nodejs;
this.timestamp = new Date().toString();
this.name = options.name;
this.log = options.log || [];
this.remark = options.remark || '';
}
}
export enum DependenceStatus {
'installing',
'installed',
'installFailed',
}
export enum DependenceTypes {
'nodejs',
'python3',
'linux',
}
export enum InstallDependenceCommandTypes {
'pnpm install -g',
'pip3 install',
'apk add --no-cache',
}
export enum unInstallDependenceCommandTypes {
'pnpm uninstall -g',
'pip3 uninstall',
'apk del',
}
+16
View File
@@ -0,0 +1,16 @@
export class SockMessage {
message?: string;
type?: SockMessageType;
references?: string[];
constructor(options: SockMessage) {
this.type = options.type;
this.message = options.message;
this.references = options.references;
}
}
export type SockMessageType =
| 'ping'
| 'installDependence'
| 'updateSystemVersion';