{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "bone-flow-recovery.schema.json",
  "title": "Bone Flow Editor Recovery Record v1.0",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "flowKey",
    "flowId",
    "fileName",
    "source",
    "lastValidDefinition",
    "dirty",
    "savePointHash",
    "sourceHash",
    "lastSavedAt",
    "updatedAt",
    "editorVersion",
    "formatVersion",
    "checksum"
  ],
  "properties": {
    "schemaVersion": {
      "const": "1.0"
    },
    "flowKey": {
      "type": "string",
      "minLength": 1
    },
    "flowId": {
      "type": [
        "string",
        "null"
      ]
    },
    "fileName": {
      "type": [
        "string",
        "null"
      ]
    },
    "source": {
      "type": "string"
    },
    "lastValidDefinition": {
      "oneOf": [
        {
          "$ref": "bone-flow-definition.schema.json"
        },
        {
          "type": "null"
        }
      ]
    },
    "dirty": {
      "type": "boolean"
    },
    "savePointHash": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[0-9a-f]{64}$"
    },
    "sourceHash": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "lastSavedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "editorVersion": {
      "type": "string"
    },
    "formatVersion": {
      "const": "1.0"
    },
    "checksum": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    }
  }
}
