{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/typeship-dev/json-schema/typeship-dev-delivery-response-schema.json",
  "title": "DeliveryResponse",
  "description": "repository is present for a repository Delivery, with issues, required_checks, and last_event; hosted_mcp is present for a hosted_mcp Delivery.",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/typeship-dev-openapi.json#/components/schemas/DeliveryResponse",
  "type": "object",
  "required": [
    "id",
    "object",
    "target_id",
    "type",
    "status",
    "created_at",
    "updated_at",
    "request_id"
  ],
  "properties": {
    "id": {
      "$ref": "#/$defs/DeliveryId"
    },
    "object": {
      "type": "string",
      "const": "delivery"
    },
    "target_id": {
      "$ref": "#/$defs/TargetId"
    },
    "type": {
      "type": "string",
      "enum": [
        "repository",
        "hosted_mcp"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "action_required",
        "disabled"
      ]
    },
    "repository": {
      "$ref": "#/$defs/RepositoryDeliverySettings"
    },
    "issues": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RepositoryDeliveryIssue"
      }
    },
    "required_checks": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "last_event": {
      "oneOf": [
        {
          "$ref": "#/$defs/RepositoryDeliveryEvent"
        },
        {
          "type": "null"
        }
      ]
    },
    "hosted_mcp": {
      "$ref": "#/$defs/HostedMcpDeliverySettings"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    },
    "request_id": {
      "$ref": "#/$defs/RequestId"
    }
  },
  "$defs": {
    "DeliveryId": {
      "type": "string",
      "pattern": "^dlv_[a-z0-9]{16}$"
    },
    "HostedMcpDeliverySettings": {
      "type": "object",
      "required": [
        "url"
      ],
      "properties": {
        "url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Hosted MCP endpoint for this Target, or null while it is being provisioned."
        }
      }
    },
    "RepositoryDeliveryEvent": {
      "type": "object",
      "required": [
        "event",
        "status",
        "created_at"
      ],
      "properties": {
        "event": {
          "type": "string",
          "description": "Repository event type."
        },
        "status": {
          "type": "string",
          "enum": [
            "queued",
            "running",
            "completed",
            "failed",
            "superseded"
          ],
          "description": "superseded: a newer event for the same repository replaced this one before it finished."
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "RepositoryDeliveryIssue": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "app_not_installed",
            "repository_unreachable",
            "contents_write_missing",
            "pull_request_missing",
            "approval_label_missing",
            "check_missing",
            "event_failed"
          ]
        },
        "message": {
          "type": "string",
          "description": "Specific customer action or repository setting to inspect."
        }
      }
    },
    "RepositoryDeliverySettings": {
      "type": "object",
      "required": [
        "provider",
        "identifier",
        "directory",
        "package_name",
        "module_path",
        "publish_on_merge"
      ],
      "properties": {
        "provider": {
          "$ref": "#/$defs/RepositoryProvider"
        },
        "identifier": {
          "$ref": "#/$defs/RepositoryIdentifier"
        },
        "directory": {
          "type": [
            "string",
            "null"
          ]
        },
        "package_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "module_path": {
          "type": [
            "string",
            "null"
          ]
        },
        "publish_on_merge": {
          "type": "boolean"
        }
      }
    },
    "RepositoryIdentifier": {
      "type": "string",
      "maxLength": 512,
      "description": "Provider-native repository identity, opaque outside its adapter."
    },
    "RepositoryProvider": {
      "type": "string",
      "enum": [
        "github"
      ],
      "description": "GitHub is the only launch provider; the field is stable for future adapters."
    },
    "RequestId": {
      "type": "string",
      "pattern": "^req_[a-z0-9]{16}$",
      "description": "Server-generated identifier used to correlate this response with Typeship logs."
    },
    "TargetId": {
      "type": "string",
      "pattern": "^tgt_[a-z0-9]{16}$",
      "description": "Stable identifier for one configured generated product."
    }
  }
}