89 lines
2.0 KiB
TypeScript
89 lines
2.0 KiB
TypeScript
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;
|
|
preloadTargetStatePath?: string;
|
|
}
|
|
|
|
export interface IBaseRunnerState {
|
|
nodeId: string;
|
|
nodeToken?: string;
|
|
lastTargetStateHash?: string;
|
|
lastTargetStateAppliedAt?: number;
|
|
lastRelease?: string;
|
|
lastReleaseUpdateTriggeredAt?: number;
|
|
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;
|
|
desiredState?: IBaseOsDesiredState;
|
|
}
|
|
|
|
export interface ICloudlyHeartbeatResult {
|
|
accepted: boolean;
|
|
message?: string;
|
|
desiredState?: IBaseOsDesiredState;
|
|
}
|