Implement task 014 assets and media library workflow

This commit is contained in:
2026-05-21 23:55:15 +03:00
parent c3914bf8be
commit 8243f20b0e
23 changed files with 2423 additions and 22 deletions
+623 -1
View File
@@ -655,6 +655,110 @@
"title": "ArticleWorkflowStatus",
"type": "string"
},
"AssetGenerateSpecsResponse": {
"additionalProperties": false,
"properties": {
"assets": {
"items": {
"$ref": "#/components/schemas/AssetSummary"
},
"title": "Assets",
"type": "array"
}
},
"title": "AssetGenerateSpecsResponse",
"type": "object"
},
"AssetListResponse": {
"additionalProperties": false,
"properties": {
"assets": {
"items": {
"$ref": "#/components/schemas/AssetSummary"
},
"title": "Assets",
"type": "array"
}
},
"title": "AssetListResponse",
"type": "object"
},
"AssetResponse": {
"additionalProperties": false,
"properties": {
"asset": {
"$ref": "#/components/schemas/AssetSummary"
}
},
"required": [
"asset"
],
"title": "AssetResponse",
"type": "object"
},
"AssetRevisionSummary": {
"additionalProperties": false,
"properties": {
"action": {
"minLength": 1,
"title": "Action",
"type": "string"
},
"actor_user_id": {
"anyOf": [
{
"format": "uuid",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Actor User Id"
},
"article_id": {
"format": "uuid",
"title": "Article Id",
"type": "string"
},
"asset_id": {
"format": "uuid",
"title": "Asset Id",
"type": "string"
},
"created_at": {
"format": "date-time",
"title": "Created At",
"type": "string"
},
"id": {
"format": "uuid",
"title": "Id",
"type": "string"
},
"payload": {
"additionalProperties": true,
"title": "Payload",
"type": "object"
},
"revision_index": {
"minimum": 1,
"title": "Revision Index",
"type": "integer"
}
},
"required": [
"id",
"asset_id",
"article_id",
"revision_index",
"action",
"created_at"
],
"title": "AssetRevisionSummary",
"type": "object"
},
"AssetStatus": {
"enum": [
"PENDING",
@@ -700,6 +804,11 @@
"default": null,
"title": "Caption"
},
"created_at": {
"format": "date-time",
"title": "Created At",
"type": "string"
},
"file_url": {
"anyOf": [
{
@@ -712,11 +821,30 @@
"default": null,
"title": "File Url"
},
"history": {
"items": {
"$ref": "#/components/schemas/AssetRevisionSummary"
},
"title": "History",
"type": "array"
},
"id": {
"format": "uuid",
"title": "Id",
"type": "string"
},
"object_key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Object Key"
},
"prompt": {
"anyOf": [
{
@@ -729,6 +857,19 @@
"default": null,
"title": "Prompt"
},
"section_id": {
"anyOf": [
{
"format": "uuid",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Section Id"
},
"status": {
"$ref": "#/components/schemas/AssetStatus"
},
@@ -736,6 +877,11 @@
"minLength": 1,
"title": "Title",
"type": "string"
},
"updated_at": {
"format": "date-time",
"title": "Updated At",
"type": "string"
}
},
"required": [
@@ -743,7 +889,9 @@
"article_id",
"asset_type",
"title",
"status"
"status",
"created_at",
"updated_at"
],
"title": "AssetSummary",
"type": "object"
@@ -753,11 +901,140 @@
"hero_image",
"diagram",
"table",
"flowchart",
"comparison_matrix",
"architecture_diagram",
"inline_image"
],
"title": "AssetType",
"type": "string"
},
"AssetUpdateRequest": {
"additionalProperties": false,
"properties": {
"alt_text": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Alt Text"
},
"caption": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Caption"
},
"prompt": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Prompt"
},
"section_id": {
"anyOf": [
{
"format": "uuid",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Section Id"
},
"status": {
"anyOf": [
{
"$ref": "#/components/schemas/AssetStatus"
},
{
"type": "null"
}
],
"default": null
},
"title": {
"anyOf": [
{
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Title"
}
},
"title": "AssetUpdateRequest",
"type": "object"
},
"AssetUploadRequest": {
"additionalProperties": false,
"properties": {
"content_base64": {
"minLength": 1,
"title": "Content Base64",
"type": "string"
},
"content_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Content Type"
},
"filename": {
"minLength": 1,
"title": "Filename",
"type": "string"
}
},
"required": [
"filename",
"content_base64"
],
"title": "AssetUploadRequest",
"type": "object"
},
"AssetUploadResponse": {
"additionalProperties": false,
"properties": {
"asset": {
"$ref": "#/components/schemas/AssetSummary"
}
},
"required": [
"asset"
],
"title": "AssetUploadResponse",
"type": "object"
},
"BoundaryQuestionListResponse": {
"additionalProperties": false,
"properties": {
@@ -3648,6 +3925,351 @@
]
}
},
"/api/articles/{article_id}/assets": {
"get": {
"operationId": "get_article_assets_api_articles__article_id__assets_get",
"parameters": [
{
"in": "path",
"name": "article_id",
"required": true,
"schema": {
"format": "uuid",
"title": "Article Id",
"type": "string"
}
},
{
"in": "header",
"name": "X-Demo-User-Email",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "X-Demo-User-Email"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AssetListResponse"
}
}
},
"description": "Successful Response"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"summary": "Get Article Assets",
"tags": [
"assets"
]
}
},
"/api/articles/{article_id}/assets/generate-specs": {
"post": {
"operationId": "post_generate_asset_specs_api_articles__article_id__assets_generate_specs_post",
"parameters": [
{
"in": "path",
"name": "article_id",
"required": true,
"schema": {
"format": "uuid",
"title": "Article Id",
"type": "string"
}
},
{
"in": "header",
"name": "X-Demo-User-Email",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "X-Demo-User-Email"
}
}
],
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AssetGenerateSpecsResponse"
}
}
},
"description": "Successful Response"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"summary": "Post Generate Asset Specs",
"tags": [
"assets"
]
}
},
"/api/articles/{article_id}/assets/{asset_id}": {
"patch": {
"operationId": "patch_article_asset_api_articles__article_id__assets__asset_id__patch",
"parameters": [
{
"in": "path",
"name": "article_id",
"required": true,
"schema": {
"format": "uuid",
"title": "Article Id",
"type": "string"
}
},
{
"in": "path",
"name": "asset_id",
"required": true,
"schema": {
"format": "uuid",
"title": "Asset Id",
"type": "string"
}
},
{
"in": "header",
"name": "X-Demo-User-Email",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "X-Demo-User-Email"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AssetUpdateRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AssetResponse"
}
}
},
"description": "Successful Response"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"summary": "Patch Article Asset",
"tags": [
"assets"
]
}
},
"/api/articles/{article_id}/assets/{asset_id}/approve": {
"post": {
"operationId": "post_approve_asset_api_articles__article_id__assets__asset_id__approve_post",
"parameters": [
{
"in": "path",
"name": "article_id",
"required": true,
"schema": {
"format": "uuid",
"title": "Article Id",
"type": "string"
}
},
{
"in": "path",
"name": "asset_id",
"required": true,
"schema": {
"format": "uuid",
"title": "Asset Id",
"type": "string"
}
},
{
"in": "header",
"name": "X-Demo-User-Email",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "X-Demo-User-Email"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AssetResponse"
}
}
},
"description": "Successful Response"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"summary": "Post Approve Asset",
"tags": [
"assets"
]
}
},
"/api/articles/{article_id}/assets/{asset_id}/upload": {
"post": {
"operationId": "post_upload_asset_file_api_articles__article_id__assets__asset_id__upload_post",
"parameters": [
{
"in": "path",
"name": "article_id",
"required": true,
"schema": {
"format": "uuid",
"title": "Article Id",
"type": "string"
}
},
{
"in": "path",
"name": "asset_id",
"required": true,
"schema": {
"format": "uuid",
"title": "Asset Id",
"type": "string"
}
},
{
"in": "header",
"name": "X-Demo-User-Email",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "X-Demo-User-Email"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AssetUploadRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AssetUploadResponse"
}
}
},
"description": "Successful Response"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"summary": "Post Upload Asset File",
"tags": [
"assets"
]
}
},
"/api/articles/{article_id}/boundary-questions": {
"get": {
"operationId": "get_boundary_questions_api_articles__article_id__boundary_questions_get",