mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-04-08 03:44:14 +00:00
Add update status to types
Change-type: minor
This commit is contained in:
parent
9b819e4837
commit
e9f460fd75
@ -131,6 +131,17 @@ export const UUID = ShortString;
|
||||
/** ***************
|
||||
* Current state *
|
||||
*****************/
|
||||
|
||||
const UpdateStatus = t.union([
|
||||
t.literal('rejected'),
|
||||
t.literal('downloading'),
|
||||
t.literal('downloaded'),
|
||||
t.literal('applying changes'),
|
||||
t.literal('aborted'),
|
||||
t.literal('done'),
|
||||
]);
|
||||
export type UpdateStatus = t.TypeOf<typeof UpdateStatus>;
|
||||
|
||||
const ServiceState = t.intersection([
|
||||
t.type({
|
||||
image: t.string,
|
||||
@ -143,6 +154,7 @@ const ServiceState = t.intersection([
|
||||
export type ServiceState = t.TypeOf<typeof ServiceState>;
|
||||
|
||||
const ReleaseState = t.type({
|
||||
update_status: UpdateStatus,
|
||||
services: t.record(DockerName, ServiceState),
|
||||
});
|
||||
export type ReleaseState = t.TypeOf<typeof ReleaseState>;
|
||||
@ -182,6 +194,8 @@ const DeviceReport = t.partial({
|
||||
cpu_usage: t.number,
|
||||
cpu_id: t.string,
|
||||
is_undervolted: t.boolean,
|
||||
// These are for internal reporting only, they are not sent
|
||||
// to the API
|
||||
update_failed: t.boolean,
|
||||
update_pending: t.boolean,
|
||||
update_downloaded: t.boolean,
|
||||
|
Loading…
x
Reference in New Issue
Block a user