bcbcb41750
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (push) Successful in 2s
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 5s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 5s
CI/CD Pipeline / Check push changed paths (push) Successful in 11s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 32s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 32s
CI/CD Pipeline / Build Staging API Image (push) Successful in 41s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 1m27s
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 54s
CI/CD Pipeline / CI Gate (pull_request) Successful in 2s
CI/CD Pipeline / Validate - Style (push) Successful in 2m26s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 2m37s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 2m13s
CI/CD Pipeline / Validate - Python (mypy + alembic) (push) Successful in 3m19s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m26s
CI/CD Pipeline / Integration Tests (push) Successful in 4m14s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 1m33s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 5m50s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 1m34s
AI Code Review / AI Code Review (pull_request) Successful in 6m48s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 3m13s
CI/CD Pipeline / Unit Tests (push) Failing after 8m1s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 5m11s
CI/CD Pipeline / Validate - Security (push) Successful in 18m6s
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Canary Release to Production (push) Failing after 234h20m56s
CI/CD Pipeline / CI Gate (push) Failing after 234h20m59s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 234h20m59s
CI/CD Pipeline / Build Production Web Image (push) Failing after 234h20m59s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Failing after 234h35m39s
CI/CD Pipeline / Build Production API Image (push) Failing after 234h21m0s
CI/CD Pipeline / Retag skipped Staging Worker Image (push) Failing after 234h36m5s
CI/CD Pipeline / Retag skipped Staging API Image (push) Failing after 234h36m6s
CI/CD Pipeline / Canary Release to Production (pull_request) Failing after 234h37m27s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 234h37m31s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 234h37m33s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 234h37m37s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 234h38m28s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 234h39m0s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 234h38m31s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 234h38m39s
CI/CD Pipeline / Integration Tests (pull_request) Failing after 234h39m0s
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Failing after 234h38m45s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Failing after 234h39m1s
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Failing after 234h38m49s
CI/CD Pipeline / Validate - Security (pull_request) Failing after 234h39m1s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Failing after 234h38m55s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 234h39m1s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 234h39m2s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 234h39m2s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 234h39m2s
CI/CD Pipeline / PR Build Web Image (push) Failing after 234h39m2s
CI/CD Pipeline / Check push changed paths (pull_request) Failing after 234h39m8s
CI/CD Pipeline / PR Build API Image (push) Failing after 234h39m3s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 234h39m10s
CI/CD Pipeline / Frontend Lint (push) Failing after 234h39m5s
CI/CD Pipeline / Deploy Production (push) Failing after 234h55m33s
CI/CD Pipeline / Retag skipped Staging Web Image (push) Failing after 235h10m42s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 235h12m8s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 235h12m11s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 235h13m35s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 235h13m36s
CI/CD Pipeline / Validate - Style (pull_request) Failing after 235h13m37s
Co-authored-by: xiaoxia <dev@xiaoxiajianji.com> Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
62 lines
2.4 KiB
TypeScript
62 lines
2.4 KiB
TypeScript
/**
|
|
* 批量变体剪辑计划 API(#1744)
|
|
*
|
|
* 批量预览时向后端申请 N 个变体的「独立剪辑计划片段」:
|
|
* - 变体 0 保留源 plan(用户在编辑器/智能选片产出的片段,含标题样式编辑结果);
|
|
* - 变体 1..N-1 由后端 reselect_plan_for_variant 完整重跑单视频选片流程
|
|
* (素材洗牌 + main 片段顺序洗牌 + 镜头/起点随机 + 跨变体 20% 区间避让 +
|
|
* 素材使用区间写回 metadata),与正式批量生成 POST /generation/tasks?count=N
|
|
* 使用同一套选片逻辑;
|
|
* - 正式生成时把 variant_plan_ids 原样回传,后端直接关联这些 plan 渲染,
|
|
* 不再重新选片 —— 预览所见即成片。
|
|
*
|
|
* 该接口只做选片/建 plan(秒级),不触发视频渲染,无渲染成本。
|
|
* 后端端点未上线(404)或选片失败(素材不足等)时前端降级为本地 variantSeed
|
|
* 模拟预览,不阻塞用户流程。
|
|
*/
|
|
import apiClient from "../client"
|
|
import type { EditPlanClip } from "../template-editor"
|
|
|
|
/** 批量变体计划请求体 */
|
|
export interface BatchVariantPlansRequest {
|
|
template_id: string
|
|
/** 本批次素材池(手动选择或智能匹配结果) */
|
|
asset_ids: string[]
|
|
/** 变体数量(≥1);=1 时只返回源 plan 片段 */
|
|
count: number
|
|
/** 源剪辑计划 ID:优先取预览/草稿关联的 plan;不传由后端按 template_id+user 兜底最新 plan */
|
|
source_edit_plan_id?: string
|
|
}
|
|
|
|
/** 单个变体的计划片段 */
|
|
export interface VariantPlan {
|
|
/** 变体序号,从 0 开始 */
|
|
variant_index: number
|
|
/** 该变体关联的剪辑计划 ID(正式生成时回传,实现预览即成片) */
|
|
plan_id: string
|
|
/** 该变体的真实片段(顺序/素材/起点与正式成片一致) */
|
|
clips: EditPlanClip[]
|
|
}
|
|
|
|
/** 批量变体计划响应 */
|
|
export interface BatchVariantPlansResponse {
|
|
items: VariantPlan[]
|
|
total: number
|
|
}
|
|
|
|
/**
|
|
* 创建批量变体剪辑计划并返回各变体片段。
|
|
*
|
|
* 注意:端点 404(后端未上线)/ 400(素材不足)等失败由调用方 catch 后降级,
|
|
* 不要抛 unhandled rejection。
|
|
*/
|
|
export async function createBatchVariantPlans(
|
|
params: BatchVariantPlansRequest,
|
|
): Promise<BatchVariantPlansResponse> {
|
|
const response = await apiClient.post<BatchVariantPlansResponse>(
|
|
"/generation/variant-plans",
|
|
params,
|
|
)
|
|
return response.data
|
|
}
|