import type { RawAxiosRequestHeaders } from 'axios'; import type { GetTaskParams, GetEntryParams, QueryParams, CollectionProp } from '../../common-types'; import type { CreateTaskParams, UpdateTaskParams, DeleteTaskParams, TaskProps, CreateTaskProps, UpdateTaskProps } from '../../entities/task'; import type { OptionalDefaults } from '../wrappers/wrap'; export type TaskPlainClientAPI = { /** Fetches a task * * @param params Space ID, Entry ID, Environment ID, and Task ID * @returns the task * @throws if the request fails or the task is not found * @example * ```javascript * const task = await client.task.get({ * spaceId: '', * entryId: '', * environmentId: '', * taskId: '', * }); * ``` */ get(params: OptionalDefaults): Promise; /** Fetches all tasks for a given entry * * @param params Space ID, Entry ID, Environment ID, and query parameters * @returns a collection of tasks * @throws if the request fails or the tasks are not found * @example * ```javascript * const tasks = await client.task.getMany({ * spaceId: '', * entryId: '', * environmentId: '', * query: { * limit: 100, * } * }); * ``` */ getMany(params: OptionalDefaults): Promise>; /** Creates a task * * @param params Space ID, Entry ID, Environment ID * @param rawData the task to create * @returns the created task * @throws if the request fails or or the payload is malformed * @example * ```javascript * const task = await client.task.create( * { * spaceId: '', * entryId: '', * environmentId: '', * }, * { * body: "Review Translation", * status: "active", * assignedTo: { * sys: { * type: "Link", * linkType: "User", * id: * } * } * } * ); * ``` */ create(params: OptionalDefaults, rawData: CreateTaskProps, headers?: RawAxiosRequestHeaders): Promise; /** Updates a task * * @param params Space ID, Entry ID, Environment ID, and Task ID * @param rawData the task update * @returns the updated task * @throws if the request fails, the task is not found, or the payload is malformed * @example * ```javascript * const task = await client.task.update( * { * spaceId: '', * entryId: '', * environmentId: '', * taskId: '', * }, * { * body: "Review Translation", * status: "active", * assignedTo: { * sys: { * type: "Link", * linkType: "User", * id: * } * } * } * ); * ``` */ update(params: OptionalDefaults, rawData: UpdateTaskProps, headers?: RawAxiosRequestHeaders): Promise; /** Deletes a task * * @param params Space ID, Entry ID, Environment ID, and Task ID * @throws if the request fails or the task is not found * @example * ```javascript * await client.task.delete({ * spaceId: '', * entryId: '', * environmentId: '', * taskId: '', * }); * ``` */ delete(params: OptionalDefaults): Promise; };