{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://preparedboard.com/standard/v1/seal-manifest.schema.json",
  "title": "prepared-board.seal-manifest.v1",
  "description": "List of sealed records in an exported bundle (file seals.json). Docs: https://preparedboard.com/standard",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "exportedAt",
    "canonicalization",
    "hashAlgorithm",
    "recordSchemas",
    "seals"
  ],
  "properties": {
    "schema": {
      "const": "prepared-board.seal-manifest.v1"
    },
    "exportedAt": {
      "type": "string",
      "format": "date-time"
    },
    "canonicalization": {
      "const": "prepared-board.canonical-json.v1"
    },
    "hashAlgorithm": {
      "const": "sha256"
    },
    "recordSchemas": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "minItems": 1,
      "uniqueItems": true
    },
    "seals": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "sealId",
          "boardId",
          "seq",
          "decisionId",
          "version",
          "sealedAt",
          "contentHash",
          "prevHash",
          "recordFile"
        ],
        "properties": {
          "sealId": {
            "type": "string",
            "minLength": 1
          },
          "boardId": {
            "type": "string",
            "minLength": 1
          },
          "seq": {
            "type": "integer",
            "minimum": 1
          },
          "decisionId": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "sealedAt": {
            "type": "string",
            "format": "date-time"
          },
          "contentHash": {
            "type": "string",
            "pattern": "^sha256:[0-9a-f]{64}$"
          },
          "prevHash": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "string",
                "pattern": "^sha256:[0-9a-f]{64}$"
              }
            ]
          },
          "recordFile": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    }
  }
}
