Download desktop/src/api/cliTasks.ts from chenbhao/codev: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/chenbhao/codev/resolve/e40073cc959cd4729bf4009662bca374c5c4e266/desktop/src/api/cliTasks.ts
- Command line
-
hf download hf://chenbhao/codev@e40073cc959cd4729bf4009662bca374c5c4e266/desktop/src/api/cliTasks.ts
-
curl -L -o cliTasks.ts https://huggingface.co/chenbhao/codev/resolve/e40073cc959cd4729bf4009662bca374c5c4e266/desktop/src/api/cliTasks.ts
1.06 kB
| import { api } from './client' | |
| import type { CLITask, TaskListSummary } from '../types/cliTask' | |
| type TaskListsResponse = { lists: TaskListSummary[] } | |
| type TasksResponse = { tasks: CLITask[] } | |
| type TaskResponse = { task: CLITask } | |
| export const cliTasksApi = { | |
| /** List all task lists with summaries */ | |
| listTaskLists() { | |
| return api.get<TaskListsResponse>('/api/tasks/lists') | |
| }, | |
| /** Get all tasks for a specific task list */ | |
| getTasksForList(taskListId: string) { | |
| return api.get<TasksResponse>(`/api/tasks/lists/${encodeURIComponent(taskListId)}`) | |
| }, | |
| /** Get a single task */ | |
| getTask(taskListId: string, taskId: string) { | |
| return api.get<TaskResponse>(`/api/tasks/lists/${encodeURIComponent(taskListId)}/${taskId}`) | |
| }, | |
| /** Clear all persisted tasks for a completed task list */ | |
| resetTaskList(taskListId: string) { | |
| return api.post<{ ok: true }>(`/api/tasks/lists/${encodeURIComponent(taskListId)}/reset`) | |
| }, | |
| /** List all tasks across all task lists */ | |
| listAll() { | |
| return api.get<TasksResponse>('/api/tasks') | |
| }, | |
| } | |