{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://opentine.com/schemas/tine-cli-publish-1.schema.json",
  "title": "tine publish zenodo | hf --json",
  "description": "`bundle` is what was (or, with `--dry-run`, would be) uploaded, after the push gate's redaction scan passed; `files` every file sent. With `--dry-run`, `plan` lists the requests and nothing is sent; otherwise `published` is the Zenodo deposition (`draft` unless `--publish`) or the Hub commit. `dataset` and `public_run` are the Hub dataset and the redacted copy's run id. Tokens never appear.",
  "type": "object",
  "required": [
    "command",
    "action",
    "ok",
    "dry_run",
    "api",
    "bundle",
    "files"
  ],
  "properties": {
    "command": {
      "const": "publish"
    },
    "action": {
      "enum": [
        "zenodo",
        "hf"
      ]
    },
    "ok": {
      "type": "boolean"
    },
    "dry_run": {
      "type": "boolean"
    },
    "api": {
      "type": "string",
      "pattern": "^https://"
    },
    "bundle": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "digest",
        "bytes",
        "refs"
      ],
      "properties": {
        "digest": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        },
        "bytes": {
          "type": "integer",
          "minimum": 0
        },
        "refs": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "files": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "bytes": {
            "type": "integer",
            "minimum": 0
          },
          "checksum": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      }
    },
    "plan": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "method",
          "path"
        ],
        "properties": {
          "method": {
            "type": "string"
          },
          "path": {
            "type": "string"
          }
        }
      }
    },
    "published": {
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "deposition",
            "state",
            "doi",
            "url",
            "files"
          ],
          "properties": {
            "deposition": {
              "type": "integer",
              "minimum": 0
            },
            "state": {
              "enum": [
                "draft",
                "published"
              ]
            },
            "doi": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "url": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^https://"
                },
                {
                  "type": "null"
                }
              ]
            },
            "files": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "bytes": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "checksum": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "commit",
            "url"
          ],
          "properties": {
            "commit": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "url": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^https://"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        }
      ]
    },
    "dataset": {
      "type": "string"
    },
    "public_run": {
      "type": "string"
    }
  }
}
