@doist/todoist-api-typescript 4.0.4 → 5.0.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.
@@ -59,13 +59,13 @@ export declare const DeadlineSchema: z.ZodObject<{
59
59
  */
60
60
  export interface Deadline extends z.infer<typeof DeadlineSchema> {
61
61
  }
62
- export declare const RawTaskSchema: z.ZodObject<{
63
- userId: z.ZodString;
62
+ export declare const TaskSchema: z.ZodEffects<z.ZodObject<{
64
63
  id: z.ZodString;
64
+ userId: z.ZodString;
65
65
  projectId: z.ZodString;
66
66
  sectionId: z.ZodNullable<z.ZodString>;
67
67
  parentId: z.ZodNullable<z.ZodString>;
68
- addedByUid: z.ZodString;
68
+ addedByUid: z.ZodNullable<z.ZodString>;
69
69
  assignedByUid: z.ZodNullable<z.ZodString>;
70
70
  responsibleUid: z.ZodNullable<z.ZodString>;
71
71
  labels: z.ZodArray<z.ZodString, "many">;
@@ -91,9 +91,9 @@ export declare const RawTaskSchema: z.ZodObject<{
91
91
  }>>;
92
92
  checked: z.ZodBoolean;
93
93
  isDeleted: z.ZodBoolean;
94
- addedAt: z.ZodString;
94
+ addedAt: z.ZodNullable<z.ZodString>;
95
95
  completedAt: z.ZodNullable<z.ZodString>;
96
- updatedAt: z.ZodString;
96
+ updatedAt: z.ZodNullable<z.ZodString>;
97
97
  due: z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
98
98
  isRecurring: z.ZodBoolean;
99
99
  string: z.ZodString;
@@ -121,18 +121,19 @@ export declare const RawTaskSchema: z.ZodObject<{
121
121
  childOrder: z.ZodNumber;
122
122
  content: z.ZodString;
123
123
  description: z.ZodString;
124
+ noteCount: z.ZodNumber;
124
125
  dayOrder: z.ZodNumber;
125
126
  isCollapsed: z.ZodBoolean;
126
127
  }, "strip", z.ZodTypeAny, {
127
- userId: string;
128
+ labels: string[];
128
129
  id: string;
130
+ userId: string;
129
131
  projectId: string;
130
132
  sectionId: string | null;
131
133
  parentId: string | null;
132
- addedByUid: string;
134
+ addedByUid: string | null;
133
135
  assignedByUid: string | null;
134
136
  responsibleUid: string | null;
135
- labels: string[];
136
137
  deadline: {
137
138
  date: string;
138
139
  lang: string;
@@ -143,9 +144,9 @@ export declare const RawTaskSchema: z.ZodObject<{
143
144
  } | null;
144
145
  checked: boolean;
145
146
  isDeleted: boolean;
146
- addedAt: string;
147
+ addedAt: string | null;
147
148
  completedAt: string | null;
148
- updatedAt: string;
149
+ updatedAt: string | null;
149
150
  due: {
150
151
  string: string;
151
152
  isRecurring: boolean;
@@ -158,18 +159,19 @@ export declare const RawTaskSchema: z.ZodObject<{
158
159
  childOrder: number;
159
160
  content: string;
160
161
  description: string;
162
+ noteCount: number;
161
163
  dayOrder: number;
162
164
  isCollapsed: boolean;
163
165
  }, {
164
- userId: string;
166
+ labels: string[];
165
167
  id: string;
168
+ userId: string;
166
169
  projectId: string;
167
170
  sectionId: string | null;
168
171
  parentId: string | null;
169
- addedByUid: string;
172
+ addedByUid: string | null;
170
173
  assignedByUid: string | null;
171
174
  responsibleUid: string | null;
172
- labels: string[];
173
175
  deadline: {
174
176
  date: string;
175
177
  lang: string;
@@ -180,9 +182,9 @@ export declare const RawTaskSchema: z.ZodObject<{
180
182
  } | null;
181
183
  checked: boolean;
182
184
  isDeleted: boolean;
183
- addedAt: string;
185
+ addedAt: string | null;
184
186
  completedAt: string | null;
185
- updatedAt: string;
187
+ updatedAt: string | null;
186
188
  due: {
187
189
  string: string;
188
190
  isRecurring: boolean;
@@ -195,76 +197,20 @@ export declare const RawTaskSchema: z.ZodObject<{
195
197
  childOrder: number;
196
198
  content: string;
197
199
  description: string;
200
+ noteCount: number;
198
201
  dayOrder: number;
199
202
  isCollapsed: boolean;
200
- }>;
201
- export interface RawTask extends z.infer<typeof RawTaskSchema> {
202
- }
203
- export declare const TaskSchema: z.ZodObject<{
204
- id: z.ZodString;
205
- assignerId: z.ZodNullable<z.ZodString>;
206
- assigneeId: z.ZodNullable<z.ZodString>;
207
- projectId: z.ZodString;
208
- sectionId: z.ZodNullable<z.ZodString>;
209
- parentId: z.ZodNullable<z.ZodString>;
210
- order: z.ZodNumber;
211
- content: z.ZodString;
212
- description: z.ZodString;
213
- isCompleted: z.ZodBoolean;
214
- labels: z.ZodArray<z.ZodString, "many">;
215
- priority: z.ZodNumber;
216
- creatorId: z.ZodString;
217
- createdAt: z.ZodString;
218
- due: z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
219
- isRecurring: z.ZodBoolean;
220
- string: z.ZodString;
221
- date: z.ZodString;
222
- }, {
223
- datetime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
224
- timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
225
- lang: z.ZodOptional<z.ZodNullable<z.ZodString>>;
226
- }>, "strip", z.ZodTypeAny, {
227
- string: string;
228
- isRecurring: boolean;
229
- date: string;
230
- datetime?: string | null | undefined;
231
- timezone?: string | null | undefined;
232
- lang?: string | null | undefined;
233
- }, {
234
- string: string;
235
- isRecurring: boolean;
236
- date: string;
237
- datetime?: string | null | undefined;
238
- timezone?: string | null | undefined;
239
- lang?: string | null | undefined;
240
- }>>;
241
- url: z.ZodString;
242
- duration: z.ZodNullable<z.ZodObject<{
243
- amount: z.ZodNumber;
244
- unit: z.ZodEnum<["minute", "day"]>;
245
- }, "strip", z.ZodTypeAny, {
246
- amount: number;
247
- unit: "minute" | "day";
248
- }, {
249
- amount: number;
250
- unit: "minute" | "day";
251
- }>>;
252
- deadline: z.ZodNullable<z.ZodObject<{
253
- date: z.ZodString;
254
- lang: z.ZodString;
255
- }, "strip", z.ZodTypeAny, {
256
- date: string;
257
- lang: string;
258
- }, {
259
- date: string;
260
- lang: string;
261
- }>>;
262
- }, "strip", z.ZodTypeAny, {
203
+ }>, {
204
+ url: string;
205
+ labels: string[];
263
206
  id: string;
207
+ userId: string;
264
208
  projectId: string;
265
209
  sectionId: string | null;
266
210
  parentId: string | null;
267
- labels: string[];
211
+ addedByUid: string | null;
212
+ assignedByUid: string | null;
213
+ responsibleUid: string | null;
268
214
  deadline: {
269
215
  date: string;
270
216
  lang: string;
@@ -273,6 +219,11 @@ export declare const TaskSchema: z.ZodObject<{
273
219
  amount: number;
274
220
  unit: "minute" | "day";
275
221
  } | null;
222
+ checked: boolean;
223
+ isDeleted: boolean;
224
+ addedAt: string | null;
225
+ completedAt: string | null;
226
+ updatedAt: string | null;
276
227
  due: {
277
228
  string: string;
278
229
  isRecurring: boolean;
@@ -282,21 +233,22 @@ export declare const TaskSchema: z.ZodObject<{
282
233
  lang?: string | null | undefined;
283
234
  } | null;
284
235
  priority: number;
236
+ childOrder: number;
285
237
  content: string;
286
238
  description: string;
287
- assignerId: string | null;
288
- assigneeId: string | null;
289
- order: number;
290
- isCompleted: boolean;
291
- creatorId: string;
292
- createdAt: string;
293
- url: string;
239
+ noteCount: number;
240
+ dayOrder: number;
241
+ isCollapsed: boolean;
294
242
  }, {
243
+ labels: string[];
295
244
  id: string;
245
+ userId: string;
296
246
  projectId: string;
297
247
  sectionId: string | null;
298
248
  parentId: string | null;
299
- labels: string[];
249
+ addedByUid: string | null;
250
+ assignedByUid: string | null;
251
+ responsibleUid: string | null;
300
252
  deadline: {
301
253
  date: string;
302
254
  lang: string;
@@ -305,6 +257,11 @@ export declare const TaskSchema: z.ZodObject<{
305
257
  amount: number;
306
258
  unit: "minute" | "day";
307
259
  } | null;
260
+ checked: boolean;
261
+ isDeleted: boolean;
262
+ addedAt: string | null;
263
+ completedAt: string | null;
264
+ updatedAt: string | null;
308
265
  due: {
309
266
  string: string;
310
267
  isRecurring: boolean;
@@ -314,15 +271,12 @@ export declare const TaskSchema: z.ZodObject<{
314
271
  lang?: string | null | undefined;
315
272
  } | null;
316
273
  priority: number;
274
+ childOrder: number;
317
275
  content: string;
318
276
  description: string;
319
- assignerId: string | null;
320
- assigneeId: string | null;
321
- order: number;
322
- isCompleted: boolean;
323
- creatorId: string;
324
- createdAt: string;
325
- url: string;
277
+ noteCount: number;
278
+ dayOrder: number;
279
+ isCollapsed: boolean;
326
280
  }>;
327
281
  /**
328
282
  * Represents a task in Todoist.
@@ -330,111 +284,300 @@ export declare const TaskSchema: z.ZodObject<{
330
284
  */
331
285
  export interface Task extends z.infer<typeof TaskSchema> {
332
286
  }
333
- export declare const RawProjectSchema: z.ZodObject<{
287
+ /**
288
+ * Base schema for all project types in Todoist.
289
+ * Contains common fields shared between personal and workspace projects.
290
+ */
291
+ export declare const BaseProjectSchema: z.ZodObject<{
334
292
  id: z.ZodString;
335
293
  canAssignTasks: z.ZodBoolean;
336
- childOrder: z.ZodNullable<z.ZodNumber>;
294
+ childOrder: z.ZodNumber;
337
295
  color: z.ZodString;
338
- createdAt: z.ZodString;
296
+ createdAt: z.ZodNullable<z.ZodString>;
339
297
  isArchived: z.ZodBoolean;
340
298
  isDeleted: z.ZodBoolean;
341
299
  isFavorite: z.ZodBoolean;
342
300
  isFrozen: z.ZodBoolean;
343
301
  name: z.ZodString;
344
- updatedAt: z.ZodString;
302
+ updatedAt: z.ZodNullable<z.ZodString>;
345
303
  viewStyle: z.ZodString;
346
- defaultOrder: z.ZodNullable<z.ZodNumber>;
304
+ defaultOrder: z.ZodNumber;
347
305
  description: z.ZodString;
348
- publicAccess: z.ZodBoolean;
349
- parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
350
- inboxProject: z.ZodOptional<z.ZodBoolean>;
351
306
  isCollapsed: z.ZodBoolean;
352
307
  isShared: z.ZodBoolean;
353
308
  }, "strip", z.ZodTypeAny, {
354
309
  id: string;
355
310
  isDeleted: boolean;
356
- updatedAt: string;
357
- childOrder: number | null;
311
+ updatedAt: string | null;
312
+ childOrder: number;
358
313
  description: string;
359
314
  isCollapsed: boolean;
360
- createdAt: string;
361
315
  canAssignTasks: boolean;
362
316
  color: string;
317
+ createdAt: string | null;
363
318
  isArchived: boolean;
364
319
  isFavorite: boolean;
365
320
  isFrozen: boolean;
366
321
  name: string;
367
322
  viewStyle: string;
368
- defaultOrder: number | null;
369
- publicAccess: boolean;
323
+ defaultOrder: number;
370
324
  isShared: boolean;
371
- parentId?: string | null | undefined;
372
- inboxProject?: boolean | undefined;
373
325
  }, {
374
326
  id: string;
375
327
  isDeleted: boolean;
376
- updatedAt: string;
377
- childOrder: number | null;
328
+ updatedAt: string | null;
329
+ childOrder: number;
378
330
  description: string;
379
331
  isCollapsed: boolean;
380
- createdAt: string;
381
332
  canAssignTasks: boolean;
382
333
  color: string;
334
+ createdAt: string | null;
383
335
  isArchived: boolean;
384
336
  isFavorite: boolean;
385
337
  isFrozen: boolean;
386
338
  name: string;
387
339
  viewStyle: string;
388
- defaultOrder: number | null;
389
- publicAccess: boolean;
340
+ defaultOrder: number;
390
341
  isShared: boolean;
391
- parentId?: string | null | undefined;
392
- inboxProject?: boolean | undefined;
393
342
  }>;
394
- export interface RawProject extends z.infer<typeof RawProjectSchema> {
395
- }
396
- export declare const ProjectSchema: z.ZodObject<{
343
+ /**
344
+ * Schema for personal projects in Todoist.
345
+ */
346
+ export declare const PersonalProjectSchema: z.ZodEffects<z.ZodObject<z.objectUtil.extendShape<{
397
347
  id: z.ZodString;
398
- parentId: z.ZodNullable<z.ZodString>;
399
- order: z.ZodNullable<z.ZodNumber>;
348
+ canAssignTasks: z.ZodBoolean;
349
+ childOrder: z.ZodNumber;
400
350
  color: z.ZodString;
401
- name: z.ZodString;
402
- isShared: z.ZodBoolean;
351
+ createdAt: z.ZodNullable<z.ZodString>;
352
+ isArchived: z.ZodBoolean;
353
+ isDeleted: z.ZodBoolean;
403
354
  isFavorite: z.ZodBoolean;
404
- isInboxProject: z.ZodBoolean;
405
- isTeamInbox: z.ZodBoolean;
406
- url: z.ZodString;
355
+ isFrozen: z.ZodBoolean;
356
+ name: z.ZodString;
357
+ updatedAt: z.ZodNullable<z.ZodString>;
407
358
  viewStyle: z.ZodString;
408
- }, "strip", z.ZodTypeAny, {
359
+ defaultOrder: z.ZodNumber;
360
+ description: z.ZodString;
361
+ isCollapsed: z.ZodBoolean;
362
+ isShared: z.ZodBoolean;
363
+ }, {
364
+ parentId: z.ZodNullable<z.ZodString>;
365
+ inboxProject: z.ZodBoolean;
366
+ }>, "strip", z.ZodTypeAny, {
409
367
  id: string;
410
368
  parentId: string | null;
411
- order: number | null;
369
+ isDeleted: boolean;
370
+ updatedAt: string | null;
371
+ childOrder: number;
372
+ description: string;
373
+ isCollapsed: boolean;
374
+ canAssignTasks: boolean;
375
+ color: string;
376
+ createdAt: string | null;
377
+ isArchived: boolean;
378
+ isFavorite: boolean;
379
+ isFrozen: boolean;
380
+ name: string;
381
+ viewStyle: string;
382
+ defaultOrder: number;
383
+ isShared: boolean;
384
+ inboxProject: boolean;
385
+ }, {
386
+ id: string;
387
+ parentId: string | null;
388
+ isDeleted: boolean;
389
+ updatedAt: string | null;
390
+ childOrder: number;
391
+ description: string;
392
+ isCollapsed: boolean;
393
+ canAssignTasks: boolean;
394
+ color: string;
395
+ createdAt: string | null;
396
+ isArchived: boolean;
397
+ isFavorite: boolean;
398
+ isFrozen: boolean;
399
+ name: string;
400
+ viewStyle: string;
401
+ defaultOrder: number;
402
+ isShared: boolean;
403
+ inboxProject: boolean;
404
+ }>, {
412
405
  url: string;
406
+ id: string;
407
+ parentId: string | null;
408
+ isDeleted: boolean;
409
+ updatedAt: string | null;
410
+ childOrder: number;
411
+ description: string;
412
+ isCollapsed: boolean;
413
+ canAssignTasks: boolean;
413
414
  color: string;
415
+ createdAt: string | null;
416
+ isArchived: boolean;
414
417
  isFavorite: boolean;
418
+ isFrozen: boolean;
415
419
  name: string;
416
420
  viewStyle: string;
421
+ defaultOrder: number;
417
422
  isShared: boolean;
418
- isInboxProject: boolean;
419
- isTeamInbox: boolean;
423
+ inboxProject: boolean;
420
424
  }, {
421
425
  id: string;
422
426
  parentId: string | null;
423
- order: number | null;
427
+ isDeleted: boolean;
428
+ updatedAt: string | null;
429
+ childOrder: number;
430
+ description: string;
431
+ isCollapsed: boolean;
432
+ canAssignTasks: boolean;
433
+ color: string;
434
+ createdAt: string | null;
435
+ isArchived: boolean;
436
+ isFavorite: boolean;
437
+ isFrozen: boolean;
438
+ name: string;
439
+ viewStyle: string;
440
+ defaultOrder: number;
441
+ isShared: boolean;
442
+ inboxProject: boolean;
443
+ }>;
444
+ /**
445
+ * Schema for workspace projects in Todoist.
446
+ */
447
+ export declare const WorkspaceProjectSchema: z.ZodEffects<z.ZodObject<z.objectUtil.extendShape<{
448
+ id: z.ZodString;
449
+ canAssignTasks: z.ZodBoolean;
450
+ childOrder: z.ZodNumber;
451
+ color: z.ZodString;
452
+ createdAt: z.ZodNullable<z.ZodString>;
453
+ isArchived: z.ZodBoolean;
454
+ isDeleted: z.ZodBoolean;
455
+ isFavorite: z.ZodBoolean;
456
+ isFrozen: z.ZodBoolean;
457
+ name: z.ZodString;
458
+ updatedAt: z.ZodNullable<z.ZodString>;
459
+ viewStyle: z.ZodString;
460
+ defaultOrder: z.ZodNumber;
461
+ description: z.ZodString;
462
+ isCollapsed: z.ZodBoolean;
463
+ isShared: z.ZodBoolean;
464
+ }, {
465
+ collaboratorRoleDefault: z.ZodString;
466
+ folderId: z.ZodNullable<z.ZodBoolean>;
467
+ isInviteOnly: z.ZodNullable<z.ZodBoolean>;
468
+ isLinkSharingEnabled: z.ZodBoolean;
469
+ role: z.ZodNullable<z.ZodString>;
470
+ status: z.ZodString;
471
+ workspaceId: z.ZodString;
472
+ }>, "strip", z.ZodTypeAny, {
473
+ status: string;
474
+ id: string;
475
+ isDeleted: boolean;
476
+ updatedAt: string | null;
477
+ childOrder: number;
478
+ description: string;
479
+ isCollapsed: boolean;
480
+ canAssignTasks: boolean;
481
+ color: string;
482
+ createdAt: string | null;
483
+ isArchived: boolean;
484
+ isFavorite: boolean;
485
+ isFrozen: boolean;
486
+ name: string;
487
+ viewStyle: string;
488
+ defaultOrder: number;
489
+ isShared: boolean;
490
+ collaboratorRoleDefault: string;
491
+ folderId: boolean | null;
492
+ isInviteOnly: boolean | null;
493
+ isLinkSharingEnabled: boolean;
494
+ role: string | null;
495
+ workspaceId: string;
496
+ }, {
497
+ status: string;
498
+ id: string;
499
+ isDeleted: boolean;
500
+ updatedAt: string | null;
501
+ childOrder: number;
502
+ description: string;
503
+ isCollapsed: boolean;
504
+ canAssignTasks: boolean;
505
+ color: string;
506
+ createdAt: string | null;
507
+ isArchived: boolean;
508
+ isFavorite: boolean;
509
+ isFrozen: boolean;
510
+ name: string;
511
+ viewStyle: string;
512
+ defaultOrder: number;
513
+ isShared: boolean;
514
+ collaboratorRoleDefault: string;
515
+ folderId: boolean | null;
516
+ isInviteOnly: boolean | null;
517
+ isLinkSharingEnabled: boolean;
518
+ role: string | null;
519
+ workspaceId: string;
520
+ }>, {
424
521
  url: string;
522
+ status: string;
523
+ id: string;
524
+ isDeleted: boolean;
525
+ updatedAt: string | null;
526
+ childOrder: number;
527
+ description: string;
528
+ isCollapsed: boolean;
529
+ canAssignTasks: boolean;
425
530
  color: string;
531
+ createdAt: string | null;
532
+ isArchived: boolean;
426
533
  isFavorite: boolean;
534
+ isFrozen: boolean;
427
535
  name: string;
428
536
  viewStyle: string;
537
+ defaultOrder: number;
429
538
  isShared: boolean;
430
- isInboxProject: boolean;
431
- isTeamInbox: boolean;
539
+ collaboratorRoleDefault: string;
540
+ folderId: boolean | null;
541
+ isInviteOnly: boolean | null;
542
+ isLinkSharingEnabled: boolean;
543
+ role: string | null;
544
+ workspaceId: string;
545
+ }, {
546
+ status: string;
547
+ id: string;
548
+ isDeleted: boolean;
549
+ updatedAt: string | null;
550
+ childOrder: number;
551
+ description: string;
552
+ isCollapsed: boolean;
553
+ canAssignTasks: boolean;
554
+ color: string;
555
+ createdAt: string | null;
556
+ isArchived: boolean;
557
+ isFavorite: boolean;
558
+ isFrozen: boolean;
559
+ name: string;
560
+ viewStyle: string;
561
+ defaultOrder: number;
562
+ isShared: boolean;
563
+ collaboratorRoleDefault: string;
564
+ folderId: boolean | null;
565
+ isInviteOnly: boolean | null;
566
+ isLinkSharingEnabled: boolean;
567
+ role: string | null;
568
+ workspaceId: string;
432
569
  }>;
433
570
  /**
434
- * Represents a project in Todoist.
571
+ * Represents a personal project in Todoist.
572
+ * @see https://todoist.com/api/v1/docs#tag/Projects
573
+ */
574
+ export interface PersonalProject extends z.infer<typeof PersonalProjectSchema> {
575
+ }
576
+ /**
577
+ * Represents a workspace project in Todoist.
435
578
  * @see https://todoist.com/api/v1/docs#tag/Projects
436
579
  */
437
- export interface Project extends z.infer<typeof ProjectSchema> {
580
+ export interface WorkspaceProject extends z.infer<typeof WorkspaceProjectSchema> {
438
581
  }
439
582
  /**
440
583
  * @see https://todoist.com/api/v1/docs#tag/Projects
@@ -453,8 +596,8 @@ export declare const SectionSchema: z.ZodObject<{
453
596
  isDeleted: z.ZodBoolean;
454
597
  isCollapsed: z.ZodBoolean;
455
598
  }, "strip", z.ZodTypeAny, {
456
- userId: string;
457
599
  id: string;
600
+ userId: string;
458
601
  projectId: string;
459
602
  isDeleted: boolean;
460
603
  addedAt: string;
@@ -465,8 +608,8 @@ export declare const SectionSchema: z.ZodObject<{
465
608
  archivedAt: string | null;
466
609
  sectionOrder: number;
467
610
  }, {
468
- userId: string;
469
611
  id: string;
612
+ userId: string;
470
613
  projectId: string;
471
614
  isDeleted: boolean;
472
615
  addedAt: string;
@@ -491,16 +634,16 @@ export declare const LabelSchema: z.ZodObject<{
491
634
  isFavorite: z.ZodBoolean;
492
635
  }, "strip", z.ZodTypeAny, {
493
636
  id: string;
494
- order: number | null;
495
637
  color: string;
496
638
  isFavorite: boolean;
497
639
  name: string;
640
+ order: number | null;
498
641
  }, {
499
642
  id: string;
500
- order: number | null;
501
643
  color: string;
502
644
  isFavorite: boolean;
503
645
  name: string;
646
+ order: number | null;
504
647
  }>;
505
648
  /**
506
649
  * Represents a label in Todoist.