@doist/todoist-api-typescript 7.4.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.
Files changed (49) hide show
  1. package/README.md +2 -0
  2. package/dist/cjs/authentication.js +50 -6
  3. package/dist/cjs/consts/endpoints.js +63 -1
  4. package/dist/cjs/test-utils/test-defaults.js +33 -1
  5. package/dist/cjs/todoist-api.js +1130 -168
  6. package/dist/cjs/{utils → transport}/fetch-with-retry.js +23 -71
  7. package/dist/cjs/{rest-client.js → transport/http-client.js} +5 -5
  8. package/dist/cjs/transport/http-dispatcher.js +72 -0
  9. package/dist/cjs/types/entities.js +124 -1
  10. package/dist/cjs/types/errors.js +9 -1
  11. package/dist/cjs/types/http.js +3 -1
  12. package/dist/cjs/types/requests.js +24 -0
  13. package/dist/cjs/types/sync/commands/shared.js +2 -8
  14. package/dist/cjs/types/sync/resources/reminders.js +2 -0
  15. package/dist/cjs/utils/multipart-upload.js +1 -1
  16. package/dist/cjs/utils/validators.js +19 -2
  17. package/dist/esm/authentication.js +47 -4
  18. package/dist/esm/consts/endpoints.js +52 -0
  19. package/dist/esm/test-utils/test-defaults.js +32 -0
  20. package/dist/esm/todoist-api.js +1061 -99
  21. package/dist/esm/{utils → transport}/fetch-with-retry.js +23 -38
  22. package/dist/esm/{rest-client.js → transport/http-client.js} +5 -5
  23. package/dist/esm/transport/http-dispatcher.js +35 -0
  24. package/dist/esm/types/entities.js +122 -0
  25. package/dist/esm/types/errors.js +7 -0
  26. package/dist/esm/types/http.js +3 -1
  27. package/dist/esm/types/requests.js +23 -1
  28. package/dist/esm/types/sync/commands/shared.js +1 -8
  29. package/dist/esm/types/sync/resources/reminders.js +2 -0
  30. package/dist/esm/utils/multipart-upload.js +1 -1
  31. package/dist/esm/utils/validators.js +19 -2
  32. package/dist/types/authentication.d.ts +51 -6
  33. package/dist/types/consts/endpoints.d.ts +31 -0
  34. package/dist/types/test-utils/test-defaults.d.ts +5 -1
  35. package/dist/types/todoist-api.d.ts +338 -6
  36. package/dist/types/{utils → transport}/fetch-with-retry.d.ts +1 -1
  37. package/dist/types/{rest-client.d.ts → transport/http-client.d.ts} +1 -1
  38. package/dist/types/transport/http-dispatcher.d.ts +3 -0
  39. package/dist/types/types/entities.d.ts +258 -14
  40. package/dist/types/types/errors.d.ts +4 -0
  41. package/dist/types/types/requests.d.ts +537 -43
  42. package/dist/types/types/sync/commands/projects.d.ts +2 -2
  43. package/dist/types/types/sync/commands/shared.d.ts +1 -4
  44. package/dist/types/types/sync/resources/reminders.d.ts +4 -0
  45. package/dist/types/types/sync/resources/user.d.ts +2 -2
  46. package/dist/types/types/sync/resources/view-options.d.ts +5 -5
  47. package/dist/types/types/sync/user-preferences.d.ts +1 -1
  48. package/dist/types/utils/validators.d.ts +202 -6
  49. package/package.json +4 -4
@@ -1,9 +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, Comment, Duration, Label, PersonalProject, ProjectViewStyle, ProjectVisibility, Section, Task, User, WorkspaceProject } from './entities.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';
4
5
  /**
5
6
  * Arguments for creating a new task.
6
- * @see https://todoist.com/api/v1/docs#tag/Tasks/operation/create_task_api_v1_tasks_post
7
+ * @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/create_task_api_v1_tasks_post
7
8
  */
8
9
  export type AddTaskArgs = {
9
10
  content: string;
@@ -29,7 +30,7 @@ export type AddTaskArgs = {
29
30
  }>;
30
31
  /**
31
32
  * Arguments for retrieving tasks.
32
- * @see https://todoist.com/api/v1/docs#tag/Tasks/operation/get_tasks_api_v1_tasks_get
33
+ * @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/get_tasks_api_v1_tasks_get
33
34
  */
34
35
  export type GetTasksArgs = {
35
36
  projectId?: string;
@@ -42,7 +43,7 @@ export type GetTasksArgs = {
42
43
  };
43
44
  /**
44
45
  * Arguments for retrieving tasks by filter.
45
- * @see https://todoist.com/api/v1/docs#tag/Tasks/operation/get_tasks_by_filter_api_v1_tasks_filter_get
46
+ * @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/get_tasks_by_filter_api_v1_tasks_filter_get
46
47
  */
47
48
  export type GetTasksByFilterArgs = {
48
49
  query: string;
@@ -52,7 +53,7 @@ export type GetTasksByFilterArgs = {
52
53
  };
53
54
  /**
54
55
  * Arguments for retrieving completed tasks by completion date.
55
- * @see https://todoist.com/api/v1/docs#tag/Tasks/operation/tasks_completed_by_completion_date_api_v1_tasks_completed_by_completion_date_get
56
+ * @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/tasks_completed_by_completion_date_api_v1_tasks_completed_by_completion_date_get
56
57
  */
57
58
  export type GetCompletedTasksByCompletionDateArgs = {
58
59
  since: string;
@@ -69,7 +70,7 @@ export type GetCompletedTasksByCompletionDateArgs = {
69
70
  };
70
71
  /**
71
72
  * Arguments for retrieving completed tasks by due date.
72
- * @see https://todoist.com/api/v1/docs#tag/Tasks/operation/tasks_completed_by_due_date_api_v1_tasks_completed_by_due_date_get
73
+ * @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/tasks_completed_by_due_date_api_v1_tasks_completed_by_due_date_get
73
74
  */
74
75
  export type GetCompletedTasksByDueDateArgs = {
75
76
  since: string;
@@ -92,15 +93,15 @@ export type SearchCompletedTasksArgs = {
92
93
  limit?: number;
93
94
  };
94
95
  /**
95
- * @see https://todoist.com/api/v1/docs#tag/Tasks/operation/get_tasks_api_v1_tasks_get
96
+ * @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/get_tasks_api_v1_tasks_get
96
97
  */
97
98
  export type GetTasksResponse = {
98
99
  results: Task[];
99
100
  nextCursor: string | null;
100
101
  };
101
102
  /**
102
- * @see https://todoist.com/api/v1/docs#tag/Tasks/operation/tasks_completed_by_due_date_api_v1_tasks_completed_by_due_date_get
103
- * @see https://todoist.com/api/v1/docs#tag/Tasks/operation/tasks_completed_by_completion_date_api_v1_tasks_completed_by_completion_date_get
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
104
105
  */
105
106
  export type GetCompletedTasksResponse = {
106
107
  items: Task[];
@@ -108,7 +109,7 @@ export type GetCompletedTasksResponse = {
108
109
  };
109
110
  /**
110
111
  * Arguments for updating a task.
111
- * @see https://todoist.com/api/v1/docs#tag/Tasks/operation/update_task_api_v1_tasks__task_id__post
112
+ * @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/update_task_api_v1_tasks__task_id__post
112
113
  */
113
114
  export type UpdateTaskArgs = {
114
115
  content?: string;
@@ -143,7 +144,7 @@ export type UpdateTaskArgs = {
143
144
  }>;
144
145
  /**
145
146
  * Arguments for quick adding a task.
146
- * @see https://todoist.com/api/v1/docs#tag/Tasks/operation/quick_add_api_v1_tasks_quick_post
147
+ * @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/quick_add_api_v1_tasks_quick_post
147
148
  */
148
149
  export type QuickAddTaskArgs = {
149
150
  text: string;
@@ -155,11 +156,11 @@ export type QuickAddTaskArgs = {
155
156
  };
156
157
  /**
157
158
  * Response from quick adding a task.
158
- * @see https://todoist.com/api/v1/docs#tag/Tasks/operation/quick_add_api_v1_tasks_quick_post
159
+ * @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/quick_add_api_v1_tasks_quick_post
159
160
  */
160
161
  /**
161
162
  * Arguments for moving a task.
162
- * @see https://todoist.com/api/v1/docs#tag/Tasks/operation/move_task_api_v1_tasks__task_id__move_post
163
+ * @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/move_task_api_v1_tasks__task_id__move_post
163
164
  */
164
165
  export type MoveTaskArgs = RequireExactlyOne<{
165
166
  projectId?: string;
@@ -168,7 +169,7 @@ export type MoveTaskArgs = RequireExactlyOne<{
168
169
  }>;
169
170
  /**
170
171
  * Arguments for retrieving projects.
171
- * @see https://todoist.com/api/v1/docs#tag/Projects/operation/get_projects_api_v1_projects_get
172
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/get_projects_api_v1_projects_get
172
173
  */
173
174
  export type GetProjectsArgs = {
174
175
  cursor?: string | null;
@@ -185,7 +186,7 @@ type SearchArgs = {
185
186
  export type SearchProjectsArgs = SearchArgs;
186
187
  /**
187
188
  * Response from retrieving projects.
188
- * @see https://todoist.com/api/v1/docs#tag/Projects/operation/get_projects_api_v1_projects_get
189
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/get_projects_api_v1_projects_get
189
190
  */
190
191
  export type GetProjectsResponse = {
191
192
  results: (PersonalProject | WorkspaceProject)[];
@@ -193,7 +194,7 @@ export type GetProjectsResponse = {
193
194
  };
194
195
  /**
195
196
  * Arguments for retrieving archived projects.
196
- * @see https://todoist.com/api/v1/docs#tag/Projects/operation/get_archived_projects_api_v1_projects_archived_get
197
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/get_archived_projects_api_v1_projects_archived_get
197
198
  */
198
199
  export type GetArchivedProjectsArgs = {
199
200
  cursor?: string | null;
@@ -201,7 +202,7 @@ export type GetArchivedProjectsArgs = {
201
202
  };
202
203
  /**
203
204
  * Response from retrieving archived projects.
204
- * @see https://todoist.com/api/v1/docs#tag/Projects/operation/get_archived_projects_api_v1_projects_archived_get
205
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/get_archived_projects_api_v1_projects_archived_get
205
206
  */
206
207
  export type GetArchivedProjectsResponse = {
207
208
  results: (PersonalProject | WorkspaceProject)[];
@@ -209,7 +210,7 @@ export type GetArchivedProjectsResponse = {
209
210
  };
210
211
  /**
211
212
  * Arguments for creating a new project.
212
- * @see https://todoist.com/api/v1/docs#tag/Projects/operation/create_project_api_v1_projects_post
213
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/create_project_api_v1_projects_post
213
214
  */
214
215
  export type AddProjectArgs = {
215
216
  name: string;
@@ -221,7 +222,7 @@ export type AddProjectArgs = {
221
222
  };
222
223
  /**
223
224
  * Arguments for updating a project.
224
- * @see https://todoist.com/api/v1/docs#tag/Projects/operation/update_project_api_v1_projects__project_id__post
225
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/update_project_api_v1_projects__project_id__post
225
226
  */
226
227
  export type UpdateProjectArgs = {
227
228
  name?: string;
@@ -231,7 +232,7 @@ export type UpdateProjectArgs = {
231
232
  };
232
233
  /**
233
234
  * Arguments for retrieving project collaborators.
234
- * @see https://todoist.com/api/v1/docs#tag/Projects/operation/get_project_collaborators_api_v1_projects__project_id__collaborators_get
235
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/get_project_collaborators_api_v1_projects__project_id__collaborators_get
235
236
  */
236
237
  export type GetProjectCollaboratorsArgs = {
237
238
  cursor?: string | null;
@@ -239,7 +240,7 @@ export type GetProjectCollaboratorsArgs = {
239
240
  };
240
241
  /**
241
242
  * Response from retrieving project collaborators.
242
- * @see https://todoist.com/api/v1/docs#tag/Projects/operation/get_project_collaborators_api_v1_projects__project_id__collaborators_get
243
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/get_project_collaborators_api_v1_projects__project_id__collaborators_get
243
244
  */
244
245
  export type GetProjectCollaboratorsResponse = {
245
246
  results: User[];
@@ -247,7 +248,7 @@ export type GetProjectCollaboratorsResponse = {
247
248
  };
248
249
  /**
249
250
  * Arguments for retrieving sections.
250
- * @see https://todoist.com/api/v1/docs#tag/Sections/operation/get_sections_api_v1_sections_get
251
+ * @see https://developer.todoist.com/api/v1/#tag/Sections/operation/get_sections_api_v1_sections_get
251
252
  */
252
253
  export type GetSectionsArgs = {
253
254
  projectId?: string | null;
@@ -262,7 +263,7 @@ export type SearchSectionsArgs = SearchArgs & {
262
263
  };
263
264
  /**
264
265
  * Response from retrieving sections.
265
- * @see https://todoist.com/api/v1/docs#tag/Sections/operation/get_sections_api_v1_sections_get
266
+ * @see https://developer.todoist.com/api/v1/#tag/Sections/operation/get_sections_api_v1_sections_get
266
267
  */
267
268
  export type GetSectionsResponse = {
268
269
  results: Section[];
@@ -270,7 +271,7 @@ export type GetSectionsResponse = {
270
271
  };
271
272
  /**
272
273
  * Arguments for creating a new section.
273
- * @see https://todoist.com/api/v1/docs#tag/Sections/operation/create_section_api_v1_sections_post
274
+ * @see https://developer.todoist.com/api/v1/#tag/Sections/operation/create_section_api_v1_sections_post
274
275
  */
275
276
  export type AddSectionArgs = {
276
277
  name: string;
@@ -279,14 +280,14 @@ export type AddSectionArgs = {
279
280
  };
280
281
  /**
281
282
  * Arguments for updating a section.
282
- * @see https://todoist.com/api/v1/docs#tag/Sections/operation/update_section_api_v1_sections__section_id__post
283
+ * @see https://developer.todoist.com/api/v1/#tag/Sections/operation/update_section_api_v1_sections__section_id__post
283
284
  */
284
285
  export type UpdateSectionArgs = {
285
286
  name: string;
286
287
  };
287
288
  /**
288
289
  * Arguments for retrieving labels.
289
- * @see https://todoist.com/api/v1/docs#tag/Labels/operation/get_labels_api_v1_labels_get
290
+ * @see https://developer.todoist.com/api/v1/#tag/Labels/operation/get_labels_api_v1_labels_get
290
291
  */
291
292
  export type GetLabelsArgs = {
292
293
  cursor?: string | null;
@@ -298,7 +299,7 @@ export type GetLabelsArgs = {
298
299
  export type SearchLabelsArgs = SearchArgs;
299
300
  /**
300
301
  * Response from retrieving labels.
301
- * @see https://todoist.com/api/v1/docs#tag/Labels/operation/get_labels_api_v1_labels_get
302
+ * @see https://developer.todoist.com/api/v1/#tag/Labels/operation/get_labels_api_v1_labels_get
302
303
  */
303
304
  export type GetLabelsResponse = {
304
305
  results: Label[];
@@ -306,7 +307,7 @@ export type GetLabelsResponse = {
306
307
  };
307
308
  /**
308
309
  * Arguments for creating a new label.
309
- * @see https://todoist.com/api/v1/docs#tag/Labels/operation/create_label_api_v1_labels_post
310
+ * @see https://developer.todoist.com/api/v1/#tag/Labels/operation/create_label_api_v1_labels_post
310
311
  */
311
312
  export type AddLabelArgs = {
312
313
  name: string;
@@ -316,7 +317,7 @@ export type AddLabelArgs = {
316
317
  };
317
318
  /**
318
319
  * Arguments for updating a label.
319
- * @see https://todoist.com/api/v1/docs#tag/Labels/operation/update_label_api_v1_labels__label_id__post
320
+ * @see https://developer.todoist.com/api/v1/#tag/Labels/operation/update_label_api_v1_labels__label_id__post
320
321
  */
321
322
  export type UpdateLabelArgs = {
322
323
  name?: string;
@@ -326,7 +327,7 @@ export type UpdateLabelArgs = {
326
327
  };
327
328
  /**
328
329
  * Arguments for retrieving shared labels.
329
- * @see https://todoist.com/api/v1/docs#tag/Labels/operation/shared_labels_api_v1_labels_shared_get
330
+ * @see https://developer.todoist.com/api/v1/#tag/Labels/operation/shared_labels_api_v1_labels_shared_get
330
331
  */
331
332
  export type GetSharedLabelsArgs = {
332
333
  omitPersonal?: boolean;
@@ -335,7 +336,7 @@ export type GetSharedLabelsArgs = {
335
336
  };
336
337
  /**
337
338
  * Response from retrieving shared labels.
338
- * @see https://todoist.com/api/v1/docs#tag/Labels/operation/shared_labels_api_v1_labels_shared_get
339
+ * @see https://developer.todoist.com/api/v1/#tag/Labels/operation/shared_labels_api_v1_labels_shared_get
339
340
  */
340
341
  export type GetSharedLabelsResponse = {
341
342
  results: string[];
@@ -343,7 +344,7 @@ export type GetSharedLabelsResponse = {
343
344
  };
344
345
  /**
345
346
  * Arguments for renaming a shared label.
346
- * @see https://todoist.com/api/v1/docs#tag/Labels/operation/shared_labels_rename_api_v1_labels_shared_rename_post
347
+ * @see https://developer.todoist.com/api/v1/#tag/Labels/operation/shared_labels_rename_api_v1_labels_shared_rename_post
347
348
  */
348
349
  export type RenameSharedLabelArgs = {
349
350
  name: string;
@@ -351,14 +352,14 @@ export type RenameSharedLabelArgs = {
351
352
  };
352
353
  /**
353
354
  * Arguments for removing a shared label.
354
- * @see https://todoist.com/api/v1/docs#tag/Labels/operation/shared_labels_remove_api_v1_labels_shared_remove_post
355
+ * @see https://developer.todoist.com/api/v1/#tag/Labels/operation/shared_labels_remove_api_v1_labels_shared_remove_post
355
356
  */
356
357
  export type RemoveSharedLabelArgs = {
357
358
  name: string;
358
359
  };
359
360
  /**
360
361
  * Arguments for retrieving comments.
361
- * @see https://todoist.com/api/v1/docs#tag/Comments/operation/get_comments_api_v1_comments_get
362
+ * @see https://developer.todoist.com/api/v1/#tag/Comments/operation/get_comments_api_v1_comments_get
362
363
  */
363
364
  export type GetCommentsArgs = {
364
365
  taskId: string;
@@ -368,7 +369,7 @@ export type GetCommentsArgs = {
368
369
  };
369
370
  /**
370
371
  * Arguments for retrieving task comments.
371
- * @see https://todoist.com/api/v1/docs#tag/Comments/operation/get_comments_api_v1_comments_get
372
+ * @see https://developer.todoist.com/api/v1/#tag/Comments/operation/get_comments_api_v1_comments_get
372
373
  */
373
374
  export type GetTaskCommentsArgs = {
374
375
  taskId: string;
@@ -378,7 +379,7 @@ export type GetTaskCommentsArgs = {
378
379
  };
379
380
  /**
380
381
  * Arguments for retrieving project comments.
381
- * @see https://todoist.com/api/v1/docs#tag/Comments/operation/get_comments_api_v1_comments_get
382
+ * @see https://developer.todoist.com/api/v1/#tag/Comments/operation/get_comments_api_v1_comments_get
382
383
  */
383
384
  export type GetProjectCommentsArgs = {
384
385
  projectId: string;
@@ -388,7 +389,7 @@ export type GetProjectCommentsArgs = {
388
389
  };
389
390
  /**
390
391
  * Response from retrieving comments.
391
- * @see https://todoist.com/api/v1/docs#tag/Comments/operation/get_comments_api_v1_comments_get
392
+ * @see https://developer.todoist.com/api/v1/#tag/Comments/operation/get_comments_api_v1_comments_get
392
393
  */
393
394
  export type GetCommentsResponse = {
394
395
  results: Comment[];
@@ -396,7 +397,7 @@ export type GetCommentsResponse = {
396
397
  };
397
398
  /**
398
399
  * Arguments for creating a new comment.
399
- * @see https://todoist.com/api/v1/docs#tag/Comments/operation/create_comment_api_v1_comments_post
400
+ * @see https://developer.todoist.com/api/v1/#tag/Comments/operation/create_comment_api_v1_comments_post
400
401
  */
401
402
  export type AddCommentArgs = {
402
403
  content: string;
@@ -412,11 +413,61 @@ export type AddCommentArgs = {
412
413
  }>;
413
414
  /**
414
415
  * Arguments for updating a comment.
415
- * @see https://todoist.com/api/v1/docs#tag/Comments/operation/update_comment_api_v1_comments__comment_id__post
416
+ * @see https://developer.todoist.com/api/v1/#tag/Comments/operation/update_comment_api_v1_comments__comment_id__post
416
417
  */
417
418
  export type UpdateCommentArgs = {
418
419
  content: string;
419
420
  };
421
+ /** Available reminder delivery services. */
422
+ export declare const REMINDER_DELIVERY_SERVICES: readonly ["email", "push"];
423
+ /** Delivery service for a reminder notification. */
424
+ export type ReminderDeliveryService = (typeof REMINDER_DELIVERY_SERVICES)[number];
425
+ export type ReminderDueDate = Partial<Pick<DueDate, 'date' | 'string' | 'timezone' | 'lang' | 'isRecurring'>>;
426
+ type ReminderTaskArgs = {
427
+ taskId: string;
428
+ };
429
+ type TimeBasedReminderArgs = {
430
+ service?: ReminderDeliveryService;
431
+ notifyUid?: string;
432
+ isUrgent?: boolean;
433
+ };
434
+ type AddLocationReminderFields = {
435
+ notifyUid?: string;
436
+ name: string;
437
+ locLat: string;
438
+ locLong: string;
439
+ locTrigger: LocationTrigger;
440
+ radius?: number;
441
+ };
442
+ export type AddRelativeReminderArgs = ReminderTaskArgs & {
443
+ reminderType?: 'relative';
444
+ minuteOffset: number;
445
+ } & TimeBasedReminderArgs;
446
+ export type AddAbsoluteReminderArgs = ReminderTaskArgs & {
447
+ reminderType: 'absolute';
448
+ due: ReminderDueDate;
449
+ } & TimeBasedReminderArgs;
450
+ export type AddLocationReminderArgs = ReminderTaskArgs & AddLocationReminderFields;
451
+ /**
452
+ * Arguments for creating a new reminder.
453
+ * @see https://developer.todoist.com/api/v1/#tag/Reminders/operation/create_reminder_api_v1_reminders_post
454
+ */
455
+ export type AddReminderArgs = AddRelativeReminderArgs | AddAbsoluteReminderArgs;
456
+ export type UpdateRelativeReminderArgs = {
457
+ reminderType: 'relative';
458
+ } & Partial<Omit<AddRelativeReminderArgs, 'taskId' | 'reminderType'>>;
459
+ export type UpdateAbsoluteReminderArgs = {
460
+ reminderType: 'absolute';
461
+ } & Partial<Omit<AddAbsoluteReminderArgs, 'taskId' | 'reminderType'>>;
462
+ /**
463
+ * Arguments for updating an existing reminder.
464
+ * @see https://developer.todoist.com/api/v1/#tag/Reminders/operation/update_reminder_api_v1_reminders__reminder_id__post
465
+ */
466
+ export type UpdateReminderArgs = UpdateRelativeReminderArgs | UpdateAbsoluteReminderArgs;
467
+ /**
468
+ * Arguments for updating an existing location reminder.
469
+ */
470
+ export type UpdateLocationReminderArgs = Partial<Omit<AddLocationReminderArgs, 'taskId'>>;
420
471
  /**
421
472
  * Common arguments for retrieving activity logs (excluding filter-type params).
422
473
  */
@@ -502,7 +553,7 @@ export type GetActivityLogsResponse = {
502
553
  };
503
554
  /**
504
555
  * Arguments for uploading a file.
505
- * @see https://todoist.com/api/v1/docs#tag/Uploads/operation/upload_file_api_v1_uploads_post
556
+ * @see https://developer.todoist.com/api/v1/#tag/Uploads/operation/upload_file_api_v1_uploads_post
506
557
  */
507
558
  export type UploadFileArgs = {
508
559
  /**
@@ -524,7 +575,7 @@ export type UploadFileArgs = {
524
575
  };
525
576
  /**
526
577
  * Arguments for deleting an uploaded file.
527
- * @see https://todoist.com/api/v1/docs#tag/Uploads/operation/delete_upload_api_v1_uploads_delete
578
+ * @see https://developer.todoist.com/api/v1/#tag/Uploads/operation/delete_upload_api_v1_uploads_delete
528
579
  */
529
580
  export type DeleteUploadArgs = {
530
581
  /**
@@ -554,6 +605,449 @@ export type MoveProjectToPersonalArgs = {
554
605
  /** The ID of the project to move. */
555
606
  projectId: string;
556
607
  };
608
+ /**
609
+ * Arguments for counting archived projects.
610
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/count_projects_archived_api_v1_projects_archived_count_get
611
+ */
612
+ export type GetArchivedProjectsCountArgs = {
613
+ workspaceId?: number | null;
614
+ joined?: boolean | null;
615
+ };
616
+ /**
617
+ * Response from counting archived projects.
618
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/count_projects_archived_api_v1_projects_archived_count_get
619
+ */
620
+ export type GetArchivedProjectsCountResponse = {
621
+ count: number;
622
+ };
623
+ /**
624
+ * An action permitted for a role.
625
+ */
626
+ export type ActionView = {
627
+ name: string;
628
+ };
629
+ /**
630
+ * A project collaborator role with its permitted actions.
631
+ */
632
+ export type ProjectRoleView = {
633
+ name: CollaboratorRole;
634
+ actions: ActionView[];
635
+ };
636
+ /**
637
+ * A workspace role with its permitted actions.
638
+ */
639
+ export type WorkspaceRoleView = {
640
+ name: WorkspaceRole;
641
+ actions: ActionView[];
642
+ };
643
+ /**
644
+ * Response from getting project permissions (role-to-action mappings).
645
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/permissions_api_v1_projects_permissions_get
646
+ */
647
+ export type GetProjectPermissionsResponse = {
648
+ projectCollaboratorActions: ProjectRoleView[];
649
+ workspaceCollaboratorActions: WorkspaceRoleView[];
650
+ };
651
+ /**
652
+ * Arguments for getting full project data.
653
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/projects_full_data_api_v1_projects__project_id__full_get
654
+ */
655
+ export type GetFullProjectArgs = {
656
+ /**
657
+ * Required to access the public project without authentication.
658
+ */
659
+ publicKey?: string | null;
660
+ };
661
+ /**
662
+ * Response from getting full project data.
663
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/projects_full_data_api_v1_projects__project_id__full_get
664
+ */
665
+ export type GetFullProjectResponse = {
666
+ project: (PersonalProject | WorkspaceProject) | null;
667
+ commentsCount: number;
668
+ tasks: Task[];
669
+ sections: Section[];
670
+ collaborators: User[];
671
+ notes: Comment[];
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
+ };
929
+ /**
930
+ * Arguments for creating a new workspace.
931
+ * @see https://developer.todoist.com/api/v1/#tag/Workspace/operation/create_workspace_api_v1_workspaces_post
932
+ */
933
+ export type AddWorkspaceArgs = {
934
+ /** Name of the workspace. */
935
+ name: string;
936
+ /** Description of the workspace. */
937
+ description?: string | null;
938
+ /** Whether link sharing is enabled for the workspace. */
939
+ isLinkSharingEnabled?: boolean;
940
+ /** Whether guests are allowed in the workspace. */
941
+ isGuestAllowed?: boolean;
942
+ /** Workspace email domain. */
943
+ domainName?: string | null;
944
+ /** Whether users with matching email domains can discover this workspace. */
945
+ domainDiscovery?: boolean;
946
+ /** Whether workspace invites are restricted to workspace domain. */
947
+ restrictEmailDomains?: boolean;
948
+ /** Workspace properties. */
949
+ properties?: Record<string, unknown> | null;
950
+ };
951
+ /**
952
+ * Arguments for updating an existing workspace.
953
+ * @see https://developer.todoist.com/api/v1/#tag/Workspace/operation/update_workspace_api_v1_workspaces__workspace_id__post
954
+ */
955
+ export type UpdateWorkspaceArgs = {
956
+ /** Updated workspace name. */
957
+ name?: string;
958
+ /** Updated workspace description. */
959
+ description?: string | null;
960
+ /** Updated link sharing status. */
961
+ isLinkSharingEnabled?: boolean;
962
+ /** Updated guest access status. */
963
+ isGuestAllowed?: boolean | null;
964
+ /** Updated workspace email domain. */
965
+ domainName?: string | null;
966
+ /** Updated domain discovery setting. */
967
+ domainDiscovery?: boolean;
968
+ /** Updated email domain restriction setting. */
969
+ restrictEmailDomains?: boolean;
970
+ /** Updated workspace properties. */
971
+ properties?: Record<string, unknown> | null;
972
+ /** Updated collapse state for current user. */
973
+ isCollapsed?: boolean;
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
+ };
557
1051
  /**
558
1052
  * Arguments for getting workspace invitations.
559
1053
  */
@@ -677,7 +1171,7 @@ export type GetWorkspaceUsersResponse = {
677
1171
  /**
678
1172
  * Array of workspace users.
679
1173
  */
680
- workspaceUsers: import('./entities.js').WorkspaceUser[];
1174
+ workspaceUsers: WorkspaceUser[];
681
1175
  };
682
1176
  /**
683
1177
  * Response type for workspace invitations endpoint (simple email list).
@@ -686,7 +1180,7 @@ export type WorkspaceInvitationsResponse = string[];
686
1180
  /**
687
1181
  * Response type for all workspace invitations endpoint (detailed objects).
688
1182
  */
689
- export type AllWorkspaceInvitationsResponse = import('./entities.js').WorkspaceInvitation[];
1183
+ export type AllWorkspaceInvitationsResponse = WorkspaceInvitation[];
690
1184
  /**
691
1185
  * Response type for workspace logo upload.
692
1186
  */