{
  "version": 2,
  "rootId": "f_api_demo",
  "catalog": {
    "versions": [
      { "id": "1.0", "label": "v1.0", "summary": "Versión inicial" },
      { "id": "2.0", "label": "v2.0", "summary": "Con autenticación" }
    ],
    "defaultView": "2.0",
    "defaultCompare": "1.0"
  },
  "dataLayer": {
    "databases": [
      {
        "id": "db_app",
        "label": "PostgreSQL app",
        "engine": "postgres",
        "description": "Base principal del servicio",
        "since": "1.0",
        "host": "localhost:5432",
        "tables": [
          { "id": "tbl_health", "name": "health_checks", "since": "1.0", "fields": "id, status, checked_at", "primaryKey": "id", "description": "Log de pings", "until": "" }
        ]
      }
    ],
    "connections": [
      {
        "id": "cx_health",
        "label": "GET /health consulta health_checks",
        "flowId": "f_api_demo",
        "nodeId": "n_health",
        "nodeLabel": "GET /health",
        "databaseId": "db_app",
        "tableId": "tbl_health",
        "operation": "read",
        "fields": "status, checked_at",
        "since": "1.0",
        "note": ""
      }
    ]
  },
  "flows": {
    "f_api_demo": {
      "id": "f_api_demo",
      "title": "API ejemplo — GET /health",
      "nodes": {
        "n_start": { "id": "n_start", "kind": "start", "label": "Cliente HTTP" },
        "n_health": {
          "id": "n_health",
          "kind": "step",
          "type": "step",
          "label": "GET /health",
          "infoTitle": "",
          "infoBody": "",
          "subflowId": null,
          "spec": {
            "description": "Comprobar que el servicio responde.",
            "since": "1.0",
            "until": "",
            "versionNotes": {
              "2.0": "Requiere header Authorization desde v2."
            },
            "http": { "method": "GET", "path": "/health" },
            "requirements": [
              { "name": "URL base del API", "kind": "knowledge", "required": true, "note": "https://api.ejemplo.com" },
              { "name": "Token Bearer", "kind": "document", "required": true, "note": "Solo v2.0+", "since": "2.0" }
            ],
            "inputs": [],
            "outputs": [
              { "name": "status", "type": "string", "required": true, "example": "ok" }
            ],
            "formFields": [],
            "payloadIn": "",
            "payloadOut": "{\"status\":\"ok\"}"
          }
        },
        "n_info": {
          "id": "n_info",
          "kind": "step",
          "type": "info",
          "label": "Notas",
          "infoTitle": "Límites",
          "infoBody": "Este endpoint no ejecuta lógica de negocio; solo health check.",
          "structures": [
            { "name": "/health", "since": "1.0", "fields": "status, uptime" }
          ],
          "subflowId": null,
          "spec": {
            "description": "",
            "since": "",
            "until": "",
            "versionNotes": {},
            "http": { "method": "", "path": "" },
            "requirements": [],
            "inputs": [],
            "outputs": [],
            "formFields": [],
            "payloadIn": "",
            "payloadOut": ""
          }
        },
        "n_end": { "id": "n_end", "kind": "end", "label": "Respuesta recibida" }
      },
      "edges": [
        { "id": "e1", "from": "n_start", "to": "n_health" },
        { "id": "e2", "from": "n_health", "to": "n_info" },
        { "id": "e3", "from": "n_info", "to": "n_end" }
      ]
    }
  }
}
