@doist/todoist-api-typescript 7.6.0 → 7.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/todoist-api.js +8 -7
- package/dist/cjs/types/activity/index.js +18 -0
- package/dist/cjs/types/activity/requests.js +2 -0
- package/dist/cjs/types/activity/types.js +28 -0
- package/dist/cjs/types/backups/index.js +18 -0
- package/dist/cjs/types/backups/requests.js +2 -0
- package/dist/cjs/types/backups/types.js +8 -0
- package/dist/cjs/types/comments/index.js +18 -0
- package/dist/cjs/types/comments/requests.js +2 -0
- package/dist/cjs/types/comments/types.js +60 -0
- package/dist/cjs/types/common.js +2 -0
- package/dist/cjs/types/emails/index.js +17 -0
- package/dist/cjs/types/emails/requests.js +5 -0
- package/dist/cjs/types/id-mappings/index.js +18 -0
- package/dist/cjs/types/{requests.js → id-mappings/requests.js} +1 -7
- package/dist/cjs/types/id-mappings/types.js +12 -0
- package/dist/cjs/types/index.js +16 -2
- package/dist/cjs/types/insights/index.js +18 -0
- package/dist/cjs/types/insights/requests.js +2 -0
- package/dist/cjs/types/insights/types.js +84 -0
- package/dist/cjs/types/labels/index.js +18 -0
- package/dist/cjs/types/labels/requests.js +2 -0
- package/dist/cjs/types/labels/types.js +11 -0
- package/dist/cjs/types/productivity/index.js +17 -0
- package/dist/cjs/types/productivity/types.js +67 -0
- package/dist/cjs/types/projects/index.js +18 -0
- package/dist/cjs/types/projects/requests.js +2 -0
- package/dist/cjs/types/projects/types.js +56 -0
- package/dist/cjs/types/reminders/index.js +17 -0
- package/dist/cjs/types/reminders/requests.js +5 -0
- package/dist/cjs/types/sections/index.js +18 -0
- package/dist/cjs/types/sections/requests.js +2 -0
- package/dist/cjs/types/sections/types.js +22 -0
- package/dist/cjs/types/sync/commands/shared.js +2 -2
- package/dist/cjs/types/sync/resources/collaborators.js +2 -2
- package/dist/cjs/types/sync/resources/notes.js +2 -2
- package/dist/cjs/types/sync/resources/reminders.js +3 -3
- package/dist/cjs/types/sync/resources/user.js +2 -2
- package/dist/cjs/types/sync/resources/workspaces.js +5 -5
- package/dist/cjs/types/tasks/index.js +18 -0
- package/dist/cjs/types/tasks/requests.js +2 -0
- package/dist/cjs/types/tasks/types.js +59 -0
- package/dist/cjs/types/templates/index.js +17 -0
- package/dist/cjs/types/templates/requests.js +2 -0
- package/dist/cjs/types/uploads/index.js +17 -0
- package/dist/cjs/types/uploads/requests.js +2 -0
- package/dist/cjs/types/users/index.js +17 -0
- package/dist/cjs/types/users/types.js +51 -0
- package/dist/cjs/types/workspaces/index.js +18 -0
- package/dist/cjs/types/workspaces/requests.js +2 -0
- package/dist/cjs/types/workspaces/types.js +137 -0
- package/dist/cjs/utils/validators.js +38 -27
- package/dist/esm/todoist-api.js +4 -3
- package/dist/esm/types/activity/index.js +2 -0
- package/dist/esm/types/activity/requests.js +1 -0
- package/dist/esm/types/activity/types.js +25 -0
- package/dist/esm/types/backups/index.js +2 -0
- package/dist/esm/types/backups/requests.js +1 -0
- package/dist/esm/types/backups/types.js +5 -0
- package/dist/esm/types/comments/index.js +2 -0
- package/dist/esm/types/comments/requests.js +1 -0
- package/dist/esm/types/comments/types.js +57 -0
- package/dist/esm/types/common.js +1 -0
- package/dist/esm/types/emails/index.js +1 -0
- package/dist/esm/types/emails/requests.js +2 -0
- package/dist/esm/types/id-mappings/index.js +2 -0
- package/dist/esm/types/{requests.js → id-mappings/requests.js} +0 -6
- package/dist/esm/types/id-mappings/types.js +9 -0
- package/dist/esm/types/index.js +16 -2
- package/dist/esm/types/insights/index.js +2 -0
- package/dist/esm/types/insights/requests.js +1 -0
- package/dist/esm/types/insights/types.js +81 -0
- package/dist/esm/types/labels/index.js +2 -0
- package/dist/esm/types/labels/requests.js +1 -0
- package/dist/esm/types/labels/types.js +8 -0
- package/dist/esm/types/productivity/index.js +1 -0
- package/dist/esm/types/productivity/types.js +64 -0
- package/dist/esm/types/projects/index.js +2 -0
- package/dist/esm/types/projects/requests.js +1 -0
- package/dist/esm/types/projects/types.js +53 -0
- package/dist/esm/types/reminders/index.js +1 -0
- package/dist/esm/types/reminders/requests.js +2 -0
- package/dist/esm/types/sections/index.js +2 -0
- package/dist/esm/types/sections/requests.js +1 -0
- package/dist/esm/types/sections/types.js +19 -0
- package/dist/esm/types/sync/commands/shared.js +1 -1
- package/dist/esm/types/sync/resources/collaborators.js +1 -1
- package/dist/esm/types/sync/resources/notes.js +1 -1
- package/dist/esm/types/sync/resources/reminders.js +1 -1
- package/dist/esm/types/sync/resources/user.js +1 -1
- package/dist/esm/types/sync/resources/workspaces.js +1 -1
- package/dist/esm/types/tasks/index.js +2 -0
- package/dist/esm/types/tasks/requests.js +1 -0
- package/dist/esm/types/tasks/types.js +56 -0
- package/dist/esm/types/templates/index.js +1 -0
- package/dist/esm/types/templates/requests.js +1 -0
- package/dist/esm/types/uploads/index.js +1 -0
- package/dist/esm/types/uploads/requests.js +1 -0
- package/dist/esm/types/users/index.js +1 -0
- package/dist/esm/types/users/types.js +48 -0
- package/dist/esm/types/workspaces/index.js +2 -0
- package/dist/esm/types/workspaces/requests.js +1 -0
- package/dist/esm/types/workspaces/types.js +134 -0
- package/dist/esm/utils/validators.js +12 -1
- package/dist/types/test-utils/test-defaults.d.ts +5 -5
- package/dist/types/todoist-api.d.ts +16 -2
- package/dist/types/types/activity/index.d.ts +2 -0
- package/dist/types/types/activity/requests.d.ts +85 -0
- package/dist/types/types/activity/types.d.ts +49 -0
- package/dist/types/types/backups/index.d.ts +2 -0
- package/dist/types/types/backups/requests.d.ts +16 -0
- package/dist/types/types/backups/types.d.ts +7 -0
- package/dist/types/types/comments/index.d.ts +2 -0
- package/dist/types/types/comments/requests.d.ts +64 -0
- package/dist/types/types/comments/types.d.ts +141 -0
- package/dist/types/types/common.d.ts +6 -0
- package/dist/types/types/emails/index.d.ts +1 -0
- package/dist/types/types/emails/requests.d.ts +30 -0
- package/dist/types/types/id-mappings/index.d.ts +2 -0
- package/dist/types/types/id-mappings/requests.d.ts +28 -0
- package/dist/types/types/id-mappings/types.d.ts +13 -0
- package/dist/types/types/index.d.ts +16 -2
- package/dist/types/types/insights/index.d.ts +2 -0
- package/dist/types/types/insights/requests.d.ts +26 -0
- package/dist/types/types/insights/types.d.ts +186 -0
- package/dist/types/types/labels/index.d.ts +2 -0
- package/dist/types/types/labels/requests.d.ts +75 -0
- package/dist/types/types/labels/types.d.ts +13 -0
- package/dist/types/types/productivity/index.d.ts +1 -0
- package/dist/types/types/productivity/types.d.ts +115 -0
- package/dist/types/types/projects/index.d.ts +2 -0
- package/dist/types/types/projects/requests.d.ts +169 -0
- package/dist/types/types/projects/types.d.ts +201 -0
- package/dist/types/types/reminders/index.d.ts +1 -0
- package/dist/types/types/reminders/requests.d.ts +91 -0
- package/dist/types/types/sections/index.d.ts +2 -0
- package/dist/types/types/sections/requests.d.ts +41 -0
- package/dist/types/types/sections/types.d.ts +44 -0
- package/dist/types/types/sync/commands/projects.d.ts +2 -1
- package/dist/types/types/sync/commands/shared.d.ts +2 -2
- package/dist/types/types/sync/commands/workspaces.d.ts +1 -1
- package/dist/types/types/sync/resources/notes.d.ts +1 -1
- package/dist/types/types/sync/response.d.ts +5 -1
- package/dist/types/types/tasks/index.d.ts +2 -0
- package/dist/types/types/tasks/requests.d.ts +197 -0
- package/dist/types/types/tasks/types.d.ts +162 -0
- package/dist/types/types/templates/index.d.ts +1 -0
- package/dist/types/types/templates/requests.d.ts +92 -0
- package/dist/types/types/uploads/index.d.ts +1 -0
- package/dist/types/types/uploads/requests.d.ts +32 -0
- package/dist/types/types/users/index.d.ts +1 -0
- package/dist/types/types/users/types.d.ts +66 -0
- package/dist/types/types/workspaces/index.d.ts +2 -0
- package/dist/types/types/workspaces/requests.d.ts +260 -0
- package/dist/types/types/workspaces/types.d.ts +225 -0
- package/dist/types/utils/colors.d.ts +1 -1
- package/dist/types/utils/validators.d.ts +7 -6
- package/package.json +3 -3
- package/dist/cjs/types/entities.js +0 -552
- package/dist/esm/types/entities.js +0 -548
- package/dist/types/types/entities.d.ts +0 -1211
- package/dist/types/types/requests.d.ts +0 -1188
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import type { RequireAllOrNone, RequireOneOrNone, RequireExactlyOne } from 'type-fest';
|
|
2
|
+
import type { Duration, Task } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Arguments for creating a new task.
|
|
5
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/create_task_api_v1_tasks_post
|
|
6
|
+
*/
|
|
7
|
+
export type AddTaskArgs = {
|
|
8
|
+
content: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
projectId?: string;
|
|
11
|
+
sectionId?: string;
|
|
12
|
+
parentId?: string;
|
|
13
|
+
order?: number;
|
|
14
|
+
labels?: string[];
|
|
15
|
+
priority?: number;
|
|
16
|
+
assigneeId?: string;
|
|
17
|
+
dueString?: string;
|
|
18
|
+
dueLang?: string;
|
|
19
|
+
deadlineLang?: string;
|
|
20
|
+
deadlineDate?: string;
|
|
21
|
+
isUncompletable?: boolean;
|
|
22
|
+
} & RequireOneOrNone<{
|
|
23
|
+
dueDate?: string;
|
|
24
|
+
dueDatetime?: string;
|
|
25
|
+
}> & RequireAllOrNone<{
|
|
26
|
+
duration?: Duration['amount'];
|
|
27
|
+
durationUnit?: Duration['unit'];
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Arguments for retrieving tasks.
|
|
31
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/get_tasks_api_v1_tasks_get
|
|
32
|
+
*/
|
|
33
|
+
export type GetTasksArgs = {
|
|
34
|
+
projectId?: string;
|
|
35
|
+
sectionId?: string;
|
|
36
|
+
parentId?: string;
|
|
37
|
+
label?: string;
|
|
38
|
+
ids?: string[];
|
|
39
|
+
cursor?: string | null;
|
|
40
|
+
limit?: number;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Arguments for retrieving tasks by filter.
|
|
44
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/get_tasks_by_filter_api_v1_tasks_filter_get
|
|
45
|
+
*/
|
|
46
|
+
export type GetTasksByFilterArgs = {
|
|
47
|
+
query: string;
|
|
48
|
+
lang?: string;
|
|
49
|
+
cursor?: string | null;
|
|
50
|
+
limit?: number;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Arguments for retrieving completed tasks by completion date.
|
|
54
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/tasks_completed_by_completion_date_api_v1_tasks_completed_by_completion_date_get
|
|
55
|
+
*/
|
|
56
|
+
export type GetCompletedTasksByCompletionDateArgs = {
|
|
57
|
+
since: string;
|
|
58
|
+
until: string;
|
|
59
|
+
workspaceId?: string | null;
|
|
60
|
+
projectId?: string | null;
|
|
61
|
+
sectionId?: string | null;
|
|
62
|
+
parentId?: string | null;
|
|
63
|
+
filterQuery?: string | null;
|
|
64
|
+
filterLang?: string | null;
|
|
65
|
+
cursor?: string | null;
|
|
66
|
+
limit?: number;
|
|
67
|
+
publicKey?: string | null;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Arguments for retrieving completed tasks by due date.
|
|
71
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/tasks_completed_by_due_date_api_v1_tasks_completed_by_due_date_get
|
|
72
|
+
*/
|
|
73
|
+
export type GetCompletedTasksByDueDateArgs = {
|
|
74
|
+
since: string;
|
|
75
|
+
until: string;
|
|
76
|
+
workspaceId?: string | null;
|
|
77
|
+
projectId?: string | null;
|
|
78
|
+
sectionId?: string | null;
|
|
79
|
+
parentId?: string | null;
|
|
80
|
+
filterQuery?: string | null;
|
|
81
|
+
filterLang?: string | null;
|
|
82
|
+
cursor?: string | null;
|
|
83
|
+
limit?: number;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Arguments for searching completed tasks.
|
|
87
|
+
*/
|
|
88
|
+
export type SearchCompletedTasksArgs = {
|
|
89
|
+
query: string;
|
|
90
|
+
cursor?: string | null;
|
|
91
|
+
limit?: number;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/get_tasks_api_v1_tasks_get
|
|
95
|
+
*/
|
|
96
|
+
export type GetTasksResponse = {
|
|
97
|
+
results: Task[];
|
|
98
|
+
nextCursor: string | null;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/tasks_completed_by_due_date_api_v1_tasks_completed_by_due_date_get
|
|
102
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/tasks_completed_by_completion_date_api_v1_tasks_completed_by_completion_date_get
|
|
103
|
+
*/
|
|
104
|
+
export type GetCompletedTasksResponse = {
|
|
105
|
+
items: Task[];
|
|
106
|
+
nextCursor: string | null;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Arguments for updating a task.
|
|
110
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/update_task_api_v1_tasks__task_id__post
|
|
111
|
+
*/
|
|
112
|
+
export type UpdateTaskArgs = {
|
|
113
|
+
content?: string;
|
|
114
|
+
description?: string;
|
|
115
|
+
labels?: string[];
|
|
116
|
+
priority?: number;
|
|
117
|
+
/**
|
|
118
|
+
* Sort order of the task within its parent/project.
|
|
119
|
+
* Internally mapped to `child_order` in the API payload.
|
|
120
|
+
*/
|
|
121
|
+
order?: number;
|
|
122
|
+
/**
|
|
123
|
+
* Natural language due date.
|
|
124
|
+
* Use `"no date"` to clear a due date, or `null` as an SDK alias for the same behavior.
|
|
125
|
+
*/
|
|
126
|
+
dueString?: (string & {}) | 'no date' | null;
|
|
127
|
+
dueLang?: string | null;
|
|
128
|
+
assigneeId?: string | null;
|
|
129
|
+
/**
|
|
130
|
+
* Deadline date in `YYYY-MM-DD` format.
|
|
131
|
+
* Use `null` to clear a task deadline.
|
|
132
|
+
*/
|
|
133
|
+
deadlineDate?: string | null;
|
|
134
|
+
deadlineLang?: string | null;
|
|
135
|
+
isUncompletable?: boolean;
|
|
136
|
+
} & RequireOneOrNone<{
|
|
137
|
+
dueDate?: string;
|
|
138
|
+
dueDatetime?: string;
|
|
139
|
+
}> & RequireAllOrNone<{
|
|
140
|
+
duration?: Duration['amount'];
|
|
141
|
+
durationUnit?: Duration['unit'];
|
|
142
|
+
}>;
|
|
143
|
+
/**
|
|
144
|
+
* Arguments for quick adding a task.
|
|
145
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/quick_add_api_v1_tasks_quick_post
|
|
146
|
+
*/
|
|
147
|
+
export type QuickAddTaskArgs = {
|
|
148
|
+
text: string;
|
|
149
|
+
note?: string;
|
|
150
|
+
reminder?: string;
|
|
151
|
+
autoReminder?: boolean;
|
|
152
|
+
meta?: boolean;
|
|
153
|
+
isUncompletable?: boolean;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Response from quick adding a task.
|
|
157
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/quick_add_api_v1_tasks_quick_post
|
|
158
|
+
*/
|
|
159
|
+
/**
|
|
160
|
+
* Arguments for moving a task.
|
|
161
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/move_task_api_v1_tasks__task_id__move_post
|
|
162
|
+
*/
|
|
163
|
+
export type MoveTaskArgs = RequireExactlyOne<{
|
|
164
|
+
projectId?: string;
|
|
165
|
+
sectionId?: string;
|
|
166
|
+
parentId?: string;
|
|
167
|
+
}>;
|
|
168
|
+
/**
|
|
169
|
+
* Arguments for getting all completed tasks.
|
|
170
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/get_all_completed_items_api_v1_tasks_completed_get
|
|
171
|
+
*/
|
|
172
|
+
export type GetAllCompletedTasksArgs = {
|
|
173
|
+
/** Filter by project ID. */
|
|
174
|
+
projectId?: string | null;
|
|
175
|
+
/** Filter by label name. */
|
|
176
|
+
label?: string | null;
|
|
177
|
+
/** Number of results to return (max 200, default 30). */
|
|
178
|
+
limit?: number;
|
|
179
|
+
/** Number of results to skip (default 0). */
|
|
180
|
+
offset?: number;
|
|
181
|
+
/** Return items completed after this date. */
|
|
182
|
+
since?: Date | null;
|
|
183
|
+
/** Return items completed before this date. */
|
|
184
|
+
until?: Date | null;
|
|
185
|
+
/** Include comment data in the response. */
|
|
186
|
+
annotateNotes?: boolean;
|
|
187
|
+
/** Include task data in the response. */
|
|
188
|
+
annotateItems?: boolean;
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Response from getting all completed tasks.
|
|
192
|
+
*/
|
|
193
|
+
export type GetAllCompletedTasksResponse = {
|
|
194
|
+
projects: Record<string, Record<string, unknown>>;
|
|
195
|
+
sections: Record<string, Record<string, unknown>>;
|
|
196
|
+
items: Task[];
|
|
197
|
+
};
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const DueDateSchema: z.ZodObject<{
|
|
3
|
+
isRecurring: z.ZodBoolean;
|
|
4
|
+
string: z.ZodString;
|
|
5
|
+
date: z.ZodString;
|
|
6
|
+
datetime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7
|
+
timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8
|
+
lang: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
/**
|
|
11
|
+
* Represents a due date for a task.
|
|
12
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/get_tasks_api_v1_tasks_get
|
|
13
|
+
*/
|
|
14
|
+
export type DueDate = z.infer<typeof DueDateSchema>;
|
|
15
|
+
/** Available duration units for task deadlines. */
|
|
16
|
+
export declare const DURATION_UNITS: readonly ["minute", "day"];
|
|
17
|
+
/** Unit of time for a task duration. */
|
|
18
|
+
export type DurationUnit = (typeof DURATION_UNITS)[number];
|
|
19
|
+
export declare const DurationSchema: z.ZodObject<{
|
|
20
|
+
amount: z.ZodNumber;
|
|
21
|
+
unit: z.ZodEnum<{
|
|
22
|
+
minute: "minute";
|
|
23
|
+
day: "day";
|
|
24
|
+
}>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
/**
|
|
27
|
+
* Represents a duration for a task deadline.
|
|
28
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks
|
|
29
|
+
*/
|
|
30
|
+
export type Duration = z.infer<typeof DurationSchema>;
|
|
31
|
+
export declare const DeadlineSchema: z.ZodObject<{
|
|
32
|
+
date: z.ZodString;
|
|
33
|
+
lang: z.ZodString;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
/**
|
|
36
|
+
* Represents a task deadline.
|
|
37
|
+
*/
|
|
38
|
+
export type Deadline = z.infer<typeof DeadlineSchema>;
|
|
39
|
+
export declare const TaskSchema: z.ZodPipe<z.ZodObject<{
|
|
40
|
+
id: z.ZodString;
|
|
41
|
+
userId: z.ZodString;
|
|
42
|
+
projectId: z.ZodString;
|
|
43
|
+
sectionId: z.ZodNullable<z.ZodString>;
|
|
44
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
45
|
+
addedByUid: z.ZodNullable<z.ZodString>;
|
|
46
|
+
assignedByUid: z.ZodNullable<z.ZodString>;
|
|
47
|
+
responsibleUid: z.ZodNullable<z.ZodString>;
|
|
48
|
+
labels: z.ZodArray<z.ZodString>;
|
|
49
|
+
deadline: z.ZodNullable<z.ZodObject<{
|
|
50
|
+
date: z.ZodString;
|
|
51
|
+
lang: z.ZodString;
|
|
52
|
+
}, z.core.$strip>>;
|
|
53
|
+
duration: z.ZodNullable<z.ZodObject<{
|
|
54
|
+
amount: z.ZodNumber;
|
|
55
|
+
unit: z.ZodEnum<{
|
|
56
|
+
minute: "minute";
|
|
57
|
+
day: "day";
|
|
58
|
+
}>;
|
|
59
|
+
}, z.core.$strip>>;
|
|
60
|
+
checked: z.ZodBoolean;
|
|
61
|
+
isDeleted: z.ZodBoolean;
|
|
62
|
+
addedAt: z.ZodNullable<z.ZodString>;
|
|
63
|
+
completedAt: z.ZodNullable<z.ZodString>;
|
|
64
|
+
updatedAt: z.ZodNullable<z.ZodString>;
|
|
65
|
+
due: z.ZodNullable<z.ZodObject<{
|
|
66
|
+
isRecurring: z.ZodBoolean;
|
|
67
|
+
string: z.ZodString;
|
|
68
|
+
date: z.ZodString;
|
|
69
|
+
datetime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
70
|
+
timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
71
|
+
lang: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
72
|
+
}, z.core.$strip>>;
|
|
73
|
+
priority: z.ZodNumber;
|
|
74
|
+
childOrder: z.ZodNumber;
|
|
75
|
+
content: z.ZodString;
|
|
76
|
+
description: z.ZodString;
|
|
77
|
+
dayOrder: z.ZodNumber;
|
|
78
|
+
isCollapsed: z.ZodBoolean;
|
|
79
|
+
isUncompletable: z.ZodDefault<z.ZodBoolean>;
|
|
80
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
81
|
+
isUncompletable: boolean;
|
|
82
|
+
url: string;
|
|
83
|
+
id: string;
|
|
84
|
+
userId: string;
|
|
85
|
+
projectId: string;
|
|
86
|
+
sectionId: string | null;
|
|
87
|
+
parentId: string | null;
|
|
88
|
+
addedByUid: string | null;
|
|
89
|
+
assignedByUid: string | null;
|
|
90
|
+
responsibleUid: string | null;
|
|
91
|
+
labels: string[];
|
|
92
|
+
deadline: {
|
|
93
|
+
date: string;
|
|
94
|
+
lang: string;
|
|
95
|
+
} | null;
|
|
96
|
+
duration: {
|
|
97
|
+
amount: number;
|
|
98
|
+
unit: "minute" | "day";
|
|
99
|
+
} | null;
|
|
100
|
+
checked: boolean;
|
|
101
|
+
isDeleted: boolean;
|
|
102
|
+
addedAt: string | null;
|
|
103
|
+
completedAt: string | null;
|
|
104
|
+
updatedAt: string | null;
|
|
105
|
+
due: {
|
|
106
|
+
isRecurring: boolean;
|
|
107
|
+
string: string;
|
|
108
|
+
date: string;
|
|
109
|
+
datetime?: string | null | undefined;
|
|
110
|
+
timezone?: string | null | undefined;
|
|
111
|
+
lang?: string | null | undefined;
|
|
112
|
+
} | null;
|
|
113
|
+
priority: number;
|
|
114
|
+
childOrder: number;
|
|
115
|
+
content: string;
|
|
116
|
+
description: string;
|
|
117
|
+
dayOrder: number;
|
|
118
|
+
isCollapsed: boolean;
|
|
119
|
+
}, {
|
|
120
|
+
id: string;
|
|
121
|
+
userId: string;
|
|
122
|
+
projectId: string;
|
|
123
|
+
sectionId: string | null;
|
|
124
|
+
parentId: string | null;
|
|
125
|
+
addedByUid: string | null;
|
|
126
|
+
assignedByUid: string | null;
|
|
127
|
+
responsibleUid: string | null;
|
|
128
|
+
labels: string[];
|
|
129
|
+
deadline: {
|
|
130
|
+
date: string;
|
|
131
|
+
lang: string;
|
|
132
|
+
} | null;
|
|
133
|
+
duration: {
|
|
134
|
+
amount: number;
|
|
135
|
+
unit: "minute" | "day";
|
|
136
|
+
} | null;
|
|
137
|
+
checked: boolean;
|
|
138
|
+
isDeleted: boolean;
|
|
139
|
+
addedAt: string | null;
|
|
140
|
+
completedAt: string | null;
|
|
141
|
+
updatedAt: string | null;
|
|
142
|
+
due: {
|
|
143
|
+
isRecurring: boolean;
|
|
144
|
+
string: string;
|
|
145
|
+
date: string;
|
|
146
|
+
datetime?: string | null | undefined;
|
|
147
|
+
timezone?: string | null | undefined;
|
|
148
|
+
lang?: string | null | undefined;
|
|
149
|
+
} | null;
|
|
150
|
+
priority: number;
|
|
151
|
+
childOrder: number;
|
|
152
|
+
content: string;
|
|
153
|
+
description: string;
|
|
154
|
+
dayOrder: number;
|
|
155
|
+
isCollapsed: boolean;
|
|
156
|
+
isUncompletable: boolean;
|
|
157
|
+
}>>;
|
|
158
|
+
/**
|
|
159
|
+
* Represents a task in Todoist.
|
|
160
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks
|
|
161
|
+
*/
|
|
162
|
+
export type Task = z.infer<typeof TaskSchema>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './requests.js';
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { Comment } from '../comments/types.js';
|
|
2
|
+
import type { PersonalProject, WorkspaceProject } from '../projects/types.js';
|
|
3
|
+
import type { Section } from '../sections/types.js';
|
|
4
|
+
import type { Task } from '../tasks/types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Arguments for exporting a project as a template file.
|
|
7
|
+
* @see https://developer.todoist.com/api/v1/#tag/Templates/operation/export_as_file_api_v1_templates_file_get
|
|
8
|
+
*/
|
|
9
|
+
export type ExportTemplateFileArgs = {
|
|
10
|
+
/** The project ID to export. */
|
|
11
|
+
projectId: string;
|
|
12
|
+
/** Whether to use relative dates in the export. */
|
|
13
|
+
useRelativeDates?: boolean;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Arguments for exporting a project as a template URL.
|
|
17
|
+
* @see https://developer.todoist.com/api/v1/#tag/Templates/operation/export_as_url_api_v1_templates_url_get
|
|
18
|
+
*/
|
|
19
|
+
export type ExportTemplateUrlArgs = {
|
|
20
|
+
/** The project ID to export. */
|
|
21
|
+
projectId: string;
|
|
22
|
+
/** Whether to use relative dates in the export. */
|
|
23
|
+
useRelativeDates?: boolean;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Response from exporting a project as a template URL.
|
|
27
|
+
*/
|
|
28
|
+
export type ExportTemplateUrlResponse = {
|
|
29
|
+
fileName: string;
|
|
30
|
+
fileUrl: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Arguments for creating a project from a template file.
|
|
34
|
+
* @see https://developer.todoist.com/api/v1/#tag/Templates/operation/create_project_from_file_api_v1_templates_create_project_from_file_post
|
|
35
|
+
*/
|
|
36
|
+
export type CreateProjectFromTemplateArgs = {
|
|
37
|
+
/** Name for the new project. */
|
|
38
|
+
name: string;
|
|
39
|
+
/** The template file content. */
|
|
40
|
+
file: Buffer | NodeJS.ReadableStream | string | Blob;
|
|
41
|
+
/** Optional file name (required for Buffer/Stream). */
|
|
42
|
+
fileName?: string;
|
|
43
|
+
/** Optional workspace ID. */
|
|
44
|
+
workspaceId?: string | null;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Response from creating a project from a template.
|
|
48
|
+
*/
|
|
49
|
+
export type CreateProjectFromTemplateResponse = {
|
|
50
|
+
status: string;
|
|
51
|
+
projectId: string;
|
|
52
|
+
templateType: string;
|
|
53
|
+
projects: (PersonalProject | WorkspaceProject)[];
|
|
54
|
+
sections: Section[];
|
|
55
|
+
tasks: Task[];
|
|
56
|
+
comments: Comment[];
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Arguments for importing a template file into an existing project.
|
|
60
|
+
* @see https://developer.todoist.com/api/v1/#tag/Templates/operation/import_into_project_from_file_api_v1_templates_import_into_project_from_file_post
|
|
61
|
+
*/
|
|
62
|
+
export type ImportTemplateIntoProjectArgs = {
|
|
63
|
+
/** The project ID to import into. */
|
|
64
|
+
projectId: string;
|
|
65
|
+
/** The template file content. */
|
|
66
|
+
file: Buffer | NodeJS.ReadableStream | string | Blob;
|
|
67
|
+
/** Optional file name (required for Buffer/Stream). */
|
|
68
|
+
fileName?: string;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Arguments for importing a template by ID into an existing project.
|
|
72
|
+
* @see https://developer.todoist.com/api/v1/#tag/Templates/operation/import_into_project_from_template_id_api_v1_templates_import_into_project_from_template_id_post
|
|
73
|
+
*/
|
|
74
|
+
export type ImportTemplateFromIdArgs = {
|
|
75
|
+
/** The project ID to import into. */
|
|
76
|
+
projectId: string;
|
|
77
|
+
/** The template ID to import. */
|
|
78
|
+
templateId: string;
|
|
79
|
+
/** Locale for the import (default: 'en'). */
|
|
80
|
+
locale?: string;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Response from importing a template into a project.
|
|
84
|
+
*/
|
|
85
|
+
export type ImportTemplateResponse = {
|
|
86
|
+
status: string;
|
|
87
|
+
templateType: string;
|
|
88
|
+
projects: (PersonalProject | WorkspaceProject)[];
|
|
89
|
+
sections: Section[];
|
|
90
|
+
tasks: Task[];
|
|
91
|
+
comments: Comment[];
|
|
92
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './requests.js';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arguments for uploading a file.
|
|
3
|
+
* @see https://developer.todoist.com/api/v1/#tag/Uploads/operation/upload_file_api_v1_uploads_post
|
|
4
|
+
*/
|
|
5
|
+
export type UploadFileArgs = {
|
|
6
|
+
/**
|
|
7
|
+
* The file content to upload. Can be:
|
|
8
|
+
* - Buffer: File content as a Buffer (requires fileName)
|
|
9
|
+
* - ReadableStream: File content as a stream (requires fileName)
|
|
10
|
+
* - string: Path to a file on the filesystem (fileName is optional, will be inferred from path)
|
|
11
|
+
*/
|
|
12
|
+
file: Buffer | NodeJS.ReadableStream | string | Blob;
|
|
13
|
+
/**
|
|
14
|
+
* The name of the file. Required for Buffer and Stream inputs.
|
|
15
|
+
* Optional for file path strings and File objects (will be inferred if not provided).
|
|
16
|
+
*/
|
|
17
|
+
fileName?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The project ID to associate the upload with.
|
|
20
|
+
*/
|
|
21
|
+
projectId?: string | null;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Arguments for deleting an uploaded file.
|
|
25
|
+
* @see https://developer.todoist.com/api/v1/#tag/Uploads/operation/delete_upload_api_v1_uploads_delete
|
|
26
|
+
*/
|
|
27
|
+
export type DeleteUploadArgs = {
|
|
28
|
+
/**
|
|
29
|
+
* The URL of the file to delete.
|
|
30
|
+
*/
|
|
31
|
+
fileUrl: string;
|
|
32
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './types.js';
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const UserSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
email: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
/**
|
|
8
|
+
* Represents a user in Todoist (simplified for collaborators).
|
|
9
|
+
* @see https://developer.todoist.com/api/v1/#tag/User
|
|
10
|
+
*/
|
|
11
|
+
export type User = z.infer<typeof UserSchema>;
|
|
12
|
+
export declare const TimezoneInfoSchema: z.ZodObject<{
|
|
13
|
+
gmtString: z.ZodString;
|
|
14
|
+
hours: z.ZodNumber;
|
|
15
|
+
isDst: z.ZodNumber;
|
|
16
|
+
minutes: z.ZodNumber;
|
|
17
|
+
timezone: z.ZodString;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
/** Available user premium statuses. */
|
|
20
|
+
export declare const PREMIUM_STATUSES: readonly ["not_premium", "current_personal_plan", "legacy_personal_plan", "teams_business_member"];
|
|
21
|
+
/** Premium subscription status of a user. */
|
|
22
|
+
export type PremiumStatus = (typeof PREMIUM_STATUSES)[number];
|
|
23
|
+
export declare const CurrentUserSchema: z.ZodObject<{
|
|
24
|
+
id: z.ZodString;
|
|
25
|
+
email: z.ZodString;
|
|
26
|
+
fullName: z.ZodString;
|
|
27
|
+
avatarBig: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
|
+
avatarMedium: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
29
|
+
avatarS640: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
30
|
+
avatarSmall: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31
|
+
businessAccountId: z.ZodNullable<z.ZodString>;
|
|
32
|
+
isPremium: z.ZodBoolean;
|
|
33
|
+
premiumStatus: z.ZodEnum<{
|
|
34
|
+
not_premium: "not_premium";
|
|
35
|
+
current_personal_plan: "current_personal_plan";
|
|
36
|
+
legacy_personal_plan: "legacy_personal_plan";
|
|
37
|
+
teams_business_member: "teams_business_member";
|
|
38
|
+
}>;
|
|
39
|
+
dateFormat: z.ZodNumber;
|
|
40
|
+
timeFormat: z.ZodNumber;
|
|
41
|
+
weeklyGoal: z.ZodNumber;
|
|
42
|
+
dailyGoal: z.ZodNumber;
|
|
43
|
+
completedCount: z.ZodNumber;
|
|
44
|
+
completedToday: z.ZodNumber;
|
|
45
|
+
karma: z.ZodNumber;
|
|
46
|
+
karmaTrend: z.ZodString;
|
|
47
|
+
lang: z.ZodString;
|
|
48
|
+
nextWeek: z.ZodNumber;
|
|
49
|
+
startDay: z.ZodNumber;
|
|
50
|
+
startPage: z.ZodString;
|
|
51
|
+
tzInfo: z.ZodObject<{
|
|
52
|
+
gmtString: z.ZodString;
|
|
53
|
+
hours: z.ZodNumber;
|
|
54
|
+
isDst: z.ZodNumber;
|
|
55
|
+
minutes: z.ZodNumber;
|
|
56
|
+
timezone: z.ZodString;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
inboxProjectId: z.ZodString;
|
|
59
|
+
daysOff: z.ZodArray<z.ZodNumber>;
|
|
60
|
+
weekendStartDay: z.ZodNumber;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
/**
|
|
63
|
+
* Represents the current authenticated user with detailed information.
|
|
64
|
+
* @see https://developer.todoist.com/api/v1/#tag/User
|
|
65
|
+
*/
|
|
66
|
+
export type CurrentUser = z.infer<typeof CurrentUserSchema>;
|