{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://getcaute.com/card-format/1/links.schema.json",
  "title": "links.json",
  "description": "Connections between two things that are both in the export.",
  "$defs": {
    "datetime": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}[ T]\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?([+-]\\d{2}:\\d{2}|Z)$",
      "description": "A date and time with its offset (RFC 3339), written with a space between date and time: 2026-10-14 03:04:05.123456+00:00. Fractional seconds are left out when they are zero."
    },
    "uuid": {
      "type": "string",
      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
    }
  },
  "type": "array",
  "items": {
    "type": "object",
    "required": [
      "from_item",
      "to_item",
      "kind",
      "origin",
      "label",
      "created_at"
    ],
    "additionalProperties": false,
    "properties": {
      "from_item": {
        "$ref": "#/$defs/uuid"
      },
      "to_item": {
        "$ref": "#/$defs/uuid"
      },
      "kind": {
        "type": "string",
        "description": "attachment, inline, thread, forwarded_original, annotates, related, manual, mentions, embeds or supersedes; read unknown values as other."
      },
      "origin": {
        "type": "string",
        "description": "system, user or agent; read unknown values as other."
      },
      "label": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "created_at": {
        "$ref": "#/$defs/datetime"
      }
    }
  }
}
