{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://capp.local/schemas/capp.sync-page.v1.schema.json",
  "title": "cApp incremental sync page v1",
  "type": "object",
  "required": [
    "protocol",
    "changes"
  ],
  "properties": {
    "protocol": {
      "const": "capp.sync-page.v1"
    },
    "collection": {
      "type": "string"
    },
    "changes": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "key",
          "revision"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "value": {},
          "contentHash": {
            "type": [
              "string",
              "null"
            ]
          },
          "deletedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "metadata": {
            "type": "object"
          }
        },
        "additionalProperties": true
      }
    },
    "cursor": {},
    "hasMore": {
      "type": "boolean"
    },
    "metadata": {
      "type": "object"
    }
  },
  "additionalProperties": true
}
