Add HTML5 access profile workspace
CI / python (push) Has been cancelled
CI / rust (push) Has been cancelled

This commit is contained in:
2026-05-21 19:29:35 +03:00
parent 29bbe1dca6
commit 2f7db03001
6 changed files with 420 additions and 0 deletions
@@ -55,6 +55,11 @@ from api_server.agent_models import (
from api_server.html5_forms import (
html5_form_data as _html5_form_data,
)
from api_server.html5_access_controller import (
html5_access_page as _html5_access_page,
html5_access_publish_dry_run as _html5_access_publish_dry_run,
html5_access_publish_plan as _html5_access_publish_plan,
)
from api_server.html5_editor_controller import (
html5_editor_page as _html5_editor_page,
html5_form_editor_page as _html5_form_editor_page,
@@ -1532,6 +1537,44 @@ async def html5_project_form_editor(project_id: str, form: str | None = None) ->
)
@app.get("/html5/projects/{project_id}/access")
async def html5_project_access(project_id: str, profile: str | None = None) -> Response:
return _html5_response(
_html5_access_page(
project_id=project_id,
profile=profile,
project_summaries=_project_summaries,
normalized_project=_normalized_project_or_404,
access_profile_by_name=_access_profile_by_name,
access_publish_plan=_build_access_profile_publish_plan,
)
)
@app.get("/html5/projects/{project_id}/access/profiles/{profile_name}/plan")
async def html5_project_access_profile_plan(project_id: str, profile_name: str) -> Response:
return _html5_response(
_html5_access_publish_plan(
project_id=project_id,
profile_name=profile_name,
normalized_project=_normalized_project_or_404,
access_profile_by_name=_access_profile_by_name,
access_publish_plan=_build_access_profile_publish_plan,
)
)
@app.post("/html5/projects/{project_id}/access/profiles/{profile_name}/publish-dry-run")
async def html5_project_access_profile_publish_dry_run(project_id: str, profile_name: str) -> Response:
return _html5_response(
await _html5_access_publish_dry_run(
project_id=project_id,
profile_name=profile_name,
publish_dry_run=dry_run_project_access_profile_publish,
)
)
@app.post("/html5/projects/{project_id}/forms/editor/preview")
async def html5_project_form_editor_preview(project_id: str, request: Request) -> Response:
form = await _html5_form_data(request)
@@ -2927,6 +2970,13 @@ async def get_normalized_project(project_id: str) -> NormalizedProject:
return normalized
def _normalized_project_or_404(project_id: str) -> NormalizedProject:
normalized = _load_normalized_project(project_id)
if normalized is None:
raise HTTPException(status_code=404, detail="NormalizedProject not found")
return normalized
@app.get("/projects/{project_id}/normalized/summary", response_model=NormalizedProjectSummary)
async def get_normalized_project_summary(project_id: str) -> NormalizedProjectSummary:
normalized = _load_normalized_project(project_id)