@doist/todoist-sdk 8.4.0 → 8.5.0-next.1

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 (39) hide show
  1. package/dist/cjs/consts/endpoints.js +6 -1
  2. package/dist/cjs/todoist-api.js +128 -0
  3. package/dist/cjs/types/goals/index.js +18 -0
  4. package/dist/cjs/types/goals/requests.js +2 -0
  5. package/dist/cjs/types/goals/types.js +29 -0
  6. package/dist/cjs/types/index.js +1 -0
  7. package/dist/cjs/types/projects/types.js +11 -1
  8. package/dist/cjs/types/sync/commands/goals.js +2 -0
  9. package/dist/cjs/types/sync/commands/index.js +1 -0
  10. package/dist/cjs/types/sync/resource-types.js +1 -0
  11. package/dist/cjs/types/sync/response.js +55 -0
  12. package/dist/cjs/utils/validators.js +67 -142
  13. package/dist/esm/consts/endpoints.js +5 -0
  14. package/dist/esm/todoist-api.js +130 -2
  15. package/dist/esm/types/goals/index.js +2 -0
  16. package/dist/esm/types/goals/requests.js +1 -0
  17. package/dist/esm/types/goals/types.js +26 -0
  18. package/dist/esm/types/index.js +1 -0
  19. package/dist/esm/types/projects/types.js +10 -0
  20. package/dist/esm/types/sync/commands/goals.js +1 -0
  21. package/dist/esm/types/sync/commands/index.js +1 -0
  22. package/dist/esm/types/sync/resource-types.js +1 -0
  23. package/dist/esm/types/sync/response.js +54 -1
  24. package/dist/esm/utils/validators.js +56 -129
  25. package/dist/types/consts/endpoints.d.ts +5 -0
  26. package/dist/types/todoist-api.d.ts +11 -0
  27. package/dist/types/types/goals/index.d.ts +2 -0
  28. package/dist/types/types/goals/requests.d.ts +33 -0
  29. package/dist/types/types/goals/types.d.ts +41 -0
  30. package/dist/types/types/index.d.ts +1 -0
  31. package/dist/types/types/projects/types.d.ts +55 -0
  32. package/dist/types/types/sync/commands/goals.d.ts +33 -0
  33. package/dist/types/types/sync/commands/index.d.ts +9 -0
  34. package/dist/types/types/sync/resource-types.d.ts +1 -1
  35. package/dist/types/types/sync/resources/view-options.d.ts +6 -6
  36. package/dist/types/types/sync/response.d.ts +942 -51
  37. package/dist/types/types/tasks/requests.d.ts +1 -0
  38. package/dist/types/utils/validators.d.ts +194 -77
  39. package/package.json +1 -1
@@ -9,6 +9,7 @@ export * from './productivity/index.js';
9
9
  export * from './activity/index.js';
10
10
  export * from './workspaces/index.js';
11
11
  export * from './folders/index.js';
12
+ export * from './goals/index.js';
12
13
  export * from './insights/index.js';
13
14
  export * from './backups/index.js';
14
15
  export * from './id-mappings/index.js';
@@ -192,6 +192,61 @@ export type PersonalProject = z.infer<typeof PersonalProjectSchema>;
192
192
  * @see https://developer.todoist.com/api/v1/#tag/Projects
193
193
  */
194
194
  export type WorkspaceProject = z.infer<typeof WorkspaceProjectSchema>;
195
+ /**
196
+ * Schema for any project type in Todoist (personal or workspace).
197
+ * Dispatches to WorkspaceProjectSchema when workspaceId is present, PersonalProjectSchema otherwise.
198
+ */
199
+ export declare const ProjectSchema: z.ZodPipe<z.ZodUnknown, z.ZodTransform<{
200
+ url: string;
201
+ id: string;
202
+ canAssignTasks: boolean;
203
+ childOrder: number;
204
+ color: string;
205
+ createdAt: string | null;
206
+ isArchived: boolean;
207
+ isDeleted: boolean;
208
+ isFavorite: boolean;
209
+ isFrozen: boolean;
210
+ name: string;
211
+ updatedAt: string | null;
212
+ viewStyle: string;
213
+ defaultOrder: number;
214
+ description: string;
215
+ isCollapsed: boolean;
216
+ isShared: boolean;
217
+ parentId: string | null;
218
+ inboxProject: boolean;
219
+ } | {
220
+ url: string;
221
+ id: string;
222
+ canAssignTasks: boolean;
223
+ childOrder: number;
224
+ color: string;
225
+ createdAt: string | null;
226
+ isArchived: boolean;
227
+ isDeleted: boolean;
228
+ isFavorite: boolean;
229
+ isFrozen: boolean;
230
+ name: string;
231
+ updatedAt: string | null;
232
+ viewStyle: string;
233
+ defaultOrder: number;
234
+ description: string;
235
+ isCollapsed: boolean;
236
+ isShared: boolean;
237
+ collaboratorRoleDefault: string;
238
+ folderId: string | null;
239
+ isInviteOnly: boolean | null;
240
+ isLinkSharingEnabled: boolean;
241
+ role: string | null;
242
+ status: string;
243
+ workspaceId: string;
244
+ access?: {
245
+ visibility: "restricted" | "team" | "public";
246
+ } | undefined;
247
+ }, unknown>>;
248
+ /** A project in Todoist — either a {@link PersonalProject} or a {@link WorkspaceProject}. */
249
+ export type Project = z.infer<typeof ProjectSchema>;
195
250
  /** Available project view styles. */
196
251
  export declare const PROJECT_VIEW_STYLES: readonly ["list", "board", "calendar"];
197
252
  /**
@@ -0,0 +1,33 @@
1
+ import type { GoalOwnerType } from '../../goals/types.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,6 +1,7 @@
1
1
  import type { CalendarUpdateArgs, CalendarAccountUpdateArgs, CalendarAccountRestoreTaskCalendarArgs } from './calendars.js';
2
2
  import type { FilterAddArgs, FilterUpdateArgs, FilterUpdateOrdersArgs, FilterDeleteArgs } from './filters.js';
3
3
  import type { FolderAddArgs, FolderUpdateArgs, FolderDeleteArgs } from './folders.js';
4
+ import type { GoalAddArgs, GoalUpdateArgs, GoalCompleteArgs, GoalUncompleteArgs, GoalDeleteArgs, GoalLinkItemArgs, GoalUnlinkItemArgs } from './goals.js';
4
5
  import type { LabelAddArgs, LabelRenameArgs, LabelUpdateArgs, LabelUpdateOrdersArgs, LabelDeleteArgs, LabelDeleteOccurrencesArgs } from './labels.js';
5
6
  import type { NoteAddArgs, NoteUpdateArgs, NoteDeleteArgs, NoteReactionAddArgs, NoteReactionRemoveArgs } from './notes.js';
6
7
  import type { LiveNotificationsMarkUnreadArgs, LiveNotificationsMarkReadArgs, LiveNotificationsMarkReadAllArgs, LiveNotificationsSetLastReadArgs } from './notifications.js';
@@ -96,6 +97,13 @@ export type SyncCommandsMap = {
96
97
  workspace_goal_delete: WorkspaceGoalDeleteArgs;
97
98
  workspace_goal_project_add: WorkspaceGoalProjectAddArgs;
98
99
  workspace_goal_project_remove: WorkspaceGoalProjectRemoveArgs;
100
+ goal_add: GoalAddArgs;
101
+ goal_update: GoalUpdateArgs;
102
+ goal_complete: GoalCompleteArgs;
103
+ goal_uncomplete: GoalUncompleteArgs;
104
+ goal_delete: GoalDeleteArgs;
105
+ goal_link_item: GoalLinkItemArgs;
106
+ goal_unlink_item: GoalUnlinkItemArgs;
99
107
  live_notifications_mark_unread: LiveNotificationsMarkUnreadArgs;
100
108
  live_notifications_mark_read: LiveNotificationsMarkReadArgs;
101
109
  live_notifications_mark_read_all: LiveNotificationsMarkReadAllArgs;
@@ -163,6 +171,7 @@ export * from './workspaces.js';
163
171
  export * from './folders.js';
164
172
  export * from './workspace-filters.js';
165
173
  export * from './workspace-goals.js';
174
+ export * from './goals.js';
166
175
  export * from './notifications.js';
167
176
  export * from './sharing.js';
168
177
  export * from './view-options.js';
@@ -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", "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", "goals", "day_orders", "calendars", "calendar_accounts", "suggestions", "tooltips"];
5
5
  export type SyncResourceType = (typeof SYNC_RESOURCE_TYPES)[number];
@@ -32,6 +32,7 @@ export declare const GROUPED_BY_OPTIONS: readonly ["ASSIGNEE", "ADDED_DATE", "DU
32
32
  /** Field to group tasks by. */
33
33
  export type GroupedBy = (typeof GROUPED_BY_OPTIONS)[number];
34
34
  export declare const GroupedBySchema: z.ZodNullable<z.ZodEnum<{
35
+ WORKSPACE: "WORKSPACE";
35
36
  PROJECT: "PROJECT";
36
37
  LABEL: "LABEL";
37
38
  ASSIGNEE: "ASSIGNEE";
@@ -39,20 +40,19 @@ export declare const GroupedBySchema: z.ZodNullable<z.ZodEnum<{
39
40
  DUE_DATE: "DUE_DATE";
40
41
  DEADLINE: "DEADLINE";
41
42
  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"];
46
46
  /** Field to sort tasks by. */
47
47
  export type SortedBy = (typeof SORTED_BY_OPTIONS)[number];
48
48
  export declare const SortedBySchema: z.ZodNullable<z.ZodEnum<{
49
+ WORKSPACE: "WORKSPACE";
49
50
  PROJECT: "PROJECT";
50
51
  ASSIGNEE: "ASSIGNEE";
51
52
  ADDED_DATE: "ADDED_DATE";
52
53
  DUE_DATE: "DUE_DATE";
53
54
  DEADLINE: "DEADLINE";
54
55
  PRIORITY: "PRIORITY";
55
- WORKSPACE: "WORKSPACE";
56
56
  MANUAL: "MANUAL";
57
57
  ALPHABETICALLY: "ALPHABETICALLY";
58
58
  }>>;
@@ -92,6 +92,7 @@ export declare const ViewOptionsSchema: z.ZodObject<{
92
92
  }>;
93
93
  objectId: z.ZodOptional<z.ZodString>;
94
94
  groupedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
95
+ WORKSPACE: "WORKSPACE";
95
96
  PROJECT: "PROJECT";
96
97
  LABEL: "LABEL";
97
98
  ASSIGNEE: "ASSIGNEE";
@@ -99,7 +100,6 @@ export declare const ViewOptionsSchema: z.ZodObject<{
99
100
  DUE_DATE: "DUE_DATE";
100
101
  DEADLINE: "DEADLINE";
101
102
  PRIORITY: "PRIORITY";
102
- WORKSPACE: "WORKSPACE";
103
103
  }>>>;
104
104
  filteredBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
105
105
  viewMode: z.ZodOptional<z.ZodEnum<{
@@ -109,13 +109,13 @@ export declare const ViewOptionsSchema: z.ZodObject<{
109
109
  }>>;
110
110
  showCompletedTasks: z.ZodOptional<z.ZodBoolean>;
111
111
  sortedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
112
+ WORKSPACE: "WORKSPACE";
112
113
  PROJECT: "PROJECT";
113
114
  ASSIGNEE: "ASSIGNEE";
114
115
  ADDED_DATE: "ADDED_DATE";
115
116
  DUE_DATE: "DUE_DATE";
116
117
  DEADLINE: "DEADLINE";
117
118
  PRIORITY: "PRIORITY";
118
- WORKSPACE: "WORKSPACE";
119
119
  MANUAL: "MANUAL";
120
120
  ALPHABETICALLY: "ALPHABETICALLY";
121
121
  }>>>;
@@ -133,6 +133,7 @@ export declare const ProjectViewOptionsDefaultsSchema: z.ZodObject<{
133
133
  CALENDAR: "CALENDAR";
134
134
  }>>>;
135
135
  groupedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
136
+ WORKSPACE: "WORKSPACE";
136
137
  PROJECT: "PROJECT";
137
138
  LABEL: "LABEL";
138
139
  ASSIGNEE: "ASSIGNEE";
@@ -140,16 +141,15 @@ export declare const ProjectViewOptionsDefaultsSchema: z.ZodObject<{
140
141
  DUE_DATE: "DUE_DATE";
141
142
  DEADLINE: "DEADLINE";
142
143
  PRIORITY: "PRIORITY";
143
- WORKSPACE: "WORKSPACE";
144
144
  }>>>;
145
145
  sortedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
146
+ WORKSPACE: "WORKSPACE";
146
147
  PROJECT: "PROJECT";
147
148
  ASSIGNEE: "ASSIGNEE";
148
149
  ADDED_DATE: "ADDED_DATE";
149
150
  DUE_DATE: "DUE_DATE";
150
151
  DEADLINE: "DEADLINE";
151
152
  PRIORITY: "PRIORITY";
152
- WORKSPACE: "WORKSPACE";
153
153
  MANUAL: "MANUAL";
154
154
  ALPHABETICALLY: "ALPHABETICALLY";
155
155
  }>>>;