76 lines
1.7 KiB
TypeScript
76 lines
1.7 KiB
TypeScript
|
|
export type TBaseOsRuntimeLevel = 'app-layer' | 'host-os' | 'target-state';
|
||
|
|
|
||
|
|
export type TBaseOsCloudlyConnectionStatus =
|
||
|
|
| 'not-configured'
|
||
|
|
| 'connecting'
|
||
|
|
| 'connected'
|
||
|
|
| 'failed';
|
||
|
|
|
||
|
|
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: TBaseOsCloudlyConnectionStatus;
|
||
|
|
supervisorAvailable: boolean;
|
||
|
|
supervisorAddress?: string;
|
||
|
|
deviceState?: IBalenaDeviceState;
|
||
|
|
stateStatus?: IBalenaStateStatus;
|
||
|
|
checkedAt: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface IBaseOsDesiredState {
|
||
|
|
release?: string;
|
||
|
|
targetState?: Record<string, unknown>;
|
||
|
|
updatedAt?: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface IBaseOsNode {
|
||
|
|
id: string;
|
||
|
|
data: {
|
||
|
|
runtimeInfo: IBaseOsRuntimeInfo;
|
||
|
|
desiredState?: IBaseOsDesiredState;
|
||
|
|
createdAt: number;
|
||
|
|
updatedAt: number;
|
||
|
|
lastHeartbeatAt?: number;
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface IBaseOsRegisterResult {
|
||
|
|
nodeId?: string;
|
||
|
|
nodeToken?: string;
|
||
|
|
accepted: boolean;
|
||
|
|
message?: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface IBaseOsHeartbeatResult {
|
||
|
|
accepted: boolean;
|
||
|
|
message?: string;
|
||
|
|
desiredState?: IBaseOsDesiredState;
|
||
|
|
}
|