{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string",
      "pattern": "^[A-Z][A-Z0-9_]*$",
      "examples": [
        "UNKNOWN_COMMAND",
        "UNKNOWN_OPTION",
        "INVALID_ARGUMENT",
        "INPUT_REQUIRED",
        "AUTH_REQUIRED",
        "AUTH_INVALID",
        "PERMISSION_DENIED",
        "LOGIN_FAILED",
        "UNATTENDED_LOGIN_UNAVAILABLE",
        "SCOPE_INVALID",
        "SCOPE_REQUIRED",
        "SCOPE_NOT_FOUND",
        "SCOPE_PLACEHOLDER",
        "PROJECT_MOVED",
        "ENVIRONMENT_UNSUPPORTED",
        "PROJECT_NOT_FOUND",
        "MANIFEST_INVALID",
        "PROJECT_INVALID",
        "BUNDLE_FAILED",
        "LOCAL_CONFLICT",
        "CHECKOUT_GIT_FAILED",
        "CHECK_FAILED",
        "DOCTOR_UNHEALTHY",
        "MIGRATION_BLOCKED",
        "BAD_REQUEST",
        "NOT_FOUND",
        "CONFLICT",
        "REJECTED",
        "RATE_LIMITED",
        "SERVER_ERROR",
        "PREFLIGHT_FAILED",
        "STAGE_BUILD_FAILED",
        "NETWORK_ERROR",
        "TIMEOUT",
        "INVALID_RESPONSE",
        "OUTCOME_UNCERTAIN",
        "CANCELLED",
        "NODE_VERSION_UNSUPPORTED",
        "COMMAND_FAILED"
      ]
    },
    "outcome": {
      "type": "string",
      "enum": ["failed", "uncertain", "cancelled"]
    },
    "status": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "apiCode": {
      "type": "string"
    },
    "details": {},
    "operation": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "minLength": 1
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "scope": {
          "type": "object",
          "properties": {
            "apiUrl": {
              "type": "string"
            },
            "organization": {
              "type": "string"
            },
            "project": {
              "type": "string",
              "description": "Empty for organization-scoped project creation before its ID is known."
            },
            "environment": {
              "type": "string",
              "enum": ["test", "live"]
            }
          },
          "required": ["apiUrl", "organization", "project", "environment"],
          "additionalProperties": {}
        },
        "resume": {
          "minItems": 1,
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": ["kind", "id", "scope", "resume"],
      "additionalProperties": {},
      "title": "Operation",
      "description": "A change the CLI sent that can be finished from a fresh process: run `domino` with `resume` as its arguments, which use pinned scope flags or the saved local operation journal. `scope` never contains a credential."
    }
  },
  "required": ["error", "code", "outcome"],
  "additionalProperties": {},
  "title": "Error",
  "description": "The last line on stderr when a command fails with --json. `error` is prose; branch on `code`, `outcome` and the exit status."
}
