{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/eurobase-dev/json-schema/eurobase-dev-deployment-log-stream-event-schema.json",
  "title": "DeploymentLogStreamEvent",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/eurobase-dev-deployments-api-openapi.yml#/components/schemas/DeploymentLogStreamEvent",
  "type": "object",
  "required": [
    "type",
    "deploymentId",
    "entry",
    "cursor",
    "streamState"
  ],
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "deployment_logs_event"
      ]
    },
    "deploymentId": {
      "type": "string"
    },
    "entry": {
      "$ref": "#/$defs/DeploymentLogEntry"
    },
    "cursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "streamState": {
      "$ref": "#/$defs/DeploymentLogStreamState"
    },
    "streamStates": {
      "oneOf": [
        {
          "$ref": "#/$defs/DeploymentLogStreamStatePatchByKind"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "$defs": {
    "DeploymentLogEntry": {
      "type": "object",
      "required": [
        "id",
        "phase",
        "severity",
        "redacted",
        "truncated",
        "observedAt",
        "createdAt"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "phase": {
          "type": "string",
          "enum": [
            "queue",
            "build",
            "deploy",
            "healthcheck",
            "system"
          ]
        },
        "category": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "clone_failed",
            "build_failed",
            "image_push_failed",
            "deploy_failed",
            "healthcheck_failed",
            "runtime_startup_failed",
            "runtime_startup_timeout",
            "app_health_failed",
            "route_activation_failed",
            "platform_capacity_failed",
            "invalid_runtime_config",
            "internal_platform_error",
            null
          ]
        },
        "severity": {
          "type": "string",
          "enum": [
            "info",
            "warning",
            "error"
          ]
        },
        "logKind": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "build",
            "deploy",
            "runtime",
            "event",
            null
          ]
        },
        "stream": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "stdout",
            "stderr",
            "system",
            null
          ]
        },
        "redacted": {
          "type": "boolean"
        },
        "truncated": {
          "type": "boolean"
        },
        "truncationReason": {
          "type": [
            "string",
            "null"
          ]
        },
        "observedAt": {
          "type": "string",
          "format": "date-time"
        },
        "message": {
          "type": [
            "string",
            "null"
          ]
        },
        "providerReady": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "gatewayStatusCode": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 100,
          "maximum": 599
        },
        "gatewayRouteMatched": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "gatewayAppRespondedOk": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "gatewayTlsOk": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "probeAttempts": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0,
          "maximum": 100
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "DeploymentLogStreamState": {
      "type": "string",
      "enum": [
        "live",
        "reconnecting",
        "catching_up",
        "delayed",
        "completed",
        "blocked"
      ]
    },
    "DeploymentLogStreamStatePatchByKind": {
      "type": "object",
      "properties": {
        "event": {
          "$ref": "#/$defs/DeploymentLogStreamState"
        },
        "build": {
          "$ref": "#/$defs/DeploymentLogStreamState"
        },
        "deploy": {
          "$ref": "#/$defs/DeploymentLogStreamState"
        },
        "runtime": {
          "$ref": "#/$defs/DeploymentLogStreamState"
        }
      }
    }
  }
}