{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/eurobase-dev/json-schema/eurobase-dev-project-logs-response-schema.json",
  "title": "ProjectLogsResponse",
  "x-generated": "2026-11-07",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/eurobase-dev-openapi.json#/components/schemas/ProjectLogsResponse",
  "type": "object",
  "required": [
    "project",
    "revision",
    "temporalEpoch",
    "nextExpiryAt",
    "filters",
    "retentionPolicy",
    "pagination",
    "entries",
    "runtimeLogState",
    "accessLogState"
  ],
  "properties": {
    "project": {
      "$ref": "#/$defs/ProjectSummary"
    },
    "revision": {
      "type": "string"
    },
    "temporalEpoch": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0
    },
    "nextExpiryAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "filters": {
      "type": "object",
      "required": [
        "assetType",
        "assetId",
        "deploymentId",
        "invocationId",
        "severity",
        "statusClass",
        "method",
        "statusCode",
        "pathClass",
        "excludePaths",
        "hideBlocked",
        "requestId",
        "sourceNetwork",
        "sourceIp",
        "country",
        "category",
        "view",
        "timeRange",
        "from",
        "to"
      ],
      "properties": {
        "assetType": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "app",
            "service",
            "function",
            "deployment",
            "container",
            "runtime",
            "storage",
            "static",
            null
          ]
        },
        "assetId": {
          "type": [
            "string",
            "null"
          ]
        },
        "deploymentId": {
          "type": [
            "string",
            "null"
          ]
        },
        "invocationId": {
          "type": [
            "string",
            "null"
          ]
        },
        "severity": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "info",
            "warning",
            "error",
            null
          ]
        },
        "statusClass": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "2xx",
            "3xx",
            "4xx",
            "5xx",
            null
          ]
        },
        "method": {
          "type": [
            "string",
            "null"
          ]
        },
        "statusCode": {
          "type": [
            "integer",
            "null"
          ]
        },
        "pathClass": {
          "type": [
            "string",
            "null"
          ]
        },
        "excludePaths": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 10
        },
        "hideBlocked": {
          "type": "boolean"
        },
        "requestId": {
          "type": [
            "string",
            "null"
          ]
        },
        "sourceNetwork": {
          "type": [
            "string",
            "null"
          ]
        },
        "sourceIp": {
          "type": [
            "string",
            "null"
          ]
        },
        "country": {
          "type": [
            "string",
            "null"
          ]
        },
        "category": {
          "type": [
            "string",
            "null"
          ]
        },
        "view": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "deployments",
            "http",
            "containers",
            "functions",
            "storage",
            null
          ]
        },
        "timeRange": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "1h",
            "24h",
            "7d",
            "30d",
            null
          ]
        },
        "from": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "to": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "retentionPolicy": {
      "type": "object",
      "required": [
        "maxEntriesPerCategory",
        "maxAgeDays"
      ],
      "properties": {
        "maxEntriesPerCategory": {
          "type": "integer"
        },
        "maxAgeDays": {
          "type": "integer"
        }
      }
    },
    "pagination": {
      "type": "object",
      "required": [
        "limit",
        "nextCursor",
        "hasMore",
        "total"
      ],
      "properties": {
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ]
        },
        "hasMore": {
          "type": "boolean"
        },
        "total": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0,
          "description": "Exact number of retained rows the filters select, on the first page; null on pages read with a cursor."
        }
      }
    },
    "entries": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ProjectLogEntry"
      }
    },
    "runtimeLogState": {
      "oneOf": [
        {
          "$ref": "#/$defs/RuntimeLogState"
        },
        {
          "type": "null"
        }
      ]
    },
    "accessLogState": {
      "type": "object",
      "required": [
        "status",
        "reason"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "ready",
            "empty",
            "delayed",
            "unavailable"
          ]
        },
        "reason": {
          "type": "string",
          "enum": [
            "access-log-ready",
            "access-log-empty",
            "access-log-delayed",
            "access-log-unavailable"
          ]
        },
        "checkedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "lastSuccessAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    }
  },
  "$defs": {
    "ProjectLogEntry": {
      "type": "object",
      "required": [
        "id",
        "assetType",
        "assetId",
        "severity",
        "category",
        "eventType",
        "message",
        "redacted",
        "truncated",
        "payloadSummary",
        "observedAt",
        "ingestedAt"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "assetType": {
          "type": "string",
          "enum": [
            "app",
            "service",
            "function",
            "deployment",
            "container",
            "runtime",
            "storage",
            "static"
          ]
        },
        "assetId": {
          "type": "string"
        },
        "assetName": {
          "type": [
            "string",
            "null"
          ]
        },
        "deploymentId": {
          "type": [
            "string",
            "null"
          ]
        },
        "severity": {
          "type": "string",
          "enum": [
            "info",
            "warning",
            "error"
          ]
        },
        "logKind": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "build",
            "deploy",
            "runtime",
            "network",
            "event",
            null
          ]
        },
        "stream": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "stdout",
            "stderr",
            "system",
            null
          ]
        },
        "source": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "builder",
            "runner",
            "deploy",
            "health",
            "gateway",
            "runtime",
            "api",
            "storage",
            "function",
            null
          ]
        },
        "category": {
          "type": "string"
        },
        "eventType": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        },
        "redacted": {
          "type": "boolean"
        },
        "truncated": {
          "type": "boolean"
        },
        "truncationReason": {
          "type": [
            "string",
            "null"
          ]
        },
        "payloadSummary": {
          "type": [
            "string",
            "null"
          ]
        },
        "requestId": {
          "type": [
            "string",
            "null"
          ]
        },
        "method": {
          "type": [
            "string",
            "null"
          ]
        },
        "requestTarget": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 8000
        },
        "pathClass": {
          "type": [
            "string",
            "null"
          ]
        },
        "statusCode": {
          "type": [
            "integer",
            "null"
          ]
        },
        "statusClass": {
          "type": [
            "string",
            "null"
          ]
        },
        "latencyMs": {
          "type": [
            "integer",
            "null"
          ]
        },
        "sourceIp": {
          "type": [
            "string",
            "null"
          ]
        },
        "sourceGeo": {
          "$ref": "#/$defs/ProjectLogSourceGeo"
        },
        "sourceNetworkHash": {
          "type": [
            "string",
            "null"
          ]
        },
        "userAgentFamily": {
          "type": [
            "string",
            "null"
          ]
        },
        "userAgent": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 256
        },
        "refererHost": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 253
        },
        "responseBytes": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "blocked": {
          "type": [
            "object",
            "null"
          ],
          "description": "A grouped Mini WAF block row (ADR 0109): its exact count, first time, most active client IPs and user-agent families. Kind path is one URL; urls is several URLs of one scope, minute and method, named in urls (most blocked first, at most 50) with their exact distinct count; not_recorded is blocks the Gateway counted but could not record.",
          "required": [
            "kind",
            "count",
            "firstObservedAt",
            "distinctIps",
            "ips",
            "userAgentFamilies",
            "distinctUrls",
            "urls"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "path",
                "urls",
                "not_recorded"
              ]
            },
            "distinctUrls": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 1
            },
            "urls": {
              "type": "array",
              "maxItems": 50,
              "items": {
                "type": "object",
                "required": [
                  "url",
                  "count"
                ],
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "count": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              }
            },
            "count": {
              "type": "integer",
              "minimum": 1
            },
            "firstObservedAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "distinctIps": {
              "type": "integer",
              "minimum": 0
            },
            "ips": {
              "type": "array",
              "maxItems": 50,
              "items": {
                "type": "object",
                "required": [
                  "ip",
                  "count"
                ],
                "properties": {
                  "ip": {
                    "type": "string"
                  },
                  "count": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              }
            },
            "userAgentFamilies": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "family",
                  "count"
                ],
                "properties": {
                  "family": {
                    "type": "string",
                    "enum": [
                      "Chrome",
                      "Firefox",
                      "Safari",
                      "curl",
                      "bot",
                      "other",
                      "unknown"
                    ]
                  },
                  "count": {
                    "type": "integer",
                    "minimum": 1
                  }
                }
              }
            }
          }
        },
        "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
        },
        "observedAt": {
          "type": "string",
          "format": "date-time"
        },
        "ingestedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "ProjectLogSourceGeo": {
      "type": [
        "object",
        "null"
      ],
      "required": [
        "label",
        "countryCode",
        "country",
        "regionCode",
        "region",
        "city"
      ],
      "properties": {
        "label": {
          "type": "string"
        },
        "countryCode": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "regionCode": {
          "type": [
            "string",
            "null"
          ]
        },
        "region": {
          "type": [
            "string",
            "null"
          ]
        },
        "city": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "ProjectRoute": {
      "type": "object",
      "required": [
        "status",
        "reasonCode",
        "managed",
        "upstream"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "healthy",
            "repairing",
            "degraded",
            "broken",
            "unknown"
          ]
        },
        "reasonCode": {
          "type": "string",
          "enum": [
            "none",
            "dns_record_missing",
            "dns_propagating",
            "domain_binding_missing",
            "tls_pending",
            "missing_project_upstream",
            "upstream_unreachable",
            "ingress_unreachable",
            "unmanaged_custom_domain",
            "scw_mutation_failed"
          ]
        },
        "checkedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "lastRepairAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "lastError": {
          "type": [
            "string",
            "null"
          ]
        },
        "managed": {
          "type": "boolean"
        },
        "convergenceState": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "recovering",
            "exhausted",
            "ready",
            null
          ]
        },
        "upstream": {
          "$ref": "#/$defs/ProjectUpstreamState"
        }
      }
    },
    "ProjectServingSuspension": {
      "type": "object",
      "description": "An operator suspension of the project's public serving (ADR 0080). Operator notes and evidence are never included.",
      "required": [
        "state",
        "reasonCategory",
        "reasonLabel",
        "since",
        "supportEmail",
        "policyUrl"
      ],
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "suspended"
          ]
        },
        "reasonCategory": {
          "type": "string",
          "enum": [
            "phishing",
            "malware",
            "shared_domain_abuse",
            "spam",
            "illegal_content",
            "legal_order",
            "other_policy_violation"
          ]
        },
        "reasonLabel": {
          "type": "string"
        },
        "since": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "supportEmail": {
          "type": "string"
        },
        "policyUrl": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ProjectSourceLock": {
      "type": "object",
      "description": "ADR 0090: while locked, no caller can change the project repository, branch, root directory or deployment mode.",
      "required": [
        "locked",
        "lockedAt"
      ],
      "properties": {
        "locked": {
          "type": "boolean"
        },
        "lockedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      },
      "additionalProperties": false
    },
    "ProjectSourceProfileSummary": {
      "type": "object",
      "required": [
        "framework",
        "frameworkLabel",
        "outputMode"
      ],
      "properties": {
        "framework": {
          "type": "string",
          "enum": [
            "next",
            "astro",
            "svelte-kit",
            "nuxt",
            "react-router",
            "tanstack-start",
            "vite",
            "hono",
            "nestjs",
            "fastify",
            "express",
            "django",
            "fastapi",
            "flask",
            "laravel",
            "rails",
            "node",
            "python",
            "php",
            "ruby",
            "go",
            "java",
            "dotnet",
            "static"
          ]
        },
        "frameworkLabel": {
          "type": "string"
        },
        "outputMode": {
          "type": "string",
          "enum": [
            "runtime",
            "static"
          ]
        }
      }
    },
    "ProjectSummary": {
      "type": "object",
      "required": [
        "id",
        "deploymentMode",
        "projectRoute",
        "releaseUsability",
        "sourceProfile"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "organizationId": {
          "type": [
            "string",
            "null"
          ]
        },
        "projectMembershipId": {
          "type": [
            "string",
            "null"
          ]
        },
        "projectRole": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "owner",
            "admin",
            "contributor",
            null
          ]
        },
        "projectSlug": {
          "type": [
            "string",
            "null"
          ]
        },
        "projectHostname": {
          "type": [
            "string",
            "null"
          ]
        },
        "primaryHostname": {
          "type": [
            "string",
            "null"
          ],
          "description": "Official address of the project: its active custom domain whose DNS points at Eurobase, the one that went live first when several do, otherwise projectHostname. projectHostname stays reserved and keeps serving."
        },
        "deploymentMode": {
          "type": "string",
          "enum": [
            "runtime",
            "static"
          ]
        },
        "lifecycleState": {
          "type": [
            "string",
            "null"
          ]
        },
        "deleteRequestedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "projectRoute": {
          "$ref": "#/$defs/ProjectRoute"
        },
        "releaseUsability": {
          "$ref": "#/$defs/ReleaseUsability"
        },
        "projectSummaryStatus": {
          "$ref": "#/$defs/ProjectSummaryStatus"
        },
        "servingSuspension": {
          "oneOf": [
            {
              "$ref": "#/$defs/ProjectServingSuspension"
            },
            {
              "type": "null"
            }
          ]
        },
        "sourceProfile": {
          "oneOf": [
            {
              "$ref": "#/$defs/ProjectSourceProfileSummary"
            },
            {
              "type": "null"
            }
          ]
        },
        "sourceLock": {
          "$ref": "#/$defs/ProjectSourceLock"
        }
      }
    },
    "ProjectSummaryStatus": {
      "type": "object",
      "required": [
        "label",
        "tone",
        "code",
        "detailTitle",
        "detail"
      ],
      "properties": {
        "label": {
          "type": "string"
        },
        "tone": {
          "type": "string",
          "enum": [
            "neutral",
            "problem",
            "error"
          ]
        },
        "code": {
          "type": "string",
          "enum": [
            "setup_required",
            "route_issue",
            "deploy_failed",
            "deploy_unhealthy",
            "live_release_blocked",
            "status_check_delayed",
            "deploy_in_progress",
            "rollback_live",
            "healthy",
            "suspended"
          ]
        },
        "detailTitle": {
          "type": [
            "string",
            "null"
          ]
        },
        "detail": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "ProjectUpstreamState": {
      "type": "object",
      "required": [
        "status",
        "reasonCode"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "healthy",
            "broken",
            "unknown"
          ]
        },
        "reasonCode": {
          "type": "string",
          "enum": [
            "none",
            "missing_project_upstream",
            "upstream_unreachable"
          ]
        },
        "checkedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "lastError": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "ReleaseUsability": {
      "type": "object",
      "required": [
        "status",
        "reasonCode",
        "lastLiveDeploymentId"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "reachable",
            "degraded",
            "blocked",
            "unknown"
          ]
        },
        "reasonCode": {
          "type": "string",
          "enum": [
            "none",
            "missing_live_release",
            "access_not_allowed",
            "route_repair_in_progress",
            "route_incident",
            "project_suspended"
          ]
        },
        "lastLiveDeploymentId": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "RuntimeLogState": {
      "type": "object",
      "required": [
        "status",
        "reason",
        "checkedAt",
        "lastSuccessAt"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "ready",
            "empty",
            "blocked",
            "delayed",
            "failed",
            "unavailable"
          ]
        },
        "reason": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "runtime-log-access-blocked",
            "runtime-log-collection-delayed",
            "runtime-log-collection-failed",
            "runtime-log-source-unavailable",
            null
          ]
        },
        "checkedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "lastSuccessAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    }
  }
}