@doist/todoist-sdk 8.3.0-next.1 → 8.3.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 (59) hide show
  1. package/dist/cjs/todoist-api.js +16 -9
  2. package/dist/cjs/types/sync/commands/index.js +0 -1
  3. package/dist/cjs/types/sync/resource-types.js +0 -1
  4. package/dist/cjs/types/sync/resources/calendars.js +4 -8
  5. package/dist/cjs/types/sync/resources/collaborators.js +4 -8
  6. package/dist/cjs/types/sync/resources/completed-info.js +6 -12
  7. package/dist/cjs/types/sync/resources/filters.js +2 -4
  8. package/dist/cjs/types/sync/resources/folders.js +2 -4
  9. package/dist/cjs/types/sync/resources/index.js +0 -1
  10. package/dist/cjs/types/sync/resources/live-notifications.js +6 -8
  11. package/dist/cjs/types/sync/resources/notes.js +2 -4
  12. package/dist/cjs/types/sync/resources/reminders.js +4 -4
  13. package/dist/cjs/types/sync/resources/suggestions.js +6 -12
  14. package/dist/cjs/types/sync/resources/tooltips.js +2 -4
  15. package/dist/cjs/types/sync/resources/user-plan-limits.js +4 -8
  16. package/dist/cjs/types/sync/resources/user-settings.js +4 -6
  17. package/dist/cjs/types/sync/resources/user.js +10 -20
  18. package/dist/cjs/types/sync/resources/view-options.js +6 -12
  19. package/dist/cjs/types/sync/resources/workspace-filters.js +2 -4
  20. package/dist/cjs/types/sync/resources/workspace-goals.js +6 -12
  21. package/dist/cjs/types/sync/resources/workspaces.js +1 -2
  22. package/dist/cjs/utils/validators.js +37 -1
  23. package/dist/esm/todoist-api.js +17 -10
  24. package/dist/esm/types/sync/commands/index.js +0 -1
  25. package/dist/esm/types/sync/resource-types.js +0 -1
  26. package/dist/esm/types/sync/resources/calendars.js +4 -8
  27. package/dist/esm/types/sync/resources/collaborators.js +4 -8
  28. package/dist/esm/types/sync/resources/completed-info.js +6 -12
  29. package/dist/esm/types/sync/resources/filters.js +2 -4
  30. package/dist/esm/types/sync/resources/folders.js +2 -4
  31. package/dist/esm/types/sync/resources/index.js +0 -1
  32. package/dist/esm/types/sync/resources/live-notifications.js +6 -8
  33. package/dist/esm/types/sync/resources/notes.js +2 -4
  34. package/dist/esm/types/sync/resources/reminders.js +4 -4
  35. package/dist/esm/types/sync/resources/suggestions.js +6 -12
  36. package/dist/esm/types/sync/resources/tooltips.js +2 -4
  37. package/dist/esm/types/sync/resources/user-plan-limits.js +4 -8
  38. package/dist/esm/types/sync/resources/user-settings.js +4 -6
  39. package/dist/esm/types/sync/resources/user.js +10 -20
  40. package/dist/esm/types/sync/resources/view-options.js +6 -12
  41. package/dist/esm/types/sync/resources/workspace-filters.js +2 -4
  42. package/dist/esm/types/sync/resources/workspace-goals.js +6 -12
  43. package/dist/esm/types/sync/resources/workspaces.js +1 -2
  44. package/dist/esm/utils/validators.js +36 -1
  45. package/dist/types/types/sync/commands/index.d.ts +0 -9
  46. package/dist/types/types/sync/resource-types.d.ts +1 -1
  47. package/dist/types/types/sync/resources/index.d.ts +0 -1
  48. package/dist/types/types/sync/resources/live-notifications.d.ts +4 -4
  49. package/dist/types/types/sync/resources/reminders.d.ts +1 -1
  50. package/dist/types/types/sync/resources/view-options.d.ts +6 -6
  51. package/dist/types/types/sync/response.d.ts +1 -2
  52. package/dist/types/utils/validators.d.ts +42 -40
  53. package/package.json +1 -1
  54. package/dist/cjs/types/sync/commands/goals.js +0 -2
  55. package/dist/cjs/types/sync/resources/goals.js +0 -33
  56. package/dist/esm/types/sync/commands/goals.js +0 -1
  57. package/dist/esm/types/sync/resources/goals.js +0 -30
  58. package/dist/types/types/sync/commands/goals.d.ts +0 -33
  59. package/dist/types/types/sync/resources/goals.d.ts +0 -37
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * All available Sync API resource types.
3
3
  */
4
- export declare const SYNC_RESOURCE_TYPES: readonly ["labels", "projects", "items", "notes", "project_notes", "sections", "filters", "reminders", "reminders_location", "locations", "user", "live_notifications", "collaborators", "collaborator_states", "user_settings", "notification_settings", "user_plan_limits", "completed_info", "stats", "workspaces", "workspace_users", "workspace_filters", "view_options", "project_view_options_defaults", "role_actions", "folders", "workspace_goals", "goals", "day_orders", "calendars", "calendar_accounts", "suggestions", "tooltips"];
4
+ export declare const SYNC_RESOURCE_TYPES: readonly ["labels", "projects", "items", "notes", "project_notes", "sections", "filters", "reminders", "reminders_location", "locations", "user", "live_notifications", "collaborators", "collaborator_states", "user_settings", "notification_settings", "user_plan_limits", "completed_info", "stats", "workspaces", "workspace_users", "workspace_filters", "view_options", "project_view_options_defaults", "role_actions", "folders", "workspace_goals", "day_orders", "calendars", "calendar_accounts", "suggestions", "tooltips"];
5
5
  export type SyncResourceType = (typeof SYNC_RESOURCE_TYPES)[number];
@@ -5,7 +5,6 @@ export * from './tooltips.js';
5
5
  export * from './notes.js';
6
6
  export * from './workspace-filters.js';
7
7
  export * from './workspace-goals.js';
8
- export * from './goals.js';
9
8
  export * from './calendars.js';
10
9
  export * from './reminders.js';
11
10
  export * from './completed-info.js';
@@ -2,10 +2,10 @@ import { z } from 'zod';
2
2
  /**
3
3
  * Live notification resource from the Sync API.
4
4
  *
5
- * Uses a base schema with commonly-present fields plus `.passthrough()` for
6
- * forward compatibility. The Sync API returns 20+ notification variants;
7
- * fully typing each is too fragile for a library, so we validate the common
8
- * shape and preserve all extra fields.
5
+ * Uses a loose object schema with commonly-present fields for forward
6
+ * compatibility. The Sync API returns 20+ notification variants; fully typing
7
+ * each is too fragile for a library, so we validate the common shape and
8
+ * preserve all extra fields.
9
9
  */
10
10
  export declare const LiveNotificationSchema: z.ZodObject<{
11
11
  id: z.ZodString;
@@ -5,7 +5,7 @@ export declare const ReminderBaseSchema: z.ZodObject<{
5
5
  itemId: z.ZodString;
6
6
  projectId: z.ZodOptional<z.ZodString>;
7
7
  isDeleted: z.ZodBoolean;
8
- }, z.core.$strip>;
8
+ }, z.core.$loose>;
9
9
  /** Enum-like object of reminder type values. */
10
10
  export declare const ReminderTypeEnum: {
11
11
  readonly Relative: "relative";
@@ -33,13 +33,13 @@ export declare const GROUPED_BY_OPTIONS: readonly ["ASSIGNEE", "ADDED_DATE", "DU
33
33
  export type GroupedBy = (typeof GROUPED_BY_OPTIONS)[number];
34
34
  export declare const GroupedBySchema: z.ZodNullable<z.ZodEnum<{
35
35
  PROJECT: "PROJECT";
36
- WORKSPACE: "WORKSPACE";
37
36
  LABEL: "LABEL";
38
37
  ASSIGNEE: "ASSIGNEE";
39
38
  ADDED_DATE: "ADDED_DATE";
40
39
  DUE_DATE: "DUE_DATE";
41
40
  DEADLINE: "DEADLINE";
42
41
  PRIORITY: "PRIORITY";
42
+ WORKSPACE: "WORKSPACE";
43
43
  }>>;
44
44
  /** Available sorting options. */
45
45
  export declare const SORTED_BY_OPTIONS: readonly ["MANUAL", "ALPHABETICALLY", "ASSIGNEE", "DUE_DATE", "DEADLINE", "ADDED_DATE", "PRIORITY", "PROJECT", "WORKSPACE"];
@@ -47,12 +47,12 @@ export declare const SORTED_BY_OPTIONS: readonly ["MANUAL", "ALPHABETICALLY", "A
47
47
  export type SortedBy = (typeof SORTED_BY_OPTIONS)[number];
48
48
  export declare const SortedBySchema: z.ZodNullable<z.ZodEnum<{
49
49
  PROJECT: "PROJECT";
50
- WORKSPACE: "WORKSPACE";
51
50
  ASSIGNEE: "ASSIGNEE";
52
51
  ADDED_DATE: "ADDED_DATE";
53
52
  DUE_DATE: "DUE_DATE";
54
53
  DEADLINE: "DEADLINE";
55
54
  PRIORITY: "PRIORITY";
55
+ WORKSPACE: "WORKSPACE";
56
56
  MANUAL: "MANUAL";
57
57
  ALPHABETICALLY: "ALPHABETICALLY";
58
58
  }>>;
@@ -93,13 +93,13 @@ export declare const ViewOptionsSchema: z.ZodObject<{
93
93
  objectId: z.ZodOptional<z.ZodString>;
94
94
  groupedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
95
95
  PROJECT: "PROJECT";
96
- WORKSPACE: "WORKSPACE";
97
96
  LABEL: "LABEL";
98
97
  ASSIGNEE: "ASSIGNEE";
99
98
  ADDED_DATE: "ADDED_DATE";
100
99
  DUE_DATE: "DUE_DATE";
101
100
  DEADLINE: "DEADLINE";
102
101
  PRIORITY: "PRIORITY";
102
+ WORKSPACE: "WORKSPACE";
103
103
  }>>>;
104
104
  filteredBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
105
105
  viewMode: z.ZodOptional<z.ZodEnum<{
@@ -110,12 +110,12 @@ export declare const ViewOptionsSchema: z.ZodObject<{
110
110
  showCompletedTasks: z.ZodOptional<z.ZodBoolean>;
111
111
  sortedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
112
112
  PROJECT: "PROJECT";
113
- WORKSPACE: "WORKSPACE";
114
113
  ASSIGNEE: "ASSIGNEE";
115
114
  ADDED_DATE: "ADDED_DATE";
116
115
  DUE_DATE: "DUE_DATE";
117
116
  DEADLINE: "DEADLINE";
118
117
  PRIORITY: "PRIORITY";
118
+ WORKSPACE: "WORKSPACE";
119
119
  MANUAL: "MANUAL";
120
120
  ALPHABETICALLY: "ALPHABETICALLY";
121
121
  }>>>;
@@ -134,22 +134,22 @@ export declare const ProjectViewOptionsDefaultsSchema: z.ZodObject<{
134
134
  }>>>;
135
135
  groupedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
136
136
  PROJECT: "PROJECT";
137
- WORKSPACE: "WORKSPACE";
138
137
  LABEL: "LABEL";
139
138
  ASSIGNEE: "ASSIGNEE";
140
139
  ADDED_DATE: "ADDED_DATE";
141
140
  DUE_DATE: "DUE_DATE";
142
141
  DEADLINE: "DEADLINE";
143
142
  PRIORITY: "PRIORITY";
143
+ WORKSPACE: "WORKSPACE";
144
144
  }>>>;
145
145
  sortedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
146
146
  PROJECT: "PROJECT";
147
- WORKSPACE: "WORKSPACE";
148
147
  ASSIGNEE: "ASSIGNEE";
149
148
  ADDED_DATE: "ADDED_DATE";
150
149
  DUE_DATE: "DUE_DATE";
151
150
  DEADLINE: "DEADLINE";
152
151
  PRIORITY: "PRIORITY";
152
+ WORKSPACE: "WORKSPACE";
153
153
  MANUAL: "MANUAL";
154
154
  ALPHABETICALLY: "ALPHABETICALLY";
155
155
  }>>>;
@@ -3,7 +3,7 @@ import type { PersonalProject, WorkspaceProject } from '../projects/types.js';
3
3
  import type { Section } from '../sections/types.js';
4
4
  import type { Task } from '../tasks/types.js';
5
5
  import type { WorkspaceUser } from '../workspaces/types.js';
6
- import type { Filter, Collaborator, CollaboratorState, Folder, Note, Tooltips, WorkspaceFilter, WorkspaceGoal, Goal, Calendar, CalendarAccount, Reminder, CompletedInfo, ViewOptions, ProjectViewOptionsDefaults, UserPlanLimits, LiveNotification, SyncWorkspace, SyncUser, UserSettings, LocationReminder, Suggestion } from './resources/index.js';
6
+ import type { Filter, Collaborator, CollaboratorState, Folder, Note, Tooltips, WorkspaceFilter, WorkspaceGoal, Calendar, CalendarAccount, Reminder, CompletedInfo, ViewOptions, ProjectViewOptionsDefaults, UserPlanLimits, LiveNotification, SyncWorkspace, SyncUser, UserSettings, LocationReminder, Suggestion } from './resources/index.js';
7
7
  export type SyncError = {
8
8
  error: string;
9
9
  errorCode: number;
@@ -43,7 +43,6 @@ export type SyncResponse = {
43
43
  roleActions?: Record<string, unknown>[];
44
44
  folders?: Folder[];
45
45
  workspaceGoals?: WorkspaceGoal[];
46
- goals?: Goal[];
47
46
  dayOrders?: Record<string, number>;
48
47
  calendars?: Calendar[];
49
48
  calendarAccounts?: CalendarAccount[];
@@ -1,4 +1,5 @@
1
1
  import { type WorkspaceProject, type PersonalProject } from '../types/projects/types.js';
2
+ import type { SyncResponse } from '../types/sync/response.js';
2
3
  import { type WorkspaceUser } from '../types/workspaces/types.js';
3
4
  export declare const validateTask: (input: unknown) => {
4
5
  isUncompletable: boolean;
@@ -40,7 +41,7 @@ export declare const validateTask: (input: unknown) => {
40
41
  dayOrder: number;
41
42
  isCollapsed: boolean;
42
43
  };
43
- export declare const validateTaskArray: (input: unknown[]) => {
44
+ export declare const validateTaskArray: (input: unknown) => {
44
45
  isUncompletable: boolean;
45
46
  url: string;
46
47
  id: string;
@@ -98,7 +99,7 @@ export declare function isPersonalProject(project: PersonalProject | WorkspacePr
98
99
  * @returns A validated project (either PersonalProject or WorkspaceProject)
99
100
  */
100
101
  export declare function validateProject(input: unknown): PersonalProject | WorkspaceProject;
101
- export declare function validateProjectArray(input: unknown[]): (PersonalProject | WorkspaceProject)[];
102
+ export declare function validateProjectArray(input: unknown): (PersonalProject | WorkspaceProject)[];
102
103
  export declare const validateWorkspaceProject: (input: unknown) => {
103
104
  url: string;
104
105
  id: string;
@@ -128,7 +129,7 @@ export declare const validateWorkspaceProject: (input: unknown) => {
128
129
  visibility: "restricted" | "team" | "public";
129
130
  } | undefined;
130
131
  };
131
- export declare const validateWorkspaceProjectArray: (input: unknown[]) => {
132
+ export declare const validateWorkspaceProjectArray: (input: unknown) => {
132
133
  url: string;
133
134
  id: string;
134
135
  canAssignTasks: boolean;
@@ -171,7 +172,7 @@ export declare const validateSection: (input: unknown) => {
171
172
  isDeleted: boolean;
172
173
  isCollapsed: boolean;
173
174
  };
174
- export declare const validateSectionArray: (input: unknown[]) => {
175
+ export declare const validateSectionArray: (input: unknown) => {
175
176
  url: string;
176
177
  id: string;
177
178
  userId: string;
@@ -192,7 +193,7 @@ export declare const validateLabel: (input: unknown) => {
192
193
  color: string;
193
194
  isFavorite: boolean;
194
195
  };
195
- export declare const validateLabelArray: (input: unknown[]) => {
196
+ export declare const validateLabelArray: (input: unknown) => {
196
197
  id: string;
197
198
  order: number | null;
198
199
  name: string;
@@ -224,7 +225,7 @@ export declare const validateComment: (input: unknown) => {
224
225
  isDeleted: boolean;
225
226
  projectId?: string | undefined;
226
227
  };
227
- export declare const validateCommentArray: (input: unknown[]) => {
228
+ export declare const validateCommentArray: (input: unknown) => {
228
229
  taskId: string | undefined;
229
230
  id: string;
230
231
  content: string;
@@ -254,7 +255,7 @@ export declare const validateUser: (input: unknown) => {
254
255
  name: string;
255
256
  email: string;
256
257
  };
257
- export declare const validateUserArray: (input: unknown[]) => {
258
+ export declare const validateUserArray: (input: unknown) => {
258
259
  id: string;
259
260
  name: string;
260
261
  email: string;
@@ -380,7 +381,7 @@ export declare const validateActivityEvent: (input: unknown) => {
380
381
  initiatorId: string | null;
381
382
  extraData: Record<string, any> | null;
382
383
  };
383
- export declare const validateActivityEventArray: (input: unknown[]) => {
384
+ export declare const validateActivityEventArray: (input: unknown) => {
384
385
  [x: string]: any;
385
386
  objectType: string;
386
387
  objectId: string;
@@ -425,7 +426,7 @@ export declare const validateWorkspaceInvitation: (input: unknown) => {
425
426
  role: "ADMIN" | "MEMBER" | "GUEST";
426
427
  isExistingUser: boolean;
427
428
  };
428
- export declare const validateWorkspaceInvitationArray: (input: unknown[]) => {
429
+ export declare const validateWorkspaceInvitationArray: (input: unknown) => {
429
430
  id: string;
430
431
  inviterId: string;
431
432
  userEmail: string;
@@ -487,7 +488,7 @@ export declare const validateWorkspace: (input: unknown) => {
487
488
  logoSmall?: string | null | undefined;
488
489
  logoS640?: string | null | undefined;
489
490
  };
490
- export declare const validateWorkspaceArray: (input: unknown[]) => {
491
+ export declare const validateWorkspaceArray: (input: unknown) => {
491
492
  createdAt: string | undefined;
492
493
  id: string;
493
494
  name: string;
@@ -513,7 +514,7 @@ export declare const validateMemberActivityInfo: (input: unknown) => {
513
514
  tasksAssigned: number;
514
515
  tasksOverdue: number;
515
516
  };
516
- export declare const validateMemberActivityInfoArray: (input: unknown[]) => {
517
+ export declare const validateMemberActivityInfoArray: (input: unknown) => {
517
518
  userId: string;
518
519
  tasksAssigned: number;
519
520
  tasksOverdue: number;
@@ -542,7 +543,7 @@ export declare const validateWorkspaceUserTask: (input: unknown) => {
542
543
  description: string;
543
544
  isOverdue: boolean;
544
545
  };
545
- export declare const validateWorkspaceUserTaskArray: (input: unknown[]) => {
546
+ export declare const validateWorkspaceUserTaskArray: (input: unknown) => {
546
547
  id: string;
547
548
  content: string;
548
549
  responsibleUid: string | null;
@@ -652,7 +653,7 @@ export declare const validateBackup: (input: unknown) => {
652
653
  version: string;
653
654
  url: string;
654
655
  };
655
- export declare const validateBackupArray: (input: unknown[]) => {
656
+ export declare const validateBackupArray: (input: unknown) => {
656
657
  version: string;
657
658
  url: string;
658
659
  }[];
@@ -660,7 +661,7 @@ export declare const validateIdMapping: (input: unknown) => {
660
661
  oldId: string | null;
661
662
  newId: string | null;
662
663
  };
663
- export declare const validateIdMappingArray: (input: unknown[]) => {
664
+ export declare const validateIdMappingArray: (input: unknown) => {
664
665
  oldId: string | null;
665
666
  newId: string | null;
666
667
  }[];
@@ -668,7 +669,7 @@ export declare const validateMovedId: (input: unknown) => {
668
669
  oldId: string;
669
670
  newId: string;
670
671
  };
671
- export declare const validateMovedIdArray: (input: unknown[]) => {
672
+ export declare const validateMovedIdArray: (input: unknown) => {
672
673
  oldId: string;
673
674
  newId: string;
674
675
  }[];
@@ -683,7 +684,7 @@ export declare const validateFilter: (input: unknown) => {
683
684
  isFrozen: boolean;
684
685
  itemOrder: number;
685
686
  };
686
- export declare const validateFilterArray: (input: unknown[]) => {
687
+ export declare const validateFilterArray: (input: unknown) => {
687
688
  [x: string]: unknown;
688
689
  id: string;
689
690
  name: string;
@@ -702,7 +703,7 @@ export declare const validateCollaborator: (input: unknown) => {
702
703
  timezone: string;
703
704
  imageId: string | null;
704
705
  };
705
- export declare const validateCollaboratorArray: (input: unknown[]) => {
706
+ export declare const validateCollaboratorArray: (input: unknown) => {
706
707
  [x: string]: unknown;
707
708
  id: string;
708
709
  email: string;
@@ -718,7 +719,7 @@ export declare const validateCollaboratorState: (input: unknown) => {
718
719
  isDeleted: boolean;
719
720
  workspaceRole?: "ADMIN" | "MEMBER" | "GUEST" | undefined;
720
721
  };
721
- export declare const validateCollaboratorStateArray: (input: unknown[]) => {
722
+ export declare const validateCollaboratorStateArray: (input: unknown) => {
722
723
  [x: string]: unknown;
723
724
  userId: string;
724
725
  projectId: string;
@@ -735,7 +736,7 @@ export declare const validateFolder: (input: unknown) => {
735
736
  defaultOrder: number;
736
737
  childOrder: number;
737
738
  };
738
- export declare const validateFolderArray: (input: unknown[]) => {
739
+ export declare const validateFolderArray: (input: unknown) => {
739
740
  [x: string]: unknown;
740
741
  id: string;
741
742
  name: string;
@@ -770,7 +771,7 @@ export declare const validateNote: (input: unknown) => {
770
771
  itemId?: string | undefined;
771
772
  projectId?: string | undefined;
772
773
  };
773
- export declare const validateNoteArray: (input: unknown[]) => {
774
+ export declare const validateNoteArray: (input: unknown) => {
774
775
  [x: string]: unknown;
775
776
  id: string;
776
777
  content: string;
@@ -817,7 +818,7 @@ export declare const validateWorkspaceFilter: (input: unknown) => {
817
818
  createdAt: string;
818
819
  updatedAt: string;
819
820
  };
820
- export declare const validateWorkspaceFilterArray: (input: unknown[]) => {
821
+ export declare const validateWorkspaceFilterArray: (input: unknown) => {
821
822
  [x: string]: unknown;
822
823
  id: string;
823
824
  workspaceId: string;
@@ -851,7 +852,7 @@ export declare const validateWorkspaceGoal: (input: unknown) => {
851
852
  createdAt: string;
852
853
  updatedAt: string;
853
854
  };
854
- export declare const validateWorkspaceGoalArray: (input: unknown[]) => {
855
+ export declare const validateWorkspaceGoalArray: (input: unknown) => {
855
856
  [x: string]: unknown;
856
857
  id: string;
857
858
  workspaceId: string;
@@ -878,7 +879,7 @@ export declare const validateCalendar: (input: unknown) => {
878
879
  isVisible: boolean;
879
880
  isTaskCalendar?: boolean | undefined;
880
881
  };
881
- export declare const validateCalendarArray: (input: unknown[]) => {
882
+ export declare const validateCalendarArray: (input: unknown) => {
882
883
  [x: string]: unknown;
883
884
  id: string;
884
885
  summary: string;
@@ -899,7 +900,7 @@ export declare const validateCalendarAccount: (input: unknown) => {
899
900
  pendingOperationUntil?: string | null | undefined;
900
901
  calendarsSyncState?: "error" | "synced" | "syncing" | undefined;
901
902
  };
902
- export declare const validateCalendarAccountArray: (input: unknown[]) => {
903
+ export declare const validateCalendarAccountArray: (input: unknown) => {
903
904
  [x: string]: unknown;
904
905
  id: string;
905
906
  name: string;
@@ -960,7 +961,7 @@ export declare const validateReminder: (input: unknown) => {
960
961
  } | undefined;
961
962
  isUrgent?: boolean | undefined;
962
963
  };
963
- export declare const validateReminderArray: (input: unknown[]) => ({
964
+ export declare const validateReminderArray: (input: unknown) => ({
964
965
  [x: string]: unknown;
965
966
  id: string;
966
967
  notifyUid: string;
@@ -1023,7 +1024,7 @@ export declare const validateLocationReminder: (input: unknown) => {
1023
1024
  radius: number;
1024
1025
  projectId?: string | undefined;
1025
1026
  };
1026
- export declare const validateLocationReminderArray: (input: unknown[]) => {
1027
+ export declare const validateLocationReminderArray: (input: unknown) => {
1027
1028
  [x: string]: unknown;
1028
1029
  id: string;
1029
1030
  notifyUid: string;
@@ -1053,7 +1054,7 @@ export declare const validateCompletedInfo: (input: unknown) => {
1053
1054
  completedItems: number;
1054
1055
  id?: string | undefined;
1055
1056
  };
1056
- export declare const validateCompletedInfoArray: (input: unknown[]) => ({
1057
+ export declare const validateCompletedInfoArray: (input: unknown) => ({
1057
1058
  [x: string]: unknown;
1058
1059
  projectId: string;
1059
1060
  archivedSections: number;
@@ -1073,30 +1074,30 @@ export declare const validateViewOptions: (input: unknown) => {
1073
1074
  [x: string]: unknown;
1074
1075
  viewType: "PROJECT" | "TODAY" | "UPCOMING" | "LABEL" | "FILTER" | "WORKSPACE_FILTER" | "SEARCH" | "TEMPLATE_PREVIEW" | "TASK_DETAIL" | "AUTOMATION" | "ASSIGNED" | "OVERDUE" | "WORKSPACE_OVERVIEW";
1075
1076
  objectId?: string | undefined;
1076
- groupedBy?: "PROJECT" | "WORKSPACE" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
1077
+ groupedBy?: "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | null | undefined;
1077
1078
  filteredBy?: string | null | undefined;
1078
1079
  viewMode?: "LIST" | "BOARD" | "CALENDAR" | undefined;
1079
1080
  showCompletedTasks?: boolean | undefined;
1080
- sortedBy?: "PROJECT" | "WORKSPACE" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1081
+ sortedBy?: "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1081
1082
  sortOrder?: "ASC" | "DESC" | null | undefined;
1082
1083
  };
1083
- export declare const validateViewOptionsArray: (input: unknown[]) => {
1084
+ export declare const validateViewOptionsArray: (input: unknown) => {
1084
1085
  [x: string]: unknown;
1085
1086
  viewType: "PROJECT" | "TODAY" | "UPCOMING" | "LABEL" | "FILTER" | "WORKSPACE_FILTER" | "SEARCH" | "TEMPLATE_PREVIEW" | "TASK_DETAIL" | "AUTOMATION" | "ASSIGNED" | "OVERDUE" | "WORKSPACE_OVERVIEW";
1086
1087
  objectId?: string | undefined;
1087
- groupedBy?: "PROJECT" | "WORKSPACE" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
1088
+ groupedBy?: "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | null | undefined;
1088
1089
  filteredBy?: string | null | undefined;
1089
1090
  viewMode?: "LIST" | "BOARD" | "CALENDAR" | undefined;
1090
1091
  showCompletedTasks?: boolean | undefined;
1091
- sortedBy?: "PROJECT" | "WORKSPACE" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1092
+ sortedBy?: "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1092
1093
  sortOrder?: "ASC" | "DESC" | null | undefined;
1093
1094
  }[];
1094
1095
  export declare const validateProjectViewOptionsDefaults: (input: unknown) => {
1095
1096
  [x: string]: unknown;
1096
1097
  projectId: string;
1097
1098
  viewMode?: "LIST" | "BOARD" | "CALENDAR" | null | undefined;
1098
- groupedBy?: "PROJECT" | "WORKSPACE" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
1099
- sortedBy?: "PROJECT" | "WORKSPACE" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1099
+ groupedBy?: "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | null | undefined;
1100
+ sortedBy?: "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1100
1101
  sortOrder?: "ASC" | "DESC" | null | undefined;
1101
1102
  showCompletedTasks?: boolean | undefined;
1102
1103
  filteredBy?: string | null | undefined;
@@ -1105,12 +1106,12 @@ export declare const validateProjectViewOptionsDefaults: (input: unknown) => {
1105
1106
  layout?: "WEEK" | "MONTH" | undefined;
1106
1107
  } | null | undefined;
1107
1108
  };
1108
- export declare const validateProjectViewOptionsDefaultsArray: (input: unknown[]) => {
1109
+ export declare const validateProjectViewOptionsDefaultsArray: (input: unknown) => {
1109
1110
  [x: string]: unknown;
1110
1111
  projectId: string;
1111
1112
  viewMode?: "LIST" | "BOARD" | "CALENDAR" | null | undefined;
1112
- groupedBy?: "PROJECT" | "WORKSPACE" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
1113
- sortedBy?: "PROJECT" | "WORKSPACE" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1113
+ groupedBy?: "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | null | undefined;
1114
+ sortedBy?: "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1114
1115
  sortOrder?: "ASC" | "DESC" | null | undefined;
1115
1116
  showCompletedTasks?: boolean | undefined;
1116
1117
  filteredBy?: string | null | undefined;
@@ -1171,7 +1172,7 @@ export declare const validateLiveNotification: (input: unknown) => {
1171
1172
  isDeleted?: boolean | undefined;
1172
1173
  invitationSecret?: string | undefined;
1173
1174
  };
1174
- export declare const validateLiveNotificationArray: (input: unknown[]) => {
1175
+ export declare const validateLiveNotificationArray: (input: unknown) => {
1175
1176
  [x: string]: unknown;
1176
1177
  id: string;
1177
1178
  createdAt: string;
@@ -1236,7 +1237,7 @@ export declare const validateSyncWorkspace: (input: unknown) => {
1236
1237
  } | undefined;
1237
1238
  properties?: Record<string, unknown> | undefined;
1238
1239
  };
1239
- export declare const validateSyncWorkspaceArray: (input: unknown[]) => {
1240
+ export declare const validateSyncWorkspaceArray: (input: unknown) => {
1240
1241
  createdAt: string | undefined;
1241
1242
  id: string;
1242
1243
  name: string;
@@ -1432,7 +1433,7 @@ export declare const validateSuggestion: (input: unknown) => {
1432
1433
  };
1433
1434
  isDeleted: boolean;
1434
1435
  };
1435
- export declare const validateSuggestionArray: (input: unknown[]) => ({
1436
+ export declare const validateSuggestionArray: (input: unknown) => ({
1436
1437
  [x: string]: unknown;
1437
1438
  type: "templates" | "most_used_user_templates";
1438
1439
  content: {
@@ -1460,3 +1461,4 @@ export declare const validateSuggestionArray: (input: unknown[]) => ({
1460
1461
  };
1461
1462
  isDeleted: boolean;
1462
1463
  })[];
1464
+ export declare function parseSyncResponse(raw: Record<string, unknown>): SyncResponse;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doist/todoist-sdk",
3
- "version": "8.3.0-next.1",
3
+ "version": "8.3.0",
4
4
  "description": "The official TypeScript SDK for the Todoist REST API.",
5
5
  "author": "Doist developers",
6
6
  "repository": "https://github.com/Doist/todoist-sdk-typescript",
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GoalSchema = exports.GoalProgressSchema = exports.GOAL_OWNER_TYPES = void 0;
4
- const zod_1 = require("zod");
5
- /** Available goal owner types. */
6
- exports.GOAL_OWNER_TYPES = ['USER', 'WORKSPACE'];
7
- exports.GoalProgressSchema = zod_1.z
8
- .object({
9
- totalItemCount: zod_1.z.number().int(),
10
- completedItemCount: zod_1.z.number().int(),
11
- percentage: zod_1.z.number(),
12
- })
13
- .passthrough();
14
- exports.GoalSchema = zod_1.z
15
- .object({
16
- id: zod_1.z.string(),
17
- ownerType: zod_1.z.enum(exports.GOAL_OWNER_TYPES),
18
- ownerId: zod_1.z.string(),
19
- name: zod_1.z.string(),
20
- description: zod_1.z.string().nullable(),
21
- deadline: zod_1.z.string().nullable(),
22
- parentGoalId: zod_1.z.string().nullable(),
23
- childOrder: zod_1.z.number().int(),
24
- isCompleted: zod_1.z.boolean(),
25
- completedAt: zod_1.z.coerce.date().nullable(),
26
- responsibleUid: zod_1.z.string().nullable(),
27
- isDeleted: zod_1.z.boolean(),
28
- progress: exports.GoalProgressSchema.optional(),
29
- creatorUid: zod_1.z.string(),
30
- createdAt: zod_1.z.coerce.date(),
31
- updatedAt: zod_1.z.coerce.date(),
32
- })
33
- .passthrough();
@@ -1 +0,0 @@
1
- export {};
@@ -1,30 +0,0 @@
1
- import { z } from 'zod';
2
- /** Available goal owner types. */
3
- export const GOAL_OWNER_TYPES = ['USER', 'WORKSPACE'];
4
- export const GoalProgressSchema = z
5
- .object({
6
- totalItemCount: z.number().int(),
7
- completedItemCount: z.number().int(),
8
- percentage: z.number(),
9
- })
10
- .passthrough();
11
- export const GoalSchema = z
12
- .object({
13
- id: z.string(),
14
- ownerType: z.enum(GOAL_OWNER_TYPES),
15
- ownerId: z.string(),
16
- name: z.string(),
17
- description: z.string().nullable(),
18
- deadline: z.string().nullable(),
19
- parentGoalId: z.string().nullable(),
20
- childOrder: z.number().int(),
21
- isCompleted: z.boolean(),
22
- completedAt: z.coerce.date().nullable(),
23
- responsibleUid: z.string().nullable(),
24
- isDeleted: z.boolean(),
25
- progress: GoalProgressSchema.optional(),
26
- creatorUid: z.string(),
27
- createdAt: z.coerce.date(),
28
- updatedAt: z.coerce.date(),
29
- })
30
- .passthrough();
@@ -1,33 +0,0 @@
1
- import type { GoalOwnerType } from '../resources/goals.js';
2
- export type GoalAddArgs = {
3
- ownerType: GoalOwnerType;
4
- ownerId: string;
5
- name: string;
6
- description?: string | null;
7
- deadline?: string | null;
8
- responsibleUid?: string | null;
9
- };
10
- export type GoalUpdateArgs = {
11
- id: string;
12
- name?: string;
13
- description?: string | null;
14
- deadline?: string | null;
15
- responsibleUid?: string | null;
16
- };
17
- export type GoalCompleteArgs = {
18
- id: string;
19
- };
20
- export type GoalUncompleteArgs = {
21
- id: string;
22
- };
23
- export type GoalDeleteArgs = {
24
- id: string;
25
- };
26
- export type GoalLinkItemArgs = {
27
- goalId: string;
28
- itemId: string;
29
- };
30
- export type GoalUnlinkItemArgs = {
31
- goalId: string;
32
- itemId: string;
33
- };
@@ -1,37 +0,0 @@
1
- import { z } from 'zod';
2
- /** Available goal owner types. */
3
- export declare const GOAL_OWNER_TYPES: readonly ["USER", "WORKSPACE"];
4
- /** Goal owner type. */
5
- export type GoalOwnerType = (typeof GOAL_OWNER_TYPES)[number];
6
- export declare const GoalProgressSchema: z.ZodObject<{
7
- totalItemCount: z.ZodNumber;
8
- completedItemCount: z.ZodNumber;
9
- percentage: z.ZodNumber;
10
- }, z.core.$loose>;
11
- export type GoalProgress = z.infer<typeof GoalProgressSchema>;
12
- export declare const GoalSchema: z.ZodObject<{
13
- id: z.ZodString;
14
- ownerType: z.ZodEnum<{
15
- USER: "USER";
16
- WORKSPACE: "WORKSPACE";
17
- }>;
18
- ownerId: z.ZodString;
19
- name: z.ZodString;
20
- description: z.ZodNullable<z.ZodString>;
21
- deadline: z.ZodNullable<z.ZodString>;
22
- parentGoalId: z.ZodNullable<z.ZodString>;
23
- childOrder: z.ZodNumber;
24
- isCompleted: z.ZodBoolean;
25
- completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
26
- responsibleUid: z.ZodNullable<z.ZodString>;
27
- isDeleted: z.ZodBoolean;
28
- progress: z.ZodOptional<z.ZodObject<{
29
- totalItemCount: z.ZodNumber;
30
- completedItemCount: z.ZodNumber;
31
- percentage: z.ZodNumber;
32
- }, z.core.$loose>>;
33
- creatorUid: z.ZodString;
34
- createdAt: z.ZodCoercedDate<unknown>;
35
- updatedAt: z.ZodCoercedDate<unknown>;
36
- }, z.core.$loose>;
37
- export type Goal = z.infer<typeof GoalSchema>;