1 | import type { BasicMetaSysProps, DefaultElements, GetEntryParams, GetTaskParams, Link, MakeRequest, SysLink } from '../common-types';
|
2 | export type TaskStatus = 'active' | 'resolved';
|
3 | export type TaskSysProps = Pick<BasicMetaSysProps, 'id' | 'version' | 'createdAt' | 'createdBy' | 'updatedAt' | 'updatedBy'> & {
|
4 | type: 'Task';
|
5 | space: SysLink;
|
6 | environment: SysLink;
|
7 | parentEntity: Link<'Entry'>;
|
8 | };
|
9 | export type TaskProps = {
|
10 | sys: TaskSysProps;
|
11 | body: string;
|
12 | assignedTo: Link<'User' | 'Team'>;
|
13 | status: TaskStatus;
|
14 | dueDate?: string;
|
15 | };
|
16 | export type CreateTaskProps = Omit<TaskProps, 'sys'>;
|
17 | export type UpdateTaskProps = Omit<TaskProps, 'sys'> & {
|
18 | sys: Pick<TaskSysProps, 'version'>;
|
19 | };
|
20 | export type CreateTaskParams = GetEntryParams;
|
21 | export type UpdateTaskParams = GetTaskParams;
|
22 | export type DeleteTaskParams = GetTaskParams & {
|
23 | version: number;
|
24 | };
|
25 | type TaskApi = {
|
26 | update(): Promise<Task>;
|
27 | delete(): Promise<void>;
|
28 | };
|
29 | export interface Task extends TaskProps, DefaultElements<TaskProps>, TaskApi {
|
30 | }
|
31 |
|
32 |
|
33 |
|
34 | export default function createTaskApi(makeRequest: MakeRequest): TaskApi;
|
35 |
|
36 |
|
37 |
|
38 | export declare function wrapTask(makeRequest: MakeRequest, data: TaskProps): Task;
|
39 |
|
40 |
|
41 |
|
42 | export declare const wrapTaskCollection: (makeRequest: MakeRequest, data: import("../common-types").CollectionProp<TaskProps>) => import("../common-types").Collection<Task, TaskProps>;
|
43 | export {};
|