Refine seller store implementation
This commit is contained in:
@@ -266,3 +266,45 @@ export async function uploadProductAsset(
|
||||
const res = await apiClient.post('/materials/bytes', form);
|
||||
return res.data as { asset_id: string; status: string };
|
||||
}
|
||||
|
||||
export interface VideoJobInfo {
|
||||
id: string;
|
||||
kind: 'slideshow_video';
|
||||
status: 'queued' | 'running' | 'done' | 'partial' | 'failed' | 'cancelled';
|
||||
total: number;
|
||||
completed: number;
|
||||
failed: number;
|
||||
source_asset_ids: string[];
|
||||
slide_seconds: number;
|
||||
duration_seconds?: number | null;
|
||||
width: number;
|
||||
height: number;
|
||||
file_size_bytes?: number | null;
|
||||
created_at?: string | null;
|
||||
error?: string | null;
|
||||
result?: { item_id: string; status: string; url?: string | null; error?: string | null } | null;
|
||||
}
|
||||
|
||||
export function createVideoJob(productId: string, assetIds: string[]) {
|
||||
return api.post<{ job_id: string }>(`/products/${productId}/video-jobs`, { asset_ids: assetIds });
|
||||
}
|
||||
|
||||
export function listVideoJobs(productId: string, config?: AxiosRequestConfig) {
|
||||
return api.get<VideoJobInfo[]>(`/products/${productId}/video-jobs`, config);
|
||||
}
|
||||
|
||||
export function cancelVideoJob(jobId: string) {
|
||||
return api.post<{ deleted: boolean }>(`/video-jobs/${jobId}/cancel`);
|
||||
}
|
||||
|
||||
export function retryVideoJob(jobId: string) {
|
||||
return api.post<VideoJobInfo>(`/video-jobs/${jobId}/retry`);
|
||||
}
|
||||
|
||||
export function deleteVideoJob(jobId: string) {
|
||||
return api.delete<{ deleted: boolean }>(`/video-jobs/${jobId}`);
|
||||
}
|
||||
|
||||
export function videoDownloadUrl(jobId: string) {
|
||||
return `/api/video-jobs/${jobId}/download`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user