{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/eurobase-dev/json-schema/eurobase-dev-function-deployments-response-schema.json",
  "title": "FunctionDeploymentsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/eurobase-dev-functions-api-openapi.yml#/components/schemas/FunctionDeploymentsResponse",
  "type": "object",
  "required": [
    "project",
    "function",
    "deployments",
    "nextCursor",
    "limit"
  ],
  "properties": {
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "project": {
      "$ref": "#/$defs/ProjectSummary"
    },
    "function": {
      "$ref": "#/$defs/FunctionAsset"
    },
    "deployments": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FunctionDeployment"
      }
    }
  },
  "$defs": {
    "FunctionActionAvailability": {
      "type": "object",
      "required": [
        "canDeploy",
        "blockedReason",
        "recoveryAction",
        "targetFunctionId"
      ],
      "additionalProperties": false,
      "properties": {
        "canDeploy": {
          "type": "boolean"
        },
        "blockedReason": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "not-authorized",
            "project-pending-delete",
            "function-deploy-in-flight",
            "function-deleted",
            "function-cron-metering-unavailable",
            "project-provider-access-not-ready",
            null
          ]
        },
        "recoveryAction": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "open_settings",
            null
          ]
        },
        "targetFunctionId": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "FunctionAsset": {
      "type": "object",
      "description": "Role-authorized function fields. Internal query aliases, deployment source copies and raw provider metadata are not exposed.",
      "required": [
        "id",
        "organizationId",
        "projectId",
        "name",
        "sourceMode",
        "entryPath",
        "runtime",
        "triggerType",
        "authMode",
        "authModeLabel",
        "deploymentCount",
        "status",
        "statusLabel",
        "actionAvailability",
        "routeConvergence",
        "createdByUserId",
        "createdAt",
        "updatedAt"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "organizationId": {
          "type": "string"
        },
        "projectId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "sourceMode": {
          "type": "string",
          "enum": [
            "managed",
            "git"
          ]
        },
        "entryPath": {
          "type": "string"
        },
        "sourceFiles": {
          "description": "Present for project owners/admins. Omitted from contributor-readable function payloads.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/FunctionSourceFile"
          }
        },
        "runtime": {
          "type": "string",
          "enum": [
            "deno_ts"
          ]
        },
        "triggerType": {
          "type": "string",
          "enum": [
            "http",
            "cron"
          ]
        },
        "authMode": {
          "type": "string",
          "enum": [
            "public",
            "signed"
          ]
        },
        "authModeLabel": {
          "type": "string"
        },
        "deploymentCount": {
          "type": "integer"
        },
        "cronSchedule": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "draft",
            "deploying",
            "ready",
            "failed",
            "deleted"
          ]
        },
        "statusLabel": {
          "type": "string"
        },
        "route": {
          "oneOf": [
            {
              "$ref": "#/$defs/FunctionRoute"
            },
            {
              "type": "null"
            }
          ]
        },
        "activeDeploymentId": {
          "type": [
            "string",
            "null"
          ]
        },
        "actionAvailability": {
          "$ref": "#/$defs/FunctionActionAvailability"
        },
        "routeConvergence": {
          "$ref": "#/$defs/FunctionRouteConvergence"
        },
        "latestDeployment": {
          "oneOf": [
            {
              "$ref": "#/$defs/FunctionDeployment"
            },
            {
              "type": "null"
            }
          ]
        },
        "createdByUserId": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "FunctionDeployment": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "organizationId",
        "projectId",
        "functionId",
        "sourceType",
        "status",
        "statusLabel",
        "createdByUserId",
        "createdAt",
        "updatedAt"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "organizationId": {
          "type": "string"
        },
        "projectId": {
          "type": "string"
        },
        "functionId": {
          "type": "string"
        },
        "sourceType": {
          "type": "string",
          "enum": [
            "managed",
            "git"
          ]
        },
        "packageRef": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "queued",
            "deploying",
            "ready",
            "failed"
          ]
        },
        "statusLabel": {
          "type": "string"
        },
        "lastError": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdByUserId": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "FunctionRoute": {
      "type": "object",
      "required": [
        "status",
        "statusLabel",
        "accessMode",
        "reasonCode",
        "statusMessage"
      ],
      "properties": {
        "hostname": {
          "type": [
            "string",
            "null"
          ]
        },
        "path": {
          "type": [
            "string",
            "null"
          ]
        },
        "productUrl": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "accessMode": {
          "type": "string",
          "enum": [
            "public",
            "private"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "ready",
            "failed"
          ]
        },
        "statusLabel": {
          "type": "string"
        },
        "reasonCode": {
          "type": "string"
        },
        "statusMessage": {
          "type": "string"
        }
      }
    },
    "FunctionRouteConvergence": {
      "type": "object",
      "required": [
        "state",
        "reasonCode",
        "statusLabel",
        "statusMessage",
        "pollRecommended"
      ],
      "additionalProperties": false,
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "idle",
            "deploying",
            "route_pending",
            "access_pending",
            "proof_pending",
            "ready",
            "failed"
          ]
        },
        "reasonCode": {
          "type": "string"
        },
        "statusLabel": {
          "type": "string"
        },
        "statusMessage": {
          "type": "string"
        },
        "pollRecommended": {
          "type": "boolean"
        }
      }
    },
    "FunctionSourceFile": {
      "type": "object",
      "required": [
        "path",
        "content"
      ],
      "properties": {
        "path": {
          "type": "string"
        },
        "content": {
          "type": "string"
        }
      }
    },
    "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"
          ]
        }
      }
    }
  }
}