feat: 实现剧本创作与拆解前端工作台
This commit is contained in:
1 parent
edc003443f
commit
2ee6f049f6
56 files changed
+7597
-2
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import { request, optionalResource } from '../../lib/http'
|
||||
import type { Checkpoint } from '../workflows/types'
|
||||
import type { CreateProjectInput, DramaState, Project, ProjectDetail } from './types'
|
||||
|
||||
/** 项目与 Create Drama API;路径严格对应后端 dev。 */
|
||||
export const projectsApi = {
|
||||
list: (signal?: AbortSignal) => request<Project[]>('/projects', { signal }),
|
||||
detail: (id: string, signal?: AbortSignal) =>
|
||||
request<ProjectDetail>(`/projects/${encodeURIComponent(id)}`, { signal }),
|
||||
create: (input: CreateProjectInput) =>
|
||||
request<{ projectId: string; status: string }>('/projects', { method: 'POST', body: input }),
|
||||
state: (id: string, signal?: AbortSignal) =>
|
||||
optionalResource(request<DramaState>(`/projects/${encodeURIComponent(id)}/state`, { signal })),
|
||||
checkpoints: (id: string, signal?: AbortSignal) =>
|
||||
request<Checkpoint[]>(`/projects/${encodeURIComponent(id)}/checkpoints`, { signal }),
|
||||
resume: (id: string, action: 'resume-generation' | 'resume-rewrite') =>
|
||||
request<unknown>(`/projects/${encodeURIComponent(id)}/${action}`, { method: 'POST', timeoutMs: 0 })
|
||||
}
|
||||
Reference in new issue
Block a user