@follow-app/client-sdk
Version:
TypeScript client SDK for Follow RSS Server API
55 lines (48 loc) • 1.33 kB
text/typescript
import type { AiTaskOptions, TaskSchedule } from "@folo-services/drizzle"
import type {
DateISOString,
EmptyResponse,
StructuredSuccessResponse,
} from "../../types"
export interface AITask {
id: string
name: string
prompt: string
isEnabled: boolean
schedule: TaskSchedule
createdAt: DateISOString
updatedAt: DateISOString
lastRunAt: DateISOString | null
nextRunAt: DateISOString | null
runCount: number
lastResult: string | null
lastError: string | null
options: AiTaskOptions
}
export interface CreateTaskRequest {
name: string
prompt: string
isEnabled?: boolean
schedule: TaskSchedule
options: AiTaskOptions
}
export interface UpdateTaskRequest {
id: string
name?: string
prompt?: string
isEnabled?: boolean
schedule?: TaskSchedule
options?: AiTaskOptions
}
export type TaskListResponse = StructuredSuccessResponse<AITask[]>
export type TaskGetResponse = StructuredSuccessResponse<AITask>
export type TaskCreateResponse = StructuredSuccessResponse<AITask>
export type TaskUpdateResponse = StructuredSuccessResponse<AITask>
export type TaskDeleteResponse = EmptyResponse
export type TaskTestRunResponse = StructuredSuccessResponse<{
taskId: string
sessionId?: string
result?: string
error?: string
}>
export { type TaskSchedule } from "@folo-services/drizzle"