31 lines
1020 B
TypeScript
31 lines
1020 B
TypeScript
import type { ListRpgCreationWorksResponse } from '../../../packages/shared/src';
|
|
import { requestRpgCreationRuntimeJson } from './rpgCreationRuntimeClient';
|
|
|
|
export async function listRpgCreationWorks() {
|
|
const response = await requestRpgCreationRuntimeJson<ListRpgCreationWorksResponse>(
|
|
'/custom-world/works',
|
|
{ method: 'GET' },
|
|
'读取创作作品列表失败',
|
|
);
|
|
|
|
return Array.isArray(response?.items) ? response.items : [];
|
|
}
|
|
|
|
export async function deleteRpgCreationAgentSession(sessionId: string) {
|
|
const response = await requestRpgCreationRuntimeJson<ListRpgCreationWorksResponse>(
|
|
`/custom-world/agent/sessions/${encodeURIComponent(sessionId)}`,
|
|
{ method: 'DELETE' },
|
|
'删除 RPG 草稿失败',
|
|
);
|
|
|
|
return Array.isArray(response?.items) ? response.items : [];
|
|
}
|
|
|
|
/**
|
|
* 工作包 D 把作品列表请求正式迁入 RPG 创作域 client。
|
|
*/
|
|
export const rpgCreationWorkClient = {
|
|
deleteAgentSession: deleteRpgCreationAgentSession,
|
|
listWorks: listRpgCreationWorks,
|
|
};
|