@doist/todoist-api-typescript 7.5.0 → 7.6.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/authentication.js +46 -2
- package/dist/cjs/consts/endpoints.js +54 -2
- package/dist/cjs/todoist-api.js +518 -0
- package/dist/cjs/types/entities.js +116 -1
- package/dist/cjs/types/requests.js +22 -1
- package/dist/cjs/utils/validators.js +19 -2
- package/dist/esm/authentication.js +46 -3
- package/dist/esm/consts/endpoints.js +43 -0
- package/dist/esm/todoist-api.js +520 -2
- package/dist/esm/types/entities.js +114 -0
- package/dist/esm/types/requests.js +21 -0
- package/dist/esm/utils/validators.js +19 -2
- package/dist/types/authentication.d.ts +51 -6
- package/dist/types/consts/endpoints.d.ts +22 -0
- package/dist/types/todoist-api.d.ts +195 -4
- package/dist/types/types/entities.d.ts +254 -14
- package/dist/types/types/requests.d.ts +383 -51
- package/dist/types/types/sync/resources/user.d.ts +2 -2
- package/dist/types/types/sync/resources/view-options.d.ts +5 -5
- package/dist/types/types/sync/user-preferences.d.ts +1 -1
- package/dist/types/utils/validators.d.ts +198 -6
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { RequireAllOrNone, RequireOneOrNone, RequireExactlyOne } from 'type-fest';
|
|
2
2
|
import type { ColorKey } from '../utils/colors.js';
|
|
3
|
-
import type { ActivityEvent, ActivityObjectEventType, CollaboratorRole, Comment, DueDate, Duration, Label, PersonalProject, ProjectViewStyle, ProjectVisibility, Section, Task, User, WorkspaceProject, WorkspaceRole } from './entities.js';
|
|
4
|
-
import type { LocationTrigger } from './sync/resources/reminders.js';
|
|
3
|
+
import type { ActivityEvent, ActivityObjectEventType, CollaboratorRole, Comment, DueDate, Duration, Label, MemberActivityInfo, PersonalProject, ProjectViewStyle, ProjectVisibility, Section, Task, User, WorkspaceInvitation, WorkspaceProject, WorkspaceRole, WorkspaceUser, WorkspaceUserTask } from './entities.js';
|
|
4
|
+
import type { LocationTrigger, Reminder, LocationReminder } from './sync/resources/reminders.js';
|
|
5
5
|
/**
|
|
6
6
|
* Arguments for creating a new task.
|
|
7
|
-
* @see https://todoist.com/api/v1
|
|
7
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/create_task_api_v1_tasks_post
|
|
8
8
|
*/
|
|
9
9
|
export type AddTaskArgs = {
|
|
10
10
|
content: string;
|
|
@@ -30,7 +30,7 @@ export type AddTaskArgs = {
|
|
|
30
30
|
}>;
|
|
31
31
|
/**
|
|
32
32
|
* Arguments for retrieving tasks.
|
|
33
|
-
* @see https://todoist.com/api/v1
|
|
33
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/get_tasks_api_v1_tasks_get
|
|
34
34
|
*/
|
|
35
35
|
export type GetTasksArgs = {
|
|
36
36
|
projectId?: string;
|
|
@@ -43,7 +43,7 @@ export type GetTasksArgs = {
|
|
|
43
43
|
};
|
|
44
44
|
/**
|
|
45
45
|
* Arguments for retrieving tasks by filter.
|
|
46
|
-
* @see https://todoist.com/api/v1
|
|
46
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/get_tasks_by_filter_api_v1_tasks_filter_get
|
|
47
47
|
*/
|
|
48
48
|
export type GetTasksByFilterArgs = {
|
|
49
49
|
query: string;
|
|
@@ -53,7 +53,7 @@ export type GetTasksByFilterArgs = {
|
|
|
53
53
|
};
|
|
54
54
|
/**
|
|
55
55
|
* Arguments for retrieving completed tasks by completion date.
|
|
56
|
-
* @see https://todoist.com/api/v1
|
|
56
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/tasks_completed_by_completion_date_api_v1_tasks_completed_by_completion_date_get
|
|
57
57
|
*/
|
|
58
58
|
export type GetCompletedTasksByCompletionDateArgs = {
|
|
59
59
|
since: string;
|
|
@@ -70,7 +70,7 @@ export type GetCompletedTasksByCompletionDateArgs = {
|
|
|
70
70
|
};
|
|
71
71
|
/**
|
|
72
72
|
* Arguments for retrieving completed tasks by due date.
|
|
73
|
-
* @see https://todoist.com/api/v1
|
|
73
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/tasks_completed_by_due_date_api_v1_tasks_completed_by_due_date_get
|
|
74
74
|
*/
|
|
75
75
|
export type GetCompletedTasksByDueDateArgs = {
|
|
76
76
|
since: string;
|
|
@@ -93,15 +93,15 @@ export type SearchCompletedTasksArgs = {
|
|
|
93
93
|
limit?: number;
|
|
94
94
|
};
|
|
95
95
|
/**
|
|
96
|
-
* @see https://todoist.com/api/v1
|
|
96
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/get_tasks_api_v1_tasks_get
|
|
97
97
|
*/
|
|
98
98
|
export type GetTasksResponse = {
|
|
99
99
|
results: Task[];
|
|
100
100
|
nextCursor: string | null;
|
|
101
101
|
};
|
|
102
102
|
/**
|
|
103
|
-
* @see https://todoist.com/api/v1
|
|
104
|
-
* @see https://todoist.com/api/v1
|
|
103
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/tasks_completed_by_due_date_api_v1_tasks_completed_by_due_date_get
|
|
104
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/tasks_completed_by_completion_date_api_v1_tasks_completed_by_completion_date_get
|
|
105
105
|
*/
|
|
106
106
|
export type GetCompletedTasksResponse = {
|
|
107
107
|
items: Task[];
|
|
@@ -109,7 +109,7 @@ export type GetCompletedTasksResponse = {
|
|
|
109
109
|
};
|
|
110
110
|
/**
|
|
111
111
|
* Arguments for updating a task.
|
|
112
|
-
* @see https://todoist.com/api/v1
|
|
112
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/update_task_api_v1_tasks__task_id__post
|
|
113
113
|
*/
|
|
114
114
|
export type UpdateTaskArgs = {
|
|
115
115
|
content?: string;
|
|
@@ -144,7 +144,7 @@ export type UpdateTaskArgs = {
|
|
|
144
144
|
}>;
|
|
145
145
|
/**
|
|
146
146
|
* Arguments for quick adding a task.
|
|
147
|
-
* @see https://todoist.com/api/v1
|
|
147
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/quick_add_api_v1_tasks_quick_post
|
|
148
148
|
*/
|
|
149
149
|
export type QuickAddTaskArgs = {
|
|
150
150
|
text: string;
|
|
@@ -156,11 +156,11 @@ export type QuickAddTaskArgs = {
|
|
|
156
156
|
};
|
|
157
157
|
/**
|
|
158
158
|
* Response from quick adding a task.
|
|
159
|
-
* @see https://todoist.com/api/v1
|
|
159
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/quick_add_api_v1_tasks_quick_post
|
|
160
160
|
*/
|
|
161
161
|
/**
|
|
162
162
|
* Arguments for moving a task.
|
|
163
|
-
* @see https://todoist.com/api/v1
|
|
163
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/move_task_api_v1_tasks__task_id__move_post
|
|
164
164
|
*/
|
|
165
165
|
export type MoveTaskArgs = RequireExactlyOne<{
|
|
166
166
|
projectId?: string;
|
|
@@ -169,7 +169,7 @@ export type MoveTaskArgs = RequireExactlyOne<{
|
|
|
169
169
|
}>;
|
|
170
170
|
/**
|
|
171
171
|
* Arguments for retrieving projects.
|
|
172
|
-
* @see https://todoist.com/api/v1
|
|
172
|
+
* @see https://developer.todoist.com/api/v1/#tag/Projects/operation/get_projects_api_v1_projects_get
|
|
173
173
|
*/
|
|
174
174
|
export type GetProjectsArgs = {
|
|
175
175
|
cursor?: string | null;
|
|
@@ -186,7 +186,7 @@ type SearchArgs = {
|
|
|
186
186
|
export type SearchProjectsArgs = SearchArgs;
|
|
187
187
|
/**
|
|
188
188
|
* Response from retrieving projects.
|
|
189
|
-
* @see https://todoist.com/api/v1
|
|
189
|
+
* @see https://developer.todoist.com/api/v1/#tag/Projects/operation/get_projects_api_v1_projects_get
|
|
190
190
|
*/
|
|
191
191
|
export type GetProjectsResponse = {
|
|
192
192
|
results: (PersonalProject | WorkspaceProject)[];
|
|
@@ -194,7 +194,7 @@ export type GetProjectsResponse = {
|
|
|
194
194
|
};
|
|
195
195
|
/**
|
|
196
196
|
* Arguments for retrieving archived projects.
|
|
197
|
-
* @see https://todoist.com/api/v1
|
|
197
|
+
* @see https://developer.todoist.com/api/v1/#tag/Projects/operation/get_archived_projects_api_v1_projects_archived_get
|
|
198
198
|
*/
|
|
199
199
|
export type GetArchivedProjectsArgs = {
|
|
200
200
|
cursor?: string | null;
|
|
@@ -202,7 +202,7 @@ export type GetArchivedProjectsArgs = {
|
|
|
202
202
|
};
|
|
203
203
|
/**
|
|
204
204
|
* Response from retrieving archived projects.
|
|
205
|
-
* @see https://todoist.com/api/v1
|
|
205
|
+
* @see https://developer.todoist.com/api/v1/#tag/Projects/operation/get_archived_projects_api_v1_projects_archived_get
|
|
206
206
|
*/
|
|
207
207
|
export type GetArchivedProjectsResponse = {
|
|
208
208
|
results: (PersonalProject | WorkspaceProject)[];
|
|
@@ -210,7 +210,7 @@ export type GetArchivedProjectsResponse = {
|
|
|
210
210
|
};
|
|
211
211
|
/**
|
|
212
212
|
* Arguments for creating a new project.
|
|
213
|
-
* @see https://todoist.com/api/v1
|
|
213
|
+
* @see https://developer.todoist.com/api/v1/#tag/Projects/operation/create_project_api_v1_projects_post
|
|
214
214
|
*/
|
|
215
215
|
export type AddProjectArgs = {
|
|
216
216
|
name: string;
|
|
@@ -222,7 +222,7 @@ export type AddProjectArgs = {
|
|
|
222
222
|
};
|
|
223
223
|
/**
|
|
224
224
|
* Arguments for updating a project.
|
|
225
|
-
* @see https://todoist.com/api/v1
|
|
225
|
+
* @see https://developer.todoist.com/api/v1/#tag/Projects/operation/update_project_api_v1_projects__project_id__post
|
|
226
226
|
*/
|
|
227
227
|
export type UpdateProjectArgs = {
|
|
228
228
|
name?: string;
|
|
@@ -232,7 +232,7 @@ export type UpdateProjectArgs = {
|
|
|
232
232
|
};
|
|
233
233
|
/**
|
|
234
234
|
* Arguments for retrieving project collaborators.
|
|
235
|
-
* @see https://todoist.com/api/v1
|
|
235
|
+
* @see https://developer.todoist.com/api/v1/#tag/Projects/operation/get_project_collaborators_api_v1_projects__project_id__collaborators_get
|
|
236
236
|
*/
|
|
237
237
|
export type GetProjectCollaboratorsArgs = {
|
|
238
238
|
cursor?: string | null;
|
|
@@ -240,7 +240,7 @@ export type GetProjectCollaboratorsArgs = {
|
|
|
240
240
|
};
|
|
241
241
|
/**
|
|
242
242
|
* Response from retrieving project collaborators.
|
|
243
|
-
* @see https://todoist.com/api/v1
|
|
243
|
+
* @see https://developer.todoist.com/api/v1/#tag/Projects/operation/get_project_collaborators_api_v1_projects__project_id__collaborators_get
|
|
244
244
|
*/
|
|
245
245
|
export type GetProjectCollaboratorsResponse = {
|
|
246
246
|
results: User[];
|
|
@@ -248,7 +248,7 @@ export type GetProjectCollaboratorsResponse = {
|
|
|
248
248
|
};
|
|
249
249
|
/**
|
|
250
250
|
* Arguments for retrieving sections.
|
|
251
|
-
* @see https://todoist.com/api/v1
|
|
251
|
+
* @see https://developer.todoist.com/api/v1/#tag/Sections/operation/get_sections_api_v1_sections_get
|
|
252
252
|
*/
|
|
253
253
|
export type GetSectionsArgs = {
|
|
254
254
|
projectId?: string | null;
|
|
@@ -263,7 +263,7 @@ export type SearchSectionsArgs = SearchArgs & {
|
|
|
263
263
|
};
|
|
264
264
|
/**
|
|
265
265
|
* Response from retrieving sections.
|
|
266
|
-
* @see https://todoist.com/api/v1
|
|
266
|
+
* @see https://developer.todoist.com/api/v1/#tag/Sections/operation/get_sections_api_v1_sections_get
|
|
267
267
|
*/
|
|
268
268
|
export type GetSectionsResponse = {
|
|
269
269
|
results: Section[];
|
|
@@ -271,7 +271,7 @@ export type GetSectionsResponse = {
|
|
|
271
271
|
};
|
|
272
272
|
/**
|
|
273
273
|
* Arguments for creating a new section.
|
|
274
|
-
* @see https://todoist.com/api/v1
|
|
274
|
+
* @see https://developer.todoist.com/api/v1/#tag/Sections/operation/create_section_api_v1_sections_post
|
|
275
275
|
*/
|
|
276
276
|
export type AddSectionArgs = {
|
|
277
277
|
name: string;
|
|
@@ -280,14 +280,14 @@ export type AddSectionArgs = {
|
|
|
280
280
|
};
|
|
281
281
|
/**
|
|
282
282
|
* Arguments for updating a section.
|
|
283
|
-
* @see https://todoist.com/api/v1
|
|
283
|
+
* @see https://developer.todoist.com/api/v1/#tag/Sections/operation/update_section_api_v1_sections__section_id__post
|
|
284
284
|
*/
|
|
285
285
|
export type UpdateSectionArgs = {
|
|
286
286
|
name: string;
|
|
287
287
|
};
|
|
288
288
|
/**
|
|
289
289
|
* Arguments for retrieving labels.
|
|
290
|
-
* @see https://todoist.com/api/v1
|
|
290
|
+
* @see https://developer.todoist.com/api/v1/#tag/Labels/operation/get_labels_api_v1_labels_get
|
|
291
291
|
*/
|
|
292
292
|
export type GetLabelsArgs = {
|
|
293
293
|
cursor?: string | null;
|
|
@@ -299,7 +299,7 @@ export type GetLabelsArgs = {
|
|
|
299
299
|
export type SearchLabelsArgs = SearchArgs;
|
|
300
300
|
/**
|
|
301
301
|
* Response from retrieving labels.
|
|
302
|
-
* @see https://todoist.com/api/v1
|
|
302
|
+
* @see https://developer.todoist.com/api/v1/#tag/Labels/operation/get_labels_api_v1_labels_get
|
|
303
303
|
*/
|
|
304
304
|
export type GetLabelsResponse = {
|
|
305
305
|
results: Label[];
|
|
@@ -307,7 +307,7 @@ export type GetLabelsResponse = {
|
|
|
307
307
|
};
|
|
308
308
|
/**
|
|
309
309
|
* Arguments for creating a new label.
|
|
310
|
-
* @see https://todoist.com/api/v1
|
|
310
|
+
* @see https://developer.todoist.com/api/v1/#tag/Labels/operation/create_label_api_v1_labels_post
|
|
311
311
|
*/
|
|
312
312
|
export type AddLabelArgs = {
|
|
313
313
|
name: string;
|
|
@@ -317,7 +317,7 @@ export type AddLabelArgs = {
|
|
|
317
317
|
};
|
|
318
318
|
/**
|
|
319
319
|
* Arguments for updating a label.
|
|
320
|
-
* @see https://todoist.com/api/v1
|
|
320
|
+
* @see https://developer.todoist.com/api/v1/#tag/Labels/operation/update_label_api_v1_labels__label_id__post
|
|
321
321
|
*/
|
|
322
322
|
export type UpdateLabelArgs = {
|
|
323
323
|
name?: string;
|
|
@@ -327,7 +327,7 @@ export type UpdateLabelArgs = {
|
|
|
327
327
|
};
|
|
328
328
|
/**
|
|
329
329
|
* Arguments for retrieving shared labels.
|
|
330
|
-
* @see https://todoist.com/api/v1
|
|
330
|
+
* @see https://developer.todoist.com/api/v1/#tag/Labels/operation/shared_labels_api_v1_labels_shared_get
|
|
331
331
|
*/
|
|
332
332
|
export type GetSharedLabelsArgs = {
|
|
333
333
|
omitPersonal?: boolean;
|
|
@@ -336,7 +336,7 @@ export type GetSharedLabelsArgs = {
|
|
|
336
336
|
};
|
|
337
337
|
/**
|
|
338
338
|
* Response from retrieving shared labels.
|
|
339
|
-
* @see https://todoist.com/api/v1
|
|
339
|
+
* @see https://developer.todoist.com/api/v1/#tag/Labels/operation/shared_labels_api_v1_labels_shared_get
|
|
340
340
|
*/
|
|
341
341
|
export type GetSharedLabelsResponse = {
|
|
342
342
|
results: string[];
|
|
@@ -344,7 +344,7 @@ export type GetSharedLabelsResponse = {
|
|
|
344
344
|
};
|
|
345
345
|
/**
|
|
346
346
|
* Arguments for renaming a shared label.
|
|
347
|
-
* @see https://todoist.com/api/v1
|
|
347
|
+
* @see https://developer.todoist.com/api/v1/#tag/Labels/operation/shared_labels_rename_api_v1_labels_shared_rename_post
|
|
348
348
|
*/
|
|
349
349
|
export type RenameSharedLabelArgs = {
|
|
350
350
|
name: string;
|
|
@@ -352,14 +352,14 @@ export type RenameSharedLabelArgs = {
|
|
|
352
352
|
};
|
|
353
353
|
/**
|
|
354
354
|
* Arguments for removing a shared label.
|
|
355
|
-
* @see https://todoist.com/api/v1
|
|
355
|
+
* @see https://developer.todoist.com/api/v1/#tag/Labels/operation/shared_labels_remove_api_v1_labels_shared_remove_post
|
|
356
356
|
*/
|
|
357
357
|
export type RemoveSharedLabelArgs = {
|
|
358
358
|
name: string;
|
|
359
359
|
};
|
|
360
360
|
/**
|
|
361
361
|
* Arguments for retrieving comments.
|
|
362
|
-
* @see https://todoist.com/api/v1
|
|
362
|
+
* @see https://developer.todoist.com/api/v1/#tag/Comments/operation/get_comments_api_v1_comments_get
|
|
363
363
|
*/
|
|
364
364
|
export type GetCommentsArgs = {
|
|
365
365
|
taskId: string;
|
|
@@ -369,7 +369,7 @@ export type GetCommentsArgs = {
|
|
|
369
369
|
};
|
|
370
370
|
/**
|
|
371
371
|
* Arguments for retrieving task comments.
|
|
372
|
-
* @see https://todoist.com/api/v1
|
|
372
|
+
* @see https://developer.todoist.com/api/v1/#tag/Comments/operation/get_comments_api_v1_comments_get
|
|
373
373
|
*/
|
|
374
374
|
export type GetTaskCommentsArgs = {
|
|
375
375
|
taskId: string;
|
|
@@ -379,7 +379,7 @@ export type GetTaskCommentsArgs = {
|
|
|
379
379
|
};
|
|
380
380
|
/**
|
|
381
381
|
* Arguments for retrieving project comments.
|
|
382
|
-
* @see https://todoist.com/api/v1
|
|
382
|
+
* @see https://developer.todoist.com/api/v1/#tag/Comments/operation/get_comments_api_v1_comments_get
|
|
383
383
|
*/
|
|
384
384
|
export type GetProjectCommentsArgs = {
|
|
385
385
|
projectId: string;
|
|
@@ -389,7 +389,7 @@ export type GetProjectCommentsArgs = {
|
|
|
389
389
|
};
|
|
390
390
|
/**
|
|
391
391
|
* Response from retrieving comments.
|
|
392
|
-
* @see https://todoist.com/api/v1
|
|
392
|
+
* @see https://developer.todoist.com/api/v1/#tag/Comments/operation/get_comments_api_v1_comments_get
|
|
393
393
|
*/
|
|
394
394
|
export type GetCommentsResponse = {
|
|
395
395
|
results: Comment[];
|
|
@@ -397,7 +397,7 @@ export type GetCommentsResponse = {
|
|
|
397
397
|
};
|
|
398
398
|
/**
|
|
399
399
|
* Arguments for creating a new comment.
|
|
400
|
-
* @see https://todoist.com/api/v1
|
|
400
|
+
* @see https://developer.todoist.com/api/v1/#tag/Comments/operation/create_comment_api_v1_comments_post
|
|
401
401
|
*/
|
|
402
402
|
export type AddCommentArgs = {
|
|
403
403
|
content: string;
|
|
@@ -413,7 +413,7 @@ export type AddCommentArgs = {
|
|
|
413
413
|
}>;
|
|
414
414
|
/**
|
|
415
415
|
* Arguments for updating a comment.
|
|
416
|
-
* @see https://todoist.com/api/v1
|
|
416
|
+
* @see https://developer.todoist.com/api/v1/#tag/Comments/operation/update_comment_api_v1_comments__comment_id__post
|
|
417
417
|
*/
|
|
418
418
|
export type UpdateCommentArgs = {
|
|
419
419
|
content: string;
|
|
@@ -553,7 +553,7 @@ export type GetActivityLogsResponse = {
|
|
|
553
553
|
};
|
|
554
554
|
/**
|
|
555
555
|
* Arguments for uploading a file.
|
|
556
|
-
* @see https://todoist.com/api/v1
|
|
556
|
+
* @see https://developer.todoist.com/api/v1/#tag/Uploads/operation/upload_file_api_v1_uploads_post
|
|
557
557
|
*/
|
|
558
558
|
export type UploadFileArgs = {
|
|
559
559
|
/**
|
|
@@ -575,7 +575,7 @@ export type UploadFileArgs = {
|
|
|
575
575
|
};
|
|
576
576
|
/**
|
|
577
577
|
* Arguments for deleting an uploaded file.
|
|
578
|
-
* @see https://todoist.com/api/v1
|
|
578
|
+
* @see https://developer.todoist.com/api/v1/#tag/Uploads/operation/delete_upload_api_v1_uploads_delete
|
|
579
579
|
*/
|
|
580
580
|
export type DeleteUploadArgs = {
|
|
581
581
|
/**
|
|
@@ -607,7 +607,7 @@ export type MoveProjectToPersonalArgs = {
|
|
|
607
607
|
};
|
|
608
608
|
/**
|
|
609
609
|
* Arguments for counting archived projects.
|
|
610
|
-
* @see https://todoist.com/api/v1
|
|
610
|
+
* @see https://developer.todoist.com/api/v1/#tag/Projects/operation/count_projects_archived_api_v1_projects_archived_count_get
|
|
611
611
|
*/
|
|
612
612
|
export type GetArchivedProjectsCountArgs = {
|
|
613
613
|
workspaceId?: number | null;
|
|
@@ -615,7 +615,7 @@ export type GetArchivedProjectsCountArgs = {
|
|
|
615
615
|
};
|
|
616
616
|
/**
|
|
617
617
|
* Response from counting archived projects.
|
|
618
|
-
* @see https://todoist.com/api/v1
|
|
618
|
+
* @see https://developer.todoist.com/api/v1/#tag/Projects/operation/count_projects_archived_api_v1_projects_archived_count_get
|
|
619
619
|
*/
|
|
620
620
|
export type GetArchivedProjectsCountResponse = {
|
|
621
621
|
count: number;
|
|
@@ -642,7 +642,7 @@ export type WorkspaceRoleView = {
|
|
|
642
642
|
};
|
|
643
643
|
/**
|
|
644
644
|
* Response from getting project permissions (role-to-action mappings).
|
|
645
|
-
* @see https://todoist.com/api/v1
|
|
645
|
+
* @see https://developer.todoist.com/api/v1/#tag/Projects/operation/permissions_api_v1_projects_permissions_get
|
|
646
646
|
*/
|
|
647
647
|
export type GetProjectPermissionsResponse = {
|
|
648
648
|
projectCollaboratorActions: ProjectRoleView[];
|
|
@@ -650,7 +650,7 @@ export type GetProjectPermissionsResponse = {
|
|
|
650
650
|
};
|
|
651
651
|
/**
|
|
652
652
|
* Arguments for getting full project data.
|
|
653
|
-
* @see https://todoist.com/api/v1
|
|
653
|
+
* @see https://developer.todoist.com/api/v1/#tag/Projects/operation/projects_full_data_api_v1_projects__project_id__full_get
|
|
654
654
|
*/
|
|
655
655
|
export type GetFullProjectArgs = {
|
|
656
656
|
/**
|
|
@@ -660,7 +660,7 @@ export type GetFullProjectArgs = {
|
|
|
660
660
|
};
|
|
661
661
|
/**
|
|
662
662
|
* Response from getting full project data.
|
|
663
|
-
* @see https://todoist.com/api/v1
|
|
663
|
+
* @see https://developer.todoist.com/api/v1/#tag/Projects/operation/projects_full_data_api_v1_projects__project_id__full_get
|
|
664
664
|
*/
|
|
665
665
|
export type GetFullProjectResponse = {
|
|
666
666
|
project: (PersonalProject | WorkspaceProject) | null;
|
|
@@ -670,9 +670,265 @@ export type GetFullProjectResponse = {
|
|
|
670
670
|
collaborators: User[];
|
|
671
671
|
notes: Comment[];
|
|
672
672
|
};
|
|
673
|
+
/**
|
|
674
|
+
* Arguments for listing backups.
|
|
675
|
+
* @see https://developer.todoist.com/api/v1/#tag/Backups/operation/get_backups_api_v1_backups_get
|
|
676
|
+
*/
|
|
677
|
+
export type GetBackupsArgs = {
|
|
678
|
+
/** MFA token if required. Not needed when using an OAuth token with the `backups:read` scope. */
|
|
679
|
+
mfaToken?: string | null;
|
|
680
|
+
};
|
|
681
|
+
/**
|
|
682
|
+
* Arguments for downloading a backup.
|
|
683
|
+
* @see https://developer.todoist.com/api/v1/#tag/Backups/operation/download_backup_api_v1_backups_download_get
|
|
684
|
+
*/
|
|
685
|
+
export type DownloadBackupArgs = {
|
|
686
|
+
/** The backup file URL. */
|
|
687
|
+
file: string;
|
|
688
|
+
};
|
|
689
|
+
/** Object types that support email forwarding. */
|
|
690
|
+
export declare const EMAIL_OBJECT_TYPES: readonly ["project", "project_comments", "task"];
|
|
691
|
+
/** Object type that supports email forwarding. */
|
|
692
|
+
export type EmailObjectType = (typeof EMAIL_OBJECT_TYPES)[number];
|
|
693
|
+
/**
|
|
694
|
+
* Arguments for getting or creating an email forwarding address.
|
|
695
|
+
* @see https://developer.todoist.com/api/v1/#tag/Emails/operation/email_get_or_create_api_v1_emails_put
|
|
696
|
+
*/
|
|
697
|
+
export type GetOrCreateEmailArgs = {
|
|
698
|
+
/** The type of object to forward emails to. */
|
|
699
|
+
objType: EmailObjectType;
|
|
700
|
+
/** The ID of the object. */
|
|
701
|
+
objId: string;
|
|
702
|
+
};
|
|
703
|
+
/**
|
|
704
|
+
* Response from getting or creating an email forwarding address.
|
|
705
|
+
*/
|
|
706
|
+
export type GetOrCreateEmailResponse = {
|
|
707
|
+
email: string;
|
|
708
|
+
};
|
|
709
|
+
/**
|
|
710
|
+
* Arguments for disabling email forwarding.
|
|
711
|
+
* @see https://developer.todoist.com/api/v1/#tag/Emails/operation/email_disable_api_v1_emails_delete
|
|
712
|
+
*/
|
|
713
|
+
export type DisableEmailArgs = {
|
|
714
|
+
/** The type of object to disable forwarding for. */
|
|
715
|
+
objType: EmailObjectType;
|
|
716
|
+
/** The ID of the object. */
|
|
717
|
+
objId: string;
|
|
718
|
+
};
|
|
719
|
+
/** Object types that support ID mappings. */
|
|
720
|
+
export declare const ID_MAPPING_OBJECT_TYPES: readonly ["sections", "tasks", "comments", "reminders", "location_reminders", "projects"];
|
|
721
|
+
/** Object type that supports ID mappings. */
|
|
722
|
+
export type IdMappingObjectType = (typeof ID_MAPPING_OBJECT_TYPES)[number];
|
|
723
|
+
/** Object types that support moved ID lookups. */
|
|
724
|
+
export declare const MOVED_ID_OBJECT_TYPES: readonly ["sections", "tasks", "comments", "reminders", "location_reminders"];
|
|
725
|
+
/** Object type that supports moved ID lookups. */
|
|
726
|
+
export type MovedIdObjectType = (typeof MOVED_ID_OBJECT_TYPES)[number];
|
|
727
|
+
/**
|
|
728
|
+
* Arguments for getting ID mappings between old and new IDs.
|
|
729
|
+
* @see https://developer.todoist.com/api/v1/#tag/Ids/operation/id_mappings_api_v1_id_mappings__obj_name___obj_ids__get
|
|
730
|
+
*/
|
|
731
|
+
export type GetIdMappingsArgs = {
|
|
732
|
+
/** The type of object to look up. */
|
|
733
|
+
objName: IdMappingObjectType;
|
|
734
|
+
/** Array of IDs to look up. */
|
|
735
|
+
objIds: [string, ...string[]];
|
|
736
|
+
};
|
|
737
|
+
/**
|
|
738
|
+
* Arguments for getting moved IDs.
|
|
739
|
+
* @see https://developer.todoist.com/api/v1/#tag/Ids/operation/moved_ids_api_v1_moved_ids__obj_name__get
|
|
740
|
+
*/
|
|
741
|
+
export type GetMovedIdsArgs = {
|
|
742
|
+
/** The type of object to look up. */
|
|
743
|
+
objName: MovedIdObjectType;
|
|
744
|
+
/** Array of old IDs to look up. */
|
|
745
|
+
oldIds?: string[];
|
|
746
|
+
};
|
|
747
|
+
/**
|
|
748
|
+
* Arguments for listing reminders.
|
|
749
|
+
* @see https://developer.todoist.com/api/v1/#tag/Reminders/operation/get_reminders_api_v1_reminders_get
|
|
750
|
+
*/
|
|
751
|
+
export type GetRemindersArgs = {
|
|
752
|
+
/** Filter by task ID. */
|
|
753
|
+
taskId?: string | null;
|
|
754
|
+
/** Cursor for pagination. */
|
|
755
|
+
cursor?: string | null;
|
|
756
|
+
/** Number of results per page (max 200, default 50). */
|
|
757
|
+
limit?: number;
|
|
758
|
+
};
|
|
759
|
+
/**
|
|
760
|
+
* Paginated response for reminders.
|
|
761
|
+
*/
|
|
762
|
+
export type GetRemindersResponse = {
|
|
763
|
+
results: Reminder[];
|
|
764
|
+
nextCursor: string | null;
|
|
765
|
+
};
|
|
766
|
+
/**
|
|
767
|
+
* Arguments for listing location reminders.
|
|
768
|
+
* @see https://developer.todoist.com/api/v1/#tag/Location-reminders/operation/get_location_reminders_api_v1_location_reminders_get
|
|
769
|
+
*/
|
|
770
|
+
export type GetLocationRemindersArgs = {
|
|
771
|
+
/** Filter by task ID. */
|
|
772
|
+
taskId?: string | null;
|
|
773
|
+
/** Cursor for pagination. */
|
|
774
|
+
cursor?: string | null;
|
|
775
|
+
/** Number of results per page (max 200, default 50). */
|
|
776
|
+
limit?: number;
|
|
777
|
+
};
|
|
778
|
+
/**
|
|
779
|
+
* Paginated response for location reminders.
|
|
780
|
+
*/
|
|
781
|
+
export type GetLocationRemindersResponse = {
|
|
782
|
+
results: LocationReminder[];
|
|
783
|
+
nextCursor: string | null;
|
|
784
|
+
};
|
|
785
|
+
/**
|
|
786
|
+
* Arguments for getting all completed tasks.
|
|
787
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/get_all_completed_items_api_v1_tasks_completed_get
|
|
788
|
+
*/
|
|
789
|
+
export type GetAllCompletedTasksArgs = {
|
|
790
|
+
/** Filter by project ID. */
|
|
791
|
+
projectId?: string | null;
|
|
792
|
+
/** Filter by label name. */
|
|
793
|
+
label?: string | null;
|
|
794
|
+
/** Number of results to return (max 200, default 30). */
|
|
795
|
+
limit?: number;
|
|
796
|
+
/** Number of results to skip (default 0). */
|
|
797
|
+
offset?: number;
|
|
798
|
+
/** Return items completed after this date. */
|
|
799
|
+
since?: Date | null;
|
|
800
|
+
/** Return items completed before this date. */
|
|
801
|
+
until?: Date | null;
|
|
802
|
+
/** Include comment data in the response. */
|
|
803
|
+
annotateNotes?: boolean;
|
|
804
|
+
/** Include task data in the response. */
|
|
805
|
+
annotateItems?: boolean;
|
|
806
|
+
};
|
|
807
|
+
/**
|
|
808
|
+
* Response from getting all completed tasks.
|
|
809
|
+
*/
|
|
810
|
+
export type GetAllCompletedTasksResponse = {
|
|
811
|
+
projects: Record<string, Record<string, unknown>>;
|
|
812
|
+
sections: Record<string, Record<string, unknown>>;
|
|
813
|
+
items: Task[];
|
|
814
|
+
};
|
|
815
|
+
/**
|
|
816
|
+
* Arguments for exporting a project as a template file.
|
|
817
|
+
* @see https://developer.todoist.com/api/v1/#tag/Templates/operation/export_as_file_api_v1_templates_file_get
|
|
818
|
+
*/
|
|
819
|
+
export type ExportTemplateFileArgs = {
|
|
820
|
+
/** The project ID to export. */
|
|
821
|
+
projectId: string;
|
|
822
|
+
/** Whether to use relative dates in the export. */
|
|
823
|
+
useRelativeDates?: boolean;
|
|
824
|
+
};
|
|
825
|
+
/**
|
|
826
|
+
* Arguments for exporting a project as a template URL.
|
|
827
|
+
* @see https://developer.todoist.com/api/v1/#tag/Templates/operation/export_as_url_api_v1_templates_url_get
|
|
828
|
+
*/
|
|
829
|
+
export type ExportTemplateUrlArgs = {
|
|
830
|
+
/** The project ID to export. */
|
|
831
|
+
projectId: string;
|
|
832
|
+
/** Whether to use relative dates in the export. */
|
|
833
|
+
useRelativeDates?: boolean;
|
|
834
|
+
};
|
|
835
|
+
/**
|
|
836
|
+
* Response from exporting a project as a template URL.
|
|
837
|
+
*/
|
|
838
|
+
export type ExportTemplateUrlResponse = {
|
|
839
|
+
fileName: string;
|
|
840
|
+
fileUrl: string;
|
|
841
|
+
};
|
|
842
|
+
/**
|
|
843
|
+
* Arguments for creating a project from a template file.
|
|
844
|
+
* @see https://developer.todoist.com/api/v1/#tag/Templates/operation/create_project_from_file_api_v1_templates_create_project_from_file_post
|
|
845
|
+
*/
|
|
846
|
+
export type CreateProjectFromTemplateArgs = {
|
|
847
|
+
/** Name for the new project. */
|
|
848
|
+
name: string;
|
|
849
|
+
/** The template file content. */
|
|
850
|
+
file: Buffer | NodeJS.ReadableStream | string | Blob;
|
|
851
|
+
/** Optional file name (required for Buffer/Stream). */
|
|
852
|
+
fileName?: string;
|
|
853
|
+
/** Optional workspace ID. */
|
|
854
|
+
workspaceId?: string | null;
|
|
855
|
+
};
|
|
856
|
+
/**
|
|
857
|
+
* Response from creating a project from a template.
|
|
858
|
+
*/
|
|
859
|
+
export type CreateProjectFromTemplateResponse = {
|
|
860
|
+
status: string;
|
|
861
|
+
projectId: string;
|
|
862
|
+
templateType: string;
|
|
863
|
+
projects: (PersonalProject | WorkspaceProject)[];
|
|
864
|
+
sections: Section[];
|
|
865
|
+
tasks: Task[];
|
|
866
|
+
comments: Comment[];
|
|
867
|
+
};
|
|
868
|
+
/**
|
|
869
|
+
* Arguments for importing a template file into an existing project.
|
|
870
|
+
* @see https://developer.todoist.com/api/v1/#tag/Templates/operation/import_into_project_from_file_api_v1_templates_import_into_project_from_file_post
|
|
871
|
+
*/
|
|
872
|
+
export type ImportTemplateIntoProjectArgs = {
|
|
873
|
+
/** The project ID to import into. */
|
|
874
|
+
projectId: string;
|
|
875
|
+
/** The template file content. */
|
|
876
|
+
file: Buffer | NodeJS.ReadableStream | string | Blob;
|
|
877
|
+
/** Optional file name (required for Buffer/Stream). */
|
|
878
|
+
fileName?: string;
|
|
879
|
+
};
|
|
880
|
+
/**
|
|
881
|
+
* Arguments for importing a template by ID into an existing project.
|
|
882
|
+
* @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
|
|
883
|
+
*/
|
|
884
|
+
export type ImportTemplateFromIdArgs = {
|
|
885
|
+
/** The project ID to import into. */
|
|
886
|
+
projectId: string;
|
|
887
|
+
/** The template ID to import. */
|
|
888
|
+
templateId: string;
|
|
889
|
+
/** Locale for the import (default: 'en'). */
|
|
890
|
+
locale?: string;
|
|
891
|
+
};
|
|
892
|
+
/**
|
|
893
|
+
* Response from importing a template into a project.
|
|
894
|
+
*/
|
|
895
|
+
export type ImportTemplateResponse = {
|
|
896
|
+
status: string;
|
|
897
|
+
templateType: string;
|
|
898
|
+
projects: (PersonalProject | WorkspaceProject)[];
|
|
899
|
+
sections: Section[];
|
|
900
|
+
tasks: Task[];
|
|
901
|
+
comments: Comment[];
|
|
902
|
+
};
|
|
903
|
+
/** Known activity object types. Accepts any string for forward compatibility. */
|
|
904
|
+
export type InsightsObjectType = 'ITEM' | 'PROJECT' | 'NOTE' | (string & Record<string, never>);
|
|
905
|
+
/** Known activity event types. Accepts any string for forward compatibility. */
|
|
906
|
+
export type InsightsEventType = 'ADDED' | 'DELETED' | 'UPDATED' | 'ARCHIVED' | 'UNARCHIVED' | 'COMPLETED' | 'UNCOMPLETED' | 'SHARED' | 'LEFT' | (string & Record<string, never>);
|
|
907
|
+
/**
|
|
908
|
+
* Arguments for getting project activity stats.
|
|
909
|
+
* @see https://developer.todoist.com/api/v1/#tag/Insights/operation/get_project_activity_stats_api_v1_projects__project_id__insights_activity_stats_get
|
|
910
|
+
*/
|
|
911
|
+
export type GetProjectActivityStatsArgs = {
|
|
912
|
+
/** The type of object to get activity counts for (default: 'ITEM'). */
|
|
913
|
+
objectType?: InsightsObjectType;
|
|
914
|
+
/** The type of event to count (default: 'COMPLETED'). */
|
|
915
|
+
eventType?: InsightsEventType;
|
|
916
|
+
/** Number of weeks of activity counts to retrieve (1-12, default 2). */
|
|
917
|
+
weeks?: number;
|
|
918
|
+
/** Whether to include weekly rollup counts in the response. */
|
|
919
|
+
includeWeeklyCounts?: boolean;
|
|
920
|
+
};
|
|
921
|
+
/**
|
|
922
|
+
* Arguments for getting workspace insights.
|
|
923
|
+
* @see https://developer.todoist.com/api/v1/#tag/Insights/operation/get_workspace_insights_api_v1_workspaces__workspace_id__insights_get
|
|
924
|
+
*/
|
|
925
|
+
export type GetWorkspaceInsightsArgs = {
|
|
926
|
+
/** Project IDs to get insights for. */
|
|
927
|
+
projectIds?: string[];
|
|
928
|
+
};
|
|
673
929
|
/**
|
|
674
930
|
* Arguments for creating a new workspace.
|
|
675
|
-
* @see https://todoist.com/api/v1
|
|
931
|
+
* @see https://developer.todoist.com/api/v1/#tag/Workspace/operation/create_workspace_api_v1_workspaces_post
|
|
676
932
|
*/
|
|
677
933
|
export type AddWorkspaceArgs = {
|
|
678
934
|
/** Name of the workspace. */
|
|
@@ -694,7 +950,7 @@ export type AddWorkspaceArgs = {
|
|
|
694
950
|
};
|
|
695
951
|
/**
|
|
696
952
|
* Arguments for updating an existing workspace.
|
|
697
|
-
* @see https://todoist.com/api/v1
|
|
953
|
+
* @see https://developer.todoist.com/api/v1/#tag/Workspace/operation/update_workspace_api_v1_workspaces__workspace_id__post
|
|
698
954
|
*/
|
|
699
955
|
export type UpdateWorkspaceArgs = {
|
|
700
956
|
/** Updated workspace name. */
|
|
@@ -716,6 +972,82 @@ export type UpdateWorkspaceArgs = {
|
|
|
716
972
|
/** Updated collapse state for current user. */
|
|
717
973
|
isCollapsed?: boolean;
|
|
718
974
|
};
|
|
975
|
+
/**
|
|
976
|
+
* Arguments for getting workspace members activity.
|
|
977
|
+
* @see https://developer.todoist.com/api/v1/#tag/Workspace/operation/get_workspace_members_activity_api_v1_workspaces_members_get
|
|
978
|
+
*/
|
|
979
|
+
export type GetWorkspaceMembersActivityArgs = {
|
|
980
|
+
/** The workspace ID. */
|
|
981
|
+
workspaceId: string;
|
|
982
|
+
/** Comma-separated list of user IDs to filter by. */
|
|
983
|
+
userIds?: string | null;
|
|
984
|
+
/** Comma-separated list of project IDs to filter by. */
|
|
985
|
+
projectIds?: string | null;
|
|
986
|
+
};
|
|
987
|
+
/**
|
|
988
|
+
* Response from getting workspace members activity.
|
|
989
|
+
*/
|
|
990
|
+
export type GetWorkspaceMembersActivityResponse = {
|
|
991
|
+
members: MemberActivityInfo[];
|
|
992
|
+
};
|
|
993
|
+
/**
|
|
994
|
+
* Arguments for getting tasks assigned to a workspace user.
|
|
995
|
+
* @see https://developer.todoist.com/api/v1/#tag/Workspace/operation/get_workspace_user_tasks_api_v1_workspaces__workspace_id__users__user_id__tasks_get
|
|
996
|
+
*/
|
|
997
|
+
export type GetWorkspaceUserTasksArgs = {
|
|
998
|
+
/** The workspace ID. */
|
|
999
|
+
workspaceId: string;
|
|
1000
|
+
/** The user ID. */
|
|
1001
|
+
userId: string;
|
|
1002
|
+
/** Comma-separated list of project IDs to filter by. */
|
|
1003
|
+
projectIds?: string | null;
|
|
1004
|
+
};
|
|
1005
|
+
/**
|
|
1006
|
+
* Response from getting workspace user tasks.
|
|
1007
|
+
*/
|
|
1008
|
+
export type GetWorkspaceUserTasksResponse = {
|
|
1009
|
+
tasks: WorkspaceUserTask[];
|
|
1010
|
+
};
|
|
1011
|
+
/**
|
|
1012
|
+
* Arguments for inviting users to a workspace.
|
|
1013
|
+
* @see https://developer.todoist.com/api/v1/#tag/Workspace/operation/invite_workspace_users_api_v1_workspaces__workspace_id__users_invite_post
|
|
1014
|
+
*/
|
|
1015
|
+
export type InviteWorkspaceUsersArgs = {
|
|
1016
|
+
/** The workspace ID. */
|
|
1017
|
+
workspaceId: string;
|
|
1018
|
+
/** List of user emails to invite. */
|
|
1019
|
+
emailList: string[];
|
|
1020
|
+
/** Role assigned to invited users. */
|
|
1021
|
+
role?: WorkspaceRole;
|
|
1022
|
+
};
|
|
1023
|
+
/**
|
|
1024
|
+
* Response from inviting workspace users.
|
|
1025
|
+
*/
|
|
1026
|
+
export type InviteWorkspaceUsersResponse = {
|
|
1027
|
+
invitedEmails: string[];
|
|
1028
|
+
};
|
|
1029
|
+
/**
|
|
1030
|
+
* Arguments for updating a workspace user's role.
|
|
1031
|
+
* @see https://developer.todoist.com/api/v1/#tag/Workspace/operation/update_workspace_user_api_v1_workspaces__workspace_id__users__user_id__post
|
|
1032
|
+
*/
|
|
1033
|
+
export type UpdateWorkspaceUserArgs = {
|
|
1034
|
+
/** The workspace ID. */
|
|
1035
|
+
workspaceId: string;
|
|
1036
|
+
/** The user ID. */
|
|
1037
|
+
userId: string;
|
|
1038
|
+
/** Updated role for the user. */
|
|
1039
|
+
role: WorkspaceRole;
|
|
1040
|
+
};
|
|
1041
|
+
/**
|
|
1042
|
+
* Arguments for removing a user from a workspace.
|
|
1043
|
+
* @see https://developer.todoist.com/api/v1/#tag/Workspace/operation/remove_workspace_user_api_v1_workspaces__workspace_id__users__user_id__delete
|
|
1044
|
+
*/
|
|
1045
|
+
export type RemoveWorkspaceUserArgs = {
|
|
1046
|
+
/** The workspace ID. */
|
|
1047
|
+
workspaceId: string;
|
|
1048
|
+
/** The user ID. */
|
|
1049
|
+
userId: string;
|
|
1050
|
+
};
|
|
719
1051
|
/**
|
|
720
1052
|
* Arguments for getting workspace invitations.
|
|
721
1053
|
*/
|
|
@@ -839,7 +1171,7 @@ export type GetWorkspaceUsersResponse = {
|
|
|
839
1171
|
/**
|
|
840
1172
|
* Array of workspace users.
|
|
841
1173
|
*/
|
|
842
|
-
workspaceUsers:
|
|
1174
|
+
workspaceUsers: WorkspaceUser[];
|
|
843
1175
|
};
|
|
844
1176
|
/**
|
|
845
1177
|
* Response type for workspace invitations endpoint (simple email list).
|
|
@@ -848,7 +1180,7 @@ export type WorkspaceInvitationsResponse = string[];
|
|
|
848
1180
|
/**
|
|
849
1181
|
* Response type for all workspace invitations endpoint (detailed objects).
|
|
850
1182
|
*/
|
|
851
|
-
export type AllWorkspaceInvitationsResponse =
|
|
1183
|
+
export type AllWorkspaceInvitationsResponse = WorkspaceInvitation[];
|
|
852
1184
|
/**
|
|
853
1185
|
* Response type for workspace logo upload.
|
|
854
1186
|
*/
|