{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://heartcortex.ai/schemas/1.0/update.schema.json",
  "title": "update",
  "type": "object",
  "required": [
    "id",
    "status"
  ],
  "properties": {
    "id": {
      "$ref": "common.schema.json#/$defs/uuid",
      "x-heart-privacy": "public"
    },
    "status": {
      "enum": [
        "queued",
        "downloading",
        "verifying",
        "installing",
        "awaiting-reboot",
        "succeeded",
        "failed",
        "rolled-back",
        "cancelling",
        "cancelled"
      ],
      "x-heart-privacy": "public"
    },
    "kind": {
      "enum": [
        "update",
        "rollback"
      ],
      "x-heart-privacy": "public",
      "description": "update: a new version is installed. rollback: the version before the last update returns."
    },
    "progress": {
      "type": "number",
      "minimum": 0,
      "maximum": 1,
      "x-heart-privacy": "public",
      "description": "Share done, 0 to 1."
    },
    "targetVersion": {
      "type": "string",
      "x-heart-privacy": "internal"
    },
    "package": {
      "type": "string",
      "x-heart-privacy": "internal",
      "description": "The package it changes."
    },
    "fromVersion": {
      "type": "string",
      "x-heart-privacy": "internal",
      "description": "The version that ran before."
    },
    "artifactId": {
      "$ref": "common.schema.json#/$defs/uuid",
      "x-heart-privacy": "internal"
    },
    "signatureVerified": {
      "type": "boolean",
      "x-heart-privacy": "internal"
    },
    "cancellable": {
      "type": "boolean",
      "x-heart-privacy": "public",
      "description": "True while the update can still be cancelled: queued, downloading or verifying. Never while installing."
    },
    "actionId": {
      "$ref": "common.schema.json#/$defs/uuid",
      "x-heart-privacy": "internal",
      "description": "The Action that carries it out."
    },
    "startedAt": {
      "$ref": "common.schema.json#/$defs/timestamp",
      "x-heart-privacy": "internal"
    },
    "finishedAt": {
      "$ref": "common.schema.json#/$defs/timestamp",
      "x-heart-privacy": "internal"
    },
    "error": {
      "type": "string",
      "x-heart-privacy": "internal",
      "description": "Why it failed, was rolled back or was refused."
    },
    "ext": {
      "$ref": "common.schema.json#/$defs/ext",
      "x-heart-privacy": "private"
    }
  }
}
