{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/notepad-page/json-schema/notepad-page-page-metadata-schema.json",
  "title": "PageMetadata",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/notepad-page-openapi.json#/components/schemas/PageMetadata",
  "type": "object",
  "required": [
    "id",
    "slug",
    "url",
    "share",
    "expiry",
    "pinned",
    "contentBytes"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "title": {
      "type": [
        "string",
        "null"
      ]
    },
    "summary": {
      "type": [
        "string",
        "null"
      ]
    },
    "topics": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "keywords": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "purpose": {
      "type": [
        "string",
        "null"
      ]
    },
    "project": {
      "type": [
        "string",
        "null"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "relatedTo": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "supersedes": {
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 200
              }
            },
            "derivedFrom": {
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 200
              }
            }
          },
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "status": {
      "type": "string"
    },
    "scanStatus": {
      "type": "string"
    },
    "scanProvider": {
      "type": [
        "string",
        "null"
      ]
    },
    "scanDegraded": {
      "type": "boolean"
    },
    "share": {
      "type": "object",
      "required": [
        "mode",
        "allowedIps",
        "activeShares"
      ],
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "private",
            "link",
            "public"
          ]
        },
        "allowedIps": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "activeShares": {
          "type": "array",
          "description": "Owner-visible active share state. Viewer email is never exposed.",
          "items": {
            "type": "object",
            "required": [
              "bound",
              "bound_at"
            ],
            "properties": {
              "bound": {
                "type": "boolean"
              },
              "bound_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "lastActivityAt": {
      "type": "string",
      "format": "date-time"
    },
    "expiry": {
      "type": "object",
      "required": [
        "state",
        "archiveAt",
        "purgeAt"
      ],
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "active",
            "archived",
            "persistent",
            "unknown"
          ]
        },
        "archiveAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "purgeAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      },
      "additionalProperties": false
    },
    "pinned": {
      "type": "boolean"
    },
    "archivedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "persistent": {
      "type": "boolean"
    },
    "contentBytes": {
      "type": "integer",
      "minimum": 0
    },
    "reviewPriority": {
      "type": "boolean"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "additionalProperties": true
}