feat: complete TASK-WP2-07 latest exports

This commit is contained in:
suyx
2026-08-03 01:43:09 +08:00
parent 2bb4f86d04
commit 1b0a05bbcf
20 changed files with 1791 additions and 18 deletions
+450
View File
@@ -2083,6 +2083,22 @@
],
"type": "object"
},
"ExportFormat": {
"anyOf": [
{
"enum": [
"jpg"
],
"type": "string"
},
{
"enum": [
"png"
],
"type": "string"
}
]
},
"FailedEmptyTrashRequest": {
"additionalProperties": false,
"properties": {
@@ -2512,6 +2528,180 @@
}
]
},
"LatestExportItem": {
"additionalProperties": false,
"properties": {
"byte_size": {
"minimum": 1,
"type": "integer"
},
"created_at": {
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$",
"type": "string"
},
"download_url": {
"pattern": "^/api/v1/projects/[0-9a-fA-F-]{36}/latest-exports/(jpg|png)$",
"type": "string"
},
"export_id": {
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
"type": "string"
},
"format": {
"$ref": "#/components/schemas/ExportFormat"
},
"pixel_height": {
"minimum": 1,
"type": "integer"
},
"pixel_width": {
"minimum": 1,
"type": "integer"
},
"sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"state_version": {
"minimum": 1,
"type": "integer"
}
},
"required": [
"byte_size",
"created_at",
"download_url",
"export_id",
"format",
"pixel_height",
"pixel_width",
"sha256",
"state_version"
],
"type": "object"
},
"LatestExportMultipartBody": {
"additionalProperties": false,
"properties": {
"byte_size": {
"pattern": "^[1-9][0-9]*$",
"type": "string"
},
"export_file": {
"format": "binary",
"type": "string"
},
"export_id": {
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
"type": "string"
},
"format": {
"$ref": "#/components/schemas/ExportFormat"
},
"pixel_height": {
"pattern": "^[1-9][0-9]*$",
"type": "string"
},
"pixel_width": {
"pattern": "^[1-9][0-9]*$",
"type": "string"
},
"sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"state_version": {
"pattern": "^[1-9][0-9]*$",
"type": "string"
}
},
"required": [
"byte_size",
"export_file",
"export_id",
"format",
"pixel_height",
"pixel_width",
"sha256",
"state_version"
],
"type": "object"
},
"LatestExportParams": {
"additionalProperties": false,
"properties": {
"format": {
"$ref": "#/components/schemas/ExportFormat"
},
"projectId": {
"$ref": "#/components/schemas/ProjectId"
}
},
"required": [
"format",
"projectId"
],
"type": "object"
},
"LatestExportSaveResponse": {
"additionalProperties": false,
"properties": {
"byte_size": {
"minimum": 1,
"type": "integer"
},
"created_at": {
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$",
"type": "string"
},
"download_url": {
"pattern": "^/api/v1/projects/[0-9a-fA-F-]{36}/latest-exports/(jpg|png)$",
"type": "string"
},
"export_id": {
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
"type": "string"
},
"format": {
"$ref": "#/components/schemas/ExportFormat"
},
"pixel_height": {
"minimum": 1,
"type": "integer"
},
"pixel_width": {
"minimum": 1,
"type": "integer"
},
"sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"state_version": {
"minimum": 1,
"type": "integer"
},
"status": {
"enum": [
"saved"
],
"type": "string"
}
},
"required": [
"byte_size",
"created_at",
"download_url",
"export_id",
"format",
"pixel_height",
"pixel_width",
"sha256",
"state_version",
"status"
],
"type": "object"
},
"LoginCompleteRequest": {
"additionalProperties": false,
"properties": {
@@ -2737,6 +2927,13 @@
"maxItems": 10,
"type": "array"
},
"latest_exports": {
"items": {
"$ref": "#/components/schemas/LatestExportItem"
},
"maxItems": 2,
"type": "array"
},
"name": {
"maxLength": 160,
"minLength": 1,
@@ -2806,6 +3003,7 @@
"draft_prompt",
"generations",
"images",
"latest_exports",
"pixel_height",
"pixel_width",
"save_status"
@@ -2856,6 +3054,22 @@
],
"type": "object"
},
"ProjectImageParams": {
"additionalProperties": false,
"properties": {
"imageId": {
"$ref": "#/components/schemas/ProjectId"
},
"projectId": {
"$ref": "#/components/schemas/ProjectId"
}
},
"required": [
"imageId",
"projectId"
],
"type": "object"
},
"ProjectListQuery": {
"additionalProperties": false,
"properties": {
@@ -6143,6 +6357,71 @@
]
}
},
"/api/v1/private-assets/projects/{projectId}/images/{imageId}": {
"get": {
"operationId": "downloadOriginalGeneration",
"parameters": [
{
"in": "path",
"name": "imageId",
"required": true,
"schema": {
"$ref": "#/components/schemas/ProjectId"
}
},
{
"in": "path",
"name": "projectId",
"required": true,
"schema": {
"$ref": "#/components/schemas/ProjectId"
}
}
],
"responses": {
"200": {
"content": {
"application/octet-stream": {
"schema": {
"format": "binary",
"type": "string"
}
}
},
"description": "Default Response"
},
"400": {
"description": "Default Response"
},
"401": {
"content": {
"application/octet-stream": {
"schema": {
"$ref": "#/components/schemas/ErrorEnvelope"
}
}
},
"description": "Default Response"
},
"404": {
"description": "Default Response"
},
"503": {
"content": {
"application/octet-stream": {
"schema": {
"$ref": "#/components/schemas/ErrorEnvelope"
}
}
},
"description": "Default Response"
}
},
"tags": [
"Projects"
]
}
},
"/api/v1/projects": {
"get": {
"operationId": "listProjects",
@@ -6350,6 +6629,177 @@
]
}
},
"/api/v1/projects/{projectId}/latest-exports/{format}": {
"get": {
"operationId": "downloadLatestExport",
"parameters": [
{
"in": "path",
"name": "format",
"required": true,
"schema": {
"$ref": "#/components/schemas/ExportFormat"
}
},
{
"in": "path",
"name": "projectId",
"required": true,
"schema": {
"$ref": "#/components/schemas/ProjectId"
}
}
],
"responses": {
"200": {
"content": {
"application/octet-stream": {
"schema": {
"format": "binary",
"type": "string"
}
}
},
"description": "Default Response"
},
"400": {
"description": "Default Response"
},
"401": {
"content": {
"application/octet-stream": {
"schema": {
"$ref": "#/components/schemas/ErrorEnvelope"
}
}
},
"description": "Default Response"
},
"404": {
"description": "Default Response"
},
"503": {
"content": {
"application/octet-stream": {
"schema": {
"$ref": "#/components/schemas/ErrorEnvelope"
}
}
},
"description": "Default Response"
}
},
"tags": [
"Projects"
]
},
"put": {
"operationId": "saveLatestExport",
"parameters": [
{
"in": "path",
"name": "format",
"required": true,
"schema": {
"$ref": "#/components/schemas/ExportFormat"
}
},
{
"in": "path",
"name": "projectId",
"required": true,
"schema": {
"$ref": "#/components/schemas/ProjectId"
}
},
{
"in": "header",
"name": "x-csrf-token",
"required": true,
"schema": {
"maxLength": 64,
"minLength": 43,
"pattern": "^[A-Za-z0-9_-]+$",
"type": "string"
}
}
],
"requestBody": {
"content": {
"multipart/form-data": {
"schema": {
"$ref": "#/components/schemas/LatestExportMultipartBody"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/LatestExportSaveResponse"
}
}
},
"description": "Default Response"
},
"400": {
"description": "Default Response"
},
"401": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorEnvelope"
}
}
},
"description": "Default Response"
},
"403": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorEnvelope"
}
}
},
"description": "Default Response"
},
"404": {
"description": "Default Response"
},
"409": {
"description": "Default Response"
},
"503": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorEnvelope"
}
}
},
"description": "Default Response"
},
"507": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorEnvelope"
}
}
},
"description": "Default Response"
}
},
"tags": [
"Projects"
]
}
},
"/api/v1/projects/{projectId}/purge": {
"post": {
"operationId": "purgeProject",