{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://onedevtoolkit.com/specs/privacy-receipt.json",
  "title": "OneDevToolkit Privacy Processing Receipt",
  "description": "Client-side proof that a tool job was processed in the browser without uploading file contents to OneDevToolkit servers.",
  "type": "object",
  "required": ["version", "type", "statement", "tool", "processedAt", "privacyMode", "site"],
  "properties": {
    "$schema": { "type": "string", "format": "uri" },
    "version": { "type": "integer", "const": 1 },
    "type": { "type": "string", "const": "OneDevToolkit.ProcessingReceipt" },
    "statement": { "type": "string" },
    "tool": {
      "type": "object",
      "required": ["slug"],
      "properties": {
        "slug": { "type": "string" },
        "name": { "type": "string" }
      }
    },
    "processedAt": { "type": "string", "format": "date-time" },
    "processedAtMs": { "type": "integer" },
    "locale": { "type": "string" },
    "timezone": { "type": "string" },
    "client": { "type": "object" },
    "network": { "type": "object" },
    "input": {
      "oneOf": [
        { "type": "null" },
        {
          "type": "object",
          "properties": {
            "name": { "type": "string" },
            "size": { "type": "integer" },
            "type": { "type": "string" },
            "sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" }
          }
        },
        { "type": "array", "items": { "type": "object" } }
      ]
    },
    "output": {
      "oneOf": [
        { "type": "null" },
        {
          "type": "object",
          "properties": {
            "name": { "type": "string" },
            "size": { "type": "integer" },
            "type": { "type": "string" },
            "sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" }
          }
        }
      ]
    },
    "privacyMode": { "type": "string", "const": "client-side" },
    "site": { "type": "string" },
    "verifyUrl": { "type": "string", "format": "uri" },
    "advanced": { "type": "boolean" },
    "verificationHint": { "type": "string" }
  },
  "additionalProperties": true
}
