{
  "schema_version": 1,
  "catalog_version": "3.6.0",
  "authority": "P2HS Core policy + P2HS Cloud execution",
  "source": "P2HS Core injected Platform Port Catalog projection",
  "project_id": "project",
  "workspace_id": "workspace",
  "validation": {
    "command": "node p2hs/verify-cloud-contract.mjs",
    "network_required": false,
    "purpose": "Validate installed routes and request/response schemas before codegen completion."
  },
  "ports": [
    {
      "port_id": "auth.signup",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/auth/signup",
        "auth": "public",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/auth/signup"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "email": {
              "type": "string"
            },
            "password": {
              "type": "string",
              "minLength": 8
            },
            "user_metadata": {
              "type": "object",
              "additionalProperties": true,
              "description": "Application-defined fields; use the project entity/function schema."
            },
            "app_origin": {
              "type": "string"
            },
            "link_path": {
              "type": "string"
            },
            "admin_only": {
              "type": "boolean"
            }
          },
          "required": [
            "email",
            "password"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "access_token": {
              "type": "string"
            },
            "refresh_token": {
              "type": "string"
            },
            "user": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "email": {
                  "type": "string"
                },
                "role": {
                  "type": "string"
                },
                "email_verified": {
                  "type": "boolean"
                },
                "provider": {
                  "type": "string"
                },
                "user_metadata": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Application-defined fields; use the project entity/function schema."
                },
                "app_metadata": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Application-defined fields; use the project entity/function schema."
                },
                "created_at": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "email",
                "role",
                "email_verified",
                "provider",
                "user_metadata",
                "app_metadata",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "access_token",
            "refresh_token",
            "user"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          201
        ],
        "notes": [
          "app_origin is auto-populated by the installed adapter from the request's Origin/Referer header (or x-p2hs-public-origin); a generated app does not need to set it, and a same-origin request never needs to."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/auth.ts"
        ]
      }
    },
    {
      "port_id": "auth.signin",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/auth/signin",
        "auth": "public",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/auth/signin"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "email": {
              "type": "string"
            },
            "password": {
              "type": "string"
            }
          },
          "required": [
            "email",
            "password"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "access_token": {
              "type": "string"
            },
            "refresh_token": {
              "type": "string"
            },
            "user": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "email": {
                  "type": "string"
                },
                "role": {
                  "type": "string"
                },
                "email_verified": {
                  "type": "boolean"
                },
                "provider": {
                  "type": "string"
                },
                "user_metadata": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Application-defined fields; use the project entity/function schema."
                },
                "app_metadata": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Application-defined fields; use the project entity/function schema."
                },
                "created_at": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "email",
                "role",
                "email_verified",
                "provider",
                "user_metadata",
                "app_metadata",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "access_token",
            "refresh_token",
            "user"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/auth.ts"
        ]
      }
    },
    {
      "port_id": "auth.signout",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/auth/signout",
        "auth": "session",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/auth/signout"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "refresh_token": {
              "type": "string"
            }
          },
          "required": [
            "refresh_token"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            }
          },
          "required": [
            "ok"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/auth.ts"
        ]
      }
    },
    {
      "port_id": "auth.refresh",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/auth/refresh",
        "auth": "public",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/auth/refresh"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "refresh_token": {
              "type": "string"
            }
          },
          "required": [
            "refresh_token"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "access_token": {
              "type": "string"
            },
            "refresh_token": {
              "type": "string"
            },
            "user": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "email": {
                  "type": "string"
                },
                "role": {
                  "type": "string"
                },
                "email_verified": {
                  "type": "boolean"
                },
                "provider": {
                  "type": "string"
                },
                "user_metadata": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Application-defined fields; use the project entity/function schema."
                },
                "app_metadata": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Application-defined fields; use the project entity/function schema."
                },
                "created_at": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "email",
                "role",
                "email_verified",
                "provider",
                "user_metadata",
                "app_metadata",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "access_token",
            "refresh_token",
            "user"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/auth.ts"
        ]
      }
    },
    {
      "port_id": "auth.session",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/auth/session",
        "auth": "public",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/auth/session"
      },
      "schema": {
        "request_body": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "grant_type": {
                  "const": "password"
                },
                "email": {
                  "type": "string"
                },
                "password": {
                  "type": "string"
                }
              },
              "required": [
                "grant_type",
                "email",
                "password"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "grant_type": {
                  "const": "refresh_token"
                },
                "refresh_token": {
                  "type": "string"
                }
              },
              "required": [
                "grant_type",
                "refresh_token"
              ],
              "additionalProperties": false
            }
          ]
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "access_token": {
              "type": "string"
            },
            "refresh_token": {
              "type": "string"
            },
            "user": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "email": {
                  "type": "string"
                },
                "role": {
                  "type": "string"
                },
                "email_verified": {
                  "type": "boolean"
                },
                "provider": {
                  "type": "string"
                },
                "user_metadata": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Application-defined fields; use the project entity/function schema."
                },
                "app_metadata": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Application-defined fields; use the project entity/function schema."
                },
                "created_at": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "email",
                "role",
                "email_verified",
                "provider",
                "user_metadata",
                "app_metadata",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "access_token",
            "refresh_token",
            "user"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/auth.ts"
        ]
      }
    },
    {
      "port_id": "auth.me",
      "entitlement": "cloud",
      "bff": {
        "method": "GET",
        "path": "/api/auth/me",
        "auth": "session",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "GET",
        "path": "/v1/projects/:project_id/auth/me"
      },
      "schema": {
        "request_body": null,
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "email": {
              "type": "string"
            },
            "role": {
              "type": "string"
            },
            "email_verified": {
              "type": "boolean"
            },
            "provider": {
              "type": "string"
            },
            "user_metadata": {
              "type": "object",
              "additionalProperties": true,
              "description": "Application-defined fields; use the project entity/function schema."
            },
            "app_metadata": {
              "type": "object",
              "additionalProperties": true,
              "description": "Application-defined fields; use the project entity/function schema."
            },
            "created_at": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "email",
            "role",
            "email_verified",
            "provider",
            "user_metadata",
            "app_metadata",
            "created_at"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/auth.ts"
        ]
      }
    },
    {
      "port_id": "auth.profile",
      "entitlement": "cloud",
      "bff": {
        "method": "PUT",
        "path": "/api/auth/me",
        "auth": "session",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "PUT",
        "path": "/v1/projects/:project_id/auth/me"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "user_metadata": {
              "type": "object",
              "additionalProperties": true,
              "description": "Application-defined fields; use the project entity/function schema."
            }
          },
          "required": [
            "user_metadata"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "email": {
              "type": "string"
            },
            "role": {
              "type": "string"
            },
            "email_verified": {
              "type": "boolean"
            },
            "provider": {
              "type": "string"
            },
            "user_metadata": {
              "type": "object",
              "additionalProperties": true,
              "description": "Application-defined fields; use the project entity/function schema."
            },
            "app_metadata": {
              "type": "object",
              "additionalProperties": true,
              "description": "Application-defined fields; use the project entity/function schema."
            },
            "created_at": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "email",
            "role",
            "email_verified",
            "provider",
            "user_metadata",
            "app_metadata",
            "created_at"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/auth.ts"
        ]
      }
    },
    {
      "port_id": "auth.magic_link_request",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/auth/magic-link/request",
        "auth": "public",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/auth/magic-link/request"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "email": {
              "type": "string"
            },
            "app_origin": {
              "type": "string"
            },
            "link_path": {
              "type": "string"
            },
            "admin_only": {
              "type": "boolean"
            }
          },
          "required": [
            "email"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            }
          },
          "required": [
            "ok"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "app_origin is auto-populated by the installed adapter from the request's Origin/Referer header (or x-p2hs-public-origin); a generated app does not need to set it, and a same-origin request never needs to."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/auth.ts"
        ]
      }
    },
    {
      "port_id": "auth.magic_link_verify",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/auth/magic-link/verify",
        "auth": "public",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/auth/magic-link/verify"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "token": {
              "type": "string"
            }
          },
          "required": [
            "token"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "access_token": {
              "type": "string"
            },
            "refresh_token": {
              "type": "string"
            },
            "user": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "email": {
                  "type": "string"
                },
                "role": {
                  "type": "string"
                },
                "email_verified": {
                  "type": "boolean"
                },
                "provider": {
                  "type": "string"
                },
                "user_metadata": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Application-defined fields; use the project entity/function schema."
                },
                "app_metadata": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Application-defined fields; use the project entity/function schema."
                },
                "created_at": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "email",
                "role",
                "email_verified",
                "provider",
                "user_metadata",
                "app_metadata",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "access_token",
            "refresh_token",
            "user"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/auth.ts"
        ]
      }
    },
    {
      "port_id": "auth.otp_request",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/auth/otp/request",
        "auth": "public",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/auth/otp/request"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "email": {
              "type": "string"
            },
            "app_origin": {
              "type": "string"
            }
          },
          "required": [
            "email"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            }
          },
          "required": [
            "ok"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "app_origin is accepted but has no effect: OTP delivers a 6-digit code by email, never a link, so no origin is needed to build one.",
          "app_origin is auto-populated by the installed adapter from the request's Origin/Referer header (or x-p2hs-public-origin); a generated app does not need to set it, and a same-origin request never needs to."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/auth.ts"
        ]
      }
    },
    {
      "port_id": "auth.otp_verify",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/auth/otp/verify",
        "auth": "public",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/auth/otp/verify"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "email": {
              "type": "string"
            },
            "code": {
              "type": "string"
            }
          },
          "required": [
            "email",
            "code"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "access_token": {
              "type": "string"
            },
            "refresh_token": {
              "type": "string"
            },
            "user": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "email": {
                  "type": "string"
                },
                "role": {
                  "type": "string"
                },
                "email_verified": {
                  "type": "boolean"
                },
                "provider": {
                  "type": "string"
                },
                "user_metadata": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Application-defined fields; use the project entity/function schema."
                },
                "app_metadata": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Application-defined fields; use the project entity/function schema."
                },
                "created_at": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "email",
                "role",
                "email_verified",
                "provider",
                "user_metadata",
                "app_metadata",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "access_token",
            "refresh_token",
            "user"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/auth.ts"
        ]
      }
    },
    {
      "port_id": "auth.verify_email",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/auth/verify-email",
        "auth": "public",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/auth/verify-email"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "token": {
              "type": "string"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {
            "token": {
              "type": "string"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            }
          },
          "required": [
            "ok"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Supply token in JSON body or query string."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/auth.ts"
        ]
      }
    },
    {
      "port_id": "auth.invite_accept",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/auth/invite/accept",
        "auth": "public",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/auth/invite/accept"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "token": {
              "type": "string"
            },
            "password": {
              "type": "string",
              "minLength": 8
            }
          },
          "required": [
            "token"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "access_token": {
              "type": "string"
            },
            "refresh_token": {
              "type": "string"
            },
            "user": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "email": {
                  "type": "string"
                },
                "role": {
                  "type": "string"
                },
                "email_verified": {
                  "type": "boolean"
                },
                "provider": {
                  "type": "string"
                },
                "user_metadata": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Application-defined fields; use the project entity/function schema."
                },
                "app_metadata": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Application-defined fields; use the project entity/function schema."
                },
                "created_at": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "email",
                "role",
                "email_verified",
                "provider",
                "user_metadata",
                "app_metadata",
                "created_at"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "access_token",
            "refresh_token",
            "user"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Password required when accepting an invite for a new email user."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/auth.ts"
        ]
      }
    },
    {
      "port_id": "auth.password_reset_request",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/auth/forgot-password",
        "auth": "public",
        "adapter": "password"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/auth/password/reset-request"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "email": {
              "type": "string"
            },
            "admin_only": {
              "type": "boolean"
            },
            "app_origin": {
              "type": "string"
            }
          },
          "required": [
            "email"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "success": {
              "const": true
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "success",
            "message"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "The installed adapter computes reset_path itself from admin_only (true \u2192 /admin/reset-password, false \u2192 /reset-password); it never reads a reset_path or link_path field from the request, so sending either has no effect.",
          "Always returns 200 with a generic message whether or not the email exists, to avoid account enumeration.",
          "app_origin is auto-populated by the installed adapter from the request's Origin/Referer header (or x-p2hs-public-origin); a generated app does not need to set it, and a same-origin request never needs to."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/auth.ts"
        ]
      }
    },
    {
      "port_id": "auth.password_reset",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/auth/reset-password",
        "auth": "public",
        "adapter": "password"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/auth/password/reset"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "token": {
              "type": "string"
            },
            "password": {
              "type": "string",
              "minLength": 8
            }
          },
          "required": [
            "token",
            "password"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "success": {
              "const": true
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "success",
            "message"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/auth.ts"
        ]
      }
    },
    {
      "port_id": "auth.users_list",
      "entitlement": "cloud",
      "bff": {
        "method": "GET",
        "path": "/api/admin/users",
        "auth": "staff",
        "adapter": "users"
      },
      "cloud": {
        "transport": "http",
        "method": "GET",
        "path": "/v1/projects/:project_id/auth/users"
      },
      "schema": {
        "request_body": null,
        "query": {
          "type": "object",
          "properties": {
            "page": {
              "type": "string"
            },
            "limit": {
              "type": "string"
            },
            "status": {
              "type": "string",
              "enum": [
                "all",
                "active",
                "inactive"
              ]
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "success": {
              "const": true
            },
            "data": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "member",
                      "admin",
                      "super_admin"
                    ]
                  },
                  "is_active": {
                    "type": "boolean"
                  },
                  "created_at": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "last_login_at": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "email",
                  "name",
                  "role",
                  "is_active",
                  "created_at",
                  "last_login_at"
                ],
                "additionalProperties": true
              }
            },
            "pagination": {
              "type": "object",
              "properties": {
                "page": {
                  "type": "integer"
                },
                "limit": {
                  "type": "integer"
                },
                "total": {
                  "type": "integer"
                },
                "totalPages": {
                  "type": "integer"
                }
              },
              "required": [
                "page",
                "limit",
                "total",
                "totalPages"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "success",
            "data",
            "pagination"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/auth.ts"
        ]
      }
    },
    {
      "port_id": "auth.users_create",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/admin/users",
        "auth": "staff",
        "adapter": "users"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/auth/users"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "email": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "password": {
              "type": "string",
              "minLength": 8
            },
            "role": {
              "type": "string",
              "enum": [
                "member",
                "admin"
              ]
            },
            "is_active": {
              "const": true
            }
          },
          "required": [
            "email"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "success": {
              "const": true
            },
            "data": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "email": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "member",
                    "admin",
                    "super_admin"
                  ]
                },
                "is_active": {
                  "type": "boolean"
                },
                "created_at": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "last_login_at": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "email",
                "name",
                "role",
                "is_active",
                "created_at",
                "last_login_at"
              ],
              "additionalProperties": true
            }
          },
          "required": [
            "success",
            "data"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200,
          201
        ],
        "notes": [
          "Only super_admin may create users. Default role is admin. This is the installed BFF shape, not raw Cloud auth/users.",
          "If email already belongs to an existing user, Cloud silently upserts instead of creating: it updates that user's role/password (and email_verified) and returns 200. A genuinely new user returns 201. Both cases return the same response shape."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/auth.ts"
        ]
      }
    },
    {
      "port_id": "auth.users_get",
      "entitlement": "cloud",
      "bff": {
        "method": "GET",
        "path": "/api/admin/users/:user_id",
        "auth": "staff",
        "adapter": "users"
      },
      "cloud": {
        "transport": "http",
        "method": "GET",
        "path": "/v1/projects/:project_id/auth/users/:user_id"
      },
      "schema": {
        "request_body": null,
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "success": {
              "const": true
            },
            "data": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "email": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "member",
                    "admin",
                    "super_admin"
                  ]
                },
                "is_active": {
                  "type": "boolean"
                },
                "created_at": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "last_login_at": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "email",
                "name",
                "role",
                "is_active",
                "created_at",
                "last_login_at"
              ],
              "additionalProperties": true
            }
          },
          "required": [
            "success",
            "data"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "user_id": {
              "type": "string"
            }
          },
          "required": [
            "user_id"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/auth.ts"
        ]
      }
    },
    {
      "port_id": "auth.users_update",
      "entitlement": "cloud",
      "bff": {
        "method": "PATCH",
        "path": "/api/admin/users/:user_id",
        "auth": "staff",
        "adapter": "users"
      },
      "cloud": {
        "transport": "http",
        "method": "PATCH",
        "path": "/v1/projects/:project_id/auth/users/:user_id"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "role": {
              "type": "string",
              "enum": [
                "member",
                "admin"
              ]
            },
            "is_active": {
              "type": "boolean"
            }
          },
          "required": [],
          "additionalProperties": false,
          "minProperties": 1
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "success": {
              "const": true
            },
            "data": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "email": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "member",
                    "admin",
                    "super_admin"
                  ]
                },
                "is_active": {
                  "type": "boolean"
                },
                "created_at": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "last_login_at": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "email",
                "name",
                "role",
                "is_active",
                "created_at",
                "last_login_at"
              ],
              "additionalProperties": true
            }
          },
          "required": [
            "success",
            "data"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "user_id": {
              "type": "string"
            }
          },
          "required": [
            "user_id"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/auth.ts"
        ]
      }
    },
    {
      "port_id": "auth.users_delete",
      "entitlement": "cloud",
      "bff": {
        "method": "DELETE",
        "path": "/api/admin/users/:user_id",
        "auth": "staff",
        "adapter": "users"
      },
      "cloud": {
        "transport": "http",
        "method": "DELETE",
        "path": "/v1/projects/:project_id/auth/users/:user_id"
      },
      "schema": {
        "request_body": null,
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "success": {
              "const": true
            }
          },
          "required": [
            "success"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "user_id": {
              "type": "string"
            }
          },
          "required": [
            "user_id"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/auth.ts"
        ]
      }
    },
    {
      "port_id": "auth.users_set_password",
      "entitlement": "cloud",
      "bff": {
        "method": "PATCH",
        "path": "/api/admin/users/:user_id/password",
        "auth": "staff",
        "adapter": "users"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/auth/users"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "password": {
              "type": "string",
              "minLength": 8
            }
          },
          "required": [
            "password"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "success": {
              "const": true
            }
          },
          "required": [
            "success"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Only super_admin may call this, and never against another super_admin. The installed adapter implements this by re-POSTing to the same Cloud endpoint as auth.users_create with the target user's existing email; Cloud upserts the password because the email already exists. This is the installed BFF shape, not a distinct raw Cloud route."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "user_id": {
              "type": "string"
            }
          },
          "required": [
            "user_id"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/auth.ts"
        ]
      }
    },
    {
      "port_id": "records.search",
      "entitlement": "query_dsl_v1",
      "bff": {
        "method": "POST",
        "path": "/api/records/search",
        "auth": "session",
        "adapter": "records"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/search"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "query": {
              "type": "string"
            },
            "entity_key": {
              "type": "string"
            },
            "entity_keys": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "status": {
              "type": "string"
            },
            "limit": {
              "type": "integer"
            }
          },
          "required": [
            "query"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "results": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "entity_key": {
                    "type": "string"
                  },
                  "title": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "slug": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Application-defined fields; use the project entity/function schema."
                  },
                  "updated_at": {
                    "type": "string"
                  },
                  "score": {
                    "type": "number"
                  }
                },
                "required": [
                  "id",
                  "entity_key",
                  "title",
                  "slug",
                  "data",
                  "updated_at",
                  "score"
                ],
                "additionalProperties": false
              }
            },
            "query": {
              "type": "string"
            },
            "entity_keys": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "required": [
            "results",
            "query",
            "entity_keys"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Search is cross-entity when entity_keys is supplied. Only indexed text-like fields plus title/slug are searched."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/record-search.ts"
        ]
      }
    },
    {
      "port_id": "records.query",
      "entitlement": "query_dsl_v1",
      "bff": {
        "method": "POST",
        "path": "/api/records/:entity/query",
        "auth": "staff",
        "adapter": "records"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/records/query"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "where": {
              "$ref": "#/$defs/where"
            },
            "status": {
              "type": "string",
              "enum": [
                "active",
                "archived",
                "all"
              ]
            },
            "order_by": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "field": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "created_at",
                          "updated_at",
                          "title",
                          "slug"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "indexed_field": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "indexed_field"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "dir": {
                    "type": "string",
                    "enum": [
                      "asc",
                      "desc"
                    ]
                  }
                },
                "required": [
                  "field",
                  "dir"
                ],
                "additionalProperties": false
              }
            },
            "limit": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            },
            "cursor": {
              "type": "string"
            }
          },
          "required": [],
          "additionalProperties": false,
          "$defs": {
            "where": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "and": {
                      "type": "array",
                      "items": {
                        "$ref": "#/$defs/where"
                      }
                    }
                  },
                  "required": [
                    "and"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "or": {
                      "type": "array",
                      "items": {
                        "$ref": "#/$defs/where"
                      },
                      "maxItems": 8
                    }
                  },
                  "required": [
                    "or"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "not": {
                      "$ref": "#/$defs/where"
                    }
                  },
                  "required": [
                    "not"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "field"
                    },
                    "field": {
                      "type": "string"
                    },
                    "op": {
                      "type": "string",
                      "enum": [
                        "eq",
                        "neq",
                        "gt",
                        "gte",
                        "lt",
                        "lte",
                        "in",
                        "not_in",
                        "contains",
                        "starts_with",
                        "between",
                        "is_null",
                        "field_exists"
                      ]
                    },
                    "value": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "number"
                              }
                            ]
                          }
                        }
                      ]
                    }
                  },
                  "required": [
                    "type",
                    "field",
                    "op"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "relation"
                    },
                    "direction": {
                      "type": "string",
                      "enum": [
                        "from",
                        "to"
                      ]
                    },
                    "relation_key": {
                      "type": "string"
                    },
                    "to_entity_key": {
                      "type": "string"
                    },
                    "from_entity_key": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "type",
                    "direction",
                    "relation_key"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          }
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "records": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "data_json": {
                    "type": "string"
                  },
                  "title": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "slug": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "status": {
                    "type": "string"
                  }
                },
                "required": [
                  "id"
                ],
                "additionalProperties": true
              }
            },
            "total": {
              "type": "integer"
            },
            "next_cursor": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "records",
            "total",
            "next_cursor"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "entity comes from the URL; do not include entity_key in the body. where depth maximum is 6. Records retain Cloud record envelopes; application data is in data_json."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "entity": {
              "type": "string"
            }
          },
          "required": [
            "entity"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/record-operations.ts"
        ]
      }
    },
    {
      "port_id": "records.create",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/records/:entity",
        "auth": "staff",
        "adapter": "records"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/entities/:entity/records"
      },
      "schema": {
        "request_body": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "data": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Application-defined fields; use the project entity/function schema."
                },
                "title": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "slug": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "metadata": {
                  "anyOf": [
                    {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Application-defined fields; use the project entity/function schema."
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "parent_record_id": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "owner_user_id": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "data"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "additionalProperties": true,
              "description": "Shorthand application data; the adapter wraps it as data. Prefer the explicit data envelope."
            }
          ]
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "record": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "data_json": {
                  "type": "string"
                },
                "title": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "slug": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "type": "string"
                }
              },
              "required": [
                "id"
              ],
              "additionalProperties": true
            }
          },
          "required": [
            "record"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "owner_user_id is accepted but ignored: Cloud always stamps the caller's own identity on rls_enabled/owner_managed entities for this staff-session auth path, and ignores it entirely otherwise. There is no way for the app to set another user's ownership through this route."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "entity": {
              "type": "string"
            }
          },
          "required": [
            "entity"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/records.ts"
        ]
      }
    },
    {
      "port_id": "records.update",
      "entitlement": "cloud",
      "bff": {
        "method": "PATCH",
        "path": "/api/records/:entity/:id",
        "auth": "staff",
        "adapter": "records"
      },
      "cloud": {
        "transport": "http",
        "method": "PATCH",
        "path": "/v1/projects/:project_id/entities/:entity/records/:id"
      },
      "schema": {
        "request_body": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "data": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Application-defined fields; use the project entity/function schema."
                },
                "title": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "slug": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "metadata": {
                  "anyOf": [
                    {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Application-defined fields; use the project entity/function schema."
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "parent_record_id": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "owner_user_id": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "data"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "additionalProperties": true,
              "description": "Shorthand application data; the adapter wraps it as data. Prefer the explicit data envelope."
            }
          ]
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "record": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "data_json": {
                  "type": "string"
                },
                "title": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "slug": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "type": "string"
                }
              },
              "required": [
                "id"
              ],
              "additionalProperties": true
            }
          },
          "required": [
            "record"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "owner_user_id is accepted but ignored: Cloud always stamps the caller's own identity on rls_enabled/owner_managed entities for this staff-session auth path, and ignores it entirely otherwise. There is no way for the app to set another user's ownership through this route."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "entity": {
              "type": "string"
            },
            "id": {
              "type": "string"
            }
          },
          "required": [
            "entity",
            "id"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/records.ts"
        ]
      }
    },
    {
      "port_id": "records.delete",
      "entitlement": "cloud",
      "bff": {
        "method": "DELETE",
        "path": "/api/records/:entity/:id",
        "auth": "staff",
        "adapter": "records"
      },
      "cloud": {
        "transport": "http",
        "method": "DELETE",
        "path": "/v1/projects/:project_id/entities/:entity/records/:id"
      },
      "schema": {
        "request_body": null,
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "success": {
              "const": true
            }
          },
          "required": [
            "success"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "entity": {
              "type": "string"
            },
            "id": {
              "type": "string"
            }
          },
          "required": [
            "entity",
            "id"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/records.ts"
        ]
      }
    },
    {
      "port_id": "storage.presign_upload",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/storage/:bucket/presign",
        "auth": "session",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/storage/:bucket/presign"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "filename": {
              "type": "string"
            },
            "content_type": {
              "type": "string"
            },
            "size_bytes": {
              "type": "number"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "file_id": {
              "type": "string"
            },
            "upload_url": {
              "type": "string"
            },
            "expires_in": {
              "type": "integer"
            }
          },
          "required": [
            "file_id",
            "upload_url",
            "expires_in"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          201
        ],
        "notes": [
          "PUT file bytes to the returned upload_url, then call storage.confirm."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "bucket": {
              "type": "string"
            }
          },
          "required": [
            "bucket"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/storage.ts"
        ]
      }
    },
    {
      "port_id": "storage.list",
      "entitlement": "cloud",
      "bff": {
        "method": "GET",
        "path": "/api/storage/:bucket/files",
        "auth": "session",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "GET",
        "path": "/v1/projects/:project_id/storage/:bucket/files"
      },
      "schema": {
        "request_body": null,
        "query": {
          "type": "object",
          "properties": {
            "limit": {
              "type": "string"
            },
            "cursor": {
              "type": "string"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "files": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "filename": {
                    "type": "string"
                  },
                  "content_type": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "size_bytes": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "status": {
                    "type": "string"
                  },
                  "uploaded_by_user_id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "created_at": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "filename"
                ],
                "additionalProperties": true
              }
            },
            "next_cursor": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "files",
            "next_cursor"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "The list row never includes entity_key, record_id or a CDN/public URL \u2014 call storage.metadata for those."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "bucket": {
              "type": "string"
            }
          },
          "required": [
            "bucket"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/storage.ts"
        ]
      }
    },
    {
      "port_id": "storage.get",
      "entitlement": "cloud",
      "bff": {
        "method": "GET",
        "path": "/api/storage/:bucket/files/:fid",
        "auth": "session",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "GET",
        "path": "/v1/projects/:project_id/storage/:bucket/files/:fid"
      },
      "schema": {
        "request_body": null,
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "filename": {
              "type": "string"
            },
            "content_type": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "size_bytes": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "status": {
              "type": "string"
            },
            "uploaded_by_user_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "filename"
          ],
          "additionalProperties": true
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Never includes entity_key, record_id or a CDN/public URL \u2014 call storage.metadata for those."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "bucket": {
              "type": "string"
            },
            "fid": {
              "type": "string"
            }
          },
          "required": [
            "bucket",
            "fid"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/storage.ts"
        ]
      }
    },
    {
      "port_id": "storage.delete",
      "entitlement": "cloud",
      "bff": {
        "method": "DELETE",
        "path": "/api/storage/:bucket/files/:fid",
        "auth": "session",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "DELETE",
        "path": "/v1/projects/:project_id/storage/:bucket/files/:fid"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            }
          },
          "required": [
            "ok"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "bucket": {
              "type": "string"
            },
            "fid": {
              "type": "string"
            }
          },
          "required": [
            "bucket",
            "fid"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/storage.ts"
        ]
      }
    },
    {
      "port_id": "storage.confirm",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/storage/:bucket/files/:fid/confirm",
        "auth": "session",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/storage/:bucket/files/:fid/confirm"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "file_id": {
              "type": "string"
            },
            "filename": {
              "type": "string"
            },
            "content_type": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "size_bytes": {
              "type": "number"
            },
            "bucket": {
              "type": "string"
            },
            "status": {
              "const": "active"
            }
          },
          "required": [
            "file_id",
            "filename",
            "content_type",
            "size_bytes",
            "bucket",
            "status"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "bucket": {
              "type": "string"
            },
            "fid": {
              "type": "string"
            }
          },
          "required": [
            "bucket",
            "fid"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/storage.ts"
        ]
      }
    },
    {
      "port_id": "storage.presign_download",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/storage/:bucket/files/:fid/presign-download",
        "auth": "session",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/storage/:bucket/files/:fid/presign-download"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "expires_in": {
              "type": "number"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "download_url": {
              "type": "string"
            },
            "expires_in": {
              "type": "number"
            },
            "filename": {
              "type": "string"
            }
          },
          "required": [
            "download_url",
            "expires_in",
            "filename"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "bucket": {
              "type": "string"
            },
            "fid": {
              "type": "string"
            }
          },
          "required": [
            "bucket",
            "fid"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/storage.ts"
        ]
      }
    },
    {
      "port_id": "storage.copy",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/storage/:bucket/files/:fid/copy",
        "auth": "session",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/storage/:bucket/files/:fid/copy"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "filename": {
              "type": "string"
            },
            "target_bucket": {
              "type": "string"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "file_id": {
              "type": "string"
            },
            "bucket": {
              "type": "string"
            },
            "filename": {
              "type": "string"
            },
            "size_bytes": {
              "type": "number"
            },
            "cloned_from": {
              "type": "string"
            }
          },
          "required": [
            "file_id",
            "bucket",
            "filename",
            "size_bytes",
            "cloned_from"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          201
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "bucket": {
              "type": "string"
            },
            "fid": {
              "type": "string"
            }
          },
          "required": [
            "bucket",
            "fid"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/storage.ts"
        ]
      }
    },
    {
      "port_id": "storage.move",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/storage/:bucket/files/:fid/move",
        "auth": "session",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/storage/:bucket/files/:fid/move"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "filename": {
              "type": "string"
            },
            "target_bucket": {
              "type": "string"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "file_id": {
              "type": "string"
            },
            "object_key": {
              "type": "string"
            },
            "bucket": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "file_id",
            "object_key"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "bucket": {
              "type": "string"
            },
            "fid": {
              "type": "string"
            }
          },
          "required": [
            "bucket",
            "fid"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/storage.ts"
        ]
      }
    },
    {
      "port_id": "storage.attach",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/storage/:bucket/files/:fid/attach",
        "auth": "session",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/storage/:bucket/files/:fid/attach"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "entity_key": {
              "type": "string"
            },
            "record_id": {
              "type": "string"
            }
          },
          "required": [
            "entity_key",
            "record_id"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "file_id": {
              "type": "string"
            },
            "entity_key": {
              "type": "string"
            },
            "record_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            }
          },
          "required": [
            "file_id",
            "entity_key",
            "record_id"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "bucket": {
              "type": "string"
            },
            "fid": {
              "type": "string"
            }
          },
          "required": [
            "bucket",
            "fid"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/storage.ts"
        ]
      }
    },
    {
      "port_id": "storage.metadata",
      "entitlement": "cloud",
      "bff": {
        "method": "GET",
        "path": "/api/storage/:bucket/files/:fid/metadata",
        "auth": "session",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "GET",
        "path": "/v1/projects/:project_id/storage/:bucket/files/:fid/metadata"
      },
      "schema": {
        "request_body": null,
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "file_id": {
              "type": "string"
            },
            "filename": {
              "type": "string"
            },
            "content_type": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "size_bytes": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "etag": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "uploaded": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "r2_custom_metadata": {
              "type": "object",
              "additionalProperties": true,
              "description": "Application-defined fields; use the project entity/function schema."
            },
            "entity_key": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "record_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "registry_metadata": {}
          },
          "required": [
            "file_id",
            "filename",
            "content_type",
            "size_bytes",
            "etag",
            "uploaded",
            "r2_custom_metadata",
            "entity_key",
            "record_id",
            "registry_metadata"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "bucket": {
              "type": "string"
            },
            "fid": {
              "type": "string"
            }
          },
          "required": [
            "bucket",
            "fid"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/storage.ts"
        ]
      }
    },
    {
      "port_id": "bookings.list_resources",
      "entitlement": "cloud",
      "bff": {
        "method": "GET",
        "path": "/api/bookings/resources",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "GET",
        "path": "/v1/projects/:project_id/bookings/resources"
      },
      "schema": {
        "request_body": null,
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "resources": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "resource_key": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "timezone": {
                    "type": "string"
                  },
                  "duration_minutes": {
                    "type": "number"
                  },
                  "buffer_minutes": {
                    "type": "number"
                  }
                },
                "required": [
                  "id",
                  "resource_key"
                ],
                "additionalProperties": true
              }
            }
          },
          "required": [
            "resources"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/bookings.ts"
        ]
      }
    },
    {
      "port_id": "bookings.upsert_resource",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/bookings/resources",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/bookings/resources"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "resource_key": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "timezone": {
              "type": "string"
            },
            "duration_minutes": {
              "type": "number"
            },
            "buffer_minutes": {
              "type": "number"
            },
            "hours": {},
            "source": {
              "type": "string"
            },
            "connection_id": {
              "type": "string"
            },
            "external_id": {
              "type": "string"
            }
          },
          "required": [
            "resource_key"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "resource": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "resource_key": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "timezone": {
                  "type": "string"
                },
                "duration_minutes": {
                  "type": "number"
                },
                "buffer_minutes": {
                  "type": "number"
                }
              },
              "required": [
                "id",
                "resource_key"
              ],
              "additionalProperties": true
            }
          },
          "required": [
            "resource"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          201
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/bookings.ts"
        ]
      }
    },
    {
      "port_id": "bookings.availability",
      "entitlement": "cloud",
      "bff": {
        "method": "GET",
        "path": "/api/bookings/resources/:resource_key/availability",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "GET",
        "path": "/v1/projects/:project_id/bookings/resources/:resource_key/availability"
      },
      "schema": {
        "request_body": null,
        "query": {
          "type": "object",
          "properties": {
            "from": {
              "type": "string"
            },
            "to": {
              "type": "string"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "resource_key": {
              "type": "string"
            },
            "timezone": {
              "type": "string"
            },
            "slots": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "starts_at": {
                    "type": "string"
                  },
                  "ends_at": {
                    "type": "string"
                  }
                },
                "required": [
                  "starts_at",
                  "ends_at"
                ],
                "additionalProperties": true
              }
            }
          },
          "required": [
            "resource_key",
            "timezone",
            "slots"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "resource_key": {
              "type": "string"
            }
          },
          "required": [
            "resource_key"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/bookings.ts"
        ]
      }
    },
    {
      "port_id": "bookings.reserve",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/bookings/reserve",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/bookings/reserve"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "resource_key": {
              "type": "string"
            },
            "starts_at": {
              "type": "string"
            },
            "ends_at": {
              "type": "string"
            },
            "confirm": {
              "type": "boolean"
            },
            "hold_minutes": {
              "type": "number"
            },
            "idempotency_key": {
              "type": "string"
            },
            "customer_email": {
              "type": "string"
            },
            "customer_name": {
              "type": "string"
            },
            "customer_phone": {
              "type": "string"
            },
            "notes": {
              "type": "string"
            },
            "source": {
              "type": "string"
            }
          },
          "required": [
            "resource_key",
            "starts_at"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "reservation": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "resource_id": {
                  "type": "string"
                },
                "starts_at": {
                  "type": "string"
                },
                "ends_at": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                }
              },
              "required": [
                "id"
              ],
              "additionalProperties": true
            }
          },
          "required": [
            "reservation"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          201
        ],
        "notes": [
          "Synchronous reservation; returns 409 if the slot is taken."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/bookings.ts"
        ]
      }
    },
    {
      "port_id": "bookings.get",
      "entitlement": "cloud",
      "bff": {
        "method": "GET",
        "path": "/api/bookings/:reservation_id",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "GET",
        "path": "/v1/projects/:project_id/bookings/:reservation_id"
      },
      "schema": {
        "request_body": null,
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "reservation": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "resource_id": {
                  "type": "string"
                },
                "starts_at": {
                  "type": "string"
                },
                "ends_at": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                }
              },
              "required": [
                "id"
              ],
              "additionalProperties": true
            }
          },
          "required": [
            "reservation"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "reservation_id": {
              "type": "string"
            }
          },
          "required": [
            "reservation_id"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/bookings.ts"
        ]
      }
    },
    {
      "port_id": "bookings.cancel",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/bookings/:reservation_id/cancel",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/bookings/:reservation_id/cancel"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "reservation": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "resource_id": {
                  "type": "string"
                },
                "starts_at": {
                  "type": "string"
                },
                "ends_at": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                }
              },
              "required": [
                "id"
              ],
              "additionalProperties": true
            }
          },
          "required": [
            "reservation"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "reservation_id": {
              "type": "string"
            }
          },
          "required": [
            "reservation_id"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/bookings.ts"
        ]
      }
    },
    {
      "port_id": "jobs.email_send",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/jobs/email.send",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "queue",
        "method": "POST",
        "path": "/v1/projects/:project_id/jobs",
        "request_type": "email.send"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "payload": {
              "type": "object",
              "properties": {
                "to": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "email"
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "email"
                      },
                      "minItems": 1
                    }
                  ]
                },
                "from": {
                  "type": "string",
                  "minLength": 1
                },
                "reply_to": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "email"
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "email"
                      },
                      "minItems": 1
                    }
                  ]
                },
                "cc": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "email"
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "email"
                      },
                      "minItems": 1
                    }
                  ]
                },
                "bcc": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "email"
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "email"
                      },
                      "minItems": 1
                    }
                  ]
                },
                "subject": {
                  "type": "string",
                  "minLength": 1
                },
                "text": {
                  "type": "string"
                },
                "html": {
                  "type": "string"
                },
                "headers": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "object",
                        "additionalProperties": {}
                      }
                    ]
                  }
                },
                "internal": {
                  "type": "boolean"
                },
                "delivery_scope": {
                  "type": "string",
                  "enum": [
                    "internal",
                    "connector"
                  ]
                },
                "connector_key": {
                  "type": "string",
                  "minLength": 1
                },
                "connection_id": {
                  "type": "string",
                  "minLength": 1
                },
                "action": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "subject"
              ],
              "additionalProperties": false,
              "x-runtime-refinement": "(val, ctx) => {\n            const result = check(val);\n            const setError = () => ctx.addIssue({\n                code: ZodError_js_1.ZodIssueCode.custom,\n                ...getIssueProperties(val),\n            });\n            if (typeof Promise !== \"undefined\" && result instanceof Promise) {\n                return result.then((data) => {\n                    if (!data) {\n                        setError();\n                        return false;\n                    }\n                    else {\n                        return true;\n                    }\n                });\n            }\n            if (!result) {\n                setError();\n                return false;\n            }\n            else {\n                return true;\n            }\n        }",
              "anyOf": [
                {
                  "required": [
                    "text"
                  ]
                },
                {
                  "required": [
                    "html"
                  ]
                }
              ]
            },
            "idempotency_key": {
              "type": "string"
            }
          },
          "required": [
            "payload"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "poll_url": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "job_id",
            "status",
            "poll_url"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Canonical request is {payload: ...}. Supply Idempotency-Key header (or idempotency_key body field). Reuse the same key on retries. Poll the returned app URL; acceptance is not completion. Unwrapped payloads are also accepted by the adapter."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            },
            "Idempotency-Key": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/project-jobs.ts",
          "packages/shared/src/request-payloads.ts"
        ]
      }
    },
    {
      "port_id": "jobs.form_forward",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/jobs/form.forward",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "queue",
        "method": "POST",
        "path": "/v1/projects/:project_id/jobs",
        "request_type": "form.forward"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "payload": {
              "type": "object",
              "properties": {
                "target_url": {
                  "type": "string",
                  "format": "uri"
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "GET",
                    "POST"
                  ]
                },
                "fields": {
                  "type": "object",
                  "additionalProperties": {}
                }
              },
              "required": [
                "target_url"
              ],
              "additionalProperties": false
            },
            "idempotency_key": {
              "type": "string"
            }
          },
          "required": [
            "payload"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "poll_url": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "job_id",
            "status",
            "poll_url"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Canonical request is {payload: ...}. Supply Idempotency-Key header (or idempotency_key body field). Reuse the same key on retries. Poll the returned app URL; acceptance is not completion. Unwrapped payloads are also accepted by the adapter."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            },
            "Idempotency-Key": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/project-jobs.ts",
          "packages/shared/src/request-payloads.ts"
        ]
      }
    },
    {
      "port_id": "jobs.webhook_dispatch",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/jobs/webhook.dispatch",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "queue",
        "method": "POST",
        "path": "/v1/projects/:project_id/jobs",
        "request_type": "webhook.dispatch"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "payload": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "GET",
                    "POST",
                    "PUT",
                    "PATCH"
                  ],
                  "default": "POST"
                },
                "headers": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                },
                "body": {},
                "data": {},
                "secret": {
                  "type": "string"
                }
              },
              "required": [
                "url"
              ],
              "additionalProperties": false
            },
            "idempotency_key": {
              "type": "string"
            }
          },
          "required": [
            "payload"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "poll_url": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "job_id",
            "status",
            "poll_url"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Canonical request is {payload: ...}. Supply Idempotency-Key header (or idempotency_key body field). Reuse the same key on retries. Poll the returned app URL; acceptance is not completion. Unwrapped payloads are also accepted by the adapter."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            },
            "Idempotency-Key": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/project-jobs.ts",
          "packages/shared/src/request-payloads.ts"
        ]
      }
    },
    {
      "port_id": "jobs.integration_execute",
      "entitlement": "integrations.execute",
      "bff": {
        "method": "POST",
        "path": "/api/jobs/integration.execute",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "queue",
        "method": "POST",
        "path": "/v1/projects/:project_id/jobs",
        "request_type": "integration.execute"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "payload": {
              "type": "object",
              "properties": {
                "connection_id": {
                  "type": "string",
                  "minLength": 1
                },
                "action": {
                  "type": "string",
                  "minLength": 1
                },
                "input": {
                  "type": "object",
                  "additionalProperties": {},
                  "default": {}
                },
                "approval_token": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "connection_id",
                "action"
              ],
              "additionalProperties": false
            },
            "idempotency_key": {
              "type": "string"
            }
          },
          "required": [
            "payload"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "poll_url": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "job_id",
            "status",
            "poll_url"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Canonical request is {payload: ...}. Supply Idempotency-Key header (or idempotency_key body field). Reuse the same key on retries. Poll the returned app URL; acceptance is not completion. Unwrapped payloads are also accepted by the adapter."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            },
            "Idempotency-Key": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/project-jobs.ts",
          "packages/shared/src/request-payloads.ts"
        ]
      }
    },
    {
      "port_id": "jobs.dropbox_import",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/jobs/dropbox.import",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "queue",
        "method": "POST",
        "path": "/v1/projects/:project_id/jobs",
        "request_type": "dropbox.import"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "payload": {
              "type": "object",
              "properties": {
                "dropbox_url": {
                  "type": "string",
                  "format": "uri"
                },
                "bucket_name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "default": "dropbox-imports"
                },
                "extract_archive": {
                  "type": "boolean",
                  "default": true
                },
                "filename_hint": {
                  "type": "string",
                  "maxLength": 255
                }
              },
              "required": [
                "dropbox_url"
              ],
              "additionalProperties": false
            },
            "idempotency_key": {
              "type": "string"
            }
          },
          "required": [
            "payload"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "poll_url": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "job_id",
            "status",
            "poll_url"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Canonical request is {payload: ...}. Supply Idempotency-Key header (or idempotency_key body field). Reuse the same key on retries. Poll the returned app URL; acceptance is not completion. Unwrapped payloads are also accepted by the adapter."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            },
            "Idempotency-Key": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/project-jobs.ts",
          "packages/shared/src/request-payloads.ts"
        ]
      }
    },
    {
      "port_id": "jobs.storage_extract",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/jobs/storage.extract",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "queue",
        "method": "POST",
        "path": "/v1/projects/:project_id/jobs",
        "request_type": "storage.extract"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "payload": {
              "type": "object",
              "properties": {
                "bucket_name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                "source_file_id": {
                  "type": "string",
                  "minLength": 1
                },
                "entry_offset": {
                  "type": "integer",
                  "minimum": 0,
                  "default": 0
                },
                "entry_limit": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 100,
                  "default": 25
                },
                "parent_job_id": {
                  "type": "string",
                  "minLength": 1
                },
                "delete_source_after_extract": {
                  "type": "boolean",
                  "default": false
                }
              },
              "required": [
                "bucket_name",
                "source_file_id"
              ],
              "additionalProperties": false
            },
            "idempotency_key": {
              "type": "string"
            }
          },
          "required": [
            "payload"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "poll_url": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "job_id",
            "status",
            "poll_url"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Canonical request is {payload: ...}. Supply Idempotency-Key header (or idempotency_key body field). Reuse the same key on retries. Poll the returned app URL; acceptance is not completion. Unwrapped payloads are also accepted by the adapter."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            },
            "Idempotency-Key": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/project-jobs.ts",
          "packages/shared/src/request-payloads.ts"
        ]
      }
    },
    {
      "port_id": "jobs.voice_call_outbound",
      "entitlement": "voice.enabled",
      "bff": {
        "method": "POST",
        "path": "/api/jobs/voice.call.outbound",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "queue",
        "method": "POST",
        "path": "/v1/projects/:project_id/jobs",
        "request_type": "voice.call.outbound"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "payload": {
              "type": "object",
              "properties": {
                "to": {
                  "type": "string",
                  "minLength": 1
                },
                "from": {
                  "type": "string",
                  "minLength": 1
                },
                "agent_id": {
                  "type": "string",
                  "minLength": 1
                },
                "twiml_url": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "required": [
                "to"
              ],
              "additionalProperties": false
            },
            "idempotency_key": {
              "type": "string"
            }
          },
          "required": [
            "payload"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "poll_url": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "job_id",
            "status",
            "poll_url"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Canonical request is {payload: ...}. Supply Idempotency-Key header (or idempotency_key body field). Reuse the same key on retries. Poll the returned app URL; acceptance is not completion. Unwrapped payloads are also accepted by the adapter."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            },
            "Idempotency-Key": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/project-jobs.ts",
          "packages/shared/src/request-payloads.ts"
        ]
      }
    },
    {
      "port_id": "jobs.voice_tool_execute",
      "entitlement": "voice.enabled",
      "bff": {
        "method": "POST",
        "path": "/api/jobs/voice.tool.execute",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "queue",
        "method": "POST",
        "path": "/v1/projects/:project_id/jobs",
        "request_type": "voice.tool.execute"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "payload": {
              "type": "object",
              "properties": {
                "tool_name": {
                  "type": "string",
                  "minLength": 1
                },
                "arguments": {
                  "type": "object",
                  "additionalProperties": {},
                  "default": {}
                },
                "call_id": {
                  "type": "string",
                  "minLength": 1
                },
                "call_sid": {
                  "type": "string",
                  "minLength": 1
                },
                "project_id": {
                  "type": "string",
                  "minLength": 1
                },
                "function_call_id": {
                  "type": "string",
                  "minLength": 1
                },
                "webhook_url": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "required": [
                "tool_name",
                "call_id",
                "call_sid",
                "project_id",
                "function_call_id"
              ],
              "additionalProperties": false
            },
            "idempotency_key": {
              "type": "string"
            }
          },
          "required": [
            "payload"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "poll_url": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "job_id",
            "status",
            "poll_url"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Canonical request is {payload: ...}. Supply Idempotency-Key header (or idempotency_key body field). Reuse the same key on retries. Poll the returned app URL; acceptance is not completion. Unwrapped payloads are also accepted by the adapter."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            },
            "Idempotency-Key": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/project-jobs.ts",
          "packages/shared/src/request-payloads.ts"
        ]
      }
    },
    {
      "port_id": "jobs.booking_reserve",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/jobs/booking.reserve",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "queue",
        "method": "POST",
        "path": "/v1/projects/:project_id/jobs",
        "request_type": "booking.reserve"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "payload": {
              "type": "object",
              "properties": {
                "resource_key": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "starts_at": {
                  "type": "string",
                  "minLength": 1
                },
                "ends_at": {
                  "type": "string",
                  "minLength": 1
                },
                "membership_record_id": {
                  "type": "string",
                  "minLength": 1
                },
                "customer_email": {
                  "type": "string",
                  "format": "email"
                },
                "customer_name": {
                  "type": "string",
                  "maxLength": 200
                },
                "customer_phone": {
                  "type": "string",
                  "maxLength": 40
                },
                "notes": {
                  "type": "string",
                  "maxLength": 2000
                },
                "hold_minutes": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 240
                },
                "confirm": {
                  "type": "boolean",
                  "default": true
                },
                "reminder_offsets_minutes": {
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10080
                  }
                },
                "reminder_channel": {
                  "type": "string",
                  "enum": [
                    "email",
                    "sms"
                  ]
                },
                "reminder_connection_id": {
                  "type": "string",
                  "minLength": 1
                },
                "reminder_action": {
                  "type": "string",
                  "minLength": 1
                },
                "calendar_connection_id": {
                  "type": "string",
                  "minLength": 1
                },
                "calendar_action": {
                  "type": "string",
                  "minLength": 1
                },
                "calendar_event_type": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "resource_key",
                "starts_at"
              ],
              "additionalProperties": false
            },
            "idempotency_key": {
              "type": "string"
            }
          },
          "required": [
            "payload"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "poll_url": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "job_id",
            "status",
            "poll_url"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Canonical request is {payload: ...}. Supply Idempotency-Key header (or idempotency_key body field). Reuse the same key on retries. Poll the returned app URL; acceptance is not completion. Unwrapped payloads are also accepted by the adapter."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            },
            "Idempotency-Key": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/project-jobs.ts",
          "packages/shared/src/request-payloads.ts"
        ]
      }
    },
    {
      "port_id": "jobs.booking_cancel",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/jobs/booking.cancel",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "queue",
        "method": "POST",
        "path": "/v1/projects/:project_id/jobs",
        "request_type": "booking.cancel"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "payload": {
              "type": "object",
              "properties": {
                "reservation_id": {
                  "type": "string",
                  "minLength": 1
                },
                "reason": {
                  "type": "string",
                  "maxLength": 500
                }
              },
              "required": [
                "reservation_id"
              ],
              "additionalProperties": false
            },
            "idempotency_key": {
              "type": "string"
            }
          },
          "required": [
            "payload"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "poll_url": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "job_id",
            "status",
            "poll_url"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Canonical request is {payload: ...}. Supply Idempotency-Key header (or idempotency_key body field). Reuse the same key on retries. Poll the returned app URL; acceptance is not completion. Unwrapped payloads are also accepted by the adapter."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            },
            "Idempotency-Key": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/project-jobs.ts",
          "packages/shared/src/request-payloads.ts"
        ]
      }
    },
    {
      "port_id": "jobs.inventory_reserve",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/jobs/inventory.reserve",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "queue",
        "method": "POST",
        "path": "/v1/projects/:project_id/jobs",
        "request_type": "inventory.reserve"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "payload": {
              "type": "object",
              "properties": {
                "record_id": {
                  "type": "string",
                  "minLength": 1
                },
                "quantity": {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                "reference_type": {
                  "type": "string",
                  "maxLength": 60
                },
                "reference_id": {
                  "type": "string",
                  "maxLength": 200
                }
              },
              "required": [
                "record_id",
                "quantity"
              ],
              "additionalProperties": false
            },
            "idempotency_key": {
              "type": "string"
            }
          },
          "required": [
            "payload"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "poll_url": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "job_id",
            "status",
            "poll_url"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Canonical request is {payload: ...}. Supply Idempotency-Key header (or idempotency_key body field). Reuse the same key on retries. Poll the returned app URL; acceptance is not completion. Unwrapped payloads are also accepted by the adapter."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            },
            "Idempotency-Key": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/project-jobs.ts",
          "packages/shared/src/request-payloads.ts"
        ]
      }
    },
    {
      "port_id": "jobs.inventory_release",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/jobs/inventory.release",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "queue",
        "method": "POST",
        "path": "/v1/projects/:project_id/jobs",
        "request_type": "inventory.release"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "payload": {
              "type": "object",
              "properties": {
                "reservation_id": {
                  "type": "string",
                  "minLength": 1
                },
                "reason": {
                  "type": "string",
                  "maxLength": 500
                }
              },
              "required": [
                "reservation_id"
              ],
              "additionalProperties": false
            },
            "idempotency_key": {
              "type": "string"
            }
          },
          "required": [
            "payload"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "poll_url": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "job_id",
            "status",
            "poll_url"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Canonical request is {payload: ...}. Supply Idempotency-Key header (or idempotency_key body field). Reuse the same key on retries. Poll the returned app URL; acceptance is not completion. Unwrapped payloads are also accepted by the adapter."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            },
            "Idempotency-Key": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/project-jobs.ts",
          "packages/shared/src/request-payloads.ts"
        ]
      }
    },
    {
      "port_id": "jobs.inventory_commit",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/jobs/inventory.commit",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "queue",
        "method": "POST",
        "path": "/v1/projects/:project_id/jobs",
        "request_type": "inventory.commit"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "payload": {
              "type": "object",
              "properties": {
                "reservation_id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "reservation_id"
              ],
              "additionalProperties": false
            },
            "idempotency_key": {
              "type": "string"
            }
          },
          "required": [
            "payload"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "poll_url": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "job_id",
            "status",
            "poll_url"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Canonical request is {payload: ...}. Supply Idempotency-Key header (or idempotency_key body field). Reuse the same key on retries. Poll the returned app URL; acceptance is not completion. Unwrapped payloads are also accepted by the adapter."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            },
            "Idempotency-Key": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/project-jobs.ts",
          "packages/shared/src/request-payloads.ts"
        ]
      }
    },
    {
      "port_id": "jobs.record_renew",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/jobs/record.renew",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "queue",
        "method": "POST",
        "path": "/v1/projects/:project_id/jobs",
        "request_type": "record.renew"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "payload": {
              "type": "object",
              "properties": {
                "entity_key": {
                  "type": "string"
                },
                "record_id": {
                  "type": "string",
                  "minLength": 1
                },
                "date_field": {
                  "type": "string"
                },
                "renewal_days": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3650
                }
              },
              "required": [
                "entity_key",
                "record_id",
                "date_field",
                "renewal_days"
              ],
              "additionalProperties": false
            },
            "idempotency_key": {
              "type": "string"
            }
          },
          "required": [
            "payload"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "poll_url": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "job_id",
            "status",
            "poll_url"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Canonical request is {payload: ...}. Supply Idempotency-Key header (or idempotency_key body field). Reuse the same key on retries. Poll the returned app URL; acceptance is not completion. Unwrapped payloads are also accepted by the adapter."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            },
            "Idempotency-Key": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/project-jobs.ts",
          "packages/shared/src/request-payloads.ts"
        ]
      }
    },
    {
      "port_id": "jobs.workforce_shift_assign",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/jobs/workforce.shift_assign",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "queue",
        "method": "POST",
        "path": "/v1/projects/:project_id/jobs",
        "request_type": "workforce.shift_assign"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "payload": {
              "type": "object",
              "properties": {
                "worker_record_id": {
                  "type": "string",
                  "minLength": 1
                },
                "starts_at": {
                  "type": "string",
                  "minLength": 1
                },
                "ends_at": {
                  "type": "string",
                  "minLength": 1
                },
                "reference_type": {
                  "type": "string",
                  "maxLength": 60
                },
                "reference_id": {
                  "type": "string",
                  "maxLength": 200
                }
              },
              "required": [
                "worker_record_id",
                "starts_at",
                "ends_at"
              ],
              "additionalProperties": false
            },
            "idempotency_key": {
              "type": "string"
            }
          },
          "required": [
            "payload"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "poll_url": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "job_id",
            "status",
            "poll_url"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Canonical request is {payload: ...}. Supply Idempotency-Key header (or idempotency_key body field). Reuse the same key on retries. Poll the returned app URL; acceptance is not completion. Unwrapped payloads are also accepted by the adapter."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            },
            "Idempotency-Key": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/project-jobs.ts",
          "packages/shared/src/request-payloads.ts"
        ]
      }
    },
    {
      "port_id": "jobs.workforce_shift_release",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/jobs/workforce.shift_release",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "queue",
        "method": "POST",
        "path": "/v1/projects/:project_id/jobs",
        "request_type": "workforce.shift_release"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "payload": {
              "type": "object",
              "properties": {
                "assignment_id": {
                  "type": "string",
                  "minLength": 1
                },
                "reason": {
                  "type": "string",
                  "maxLength": 500
                }
              },
              "required": [
                "assignment_id"
              ],
              "additionalProperties": false
            },
            "idempotency_key": {
              "type": "string"
            }
          },
          "required": [
            "payload"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "poll_url": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "job_id",
            "status",
            "poll_url"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Canonical request is {payload: ...}. Supply Idempotency-Key header (or idempotency_key body field). Reuse the same key on retries. Poll the returned app URL; acceptance is not completion. Unwrapped payloads are also accepted by the adapter."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            },
            "Idempotency-Key": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/project-jobs.ts",
          "packages/shared/src/request-payloads.ts"
        ]
      }
    },
    {
      "port_id": "inventory.reservations.list",
      "entitlement": "cloud",
      "bff": {
        "method": "GET",
        "path": "/api/inventory/reservations",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "GET",
        "path": "/v1/projects/:project_id/inventory/reservations"
      },
      "schema": {
        "request_body": null,
        "query": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "active",
                "released"
              ]
            },
            "inventory_record_id": {
              "type": "string"
            },
            "limit": {
              "type": "integer"
            },
            "cursor": {
              "type": "string"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "reservations": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "workspace_id": {
                    "type": "string"
                  },
                  "project_id": {
                    "type": "string"
                  },
                  "inventory_record_id": {
                    "type": "string"
                  },
                  "quantity": {
                    "type": "number"
                  },
                  "status": {
                    "type": "string"
                  },
                  "reference_type": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reference_id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "updated_at": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "project_id",
                  "inventory_record_id",
                  "quantity",
                  "status",
                  "created_at"
                ],
                "additionalProperties": true
              }
            },
            "next_cursor": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "reservations",
            "next_cursor"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/inventory-reservations.ts"
        ]
      }
    },
    {
      "port_id": "inventory.reservations.get",
      "entitlement": "cloud",
      "bff": {
        "method": "GET",
        "path": "/api/inventory/reservations/:id",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "GET",
        "path": "/v1/projects/:project_id/inventory/reservations/:id"
      },
      "schema": {
        "request_body": null,
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "reservation": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "workspace_id": {
                  "type": "string"
                },
                "project_id": {
                  "type": "string"
                },
                "inventory_record_id": {
                  "type": "string"
                },
                "quantity": {
                  "type": "number"
                },
                "status": {
                  "type": "string"
                },
                "reference_type": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "reference_id": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "created_at": {
                  "type": "string"
                },
                "updated_at": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "project_id",
                "inventory_record_id",
                "quantity",
                "status",
                "created_at"
              ],
              "additionalProperties": true
            }
          },
          "required": [
            "reservation"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            }
          },
          "required": [
            "id"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/inventory-reservations.ts"
        ]
      }
    },
    {
      "port_id": "workforce.shifts.list",
      "entitlement": "cloud",
      "bff": {
        "method": "GET",
        "path": "/api/workforce/shifts",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "GET",
        "path": "/v1/projects/:project_id/workforce/shifts"
      },
      "schema": {
        "request_body": null,
        "query": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "assigned",
                "cancelled"
              ]
            },
            "worker_record_id": {
              "type": "string"
            },
            "starts_after": {
              "type": "string"
            },
            "starts_before": {
              "type": "string"
            },
            "limit": {
              "type": "integer"
            },
            "cursor": {
              "type": "string"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "shifts": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "workspace_id": {
                    "type": "string"
                  },
                  "project_id": {
                    "type": "string"
                  },
                  "worker_record_id": {
                    "type": "string"
                  },
                  "starts_at": {
                    "type": "string"
                  },
                  "ends_at": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string"
                  },
                  "reference_type": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reference_id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "updated_at": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "project_id",
                  "worker_record_id",
                  "starts_at",
                  "ends_at",
                  "status",
                  "created_at"
                ],
                "additionalProperties": true
              }
            },
            "next_cursor": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "shifts",
            "next_cursor"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/workforce-shifts.ts"
        ]
      }
    },
    {
      "port_id": "workforce.shifts.get",
      "entitlement": "cloud",
      "bff": {
        "method": "GET",
        "path": "/api/workforce/shifts/:id",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "GET",
        "path": "/v1/projects/:project_id/workforce/shifts/:id"
      },
      "schema": {
        "request_body": null,
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "shift": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "workspace_id": {
                  "type": "string"
                },
                "project_id": {
                  "type": "string"
                },
                "worker_record_id": {
                  "type": "string"
                },
                "starts_at": {
                  "type": "string"
                },
                "ends_at": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "reference_type": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "reference_id": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "created_at": {
                  "type": "string"
                },
                "updated_at": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "project_id",
                "worker_record_id",
                "starts_at",
                "ends_at",
                "status",
                "created_at"
              ],
              "additionalProperties": true
            }
          },
          "required": [
            "shift"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            }
          },
          "required": [
            "id"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/workforce-shifts.ts"
        ]
      }
    },
    {
      "port_id": "jobs.reminder_send",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/jobs/reminder.send",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "queue",
        "method": "POST",
        "path": "/v1/projects/:project_id/jobs",
        "request_type": "reminder.send"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "payload": {
              "type": "object",
              "properties": {
                "channel": {
                  "type": "string",
                  "enum": [
                    "email",
                    "sms"
                  ]
                },
                "to": {
                  "type": "string",
                  "minLength": 1
                },
                "subject": {
                  "type": "string",
                  "maxLength": 300
                },
                "text": {
                  "type": "string",
                  "minLength": 1
                },
                "html": {
                  "type": "string"
                },
                "connection_id": {
                  "type": "string",
                  "minLength": 1
                },
                "action": {
                  "type": "string",
                  "minLength": 1
                },
                "reservation_id": {
                  "type": "string",
                  "minLength": 1
                },
                "reminder_id": {
                  "type": "string",
                  "minLength": 1
                },
                "client_id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "channel",
                "to"
              ],
              "additionalProperties": false,
              "x-runtime-refinement": "(val, ctx) => {\n            const result = check(val);\n            const setError = () => ctx.addIssue({\n                code: ZodError_js_1.ZodIssueCode.custom,\n                ...getIssueProperties(val),\n            });\n            if (typeof Promise !== \"undefined\" && result instanceof Promise) {\n                return result.then((data) => {\n                    if (!data) {\n                        setError();\n                        return false;\n                    }\n                    else {\n                        return true;\n                    }\n                });\n            }\n            if (!result) {\n                setError();\n                return false;\n            }\n            else {\n                return true;\n            }\n        }",
              "anyOf": [
                {
                  "required": [
                    "text"
                  ]
                },
                {
                  "required": [
                    "html"
                  ],
                  "properties": {
                    "html": {
                      "minLength": 1
                    }
                  }
                }
              ]
            },
            "idempotency_key": {
              "type": "string"
            }
          },
          "required": [
            "payload"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "poll_url": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "job_id",
            "status",
            "poll_url"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Canonical request is {payload: ...}. Supply Idempotency-Key header (or idempotency_key body field). Reuse the same key on retries. Poll the returned app URL; acceptance is not completion. Unwrapped payloads are also accepted by the adapter."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            },
            "Idempotency-Key": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/project-jobs.ts",
          "packages/shared/src/request-payloads.ts"
        ]
      }
    },
    {
      "port_id": "jobs.reminder_schedule",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/jobs/reminder.schedule",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "queue",
        "method": "POST",
        "path": "/v1/projects/:project_id/jobs",
        "request_type": "reminder.schedule"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "payload": {
              "type": "object",
              "properties": {
                "channel": {
                  "type": "string",
                  "enum": [
                    "email",
                    "sms"
                  ]
                },
                "to": {
                  "type": "string",
                  "minLength": 1
                },
                "send_at": {
                  "type": "string",
                  "minLength": 1
                },
                "subject": {
                  "type": "string",
                  "maxLength": 300
                },
                "text": {
                  "type": "string",
                  "minLength": 1
                },
                "html": {
                  "type": "string"
                },
                "connection_id": {
                  "type": "string",
                  "minLength": 1
                },
                "action": {
                  "type": "string",
                  "minLength": 1
                },
                "reservation_id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "channel",
                "to",
                "send_at"
              ],
              "additionalProperties": false,
              "x-runtime-refinement": "(val, ctx) => {\n            const result = check(val);\n            const setError = () => ctx.addIssue({\n                code: ZodError_js_1.ZodIssueCode.custom,\n                ...getIssueProperties(val),\n            });\n            if (typeof Promise !== \"undefined\" && result instanceof Promise) {\n                return result.then((data) => {\n                    if (!data) {\n                        setError();\n                        return false;\n                    }\n                    else {\n                        return true;\n                    }\n                });\n            }\n            if (!result) {\n                setError();\n                return false;\n            }\n            else {\n                return true;\n            }\n        }",
              "anyOf": [
                {
                  "required": [
                    "text"
                  ]
                },
                {
                  "required": [
                    "html"
                  ],
                  "properties": {
                    "html": {
                      "minLength": 1
                    }
                  }
                }
              ],
              "allOf": [
                {
                  "if": {
                    "properties": {
                      "channel": {
                        "const": "sms"
                      }
                    },
                    "required": [
                      "channel"
                    ]
                  },
                  "then": {
                    "required": [
                      "connection_id"
                    ]
                  }
                }
              ]
            },
            "idempotency_key": {
              "type": "string"
            }
          },
          "required": [
            "payload"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "poll_url": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "job_id",
            "status",
            "poll_url"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Canonical request is {payload: ...}. Supply Idempotency-Key header (or idempotency_key body field). Reuse the same key on retries. Poll the returned app URL; acceptance is not completion. Unwrapped payloads are also accepted by the adapter."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            },
            "Idempotency-Key": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/project-jobs.ts",
          "packages/shared/src/request-payloads.ts"
        ]
      }
    },
    {
      "port_id": "jobs.payment_checkout_create",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/jobs/payment.checkout.create",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "queue",
        "method": "POST",
        "path": "/v1/projects/:project_id/jobs",
        "request_type": "payment.checkout.create"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "payload": {
              "type": "object",
              "properties": {
                "connection_id": {
                  "type": "string",
                  "minLength": 1
                },
                "success_url": {
                  "type": "string",
                  "format": "uri"
                },
                "cancel_url": {
                  "type": "string",
                  "format": "uri"
                },
                "items": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "price_record_id": {
                        "type": "string",
                        "minLength": 1
                      },
                      "quantity": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 9999
                      }
                    },
                    "required": [
                      "price_record_id"
                    ],
                    "additionalProperties": false
                  },
                  "minItems": 1
                },
                "customer_email": {
                  "type": "string",
                  "format": "email"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "checkout",
                    "upsell",
                    "additional_purchase",
                    "balance_due"
                  ]
                },
                "capture_mode": {
                  "type": "string",
                  "enum": [
                    "immediate",
                    "manual"
                  ]
                },
                "related_order_id": {
                  "type": "string",
                  "minLength": 1
                },
                "metadata": {
                  "type": "object",
                  "additionalProperties": {}
                }
              },
              "required": [
                "success_url",
                "cancel_url",
                "items"
              ],
              "additionalProperties": false,
              "x-runtime-refinement": "(value, ctx) => {\n    const kind = value.kind ?? \"checkout\";\n    if (kind !== \"checkout\" && !value.related_order_id) {\n        ctx.addIssue({\n            code: zod_1.z.ZodIssueCode.custom,\n            message: `${kind} requires related_order_id`,\n            path: [\"related_order_id\"],\n        });\n    }\n}"
            },
            "idempotency_key": {
              "type": "string"
            }
          },
          "required": [
            "payload"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "poll_url": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "job_id",
            "status",
            "poll_url"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Canonical request is {payload: ...}. Supply Idempotency-Key header (or idempotency_key body field). Reuse the same key on retries. Poll the returned app URL; acceptance is not completion. Unwrapped payloads are also accepted by the adapter."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            },
            "Idempotency-Key": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/project-jobs.ts",
          "packages/shared/src/request-payloads.ts"
        ]
      }
    },
    {
      "port_id": "jobs.payment_capture",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/jobs/payment.capture",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "queue",
        "method": "POST",
        "path": "/v1/projects/:project_id/jobs",
        "request_type": "payment.capture"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "payload": {
              "type": "object",
              "properties": {
                "connection_id": {
                  "type": "string",
                  "minLength": 1
                },
                "order_id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "order_id"
              ],
              "additionalProperties": false
            },
            "idempotency_key": {
              "type": "string"
            }
          },
          "required": [
            "payload"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "poll_url": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "job_id",
            "status",
            "poll_url"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Canonical request is {payload: ...}. Supply Idempotency-Key header (or idempotency_key body field). Reuse the same key on retries. Poll the returned app URL; acceptance is not completion. Unwrapped payloads are also accepted by the adapter."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            },
            "Idempotency-Key": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/project-jobs.ts",
          "packages/shared/src/request-payloads.ts"
        ]
      }
    },
    {
      "port_id": "jobs.payment_refund",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/jobs/payment.refund",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "queue",
        "method": "POST",
        "path": "/v1/projects/:project_id/jobs",
        "request_type": "payment.refund"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "payload": {
              "type": "object",
              "properties": {
                "connection_id": {
                  "type": "string",
                  "minLength": 1
                },
                "order_id": {
                  "type": "string",
                  "minLength": 1
                },
                "amount": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "required": [
                "order_id"
              ],
              "additionalProperties": false
            },
            "idempotency_key": {
              "type": "string"
            }
          },
          "required": [
            "payload"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "poll_url": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "job_id",
            "status",
            "poll_url"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Canonical request is {payload: ...}. Supply Idempotency-Key header (or idempotency_key body field). Reuse the same key on retries. Poll the returned app URL; acceptance is not completion. Unwrapped payloads are also accepted by the adapter."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            },
            "Idempotency-Key": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/project-jobs.ts",
          "packages/shared/src/request-payloads.ts"
        ]
      }
    },
    {
      "port_id": "jobs.payment_catalog_upsert",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/jobs/payment.catalog.upsert",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "queue",
        "method": "POST",
        "path": "/v1/projects/:project_id/jobs",
        "request_type": "payment.catalog.upsert"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "payload": {
              "type": "object",
              "properties": {
                "connection_id": {
                  "type": "string",
                  "minLength": 1
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255
                },
                "description": {
                  "type": "string",
                  "maxLength": 2000
                },
                "sku": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "product_record_id": {
                  "type": "string",
                  "minLength": 1
                },
                "price_record_id": {
                  "type": "string",
                  "minLength": 1
                },
                "unit_amount": {
                  "type": "integer",
                  "minimum": 1
                },
                "currency": {
                  "type": "string",
                  "minLength": 3,
                  "maxLength": 3
                },
                "interval": {
                  "type": "string",
                  "enum": [
                    "one_time",
                    "month",
                    "year"
                  ]
                },
                "active": {
                  "type": "boolean"
                }
              },
              "required": [
                "name",
                "unit_amount",
                "currency"
              ],
              "additionalProperties": false
            },
            "idempotency_key": {
              "type": "string"
            }
          },
          "required": [
            "payload"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "poll_url": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "job_id",
            "status",
            "poll_url"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Canonical request is {payload: ...}. Supply Idempotency-Key header (or idempotency_key body field). Reuse the same key on retries. Poll the returned app URL; acceptance is not completion. Unwrapped payloads are also accepted by the adapter."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            },
            "Idempotency-Key": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/project-jobs.ts",
          "packages/shared/src/request-payloads.ts"
        ]
      }
    },
    {
      "port_id": "jobs.get",
      "entitlement": "cloud",
      "bff": {
        "method": "GET",
        "path": "/api/jobs/:job_id",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "GET",
        "path": "/v1/projects/:project_id/jobs/:job_id"
      },
      "schema": {
        "request_body": null,
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "request_type": {
              "type": "string"
            },
            "result_available": {
              "type": "boolean"
            },
            "error": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string"
            },
            "updated_at": {
              "type": "string"
            }
          },
          "required": [
            "job_id",
            "status",
            "request_type",
            "result_available",
            "error",
            "created_at",
            "updated_at"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "job_id": {
              "type": "string"
            }
          },
          "required": [
            "job_id"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/requests.ts"
        ]
      }
    },
    {
      "port_id": "jobs.result",
      "entitlement": "cloud",
      "bff": {
        "method": "GET",
        "path": "/api/jobs/:job_id/result",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "GET",
        "path": "/v1/projects/:project_id/jobs/:job_id/result"
      },
      "schema": {
        "request_body": null,
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "result": {
              "type": "object",
              "additionalProperties": true,
              "description": "Provider/job-specific result. Consult the selected function or provider output schema."
            },
            "error": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "message"
              ],
              "additionalProperties": false
            },
            "artifact_ref": {
              "type": "string"
            }
          },
          "required": [
            "job_id",
            "status"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "409 until terminal; failed/dead_letter may return HTTP 200 with error. A terminal response is not proof of success.",
          "The installed generic adapter treats the 409 as a failure and replaces its body with {statusCode, message}, discarding job_id/status/error.code from Cloud\u2019s raw 409 payload. A generated app can only branch on the 409 status code while polling, never on fields inside that response body."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "job_id": {
              "type": "string"
            }
          },
          "required": [
            "job_id"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/requests.ts"
        ]
      }
    },
    {
      "port_id": "jobs.cancel",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/jobs/:job_id/cancel",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/jobs/:job_id/cancel"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "ok": {
              "const": true
            },
            "job_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            }
          },
          "required": [
            "ok",
            "job_id",
            "status"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "job_id": {
              "type": "string"
            }
          },
          "required": [
            "job_id"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/requests.ts"
        ]
      }
    },
    {
      "port_id": "ai.embed",
      "entitlement": "ai",
      "bff": {
        "method": "POST",
        "path": "/api/ai/embed",
        "auth": "session",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/ai/embed"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "text": {
              "type": "string"
            },
            "id": {
              "type": "string"
            },
            "entity_key": {
              "type": "string"
            },
            "record_id": {
              "type": "string"
            },
            "field_key": {
              "type": "string"
            },
            "metadata": {
              "type": "object",
              "additionalProperties": true,
              "description": "Application-defined fields; use the project entity/function schema."
            }
          },
          "required": [
            "text"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "dimensions": {
              "type": "integer"
            }
          },
          "required": [
            "id",
            "dimensions"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "metadata is currently accepted but discarded server-side; it is never stored or returned."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/ai.ts"
        ]
      }
    },
    {
      "port_id": "ai.search",
      "entitlement": "ai",
      "bff": {
        "method": "POST",
        "path": "/api/ai/search",
        "auth": "session",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/ai/search"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "query": {
              "type": "string"
            },
            "entity_key": {
              "type": "string"
            },
            "field_key": {
              "type": "string"
            },
            "top_k": {
              "type": "integer"
            }
          },
          "required": [
            "query",
            "entity_key",
            "field_key"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "results": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "score": {
                    "type": "number"
                  },
                  "record_id": {
                    "type": "string"
                  },
                  "record": {}
                },
                "required": [
                  "score",
                  "record_id"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "results"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/ai.ts"
        ]
      }
    },
    {
      "port_id": "ai.complete",
      "entitlement": "ai",
      "bff": {
        "method": "POST",
        "path": "/api/ai/complete",
        "auth": "session",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/ai/complete"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "model": {
              "type": "string"
            },
            "messages": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "role": {
                    "type": "string",
                    "enum": [
                      "system",
                      "user",
                      "assistant"
                    ]
                  },
                  "content": {
                    "type": "string"
                  }
                },
                "required": [
                  "role",
                  "content"
                ],
                "additionalProperties": false
              },
              "minItems": 1
            },
            "context": {
              "type": "object",
              "properties": {
                "query": {
                  "type": "string"
                },
                "entity_key": {
                  "type": "string"
                },
                "field_key": {
                  "type": "string"
                },
                "top_k": {
                  "type": "integer"
                },
                "max_context_tokens": {
                  "type": "integer"
                }
              },
              "required": [
                "query",
                "entity_key",
                "field_key"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "messages"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "content": {
              "type": "string"
            },
            "model": {
              "type": "string"
            },
            "usage": {
              "type": "object",
              "properties": {
                "input_tokens": {
                  "type": "integer"
                },
                "output_tokens": {
                  "type": "integer"
                }
              },
              "required": [
                "input_tokens",
                "output_tokens"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "content",
            "model",
            "usage"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "context.query/entity_key/field_key are not actually enforced as required by the handler; omitting them silently yields an empty RAG context instead of a 400. Treat them as required anyway \u2014 a silently empty context is rarely what you want."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/ai.ts"
        ]
      }
    },
    {
      "port_id": "functions.invoke",
      "entitlement": "cloud",
      "bff": {
        "method": "POST",
        "path": "/api/fn/:slug",
        "auth": "session",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/fn/:slug"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "additionalProperties": true,
          "description": "Application-defined fields; use the project entity/function schema."
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "description": "Function-specific JSON output; resolve output_schema for the selected slug in manifest.functions.system. No global field shape exists."
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Resolve input_schema and output_schema by slug from the function catalog. If absent, report that function-specific contract gap. Generic BFF accepts only JSON objects and JSON responses; private function policy cannot be bypassed with customer auth.",
          "On error, only status codes in [400,401,403,404,405,409,422,429,503] pass through; any other status the function returns collapses to a generic 502, and the function's own structured error body is always replaced with {statusCode, message}."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "slug": {
              "type": "string"
            }
          },
          "required": [
            "slug"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/functions.ts"
        ]
      }
    },
    {
      "port_id": "records.aggregate",
      "entitlement": "query_dsl_v1",
      "bff": {
        "method": "POST",
        "path": "/api/records/:entity/aggregate",
        "auth": "session",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/records/aggregate"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "where": {
              "$ref": "#/$defs/where"
            },
            "status": {
              "type": "string",
              "enum": [
                "active",
                "archived",
                "all"
              ]
            },
            "group_by": {
              "type": "array",
              "items": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "field"
                      },
                      "field": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "field"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "const": "date_bucket"
                      },
                      "field": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "object",
                            "properties": {
                              "indexed_date_field": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "indexed_date_field"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      },
                      "granularity": {
                        "type": "string",
                        "enum": [
                          "day",
                          "month",
                          "year"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "field",
                      "granularity"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "maxItems": 6
            },
            "measures": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "op": {
                    "type": "string",
                    "enum": [
                      "count",
                      "sum",
                      "avg",
                      "min",
                      "max"
                    ]
                  },
                  "field": {
                    "type": "string"
                  },
                  "alias": {
                    "type": "string"
                  }
                },
                "required": [
                  "op",
                  "alias"
                ],
                "additionalProperties": false
              },
              "minItems": 1,
              "maxItems": 10
            },
            "max_groups": {
              "type": "integer"
            }
          },
          "required": [
            "group_by",
            "measures"
          ],
          "additionalProperties": false,
          "$defs": {
            "where": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "and": {
                      "type": "array",
                      "items": {
                        "$ref": "#/$defs/where"
                      }
                    }
                  },
                  "required": [
                    "and"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "or": {
                      "type": "array",
                      "items": {
                        "$ref": "#/$defs/where"
                      },
                      "maxItems": 8
                    }
                  },
                  "required": [
                    "or"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "not": {
                      "$ref": "#/$defs/where"
                    }
                  },
                  "required": [
                    "not"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "field"
                    },
                    "field": {
                      "type": "string"
                    },
                    "op": {
                      "type": "string",
                      "enum": [
                        "eq",
                        "neq",
                        "gt",
                        "gte",
                        "lt",
                        "lte",
                        "in",
                        "not_in",
                        "contains",
                        "starts_with",
                        "between",
                        "is_null",
                        "field_exists"
                      ]
                    },
                    "value": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "number"
                              }
                            ]
                          }
                        }
                      ]
                    }
                  },
                  "required": [
                    "type",
                    "field",
                    "op"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "relation"
                    },
                    "direction": {
                      "type": "string",
                      "enum": [
                        "from",
                        "to"
                      ]
                    },
                    "relation_key": {
                      "type": "string"
                    },
                    "to_entity_key": {
                      "type": "string"
                    },
                    "from_entity_key": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "type",
                    "direction",
                    "relation_key"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          }
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "rows": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": true,
                "description": "Application-defined fields; use the project entity/function schema."
              }
            },
            "query_api_version": {
              "const": "1"
            }
          },
          "required": [
            "rows",
            "query_api_version"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "entity comes from the URL; do not include entity_key in the body.",
          "Only group_by[0] is evaluated; additional entries are silently ignored, not combined into a multi-level group-by."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "entity": {
              "type": "string"
            }
          },
          "required": [
            "entity"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/record-operations.ts"
        ]
      }
    },
    {
      "port_id": "records.facet",
      "entitlement": "query_dsl_v1",
      "bff": {
        "method": "POST",
        "path": "/api/records/:entity/facet",
        "auth": "session",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/records/facet"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "where": {
              "$ref": "#/$defs/where"
            },
            "status": {
              "type": "string",
              "enum": [
                "active",
                "archived",
                "all"
              ]
            },
            "dimensions": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "field": {
                    "type": "string"
                  },
                  "limit": {
                    "type": "integer",
                    "maximum": 200
                  }
                },
                "required": [
                  "field"
                ],
                "additionalProperties": false
              },
              "minItems": 1,
              "maxItems": 5
            }
          },
          "required": [
            "dimensions"
          ],
          "additionalProperties": false,
          "$defs": {
            "where": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "and": {
                      "type": "array",
                      "items": {
                        "$ref": "#/$defs/where"
                      }
                    }
                  },
                  "required": [
                    "and"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "or": {
                      "type": "array",
                      "items": {
                        "$ref": "#/$defs/where"
                      },
                      "maxItems": 8
                    }
                  },
                  "required": [
                    "or"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "not": {
                      "$ref": "#/$defs/where"
                    }
                  },
                  "required": [
                    "not"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "field"
                    },
                    "field": {
                      "type": "string"
                    },
                    "op": {
                      "type": "string",
                      "enum": [
                        "eq",
                        "neq",
                        "gt",
                        "gte",
                        "lt",
                        "lte",
                        "in",
                        "not_in",
                        "contains",
                        "starts_with",
                        "between",
                        "is_null",
                        "field_exists"
                      ]
                    },
                    "value": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "number"
                              }
                            ]
                          }
                        }
                      ]
                    }
                  },
                  "required": [
                    "type",
                    "field",
                    "op"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "relation"
                    },
                    "direction": {
                      "type": "string",
                      "enum": [
                        "from",
                        "to"
                      ]
                    },
                    "relation_key": {
                      "type": "string"
                    },
                    "to_entity_key": {
                      "type": "string"
                    },
                    "from_entity_key": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "type",
                    "direction",
                    "relation_key"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          }
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "facets": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "field": {
                    "type": "string"
                  },
                  "buckets": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "bucket": {},
                        "n": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "bucket",
                        "n"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "field",
                  "buckets"
                ],
                "additionalProperties": false
              }
            },
            "query_api_version": {
              "const": "1"
            }
          },
          "required": [
            "facets",
            "query_api_version"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "entity comes from the URL; do not include entity_key in the body.",
          "Each dimension's limit is silently capped at 200 server-side regardless of what is sent."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "entity": {
              "type": "string"
            }
          },
          "required": [
            "entity"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/record-operations.ts"
        ]
      }
    },
    {
      "port_id": "records.bulk_update",
      "entitlement": "query_dsl_v1",
      "bff": {
        "method": "POST",
        "path": "/api/records/:entity/bulk-update",
        "auth": "session",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/records/bulk-update"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "where": {
              "$ref": "#/$defs/where"
            },
            "ids": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 500
            },
            "status_filter": {
              "type": "string",
              "enum": [
                "active",
                "archived",
                "all"
              ]
            },
            "serialized": {
              "type": "boolean"
            },
            "patch": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Application-defined fields; use the project entity/function schema."
                },
                "title": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "slug": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "metadata": {
                  "anyOf": [
                    {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Application-defined fields; use the project entity/function schema."
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "type": "string"
                }
              },
              "required": [],
              "additionalProperties": false
            }
          },
          "required": [
            "patch"
          ],
          "additionalProperties": false,
          "$defs": {
            "where": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "and": {
                      "type": "array",
                      "items": {
                        "$ref": "#/$defs/where"
                      }
                    }
                  },
                  "required": [
                    "and"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "or": {
                      "type": "array",
                      "items": {
                        "$ref": "#/$defs/where"
                      },
                      "maxItems": 8
                    }
                  },
                  "required": [
                    "or"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "not": {
                      "$ref": "#/$defs/where"
                    }
                  },
                  "required": [
                    "not"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "field"
                    },
                    "field": {
                      "type": "string"
                    },
                    "op": {
                      "type": "string",
                      "enum": [
                        "eq",
                        "neq",
                        "gt",
                        "gte",
                        "lt",
                        "lte",
                        "in",
                        "not_in",
                        "contains",
                        "starts_with",
                        "between",
                        "is_null",
                        "field_exists"
                      ]
                    },
                    "value": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "number"
                              }
                            ]
                          }
                        }
                      ]
                    }
                  },
                  "required": [
                    "type",
                    "field",
                    "op"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "relation"
                    },
                    "direction": {
                      "type": "string",
                      "enum": [
                        "from",
                        "to"
                      ]
                    },
                    "relation_key": {
                      "type": "string"
                    },
                    "to_entity_key": {
                      "type": "string"
                    },
                    "from_entity_key": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "type",
                    "direction",
                    "relation_key"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          }
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "updated": {
              "type": "integer"
            },
            "query_api_version": {
              "type": "string"
            }
          },
          "required": [
            "updated"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "entity comes from the URL; do not include entity_key in the body.",
          "Rejected with 403 when the entity is owner_managed and the caller is an app user (staff-issued service tokens are unaffected)."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "entity": {
              "type": "string"
            }
          },
          "required": [
            "entity"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/record-operations.ts"
        ]
      }
    },
    {
      "port_id": "records.bulk_delete",
      "entitlement": "query_dsl_v1",
      "bff": {
        "method": "POST",
        "path": "/api/records/:entity/bulk-delete",
        "auth": "session",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/records/bulk-delete"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "where": {
              "$ref": "#/$defs/where"
            },
            "ids": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 500
            },
            "status_filter": {
              "type": "string",
              "enum": [
                "active",
                "archived",
                "all"
              ]
            },
            "serialized": {
              "type": "boolean"
            },
            "hard": {
              "type": "boolean"
            }
          },
          "required": [],
          "additionalProperties": false,
          "$defs": {
            "where": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "and": {
                      "type": "array",
                      "items": {
                        "$ref": "#/$defs/where"
                      }
                    }
                  },
                  "required": [
                    "and"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "or": {
                      "type": "array",
                      "items": {
                        "$ref": "#/$defs/where"
                      },
                      "maxItems": 8
                    }
                  },
                  "required": [
                    "or"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "not": {
                      "$ref": "#/$defs/where"
                    }
                  },
                  "required": [
                    "not"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "field"
                    },
                    "field": {
                      "type": "string"
                    },
                    "op": {
                      "type": "string",
                      "enum": [
                        "eq",
                        "neq",
                        "gt",
                        "gte",
                        "lt",
                        "lte",
                        "in",
                        "not_in",
                        "contains",
                        "starts_with",
                        "between",
                        "is_null",
                        "field_exists"
                      ]
                    },
                    "value": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "number"
                              }
                            ]
                          }
                        }
                      ]
                    }
                  },
                  "required": [
                    "type",
                    "field",
                    "op"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "const": "relation"
                    },
                    "direction": {
                      "type": "string",
                      "enum": [
                        "from",
                        "to"
                      ]
                    },
                    "relation_key": {
                      "type": "string"
                    },
                    "to_entity_key": {
                      "type": "string"
                    },
                    "from_entity_key": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "type",
                    "direction",
                    "relation_key"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          }
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "deleted": {
              "type": "integer"
            },
            "query_api_version": {
              "type": "string"
            }
          },
          "required": [
            "deleted",
            "query_api_version"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "entity comes from the URL; do not include entity_key in the body.",
          "Rejected with 403 when the entity is owner_managed and the caller is an app user (staff-issued service tokens are unaffected).",
          "hard:true is not supported and always returns 400; omit hard or send false."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "entity": {
              "type": "string"
            }
          },
          "required": [
            "entity"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/record-operations.ts"
        ]
      }
    },
    {
      "port_id": "imports.create",
      "entitlement": "bulk_import",
      "bff": {
        "method": "POST",
        "path": "/api/imports",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/records/imports/sessions"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "source": {
              "type": "object",
              "properties": {
                "type": {
                  "const": "file"
                },
                "file_id": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "file_id"
              ],
              "additionalProperties": false
            },
            "destination": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "records",
                    "external_table"
                  ]
                },
                "entity_key": {
                  "type": "string"
                },
                "table": {
                  "type": "string"
                },
                "connection_id": {
                  "type": "string"
                }
              },
              "required": [
                "type"
              ],
              "additionalProperties": false
            },
            "options": {
              "type": "object",
              "properties": {
                "mode": {
                  "type": "string",
                  "enum": [
                    "insert",
                    "upsert"
                  ]
                },
                "delimiter": {
                  "type": "string"
                },
                "has_header": {
                  "type": "boolean"
                }
              },
              "required": [],
              "additionalProperties": true
            },
            "created_by_user_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "source_type": {
              "type": "string",
              "enum": [
                "csv",
                "json",
                "sql"
              ]
            }
          },
          "required": [
            "source",
            "destination"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "import_session_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "source_type": {
              "type": "string"
            },
            "destination_type": {
              "type": "string"
            }
          },
          "required": [
            "import_session_id",
            "status",
            "source_type",
            "destination_type"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          201
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/import-sessions.ts"
        ]
      }
    },
    {
      "port_id": "imports.get",
      "entitlement": "bulk_import",
      "bff": {
        "method": "GET",
        "path": "/api/imports/:session_id",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "GET",
        "path": "/v1/projects/:project_id/records/imports/sessions/:session_id"
      },
      "schema": {
        "request_body": null,
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "import_session_id": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "source_type": {
              "type": "string"
            },
            "destination_type": {
              "type": "string"
            },
            "mapping_json": {
              "anyOf": [
                {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Application-defined fields; use the project entity/function schema."
                },
                {
                  "type": "null"
                }
              ]
            },
            "options_json": {
              "anyOf": [
                {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Application-defined fields; use the project entity/function schema."
                },
                {
                  "type": "null"
                }
              ]
            },
            "preview_json": {
              "anyOf": [
                {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Application-defined fields; use the project entity/function schema."
                },
                {
                  "type": "null"
                }
              ]
            },
            "total_rows": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            },
            "processed_rows": {
              "type": "integer"
            },
            "succeeded_rows": {
              "type": "integer"
            },
            "failed_rows": {
              "type": "integer"
            },
            "error_count": {
              "type": "integer"
            },
            "last_error": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "created_at": {
              "type": "string"
            },
            "started_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "completed_at": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "recent_errors": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "row_number": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "column_name": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "error_code": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "error_message": {
                    "type": "string"
                  },
                  "raw_row_json": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "created_at": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "error_message",
                  "created_at"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "import_session_id",
            "status"
          ],
          "additionalProperties": true
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "session_id": {
              "type": "string"
            }
          },
          "required": [
            "session_id"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/import-sessions.ts"
        ]
      }
    },
    {
      "port_id": "imports.preview",
      "entitlement": "bulk_import",
      "bff": {
        "method": "POST",
        "path": "/api/imports/:session_id/preview",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/records/imports/sessions/:session_id/preview"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "sample_rows": {
              "type": "integer"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "import_session_id": {
                  "type": "string"
                },
                "kind": {
                  "const": "sql"
                },
                "snippet_chars": {
                  "type": "integer"
                },
                "total_chars_est": {
                  "type": "integer"
                }
              },
              "required": [
                "import_session_id",
                "kind",
                "snippet_chars",
                "total_chars_est"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "import_session_id": {
                  "type": "string"
                },
                "kind": {
                  "const": "json"
                },
                "row_count_sample": {
                  "type": "integer"
                },
                "columns": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "sample_rows": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Application-defined fields; use the project entity/function schema."
                  }
                }
              },
              "required": [
                "import_session_id",
                "kind",
                "row_count_sample",
                "columns",
                "sample_rows"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "import_session_id": {
                  "type": "string"
                },
                "kind": {
                  "const": "csv"
                },
                "columns": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "inferred_type": {
                        "type": "string"
                      },
                      "matches_schema_field": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "name",
                      "inferred_type",
                      "matches_schema_field"
                    ],
                    "additionalProperties": false
                  }
                },
                "row_count_sample": {
                  "type": "integer"
                },
                "sample_rows": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Application-defined fields; use the project entity/function schema."
                  }
                },
                "entity_hint": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "inferred_type": {
                        "type": "string"
                      },
                      "matches_schema_field": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "name",
                      "inferred_type",
                      "matches_schema_field"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "import_session_id",
                "kind",
                "columns",
                "row_count_sample",
                "sample_rows",
                "entity_hint"
              ],
              "additionalProperties": false
            }
          ]
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "The response shape depends on the session's source_type: sql returns only snippet_chars/total_chars_est; json returns columns as a plain string array; csv additionally returns entity_hint, which duplicates columns."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "session_id": {
              "type": "string"
            }
          },
          "required": [
            "session_id"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/import-sessions.ts"
        ]
      }
    },
    {
      "port_id": "imports.map_fields",
      "entitlement": "bulk_import",
      "bff": {
        "method": "POST",
        "path": "/api/imports/:session_id/map-fields",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/records/imports/sessions/:session_id/map-fields"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "mapping": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          },
          "required": [
            "mapping"
          ],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "import_session_id": {
              "type": "string"
            },
            "mapping": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          },
          "required": [
            "import_session_id",
            "mapping"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "mapping values are not validated as strings server-side despite the declared shape; send strings anyway."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "session_id": {
              "type": "string"
            }
          },
          "required": [
            "session_id"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/import-sessions.ts"
        ]
      }
    },
    {
      "port_id": "imports.validate",
      "entitlement": "bulk_import",
      "bff": {
        "method": "POST",
        "path": "/api/imports/:session_id/validate",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/records/imports/sessions/:session_id/validate"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "import_session_id": {
              "type": "string"
            },
            "valid": {
              "type": "boolean"
            },
            "validated": {
              "type": "integer"
            },
            "error_count": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "import_session_id",
            "valid",
            "validated",
            "error_count"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "session_id": {
              "type": "string"
            }
          },
          "required": [
            "session_id"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/import-sessions.ts"
        ]
      }
    },
    {
      "port_id": "imports.commit",
      "entitlement": "bulk_import",
      "bff": {
        "method": "POST",
        "path": "/api/imports/:session_id/commit",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/records/imports/sessions/:session_id/commit"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {
            "validate_only": {
              "type": "boolean"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "import_session_id": {
                  "type": "string"
                },
                "message": {
                  "const": "already validated; noop"
                }
              },
              "required": [
                "import_session_id",
                "message"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "import_session_id": {
                  "type": "string"
                },
                "job_id": {
                  "type": "string"
                },
                "status": {
                  "const": "running"
                },
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "import_session_id",
                "job_id",
                "status",
                "message"
              ],
              "additionalProperties": false
            }
          ]
        },
        "success_statuses": [
          200,
          202
        ],
        "notes": [
          "validate_only:true (200) short-circuits to {import_session_id, message} with no job_id/status; omitting it or sending false starts the real commit (202) with the full shape. Requires the session to be in status ready, else 400."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "session_id": {
              "type": "string"
            }
          },
          "required": [
            "session_id"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/import-sessions.ts"
        ]
      }
    },
    {
      "port_id": "imports.cancel",
      "entitlement": "bulk_import",
      "bff": {
        "method": "POST",
        "path": "/api/imports/:session_id/cancel",
        "auth": "staff",
        "adapter": "generic"
      },
      "cloud": {
        "transport": "http",
        "method": "POST",
        "path": "/v1/projects/:project_id/records/imports/sessions/:session_id/cancel"
      },
      "schema": {
        "request_body": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "query": {
          "type": "object",
          "properties": {},
          "required": [],
          "additionalProperties": false
        },
        "response": {
          "type": "object",
          "properties": {
            "import_session_id": {
              "type": "string"
            },
            "status": {
              "const": "cancelled"
            }
          },
          "required": [
            "import_session_id",
            "status"
          ],
          "additionalProperties": false
        },
        "success_statuses": [
          200
        ],
        "notes": [
          "Only allowed from draft/previewed/validating/ready/running; any other current status returns 400."
        ],
        "schema_version": "1",
        "audience": "generated_app",
        "path_parameters": {
          "type": "object",
          "properties": {
            "session_id": {
              "type": "string"
            }
          },
          "required": [
            "session_id"
          ],
          "additionalProperties": false
        },
        "headers": {
          "type": "object",
          "properties": {
            "Authorization": {
              "type": "string",
              "pattern": "^Bearer .+"
            }
          },
          "required": [],
          "additionalProperties": false
        },
        "error": {
          "type": "object",
          "properties": {
            "statusCode": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "statusCode",
            "message"
          ],
          "additionalProperties": true
        },
        "error_notes": [
          "Non-2xx means failure; never replace with mock success. Framework transport may add error fields."
        ],
        "source": [
          "apps/pc-gateway/src/routes/import-sessions.ts"
        ]
      }
    }
  ]
}
