+18


![dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>](/assets/img/avatar_default.png)

![autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>](/assets/img/avatar_default.png)




FFXN
GitHub
yyh
盐粒 Yanli
autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Tianle
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Yunlu Wen
zyssyz123
Claude Opus 4.7
chariri
Asuka Minato
Copilot Autofix powered by AI
Nian
非法操作
Carmen Fernández Ruiz
wangxiaolei
QuantumGhost
L1nSn0w
Evan
Escape0707
Jingyi
Amr Sherif
ZHOU ZHICHEN
unknown
JzoNg
Xiyuan Chen
-LAN-
107bba0116
Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: EvanYao826 <[email protected]> Co-authored-by: yyh <[email protected]> Co-authored-by: 盐粒 Yanli <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Tianle <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Yunlu Wen <[email protected]> Co-authored-by: zyssyz123 <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Co-authored-by: chariri <[email protected]> Co-authored-by: Asuka Minato <[email protected]> Co-authored-by: Copilot Autofix powered by AI <[email protected]> Co-authored-by: Nian <[email protected]> Co-authored-by: 非法操作 <[email protected]> Co-authored-by: Carmen Fernández Ruiz <[email protected]> Co-authored-by: wangxiaolei <[email protected]> Co-authored-by: QuantumGhost <[email protected]> Co-authored-by: L1nSn0w <[email protected]> Co-authored-by: Evan <[email protected]> Co-authored-by: Escape0707 <[email protected]> Co-authored-by: Jingyi <[email protected]> Co-authored-by: Amr Sherif <[email protected]> Co-authored-by: ZHOU ZHICHEN <[email protected]> Co-authored-by: unknown <[email protected]> Co-authored-by: JzoNg <[email protected]> Co-authored-by: Xiyuan Chen <[email protected]> Co-authored-by: -LAN- <[email protected]>
143 lines
3.2 KiB
Python
143 lines
3.2 KiB
Python
from flask import Blueprint
|
|
from flask_restx import Namespace
|
|
|
|
from libs.device_flow_security import attach_anti_framing
|
|
from libs.external_api import ExternalApi
|
|
|
|
bp = Blueprint("openapi", __name__, url_prefix="/openapi/v1")
|
|
attach_anti_framing(bp)
|
|
|
|
api = ExternalApi(
|
|
bp,
|
|
version="1.0",
|
|
title="OpenAPI",
|
|
description="User-scoped programmatic API (bearer auth)",
|
|
)
|
|
|
|
openapi_ns = Namespace("openapi", description="User-scoped operations", path="/")
|
|
|
|
# Register response/query models BEFORE importing controller modules so that
|
|
# @openapi_ns.response / @openapi_ns.expect decorators can resolve model names.
|
|
from controllers.common.schema import register_response_schema_models, register_schema_models
|
|
from controllers.openapi._models import (
|
|
AccountPayload,
|
|
AccountResponse,
|
|
AppDescribeInfo,
|
|
AppDescribeQuery,
|
|
AppDescribeResponse,
|
|
AppInfoResponse,
|
|
AppListQuery,
|
|
AppListResponse,
|
|
AppListRow,
|
|
AppRunRequest,
|
|
DeviceCodeRequest,
|
|
DeviceCodeResponse,
|
|
DeviceLookupQuery,
|
|
DeviceLookupResponse,
|
|
DeviceMutateRequest,
|
|
DeviceMutateResponse,
|
|
DevicePollRequest,
|
|
MemberActionResponse,
|
|
MemberInvitePayload,
|
|
MemberInviteResponse,
|
|
MemberListQuery,
|
|
MemberListResponse,
|
|
MemberResponse,
|
|
MemberRoleUpdatePayload,
|
|
MessageMetadata,
|
|
PermittedExternalAppsListQuery,
|
|
PermittedExternalAppsListResponse,
|
|
RevokeResponse,
|
|
ServerVersionResponse,
|
|
SessionListResponse,
|
|
SessionRow,
|
|
TagItem,
|
|
UsageInfo,
|
|
WorkflowRunData,
|
|
WorkspaceDetailResponse,
|
|
WorkspaceListResponse,
|
|
WorkspacePayload,
|
|
WorkspaceSummaryResponse,
|
|
)
|
|
from fields.file_fields import FileResponse
|
|
|
|
register_schema_models(
|
|
openapi_ns,
|
|
AppDescribeQuery,
|
|
AppListQuery,
|
|
AppRunRequest,
|
|
DeviceCodeRequest,
|
|
DevicePollRequest,
|
|
DeviceLookupQuery,
|
|
DeviceMutateRequest,
|
|
MemberInvitePayload,
|
|
MemberListQuery,
|
|
MemberRoleUpdatePayload,
|
|
PermittedExternalAppsListQuery,
|
|
)
|
|
register_response_schema_models(
|
|
openapi_ns,
|
|
TagItem,
|
|
UsageInfo,
|
|
MessageMetadata,
|
|
AppListRow,
|
|
AppListResponse,
|
|
AppInfoResponse,
|
|
AppDescribeInfo,
|
|
AppDescribeResponse,
|
|
WorkflowRunData,
|
|
AccountPayload,
|
|
WorkspacePayload,
|
|
AccountResponse,
|
|
SessionRow,
|
|
SessionListResponse,
|
|
PermittedExternalAppsListResponse,
|
|
RevokeResponse,
|
|
WorkspaceSummaryResponse,
|
|
WorkspaceListResponse,
|
|
WorkspaceDetailResponse,
|
|
MemberResponse,
|
|
MemberListResponse,
|
|
MemberInviteResponse,
|
|
MemberActionResponse,
|
|
DeviceCodeResponse,
|
|
DeviceLookupResponse,
|
|
DeviceMutateResponse,
|
|
FileResponse,
|
|
ServerVersionResponse,
|
|
)
|
|
|
|
from . import (
|
|
_meta,
|
|
account,
|
|
app_run,
|
|
apps,
|
|
apps_permitted_external,
|
|
files,
|
|
human_input_form,
|
|
index,
|
|
oauth_device,
|
|
oauth_device_sso,
|
|
workflow_events,
|
|
workspaces,
|
|
)
|
|
|
|
# Request models are imported from _models.py and registered above.
|
|
|
|
__all__ = [
|
|
"_meta",
|
|
"account",
|
|
"app_run",
|
|
"apps",
|
|
"apps_permitted_external",
|
|
"files",
|
|
"human_input_form",
|
|
"index",
|
|
"oauth_device",
|
|
"oauth_device_sso",
|
|
"workflow_events",
|
|
"workspaces",
|
|
]
|
|
|
|
api.add_namespace(openapi_ns)
|