{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "imports-v2/manifest.json",
  "title": "Package manifest",
  "description": "meta-data.json in the root of the package, encoded as UTF-8. All properties are required.",
  "type": "object",
  "properties": {
    "profile": {
      "type": "object",
      "description": "Profile of the package.",
      "properties": {
        "name": {
          "const": "external",
          "description": "Always external."
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "package_id": {
      "type": "string",
      "format": "uuid",
      "description": "Immutable identifier of the export snapshot; a new snapshot gets a new UUID."
    },
    "source": {
      "type": "object",
      "description": "Where the data comes from. It describes the origin, not the target company.",
      "properties": {
        "system": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "description": "jira, clickup, yougile, notion, custom or the name of the vendor."
        },
        "namespace": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "description": "Stable key space of the source."
        },
        "exported_at": {
          "type": "string",
          "format": "date-time",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})$",
          "description": "Time of the snapshot."
        }
      },
      "required": [
        "system",
        "namespace",
        "exported_at"
      ],
      "additionalProperties": false
    },
    "timeline_mode": {
      "type": "string",
      "enum": [
        "current_state_only",
        "explicit"
      ],
      "description": "current_state_only: no history, so the cards have no steps. explicit: activities and card_history are given, and the card_add of each card is its creation."
    },
    "resource_files": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100000,
      "description": "JSON files of the package. A resource can have several files. The files are read in the order of this list and the records of a file in the order of its array; where the position of a record matters (cards in a column, columns on a board), that order decides. A JSON file outside files/ that is not listed here is an error; other files are ignored.",
      "items": {
        "type": "object",
        "properties": {
          "resource": {
            "type": "string",
            "enum": [
              "activities",
              "attachments",
              "boards",
              "card_blockers",
              "card_children",
              "card_history",
              "card_links",
              "card_members",
              "card_planned_relations",
              "card_time_logs",
              "card_types",
              "cards",
              "checklist_items",
              "checklists",
              "columns",
              "comments",
              "custom_directories",
              "custom_directory_records",
              "custom_properties",
              "document_comments",
              "documents",
              "folders",
              "iteration_cards",
              "iterations",
              "lanes",
              "roles",
              "space_boards",
              "spaces",
              "tags",
              "tree_entity_roles",
              "user_groups",
              "users"
            ],
            "description": "Name of the resource the file holds."
          },
          "path": {
            "type": "string",
            "minLength": 1,
            "description": "Safe unique path of a JSON array file, relative to the package root."
          }
        },
        "required": [
          "resource",
          "path"
        ],
        "additionalProperties": false
      }
    },
    "binary_files": {
      "type": "object",
      "description": "Location of the files referenced by records. Files there that no record names are not imported.",
      "properties": {
        "base_path": {
          "const": "files/",
          "description": "Always files/. The directory may be absent."
        }
      },
      "required": [
        "base_path"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "profile",
    "package_id",
    "source",
    "timeline_mode",
    "resource_files",
    "binary_files"
  ],
  "additionalProperties": false
}
