@doist/todoist-sdk 10.1.0 → 10.2.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 (48) hide show
  1. package/dist/cjs/clients/goals-client.js +145 -0
  2. package/dist/cjs/consts/endpoints.js +6 -1
  3. package/dist/cjs/test-utils/test-defaults.js +26 -2
  4. package/dist/cjs/todoist-api.js +33 -0
  5. package/dist/cjs/types/goals/index.js +18 -0
  6. package/dist/cjs/types/goals/requests.js +2 -0
  7. package/dist/cjs/types/goals/types.js +56 -0
  8. package/dist/cjs/types/index.js +1 -0
  9. package/dist/cjs/types/sync/commands/goals.js +2 -0
  10. package/dist/cjs/types/sync/commands/index.js +1 -0
  11. package/dist/cjs/types/sync/resource-types.js +1 -0
  12. package/dist/cjs/types/sync/resources/user-settings.js +2 -2
  13. package/dist/cjs/types/sync/resources/user.js +4 -4
  14. package/dist/cjs/types/sync/response.js +12 -10
  15. package/dist/cjs/utils/validators.js +53 -51
  16. package/dist/esm/clients/goals-client.js +141 -0
  17. package/dist/esm/consts/endpoints.js +5 -0
  18. package/dist/esm/test-utils/test-defaults.js +24 -0
  19. package/dist/esm/todoist-api.js +33 -0
  20. package/dist/esm/types/goals/index.js +2 -0
  21. package/dist/esm/types/goals/requests.js +1 -0
  22. package/dist/esm/types/goals/types.js +53 -0
  23. package/dist/esm/types/index.js +1 -0
  24. package/dist/esm/types/sync/commands/goals.js +1 -0
  25. package/dist/esm/types/sync/commands/index.js +1 -0
  26. package/dist/esm/types/sync/resource-types.js +1 -0
  27. package/dist/esm/types/sync/resources/user-settings.js +2 -2
  28. package/dist/esm/types/sync/resources/user.js +4 -4
  29. package/dist/esm/types/sync/response.js +2 -0
  30. package/dist/esm/utils/validators.js +2 -0
  31. package/dist/types/clients/goals-client.d.ts +20 -0
  32. package/dist/types/consts/endpoints.d.ts +5 -0
  33. package/dist/types/test-utils/test-defaults.d.ts +4 -1
  34. package/dist/types/todoist-api.d.ts +12 -0
  35. package/dist/types/types/goals/index.d.ts +2 -0
  36. package/dist/types/types/goals/requests.d.ts +33 -0
  37. package/dist/types/types/goals/types.d.ts +51 -0
  38. package/dist/types/types/index.d.ts +1 -0
  39. package/dist/types/types/sync/commands/goals.d.ts +33 -0
  40. package/dist/types/types/sync/commands/index.d.ts +9 -0
  41. package/dist/types/types/sync/resource-types.d.ts +1 -1
  42. package/dist/types/types/sync/resources/user-settings.d.ts +2 -2
  43. package/dist/types/types/sync/resources/user.d.ts +4 -4
  44. package/dist/types/types/sync/resources/view-options.d.ts +6 -6
  45. package/dist/types/types/sync/response.d.ts +35 -10
  46. package/dist/types/types/tasks/requests.d.ts +1 -0
  47. package/dist/types/utils/validators.d.ts +60 -13
  48. package/package.json +1 -1
@@ -5,6 +5,7 @@ import { Backup, GetBackupsArgs, DownloadBackupArgs } from './types/backups/inde
5
5
  import { Attachment, Comment, AddCommentArgs, UpdateCommentArgs, GetProjectCommentsArgs, GetTaskCommentsArgs, GetCommentsResponse } from './types/comments/index.js';
6
6
  import { GetOrCreateEmailArgs, GetOrCreateEmailResponse, DisableEmailArgs } from './types/emails/index.js';
7
7
  import { GetFoldersArgs, GetFoldersResponse, AddFolderArgs, UpdateFolderArgs } from './types/folders/index.js';
8
+ import type { AddGoalArgs, GetGoalsArgs, GetGoalsResponse, Goal, SearchGoalsArgs, TaskLinkingArgs, UpdateGoalArgs } from './types/goals/index.js';
8
9
  import { CustomFetch, FileResponse } from './types/http.js';
9
10
  import { IdMapping, MovedId, GetIdMappingsArgs, GetMovedIdsArgs } from './types/id-mappings/index.js';
10
11
  import { ProjectActivityStats, ProjectHealth, ProjectHealthContext, ProjectProgress, WorkspaceInsights, GetProjectActivityStatsArgs, GetWorkspaceInsightsArgs } from './types/insights/index.js';
@@ -75,6 +76,7 @@ export declare class TodoistApi {
75
76
  private readonly activityClient;
76
77
  private readonly productivityClient;
77
78
  private readonly workspaceClient;
79
+ private readonly goalsClient;
78
80
  private readonly appClient;
79
81
  private readonly uiExtensionClient;
80
82
  constructor(
@@ -787,6 +789,16 @@ export declare class TodoistApi {
787
789
  * @returns A promise that resolves to `true` if successful.
788
790
  */
789
791
  deleteFolder(id: string, requestId?: string): Promise<boolean>;
792
+ getGoals(args?: GetGoalsArgs): Promise<GetGoalsResponse>;
793
+ searchGoals(args: SearchGoalsArgs): Promise<GetGoalsResponse>;
794
+ getGoal(id: string): Promise<Goal>;
795
+ addGoal(args: AddGoalArgs, requestId?: string): Promise<Goal>;
796
+ updateGoal(id: string, args: UpdateGoalArgs, requestId?: string): Promise<Goal>;
797
+ deleteGoal(id: string, requestId?: string): Promise<boolean>;
798
+ completeGoal(id: string, requestId?: string): Promise<Goal>;
799
+ uncompleteGoal(id: string, requestId?: string): Promise<Goal>;
800
+ linkTaskToGoal(args: TaskLinkingArgs, requestId?: string): Promise<Goal>;
801
+ unlinkTaskFromGoal(args: TaskLinkingArgs, requestId?: string): Promise<boolean>;
790
802
  /**
791
803
  * Retrieves a list of available backups.
792
804
  *
@@ -0,0 +1,2 @@
1
+ export * from './types.js';
2
+ export * from './requests.js';
@@ -0,0 +1,33 @@
1
+ import type { SearchArgs } from '../common.js';
2
+ import type { Workspace } from '../workspaces/index.js';
3
+ import type { Goal, GoalOwnerType } from './types.js';
4
+ export type GetGoalsArgs = {
5
+ ownerType?: GoalOwnerType;
6
+ workspaceId?: Workspace['id'];
7
+ cursor?: string | null;
8
+ limit?: number;
9
+ };
10
+ export type SearchGoalsArgs = SearchArgs & {
11
+ ownerType?: GoalOwnerType;
12
+ };
13
+ export type GetGoalsResponse = {
14
+ results: Goal[];
15
+ nextCursor: string | null;
16
+ };
17
+ export type AddGoalArgs = {
18
+ name: string;
19
+ workspaceId?: string;
20
+ description?: string | null;
21
+ deadline?: string | null;
22
+ responsibleUid?: string | null;
23
+ };
24
+ export type UpdateGoalArgs = {
25
+ name?: string;
26
+ description?: string | null;
27
+ deadline?: string | null;
28
+ responsibleUid?: string | null;
29
+ };
30
+ export type TaskLinkingArgs = {
31
+ goalId: string;
32
+ taskId: string;
33
+ };
@@ -0,0 +1,51 @@
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
+ /**
7
+ * Progress of a {@link Goal}.
8
+ *
9
+ * The REST API returns these counts under `total_item_count` / `completed_item_count`,
10
+ * reflecting the backend's generic "item" terminology. The SDK normalizes them to
11
+ * `totalTaskCount` / `completedTaskCount` so the public surface consistently speaks
12
+ * in "tasks" (matching the rest of the SDK). The `preprocess` step below performs
13
+ * that rename after the transport layer's snake_case → camelCase conversion — do not
14
+ * remove it without also changing the downstream field names.
15
+ */
16
+ export declare const GoalProgressSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodObject<{
17
+ totalTaskCount: z.ZodNumber;
18
+ completedTaskCount: z.ZodNumber;
19
+ percentage: z.ZodNumber;
20
+ }, z.core.$loose>>;
21
+ export type GoalProgress = z.infer<typeof GoalProgressSchema>;
22
+ export declare const GoalSchema: z.ZodObject<{
23
+ id: z.ZodString;
24
+ ownerType: z.ZodEnum<{
25
+ USER: "USER";
26
+ WORKSPACE: "WORKSPACE";
27
+ }>;
28
+ ownerId: z.ZodString;
29
+ name: z.ZodString;
30
+ description: z.ZodNullable<z.ZodString>;
31
+ deadline: z.ZodNullable<z.ZodString>;
32
+ parentGoalId: z.ZodNullable<z.ZodString>;
33
+ childOrder: z.ZodNumber;
34
+ isCompleted: z.ZodBoolean;
35
+ completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
36
+ responsibleUid: z.ZodNullable<z.ZodString>;
37
+ isDeleted: z.ZodBoolean;
38
+ progress: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodObject<{
39
+ totalTaskCount: z.ZodNumber;
40
+ completedTaskCount: z.ZodNumber;
41
+ percentage: z.ZodNumber;
42
+ }, z.core.$loose>>>;
43
+ creatorUid: z.ZodString;
44
+ createdAt: z.ZodCoercedDate<unknown>;
45
+ updatedAt: z.ZodCoercedDate<unknown>;
46
+ }, z.core.$loose>;
47
+ /**
48
+ * Represents a goal in Todoist.
49
+ * Goals support dual ownership: personal (ownerType=USER) and workspace (ownerType=WORKSPACE).
50
+ */
51
+ export type Goal = z.infer<typeof GoalSchema>;
@@ -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';
@@ -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];
@@ -13,8 +13,8 @@ export declare const QuickAddFeatureSchema: z.ZodObject<{
13
13
  export declare const UserSettingsSchema: z.ZodObject<{
14
14
  completedSoundDesktop: z.ZodBoolean;
15
15
  completedSoundMobile: z.ZodBoolean;
16
- debugLogSendingEnabledUntil: z.ZodNullable<z.ZodString>;
17
- legacyPricing: z.ZodBoolean;
16
+ debugLogSendingEnabledUntil: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17
+ legacyPricing: z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<0>, z.ZodLiteral<1>]>, z.ZodTransform<boolean, boolean | 0 | 1>>;
18
18
  navigation: z.ZodObject<{
19
19
  countsShown: z.ZodBoolean;
20
20
  features: z.ZodArray<z.ZodObject<{
@@ -48,7 +48,7 @@ export declare const SyncUserSchema: z.ZodObject<{
48
48
  businessAccountId: z.ZodNullable<z.ZodString>;
49
49
  dailyGoal: z.ZodNumber;
50
50
  dateFormat: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>, z.ZodTransform<"DD/MM/YYYY" | "MM/DD/YYYY", 0 | 1>>;
51
- dateistLang: z.ZodNullable<z.ZodString>;
51
+ dateistLang: z.ZodOptional<z.ZodNullable<z.ZodString>>;
52
52
  daysOff: z.ZodArray<z.ZodNumber>;
53
53
  featureIdentifier: z.ZodString;
54
54
  features: z.ZodObject<{
@@ -87,8 +87,8 @@ export declare const SyncUserSchema: z.ZodObject<{
87
87
  karmaTrend: z.ZodString;
88
88
  lang: z.ZodString;
89
89
  mfaEnabled: z.ZodOptional<z.ZodBoolean>;
90
- mobileHost: z.ZodNullable<z.ZodString>;
91
- mobileNumber: z.ZodNullable<z.ZodString>;
90
+ mobileHost: z.ZodOptional<z.ZodNullable<z.ZodString>>;
91
+ mobileNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
92
92
  nextWeek: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<7>]>, z.ZodTransform<"Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday", 3 | 2 | 1 | 7 | 4 | 5 | 6>>;
93
93
  onboardingLevel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
94
94
  onboardingRole: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -117,7 +117,7 @@ export declare const SyncUserSchema: z.ZodObject<{
117
117
  startPage: z.ZodString;
118
118
  themeId: z.ZodString;
119
119
  timeFormat: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>, z.ZodTransform<"24h" | "12h", 0 | 1>>;
120
- token: z.ZodString;
120
+ token: z.ZodOptional<z.ZodString>;
121
121
  tzInfo: z.ZodObject<{
122
122
  timezone: z.ZodString;
123
123
  hours: z.ZodNumber;
@@ -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
  }>>>;
@@ -376,7 +376,7 @@ export declare const SyncResponseSchema: z.ZodObject<{
376
376
  businessAccountId: z.ZodNullable<z.ZodString>;
377
377
  dailyGoal: z.ZodNumber;
378
378
  dateFormat: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>, z.ZodTransform<"DD/MM/YYYY" | "MM/DD/YYYY", 0 | 1>>;
379
- dateistLang: z.ZodNullable<z.ZodString>;
379
+ dateistLang: z.ZodOptional<z.ZodNullable<z.ZodString>>;
380
380
  daysOff: z.ZodArray<z.ZodNumber>;
381
381
  featureIdentifier: z.ZodString;
382
382
  features: z.ZodObject<{
@@ -415,8 +415,8 @@ export declare const SyncResponseSchema: z.ZodObject<{
415
415
  karmaTrend: z.ZodString;
416
416
  lang: z.ZodString;
417
417
  mfaEnabled: z.ZodOptional<z.ZodBoolean>;
418
- mobileHost: z.ZodNullable<z.ZodString>;
419
- mobileNumber: z.ZodNullable<z.ZodString>;
418
+ mobileHost: z.ZodOptional<z.ZodNullable<z.ZodString>>;
419
+ mobileNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
420
420
  nextWeek: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<7>]>, z.ZodTransform<"Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday", 3 | 2 | 1 | 7 | 4 | 5 | 6>>;
421
421
  onboardingLevel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
422
422
  onboardingRole: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -445,7 +445,7 @@ export declare const SyncResponseSchema: z.ZodObject<{
445
445
  startPage: z.ZodString;
446
446
  themeId: z.ZodString;
447
447
  timeFormat: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>, z.ZodTransform<"24h" | "12h", 0 | 1>>;
448
- token: z.ZodString;
448
+ token: z.ZodOptional<z.ZodString>;
449
449
  tzInfo: z.ZodObject<{
450
450
  timezone: z.ZodString;
451
451
  hours: z.ZodNumber;
@@ -505,8 +505,8 @@ export declare const SyncResponseSchema: z.ZodObject<{
505
505
  userSettings: z.ZodOptional<z.ZodObject<{
506
506
  completedSoundDesktop: z.ZodBoolean;
507
507
  completedSoundMobile: z.ZodBoolean;
508
- debugLogSendingEnabledUntil: z.ZodNullable<z.ZodString>;
509
- legacyPricing: z.ZodBoolean;
508
+ debugLogSendingEnabledUntil: z.ZodOptional<z.ZodNullable<z.ZodString>>;
509
+ legacyPricing: z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<0>, z.ZodLiteral<1>]>, z.ZodTransform<boolean, boolean | 0 | 1>>;
510
510
  navigation: z.ZodObject<{
511
511
  countsShown: z.ZodBoolean;
512
512
  features: z.ZodArray<z.ZodObject<{
@@ -750,6 +750,7 @@ export declare const SyncResponseSchema: z.ZodObject<{
750
750
  }>;
751
751
  objectId: z.ZodOptional<z.ZodString>;
752
752
  groupedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
753
+ WORKSPACE: "WORKSPACE";
753
754
  PROJECT: "PROJECT";
754
755
  LABEL: "LABEL";
755
756
  ASSIGNEE: "ASSIGNEE";
@@ -757,7 +758,6 @@ export declare const SyncResponseSchema: z.ZodObject<{
757
758
  DUE_DATE: "DUE_DATE";
758
759
  DEADLINE: "DEADLINE";
759
760
  PRIORITY: "PRIORITY";
760
- WORKSPACE: "WORKSPACE";
761
761
  }>>>;
762
762
  filteredBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
763
763
  viewMode: z.ZodOptional<z.ZodEnum<{
@@ -767,13 +767,13 @@ export declare const SyncResponseSchema: z.ZodObject<{
767
767
  }>>;
768
768
  showCompletedTasks: z.ZodOptional<z.ZodBoolean>;
769
769
  sortedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
770
+ WORKSPACE: "WORKSPACE";
770
771
  PROJECT: "PROJECT";
771
772
  ASSIGNEE: "ASSIGNEE";
772
773
  ADDED_DATE: "ADDED_DATE";
773
774
  DUE_DATE: "DUE_DATE";
774
775
  DEADLINE: "DEADLINE";
775
776
  PRIORITY: "PRIORITY";
776
- WORKSPACE: "WORKSPACE";
777
777
  MANUAL: "MANUAL";
778
778
  ALPHABETICALLY: "ALPHABETICALLY";
779
779
  }>>>;
@@ -790,6 +790,7 @@ export declare const SyncResponseSchema: z.ZodObject<{
790
790
  CALENDAR: "CALENDAR";
791
791
  }>>>;
792
792
  groupedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
793
+ WORKSPACE: "WORKSPACE";
793
794
  PROJECT: "PROJECT";
794
795
  LABEL: "LABEL";
795
796
  ASSIGNEE: "ASSIGNEE";
@@ -797,16 +798,15 @@ export declare const SyncResponseSchema: z.ZodObject<{
797
798
  DUE_DATE: "DUE_DATE";
798
799
  DEADLINE: "DEADLINE";
799
800
  PRIORITY: "PRIORITY";
800
- WORKSPACE: "WORKSPACE";
801
801
  }>>>;
802
802
  sortedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
803
+ WORKSPACE: "WORKSPACE";
803
804
  PROJECT: "PROJECT";
804
805
  ASSIGNEE: "ASSIGNEE";
805
806
  ADDED_DATE: "ADDED_DATE";
806
807
  DUE_DATE: "DUE_DATE";
807
808
  DEADLINE: "DEADLINE";
808
809
  PRIORITY: "PRIORITY";
809
- WORKSPACE: "WORKSPACE";
810
810
  MANUAL: "MANUAL";
811
811
  ALPHABETICALLY: "ALPHABETICALLY";
812
812
  }>>>;
@@ -832,6 +832,31 @@ export declare const SyncResponseSchema: z.ZodObject<{
832
832
  defaultOrder: z.ZodNumber;
833
833
  childOrder: z.ZodNumber;
834
834
  }, z.core.$loose>>>;
835
+ goals: z.ZodOptional<z.ZodArray<z.ZodObject<{
836
+ id: z.ZodString;
837
+ ownerType: z.ZodEnum<{
838
+ USER: "USER";
839
+ WORKSPACE: "WORKSPACE";
840
+ }>;
841
+ ownerId: z.ZodString;
842
+ name: z.ZodString;
843
+ description: z.ZodNullable<z.ZodString>;
844
+ deadline: z.ZodNullable<z.ZodString>;
845
+ parentGoalId: z.ZodNullable<z.ZodString>;
846
+ childOrder: z.ZodNumber;
847
+ isCompleted: z.ZodBoolean;
848
+ completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
849
+ responsibleUid: z.ZodNullable<z.ZodString>;
850
+ isDeleted: z.ZodBoolean;
851
+ progress: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodObject<{
852
+ totalTaskCount: z.ZodNumber;
853
+ completedTaskCount: z.ZodNumber;
854
+ percentage: z.ZodNumber;
855
+ }, z.core.$loose>>>;
856
+ creatorUid: z.ZodString;
857
+ createdAt: z.ZodCoercedDate<unknown>;
858
+ updatedAt: z.ZodCoercedDate<unknown>;
859
+ }, z.core.$loose>>>;
835
860
  workspaceGoals: z.ZodOptional<z.ZodArray<z.ZodObject<{
836
861
  id: z.ZodString;
837
862
  workspaceId: z.ZodString;
@@ -36,6 +36,7 @@ export type GetTasksArgs = {
36
36
  parentId?: string;
37
37
  label?: string;
38
38
  ids?: string[];
39
+ goalId?: string;
39
40
  cursor?: string | null;
40
41
  limit?: number;
41
42
  };
@@ -818,6 +818,53 @@ export declare const validateFolder: (input: unknown) => {
818
818
  defaultOrder: number;
819
819
  childOrder: number;
820
820
  }[];
821
+ export declare const validateGoal: (input: unknown) => {
822
+ [x: string]: unknown;
823
+ id: string;
824
+ ownerType: "USER" | "WORKSPACE";
825
+ ownerId: string;
826
+ name: string;
827
+ description: string | null;
828
+ deadline: string | null;
829
+ parentGoalId: string | null;
830
+ childOrder: number;
831
+ isCompleted: boolean;
832
+ completedAt: Date | null;
833
+ responsibleUid: string | null;
834
+ isDeleted: boolean;
835
+ creatorUid: string;
836
+ createdAt: Date;
837
+ updatedAt: Date;
838
+ progress?: {
839
+ [x: string]: unknown;
840
+ totalTaskCount: number;
841
+ completedTaskCount: number;
842
+ percentage: number;
843
+ } | undefined;
844
+ }, validateGoalArray: (input: unknown) => {
845
+ [x: string]: unknown;
846
+ id: string;
847
+ ownerType: "USER" | "WORKSPACE";
848
+ ownerId: string;
849
+ name: string;
850
+ description: string | null;
851
+ deadline: string | null;
852
+ parentGoalId: string | null;
853
+ childOrder: number;
854
+ isCompleted: boolean;
855
+ completedAt: Date | null;
856
+ responsibleUid: string | null;
857
+ isDeleted: boolean;
858
+ creatorUid: string;
859
+ createdAt: Date;
860
+ updatedAt: Date;
861
+ progress?: {
862
+ [x: string]: unknown;
863
+ totalTaskCount: number;
864
+ completedTaskCount: number;
865
+ percentage: number;
866
+ } | undefined;
867
+ }[];
821
868
  export declare const validateNote: (input: unknown) => {
822
869
  [x: string]: unknown;
823
870
  id: string;
@@ -1139,29 +1186,29 @@ export declare const validateViewOptions: (input: unknown) => {
1139
1186
  [x: string]: unknown;
1140
1187
  viewType: "PROJECT" | "TODAY" | "UPCOMING" | "LABEL" | "FILTER" | "WORKSPACE_FILTER" | "SEARCH" | "TEMPLATE_PREVIEW" | "TASK_DETAIL" | "AUTOMATION" | "ASSIGNED" | "OVERDUE" | "WORKSPACE_OVERVIEW";
1141
1188
  objectId?: string | undefined;
1142
- groupedBy?: "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | null | undefined;
1189
+ groupedBy?: "WORKSPACE" | "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
1143
1190
  filteredBy?: string | null | undefined;
1144
1191
  viewMode?: "LIST" | "BOARD" | "CALENDAR" | undefined;
1145
1192
  showCompletedTasks?: boolean | undefined;
1146
- sortedBy?: "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1193
+ sortedBy?: "WORKSPACE" | "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1147
1194
  sortOrder?: "ASC" | "DESC" | null | undefined;
1148
1195
  }, validateViewOptionsArray: (input: unknown) => {
1149
1196
  [x: string]: unknown;
1150
1197
  viewType: "PROJECT" | "TODAY" | "UPCOMING" | "LABEL" | "FILTER" | "WORKSPACE_FILTER" | "SEARCH" | "TEMPLATE_PREVIEW" | "TASK_DETAIL" | "AUTOMATION" | "ASSIGNED" | "OVERDUE" | "WORKSPACE_OVERVIEW";
1151
1198
  objectId?: string | undefined;
1152
- groupedBy?: "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | null | undefined;
1199
+ groupedBy?: "WORKSPACE" | "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
1153
1200
  filteredBy?: string | null | undefined;
1154
1201
  viewMode?: "LIST" | "BOARD" | "CALENDAR" | undefined;
1155
1202
  showCompletedTasks?: boolean | undefined;
1156
- sortedBy?: "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1203
+ sortedBy?: "WORKSPACE" | "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1157
1204
  sortOrder?: "ASC" | "DESC" | null | undefined;
1158
1205
  }[];
1159
1206
  export declare const validateProjectViewOptionsDefaults: (input: unknown) => {
1160
1207
  [x: string]: unknown;
1161
1208
  projectId: string;
1162
1209
  viewMode?: "LIST" | "BOARD" | "CALENDAR" | null | undefined;
1163
- groupedBy?: "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | null | undefined;
1164
- sortedBy?: "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1210
+ groupedBy?: "WORKSPACE" | "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
1211
+ sortedBy?: "WORKSPACE" | "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1165
1212
  sortOrder?: "ASC" | "DESC" | null | undefined;
1166
1213
  showCompletedTasks?: boolean | undefined;
1167
1214
  filteredBy?: string | null | undefined;
@@ -1173,8 +1220,8 @@ export declare const validateProjectViewOptionsDefaults: (input: unknown) => {
1173
1220
  [x: string]: unknown;
1174
1221
  projectId: string;
1175
1222
  viewMode?: "LIST" | "BOARD" | "CALENDAR" | null | undefined;
1176
- groupedBy?: "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | null | undefined;
1177
- sortedBy?: "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1223
+ groupedBy?: "WORKSPACE" | "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
1224
+ sortedBy?: "WORKSPACE" | "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1178
1225
  sortOrder?: "ASC" | "DESC" | null | undefined;
1179
1226
  showCompletedTasks?: boolean | undefined;
1180
1227
  filteredBy?: string | null | undefined;
@@ -1350,7 +1397,6 @@ export declare const validateSyncUser: (input: unknown) => {
1350
1397
  businessAccountId: string | null;
1351
1398
  dailyGoal: number;
1352
1399
  dateFormat: "DD/MM/YYYY" | "MM/DD/YYYY";
1353
- dateistLang: string | null;
1354
1400
  daysOff: number[];
1355
1401
  featureIdentifier: string;
1356
1402
  features: {
@@ -1389,8 +1435,6 @@ export declare const validateSyncUser: (input: unknown) => {
1389
1435
  karma: number;
1390
1436
  karmaTrend: string;
1391
1437
  lang: string;
1392
- mobileHost: string | null;
1393
- mobileNumber: string | null;
1394
1438
  nextWeek: "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday";
1395
1439
  premiumStatus: "not_premium" | "current_personal_plan" | "legacy_personal_plan" | "teams_business_member";
1396
1440
  premiumUntil: Date | null;
@@ -1400,7 +1444,6 @@ export declare const validateSyncUser: (input: unknown) => {
1400
1444
  startPage: string;
1401
1445
  themeId: string;
1402
1446
  timeFormat: "24h" | "12h";
1403
- token: string;
1404
1447
  tzInfo: {
1405
1448
  [x: string]: unknown;
1406
1449
  timezone: string;
@@ -1418,9 +1461,12 @@ export declare const validateSyncUser: (input: unknown) => {
1418
1461
  avatarMedium?: string | undefined;
1419
1462
  avatarS640?: string | undefined;
1420
1463
  avatarSmall?: string | undefined;
1464
+ dateistLang?: string | null | undefined;
1421
1465
  freeTrailExpires?: Date | undefined;
1422
1466
  hasStartedATrial?: boolean | undefined;
1423
1467
  mfaEnabled?: boolean | undefined;
1468
+ mobileHost?: string | null | undefined;
1469
+ mobileNumber?: string | null | undefined;
1424
1470
  onboardingLevel?: string | null | undefined;
1425
1471
  onboardingRole?: string | null | undefined;
1426
1472
  onboardingPersona?: string | null | undefined;
@@ -1435,12 +1481,12 @@ export declare const validateSyncUser: (input: unknown) => {
1435
1481
  remaining: number;
1436
1482
  resetDate: Date;
1437
1483
  } | null | undefined;
1484
+ token?: string | undefined;
1438
1485
  };
1439
1486
  export declare const validateUserSettings: (input: unknown) => {
1440
1487
  [x: string]: unknown;
1441
1488
  completedSoundDesktop: boolean;
1442
1489
  completedSoundMobile: boolean;
1443
- debugLogSendingEnabledUntil: string | null;
1444
1490
  legacyPricing: boolean;
1445
1491
  navigation: {
1446
1492
  [x: string]: unknown;
@@ -1463,6 +1509,7 @@ export declare const validateUserSettings: (input: unknown) => {
1463
1509
  shown: boolean;
1464
1510
  }[];
1465
1511
  };
1512
+ debugLogSendingEnabledUntil?: string | null | undefined;
1466
1513
  theme?: string | null | undefined;
1467
1514
  syncTheme?: boolean | undefined;
1468
1515
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doist/todoist-sdk",
3
- "version": "10.1.0",
3
+ "version": "10.2.0-next.1",
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",