feat(api): proxy Translation Memory over bat.sock

This commit is contained in:
2026-09-06 22:50:59 +08:00
parent 7d6389806b
commit e373e3fd32
9 changed files with 848 additions and 42 deletions
+59 -1
View File
@@ -411,6 +411,56 @@ paths:
description: Missing or invalid admin token.
"503":
description: Rust bat translation backend is unavailable.
/admin/translation/memory/summary:
get:
summary: Read Rust-owned Translation Memory summary
parameters:
- name: translation_memory_path
in: query
schema:
type: string
responses:
"200":
description: Translation Memory availability and candidate/trusted counts.
"401":
description: Missing or invalid admin token.
"503":
description: Rust bat Translation Memory backend is unavailable.
/admin/translation/memory/query:
get:
summary: Query Rust-owned Translation Memory records
parameters:
- name: source_text
in: query
required: true
schema:
type: string
- name: source_context
in: query
description: JSON object whose values are strings.
schema:
type: string
- name: limit
in: query
schema:
type: integer
format: int64
minimum: 1
maximum: 1000
default: 100
- name: translation_memory_path
in: query
schema:
type: string
responses:
"200":
description: Translation Memory matches with reuse decision and provenance.
"400":
description: Missing source text or invalid context/limit.
"401":
description: Missing or invalid admin token.
"503":
description: Rust bat Translation Memory backend is unavailable.
/admin/translation/status:
get:
summary: Read Rust-owned localized release status
@@ -430,7 +480,7 @@ paths:
required: true
schema:
type: string
enum: [reload, refresh, restart, sync, verify, repair, catalog-refresh, schedule-add, schedule-update, schedule-remove, schedule-run, task-cancel, translation-task-update, translation-worker-run, translation-proofread, localized-publish, localized-rollback]
enum: [reload, refresh, restart, sync, verify, repair, catalog-refresh, schedule-add, schedule-update, schedule-remove, schedule-run, task-cancel, translation-task-update, translation-worker-run, translation-proofread, translation-memory-confirm, localized-publish, localized-rollback]
requestBody:
required: false
content:
@@ -521,6 +571,14 @@ paths:
minimum: 1
worker_id:
type: string
translation_memory_path:
type: string
record_id:
type: string
reviewer:
type: string
reason:
type: string
translation_file:
type: string
from_worker: