feat: scaffold baseos runtime
This commit is contained in:
+82
@@ -0,0 +1,82 @@
|
||||
export type TBaseOsRuntimeLevel = 'app-layer' | 'host-os' | 'target-state';
|
||||
|
||||
export type TCloudlyConnectionStatus =
|
||||
| 'not-configured'
|
||||
| 'connecting'
|
||||
| 'connected'
|
||||
| 'failed';
|
||||
|
||||
export interface IBaseRunnerConfig {
|
||||
cloudlyUrl?: string;
|
||||
joinToken?: string;
|
||||
nodeToken?: string;
|
||||
nodeId?: string;
|
||||
statePath: string;
|
||||
heartbeatIntervalMs: number;
|
||||
supervisorAddress?: string;
|
||||
supervisorApiKey?: string;
|
||||
}
|
||||
|
||||
export interface IBaseRunnerState {
|
||||
nodeId: string;
|
||||
nodeToken?: string;
|
||||
createdAt: number;
|
||||
updatedAt: number;
|
||||
}
|
||||
|
||||
export interface IBalenaDeviceState {
|
||||
api_port?: number;
|
||||
ip_address?: string;
|
||||
mac_address?: string;
|
||||
commit?: string;
|
||||
status?: string;
|
||||
os_version?: string;
|
||||
supervisor_version?: string;
|
||||
update_pending?: boolean;
|
||||
update_downloaded?: boolean;
|
||||
update_failed?: boolean;
|
||||
download_progress?: number | null;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
export interface IBalenaStateStatus {
|
||||
status?: string;
|
||||
appState?: string;
|
||||
overallDownloadProgress?: number | null;
|
||||
release?: string;
|
||||
containers?: Array<Record<string, unknown>>;
|
||||
images?: Array<Record<string, unknown>>;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
export interface IBaseOsRuntimeInfo {
|
||||
runtime: 'baseos';
|
||||
runtimeLevel: TBaseOsRuntimeLevel;
|
||||
nodeId: string;
|
||||
cloudlyUrl?: string;
|
||||
cloudlyConnectionStatus: TCloudlyConnectionStatus;
|
||||
supervisorAvailable: boolean;
|
||||
supervisorAddress?: string;
|
||||
deviceState?: IBalenaDeviceState;
|
||||
stateStatus?: IBalenaStateStatus;
|
||||
checkedAt: number;
|
||||
}
|
||||
|
||||
export interface IBaseOsDesiredState {
|
||||
release?: string;
|
||||
targetState?: Record<string, unknown>;
|
||||
updatedAt?: number;
|
||||
}
|
||||
|
||||
export interface ICloudlyRegisterResult {
|
||||
nodeId?: string;
|
||||
nodeToken?: string;
|
||||
accepted: boolean;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
export interface ICloudlyHeartbeatResult {
|
||||
accepted: boolean;
|
||||
message?: string;
|
||||
desiredState?: IBaseOsDesiredState;
|
||||
}
|
||||
Reference in New Issue
Block a user