vibe.workbench.routes¶
Workbench API Routes.
Provides stateless API endpoints for managing template drafts. All state-changing endpoints require CSRF protection and author authentication.
create_draft ¶
create_draft() -> Response | tuple[Response, int]
Create a new draft from an uploaded DOCX file.
Expects
- template_file: The uploaded .docx file
| Returns: |
|
|---|
create_draft_from_template ¶
create_draft_from_template(template_id: str) -> Response | tuple[Response, int]
Create a new draft from an existing published template.
| Parameters: |
|
|---|
| Returns: |
|
|---|
get_draft ¶
get_draft(draft_id: str) -> Response | tuple[Response, int]
Get draft data including config, markup overlay, and HTML content with stable IDs.
| Parameters: |
|
|---|
| Returns: |
|
|---|
update_draft_config ¶
update_draft_config(draft_id: str) -> Response | tuple[Response, int]
Update the draft configuration.
| Parameters: |
|
|---|
Expects
JSON: The complete config object to save
| Returns: |
|
|---|
update_draft_markup ¶
update_draft_markup(draft_id: str) -> Response | tuple[Response, int]
Update the draft markup overlay.
| Parameters: |
|
|---|
Expects
JSON: The complete markup overlay object to save
| Returns: |
|
|---|
validate_draft ¶
validate_draft(draft_id: str) -> Response | tuple[Response, int]
Validate the draft configuration against VIBE template requirements.
Uses the core VIBE validation engine to perform comprehensive validation of the draft's template configuration and structure.
| Parameters: |
|
|---|
| Returns: |
|
|---|
test_draft ¶
test_draft(draft_id: str) -> Response | tuple[Response, int]
Run a test interview session with the draft template.
Uses the headless interview engine to process the template configuration and generate appropriate questions and responses.
| Parameters: |
|
|---|
Expects
JSON: { "session_state": {...}, "form_data": {...} # Optional form submission data }
| Returns: |
|
|---|
publish_draft ¶
publish_draft(draft_id: str) -> Response | tuple[Response, int]
Publish the draft as a live template using DOCXService.
| Parameters: |
|
|---|
Expects
JSON: { "template_id": "new_template_id", "title": "Template Title" }
| Returns: |
|
|---|
editor_page ¶
editor_page(draft_id: str) -> str | tuple[str, int]
Serve the workbench editor page for a specific draft.
| Parameters: |
|
|---|
| Returns: |
|
|---|