@doist/todoist-sdk 10.5.0 → 11.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.
Files changed (60) hide show
  1. package/dist/cjs/consts/endpoints.js +1 -6
  2. package/dist/cjs/test-utils/test-defaults.js +2 -26
  3. package/dist/cjs/test-utils/transport-seam.js +17 -0
  4. package/dist/cjs/test-utils/webhook-fixtures.js +1 -1
  5. package/dist/cjs/todoist-api.js +0 -101
  6. package/dist/cjs/transport/fetch-with-retry.js +19 -7
  7. package/dist/cjs/transport/http-dispatcher.js +60 -15
  8. package/dist/cjs/types/index.js +0 -1
  9. package/dist/cjs/types/sync/commands/index.js +0 -2
  10. package/dist/cjs/types/sync/resource-types.js +0 -2
  11. package/dist/cjs/types/sync/resources/index.js +0 -1
  12. package/dist/cjs/types/sync/response.js +10 -13
  13. package/dist/cjs/utils/validators.js +50 -54
  14. package/dist/esm/consts/endpoints.js +0 -5
  15. package/dist/esm/test-utils/test-defaults.js +0 -24
  16. package/dist/esm/test-utils/transport-seam.js +15 -0
  17. package/dist/esm/test-utils/webhook-fixtures.js +1 -1
  18. package/dist/esm/todoist-api.js +0 -101
  19. package/dist/esm/transport/fetch-with-retry.js +20 -8
  20. package/dist/esm/transport/http-dispatcher.js +58 -15
  21. package/dist/esm/types/index.js +0 -1
  22. package/dist/esm/types/sync/commands/index.js +0 -2
  23. package/dist/esm/types/sync/resource-types.js +0 -2
  24. package/dist/esm/types/sync/resources/index.js +0 -1
  25. package/dist/esm/types/sync/response.js +1 -4
  26. package/dist/esm/utils/validators.js +1 -4
  27. package/dist/types/consts/endpoints.d.ts +0 -5
  28. package/dist/types/test-utils/test-defaults.d.ts +1 -4
  29. package/dist/types/todoist-api.d.ts +0 -80
  30. package/dist/types/transport/http-dispatcher.d.ts +36 -0
  31. package/dist/types/types/index.d.ts +0 -1
  32. package/dist/types/types/sync/commands/index.d.ts +0 -16
  33. package/dist/types/types/sync/resource-types.d.ts +1 -1
  34. package/dist/types/types/sync/resources/index.d.ts +0 -1
  35. package/dist/types/types/sync/resources/view-options.d.ts +6 -6
  36. package/dist/types/types/sync/response.d.ts +4 -45
  37. package/dist/types/types/tasks/requests.d.ts +0 -1
  38. package/dist/types/utils/validators.d.ts +8 -90
  39. package/package.json +1 -1
  40. package/dist/cjs/clients/goals-client.js +0 -144
  41. package/dist/cjs/types/goals/index.js +0 -18
  42. package/dist/cjs/types/goals/requests.js +0 -2
  43. package/dist/cjs/types/goals/types.js +0 -56
  44. package/dist/cjs/types/sync/commands/goals.js +0 -2
  45. package/dist/cjs/types/sync/commands/workspace-goals.js +0 -2
  46. package/dist/cjs/types/sync/resources/workspace-goals.js +0 -26
  47. package/dist/esm/clients/goals-client.js +0 -140
  48. package/dist/esm/types/goals/index.js +0 -2
  49. package/dist/esm/types/goals/types.js +0 -53
  50. package/dist/esm/types/sync/commands/goals.js +0 -1
  51. package/dist/esm/types/sync/commands/workspace-goals.js +0 -1
  52. package/dist/esm/types/sync/resources/workspace-goals.js +0 -23
  53. package/dist/types/clients/goals-client.d.ts +0 -20
  54. package/dist/types/types/goals/index.d.ts +0 -2
  55. package/dist/types/types/goals/requests.d.ts +0 -33
  56. package/dist/types/types/goals/types.d.ts +0 -51
  57. package/dist/types/types/sync/commands/goals.d.ts +0 -33
  58. package/dist/types/types/sync/commands/workspace-goals.d.ts +0 -24
  59. package/dist/types/types/sync/resources/workspace-goals.d.ts +0 -29
  60. /package/dist/{esm/types/goals/requests.js → types/test-utils/transport-seam.d.ts} +0 -0
@@ -4,7 +4,6 @@ import { AppSchema, AppWithUserCountSchema, AppSecretsSchema, AppVerificationTok
4
4
  import { BackupSchema } from '../types/backups/types.js';
5
5
  import { SubscriptionInfoSchema, ProPlanDetailsSchema, PricesResponseSchema, PricingResponseSchema, } from '../types/billing/types.js';
6
6
  import { AttachmentSchema, CommentSchema } from '../types/comments/types.js';
7
- import { GoalSchema } from '../types/goals/types.js';
8
7
  import { IdMappingSchema, MovedIdSchema } from '../types/id-mappings/types.js';
9
8
  import { ProjectActivityStatsSchema, ProjectHealthSchema, ProjectHealthContextSchema, ProjectProgressSchema, WorkspaceInsightsSchema, } from '../types/insights/types.js';
10
9
  import { LabelSchema } from '../types/labels/types.js';
@@ -16,7 +15,7 @@ import { TaskSchema } from '../types/tasks/types.js';
16
15
  import { UiExtensionSchema } from '../types/ui-extensions/types.js';
17
16
  import { UserSchema, CurrentUserSchema } from '../types/users/types.js';
18
17
  import { WorkspaceUserSchema, WorkspaceInvitationSchema, WorkspacePlanDetailsSchema, JoinWorkspaceResultSchema, WorkspaceSchema, MemberActivityInfoSchema, WorkspaceUserTaskSchema, } from '../types/workspaces/types.js';
19
- import { FilterSchema, CollaboratorSchema, CollaboratorStateSchema, FolderSchema, NoteSchema, TooltipsSchema, WorkspaceFilterSchema, WorkspaceGoalSchema, CalendarSchema, CalendarAccountSchema, ReminderSchema, LocationReminderSchema, CompletedInfoSchema, ViewOptionsSchema, ProjectViewOptionsDefaultsSchema, UserPlanLimitsSchema, LiveNotificationSchema, SyncWorkspaceSchema, SyncUserSchema, UserSettingsSchema, SuggestionSchema, } from '../types/sync/resources/index.js';
18
+ import { FilterSchema, CollaboratorSchema, CollaboratorStateSchema, FolderSchema, NoteSchema, TooltipsSchema, WorkspaceFilterSchema, CalendarSchema, CalendarAccountSchema, ReminderSchema, LocationReminderSchema, CompletedInfoSchema, ViewOptionsSchema, ProjectViewOptionsDefaultsSchema, UserPlanLimitsSchema, LiveNotificationSchema, SyncWorkspaceSchema, SyncUserSchema, UserSettingsSchema, SuggestionSchema, } from '../types/sync/resources/index.js';
20
19
  function createValidator(schema) {
21
20
  return {
22
21
  validate: (input) => schema.parse(input),
@@ -65,7 +64,6 @@ export const { validate: validateFilter, validateArray: validateFilterArray } =
65
64
  export const { validate: validateCollaborator, validateArray: validateCollaboratorArray } = createValidator(CollaboratorSchema);
66
65
  export const { validate: validateCollaboratorState, validateArray: validateCollaboratorStateArray, } = createValidator(CollaboratorStateSchema);
67
66
  export const { validate: validateFolder, validateArray: validateFolderArray } = createValidator(FolderSchema);
68
- export const { validate: validateGoal, validateArray: validateGoalArray } = createValidator(GoalSchema);
69
67
  // Billing validators
70
68
  export const { validate: validateSubscriptionInfo } = createValidator(SubscriptionInfoSchema);
71
69
  export const { validate: validateProPlanDetails } = createValidator(ProPlanDetailsSchema);
@@ -74,7 +72,6 @@ export const { validate: validatePricing } = createValidator(PricingResponseSche
74
72
  export const { validate: validateNote, validateArray: validateNoteArray } = createValidator(NoteSchema);
75
73
  export const { validate: validateTooltips } = createValidator(TooltipsSchema);
76
74
  export const { validate: validateWorkspaceFilter, validateArray: validateWorkspaceFilterArray } = createValidator(WorkspaceFilterSchema);
77
- export const { validate: validateWorkspaceGoal, validateArray: validateWorkspaceGoalArray } = createValidator(WorkspaceGoalSchema);
78
75
  export const { validate: validateCalendar, validateArray: validateCalendarArray } = createValidator(CalendarSchema);
79
76
  export const { validate: validateCalendarAccount, validateArray: validateCalendarAccountArray } = createValidator(CalendarAccountSchema);
80
77
  export const { validate: validateReminder, validateArray: validateReminderArray } = createValidator(ReminderSchema);
@@ -59,11 +59,6 @@ export declare const ENDPOINT_GET_TOKEN = "access_token";
59
59
  export declare const ENDPOINT_REVOKE = "revoke";
60
60
  export declare const ENDPOINT_REGISTER = "register";
61
61
  export declare const ENDPOINT_REST_FOLDERS = "folders";
62
- export declare const ENDPOINT_REST_GOALS = "goals";
63
- export declare const ENDPOINT_REST_GOALS_SEARCH: string;
64
- export declare const GOAL_COMPLETE = "complete";
65
- export declare const GOAL_UNCOMPLETE = "uncomplete";
66
- export declare const GOAL_TASKS = "items";
67
62
  export declare const ENDPOINT_REST_WORKSPACES = "workspaces";
68
63
  export declare const ENDPOINT_WORKSPACE_INVITATIONS = "workspaces/invitations";
69
64
  export declare const ENDPOINT_WORKSPACE_INVITATIONS_ALL = "workspaces/invitations/all";
@@ -1,4 +1,4 @@
1
- import { Label, Section, Task, User, Attachment, Duration, Deadline, RawComment, PersonalProject, WorkspaceProject, Reminder, Folder, Goal, App, AppWithUserCount, AppSecrets, AppVerificationToken, AppTestToken, AppDistributionToken, AppWebhook, AppInstallation, UserAuthorization, UiExtension } from '../types/index.js';
1
+ import { Label, Section, Task, User, Attachment, Duration, Deadline, RawComment, PersonalProject, WorkspaceProject, Reminder, Folder, App, AppWithUserCount, AppSecrets, AppVerificationToken, AppTestToken, AppDistributionToken, AppWebhook, AppInstallation, UserAuthorization, UiExtension } from '../types/index.js';
2
2
  import type { Collaborator, CollaboratorState } from '../types/sync/resources/collaborators.js';
3
3
  import type { Note } from '../types/sync/resources/notes.js';
4
4
  export declare const DEFAULT_TASK_ID = "1234";
@@ -265,9 +265,6 @@ export declare const COMMENT_WITH_OPTIONALS_AS_NULL_PROJECT: {
265
265
  export declare const DEFAULT_FOLDER: Folder;
266
266
  export declare const DEFAULT_COLLABORATOR: Collaborator;
267
267
  export declare const DEFAULT_COLLABORATOR_STATE: CollaboratorState;
268
- export declare const DEFAULT_GOAL_ID = "550e8400-e29b-41d4-a716-446655440000";
269
- export declare const DEFAULT_GOAL: Goal;
270
- export declare const DEFAULT_GOAL_NO_PROGRESS: Goal;
271
268
  export declare const DEFAULT_APP_ID = "42";
272
269
  export declare const DEFAULT_INSTALLATION_ID = "1001";
273
270
  export declare const DEFAULT_UI_EXTENSION_ID = "2002";
@@ -6,7 +6,6 @@ import type { BillingPortalUrlResponse, CancelPlanArgs, CheckoutSessionResponse,
6
6
  import { Attachment, Comment, AddCommentArgs, UpdateCommentArgs, GetProjectCommentsArgs, GetTaskCommentsArgs, GetCommentsResponse } from './types/comments/index.js';
7
7
  import { GetOrCreateEmailArgs, GetOrCreateEmailResponse, DisableEmailArgs } from './types/emails/index.js';
8
8
  import { GetFoldersArgs, GetFoldersResponse, AddFolderArgs, UpdateFolderArgs } from './types/folders/index.js';
9
- import type { AddGoalArgs, GetGoalsArgs, GetGoalsResponse, Goal, SearchGoalsArgs, TaskLinkingArgs, UpdateGoalArgs } from './types/goals/index.js';
10
9
  import { CustomFetch, FileResponse } from './types/http.js';
11
10
  import { IdMapping, MovedId, GetIdMappingsArgs, GetMovedIdsArgs } from './types/id-mappings/index.js';
12
11
  import { ProjectActivityStats, ProjectHealth, ProjectHealthContext, ProjectProgress, WorkspaceInsights, GetProjectActivityStatsArgs, GetWorkspaceInsightsArgs } from './types/insights/index.js';
@@ -77,7 +76,6 @@ export declare class TodoistApi {
77
76
  private readonly activityClient;
78
77
  private readonly productivityClient;
79
78
  private readonly workspaceClient;
80
- private readonly goalsClient;
81
79
  private readonly billingClient;
82
80
  private readonly appClient;
83
81
  private readonly uiExtensionClient;
@@ -796,84 +794,6 @@ export declare class TodoistApi {
796
794
  * @returns A promise that resolves to `true` if successful.
797
795
  */
798
796
  deleteFolder(id: string, requestId?: string): Promise<boolean>;
799
- /**
800
- * Retrieves a paginated list of goals.
801
- *
802
- * @param args - Optional filters including owner type, workspace ID, cursor, and limit.
803
- * @returns A promise that resolves to a paginated list of goals.
804
- */
805
- getGoals(args?: GetGoalsArgs): Promise<GetGoalsResponse>;
806
- /**
807
- * Searches for goals matching a query.
808
- *
809
- * @param args - Search parameters including query string and optional owner type.
810
- * @returns A promise that resolves to a paginated list of matching goals.
811
- */
812
- searchGoals(args: SearchGoalsArgs): Promise<GetGoalsResponse>;
813
- /**
814
- * Retrieves a single goal by its ID.
815
- *
816
- * @param id - The unique identifier of the goal.
817
- * @returns A promise that resolves to the goal.
818
- */
819
- getGoal(id: string): Promise<Goal>;
820
- /**
821
- * Creates a new goal.
822
- *
823
- * @param args - Goal attributes including name and optional workspace, description, deadline, and responsible user.
824
- * @param requestId - Optional custom identifier for the request.
825
- * @returns A promise that resolves to the created goal.
826
- */
827
- addGoal(args: AddGoalArgs, requestId?: string): Promise<Goal>;
828
- /**
829
- * Updates an existing goal.
830
- *
831
- * @param id - The unique identifier of the goal to update.
832
- * @param args - Attributes to update on the goal.
833
- * @param requestId - Optional custom identifier for the request.
834
- * @returns A promise that resolves to the updated goal.
835
- */
836
- updateGoal(id: string, args: UpdateGoalArgs, requestId?: string): Promise<Goal>;
837
- /**
838
- * Deletes a goal by its ID.
839
- *
840
- * @param id - The unique identifier of the goal to delete.
841
- * @param requestId - Optional custom identifier for the request.
842
- * @returns A promise that resolves to `true` if successful.
843
- */
844
- deleteGoal(id: string, requestId?: string): Promise<boolean>;
845
- /**
846
- * Marks a goal as complete.
847
- *
848
- * @param id - The unique identifier of the goal to complete.
849
- * @param requestId - Optional custom identifier for the request.
850
- * @returns A promise that resolves to the updated goal.
851
- */
852
- completeGoal(id: string, requestId?: string): Promise<Goal>;
853
- /**
854
- * Marks a previously completed goal as incomplete.
855
- *
856
- * @param id - The unique identifier of the goal to uncomplete.
857
- * @param requestId - Optional custom identifier for the request.
858
- * @returns A promise that resolves to the updated goal.
859
- */
860
- uncompleteGoal(id: string, requestId?: string): Promise<Goal>;
861
- /**
862
- * Links a task to a goal so it contributes to goal progress.
863
- *
864
- * @param args - The goal ID and task ID to link.
865
- * @param requestId - Optional custom identifier for the request.
866
- * @returns A promise that resolves to the updated goal.
867
- */
868
- linkTaskToGoal(args: TaskLinkingArgs, requestId?: string): Promise<Goal>;
869
- /**
870
- * Unlinks a previously linked task from a goal.
871
- *
872
- * @param args - The goal ID and task ID to unlink.
873
- * @param requestId - Optional custom identifier for the request.
874
- * @returns A promise that resolves to `true` if successful.
875
- */
876
- unlinkTaskFromGoal(args: TaskLinkingArgs, requestId?: string): Promise<boolean>;
877
797
  /**
878
798
  * Retrieves the current user's subscription state.
879
799
  *
@@ -1,4 +1,40 @@
1
1
  import type { Dispatcher } from 'undici';
2
+ type UndiciFetch = typeof import('undici').fetch;
3
+ /**
4
+ * A dispatcher and the `fetch` that must be used with it. `fetch` is undici's
5
+ * own `fetch` on the full-undici Node path, or `undefined` (meaning: use the
6
+ * global `fetch`) on the Bun path. The two are cached together so callers can
7
+ * never observe a dispatcher paired with a mismatched `fetch` — see
8
+ * {@link getDefaultFetch} for why the pairing matters.
9
+ */
10
+ type DefaultTransport = {
11
+ dispatcher: Dispatcher;
12
+ fetch: UndiciFetch | undefined;
13
+ };
14
+ /**
15
+ * The default dispatcher and its paired `fetch`, as a single value so the two
16
+ * are always read consistently. Resolves to `undefined` outside Node (browser/
17
+ * edge), where callers use the global `fetch` with no dispatcher.
18
+ */
19
+ export declare function getDefaultTransport(): Promise<DefaultTransport | undefined>;
2
20
  export declare function getDefaultDispatcher(): Promise<Dispatcher | undefined>;
21
+ /**
22
+ * The `fetch` implementation that must be used with the default dispatcher.
23
+ * Returns undici's own `fetch` on the full-undici Node path, or `undefined`
24
+ * (meaning: use the global `fetch`) in the browser/edge/Bun paths.
25
+ *
26
+ * Node's global `fetch` is backed by whatever undici version ships inside that
27
+ * Node release (6.x on Node 22 … 8.x on Node 26). Our dispatcher — and its
28
+ * `decompress` interceptor — comes from the npm `undici` package, which is a
29
+ * different version. Handing an npm-undici dispatcher to a mismatched built-in
30
+ * client makes gzip responses fail mid-stream with `terminated`. Sourcing
31
+ * `fetch` from the same npm `undici` keeps the whole request path on one
32
+ * version and removes the split.
33
+ *
34
+ * Only meaningful after {@link getDefaultTransport} has resolved, which is the
35
+ * one place that populates it.
36
+ */
37
+ export declare function getDefaultFetch(): UndiciFetch | undefined;
3
38
  export declare function resetDefaultDispatcherForTests(): Promise<void>;
4
39
  export declare function suppressExperimentalWarningsSync<T>(fn: () => T): T;
40
+ export {};
@@ -9,7 +9,6 @@ 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';
13
12
  export * from './billing/index.js';
14
13
  export * from './insights/index.js';
15
14
  export * from './backups/index.js';
@@ -1,7 +1,6 @@
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';
5
4
  import type { LabelAddArgs, LabelRenameArgs, LabelUpdateArgs, LabelUpdateOrdersArgs, LabelDeleteArgs, LabelDeleteOccurrencesArgs } from './labels.js';
6
5
  import type { NoteAddArgs, NoteUpdateArgs, NoteDeleteArgs, NoteReactionAddArgs, NoteReactionRemoveArgs } from './notes.js';
7
6
  import type { LiveNotificationsMarkUnreadArgs, LiveNotificationsMarkReadArgs, LiveNotificationsMarkReadAllArgs, LiveNotificationsSetLastReadArgs } from './notifications.js';
@@ -14,7 +13,6 @@ import type { AcceptInvitationArgs, RejectInvitationArgs, BizAcceptInvitationArg
14
13
  import type { TaskAddArgs, TaskUpdateArgs, TaskCompleteArgs, TaskCompleteUndoArgs, TaskMoveArgs, TaskReorderArgs, TaskUncompleteArgs, TaskUpdateDateCompleteArgs, TaskDeleteArgs, TaskUpdateDayOrderArgs } from './tasks.js';
15
14
  import type { ViewOptionsSetArgs, ViewOptionsDeleteArgs } from './view-options.js';
16
15
  import type { WorkspaceFilterAddArgs, WorkspaceFilterUpdateArgs, WorkspaceFilterUpdateOrdersArgs, WorkspaceFilterDeleteArgs } from './workspace-filters.js';
17
- import type { WorkspaceGoalAddArgs, WorkspaceGoalUpdateArgs, WorkspaceGoalDeleteArgs, WorkspaceGoalProjectAddArgs, WorkspaceGoalProjectRemoveArgs } from './workspace-goals.js';
18
16
  import type { WorkspaceAddArgs, WorkspaceUpdateArgs, WorkspaceDeleteArgs, WorkspaceUpdateUserArgs, WorkspaceDeleteUserArgs, WorkspaceLeaveArgs, WorkspaceInviteArgs, WorkspaceSetDefaultOrderArgs, WorkspaceUpdateUserProjectSortPreferenceArgs } from './workspaces.js';
19
17
  /**
20
18
  * Maps each Sync API command type string to its corresponding argument type.
@@ -92,18 +90,6 @@ export type SyncCommandsMap = {
92
90
  workspace_filter_update: WorkspaceFilterUpdateArgs;
93
91
  workspace_filter_update_orders: WorkspaceFilterUpdateOrdersArgs;
94
92
  workspace_filter_delete: WorkspaceFilterDeleteArgs;
95
- workspace_goal_add: WorkspaceGoalAddArgs;
96
- workspace_goal_update: WorkspaceGoalUpdateArgs;
97
- workspace_goal_delete: WorkspaceGoalDeleteArgs;
98
- workspace_goal_project_add: WorkspaceGoalProjectAddArgs;
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;
107
93
  live_notifications_mark_unread: LiveNotificationsMarkUnreadArgs;
108
94
  live_notifications_mark_read: LiveNotificationsMarkReadArgs;
109
95
  live_notifications_mark_read_all: LiveNotificationsMarkReadAllArgs;
@@ -170,8 +156,6 @@ export * from './reminders.js';
170
156
  export * from './workspaces.js';
171
157
  export * from './folders.js';
172
158
  export * from './workspace-filters.js';
173
- export * from './workspace-goals.js';
174
- export * from './goals.js';
175
159
  export * from './notifications.js';
176
160
  export * from './sharing.js';
177
161
  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", "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", "day_orders", "calendars", "calendar_accounts", "suggestions", "tooltips"];
5
5
  export type SyncResourceType = (typeof SYNC_RESOURCE_TYPES)[number];
@@ -4,7 +4,6 @@ export * from './folders.js';
4
4
  export * from './tooltips.js';
5
5
  export * from './notes.js';
6
6
  export * from './workspace-filters.js';
7
- export * from './workspace-goals.js';
8
7
  export * from './calendars.js';
9
8
  export * from './reminders.js';
10
9
  export * from './completed-info.js';
@@ -32,7 +32,6 @@ 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";
36
35
  PROJECT: "PROJECT";
37
36
  LABEL: "LABEL";
38
37
  ASSIGNEE: "ASSIGNEE";
@@ -40,19 +39,20 @@ export declare const GroupedBySchema: z.ZodNullable<z.ZodEnum<{
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"];
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";
50
49
  PROJECT: "PROJECT";
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
  }>>;
@@ -92,7 +92,6 @@ 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";
96
95
  PROJECT: "PROJECT";
97
96
  LABEL: "LABEL";
98
97
  ASSIGNEE: "ASSIGNEE";
@@ -100,6 +99,7 @@ export declare const ViewOptionsSchema: z.ZodObject<{
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<{
@@ -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";
113
112
  PROJECT: "PROJECT";
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
  }>>>;
@@ -133,7 +133,6 @@ export declare const ProjectViewOptionsDefaultsSchema: z.ZodObject<{
133
133
  CALENDAR: "CALENDAR";
134
134
  }>>>;
135
135
  groupedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
136
- WORKSPACE: "WORKSPACE";
137
136
  PROJECT: "PROJECT";
138
137
  LABEL: "LABEL";
139
138
  ASSIGNEE: "ASSIGNEE";
@@ -141,15 +140,16 @@ export declare const ProjectViewOptionsDefaultsSchema: z.ZodObject<{
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
- WORKSPACE: "WORKSPACE";
147
146
  PROJECT: "PROJECT";
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
  }>>>;
@@ -753,7 +753,6 @@ export declare const SyncResponseSchema: z.ZodObject<{
753
753
  }>;
754
754
  objectId: z.ZodOptional<z.ZodString>;
755
755
  groupedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
756
- WORKSPACE: "WORKSPACE";
757
756
  PROJECT: "PROJECT";
758
757
  LABEL: "LABEL";
759
758
  ASSIGNEE: "ASSIGNEE";
@@ -761,6 +760,7 @@ export declare const SyncResponseSchema: z.ZodObject<{
761
760
  DUE_DATE: "DUE_DATE";
762
761
  DEADLINE: "DEADLINE";
763
762
  PRIORITY: "PRIORITY";
763
+ WORKSPACE: "WORKSPACE";
764
764
  }>>>;
765
765
  filteredBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
766
766
  viewMode: z.ZodOptional<z.ZodEnum<{
@@ -770,13 +770,13 @@ export declare const SyncResponseSchema: z.ZodObject<{
770
770
  }>>;
771
771
  showCompletedTasks: z.ZodOptional<z.ZodBoolean>;
772
772
  sortedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
773
- WORKSPACE: "WORKSPACE";
774
773
  PROJECT: "PROJECT";
775
774
  ASSIGNEE: "ASSIGNEE";
776
775
  ADDED_DATE: "ADDED_DATE";
777
776
  DUE_DATE: "DUE_DATE";
778
777
  DEADLINE: "DEADLINE";
779
778
  PRIORITY: "PRIORITY";
779
+ WORKSPACE: "WORKSPACE";
780
780
  MANUAL: "MANUAL";
781
781
  ALPHABETICALLY: "ALPHABETICALLY";
782
782
  }>>>;
@@ -793,7 +793,6 @@ export declare const SyncResponseSchema: z.ZodObject<{
793
793
  CALENDAR: "CALENDAR";
794
794
  }>>>;
795
795
  groupedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
796
- WORKSPACE: "WORKSPACE";
797
796
  PROJECT: "PROJECT";
798
797
  LABEL: "LABEL";
799
798
  ASSIGNEE: "ASSIGNEE";
@@ -801,15 +800,16 @@ export declare const SyncResponseSchema: z.ZodObject<{
801
800
  DUE_DATE: "DUE_DATE";
802
801
  DEADLINE: "DEADLINE";
803
802
  PRIORITY: "PRIORITY";
803
+ WORKSPACE: "WORKSPACE";
804
804
  }>>>;
805
805
  sortedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
806
- WORKSPACE: "WORKSPACE";
807
806
  PROJECT: "PROJECT";
808
807
  ASSIGNEE: "ASSIGNEE";
809
808
  ADDED_DATE: "ADDED_DATE";
810
809
  DUE_DATE: "DUE_DATE";
811
810
  DEADLINE: "DEADLINE";
812
811
  PRIORITY: "PRIORITY";
812
+ WORKSPACE: "WORKSPACE";
813
813
  MANUAL: "MANUAL";
814
814
  ALPHABETICALLY: "ALPHABETICALLY";
815
815
  }>>>;
@@ -835,47 +835,6 @@ export declare const SyncResponseSchema: z.ZodObject<{
835
835
  defaultOrder: z.ZodNumber;
836
836
  childOrder: z.ZodNumber;
837
837
  }, z.core.$loose>>>;
838
- goals: z.ZodOptional<z.ZodArray<z.ZodObject<{
839
- id: z.ZodString;
840
- ownerType: z.ZodEnum<{
841
- USER: "USER";
842
- WORKSPACE: "WORKSPACE";
843
- }>;
844
- ownerId: z.ZodString;
845
- name: z.ZodString;
846
- description: z.ZodNullable<z.ZodString>;
847
- deadline: z.ZodNullable<z.ZodString>;
848
- parentGoalId: z.ZodNullable<z.ZodString>;
849
- childOrder: z.ZodNumber;
850
- isCompleted: z.ZodBoolean;
851
- completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
852
- responsibleUid: z.ZodNullable<z.ZodString>;
853
- isDeleted: z.ZodBoolean;
854
- progress: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodObject<{
855
- totalTaskCount: z.ZodNumber;
856
- completedTaskCount: z.ZodNumber;
857
- percentage: z.ZodNumber;
858
- }, z.core.$loose>>>;
859
- creatorUid: z.ZodString;
860
- createdAt: z.ZodCoercedDate<unknown>;
861
- updatedAt: z.ZodCoercedDate<unknown>;
862
- }, z.core.$loose>>>;
863
- workspaceGoals: z.ZodOptional<z.ZodArray<z.ZodObject<{
864
- id: z.ZodString;
865
- workspaceId: z.ZodString;
866
- title: z.ZodString;
867
- description: z.ZodNullable<z.ZodString>;
868
- deadline: z.ZodNullable<z.ZodString>;
869
- isDeleted: z.ZodBoolean;
870
- projectIds: z.ZodArray<z.ZodString>;
871
- progress: z.ZodNullable<z.ZodObject<{
872
- completedItems: z.ZodNumber;
873
- totalItems: z.ZodNumber;
874
- }, z.core.$loose>>;
875
- creatorUid: z.ZodString;
876
- createdAt: z.ZodCoercedDate<unknown>;
877
- updatedAt: z.ZodCoercedDate<unknown>;
878
- }, z.core.$loose>>>;
879
838
  dayOrders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
880
839
  calendars: z.ZodOptional<z.ZodArray<z.ZodObject<{
881
840
  id: z.ZodString;
@@ -36,7 +36,6 @@ export type GetTasksArgs = {
36
36
  parentId?: string;
37
37
  label?: string;
38
38
  ids?: string[];
39
- goalId?: string;
40
39
  cursor?: string | null;
41
40
  limit?: number;
42
41
  };
@@ -820,53 +820,6 @@ export declare const validateFolder: (input: unknown) => {
820
820
  defaultOrder: number;
821
821
  childOrder: number;
822
822
  }[];
823
- export declare const validateGoal: (input: unknown) => {
824
- [x: string]: unknown;
825
- id: string;
826
- ownerType: "USER" | "WORKSPACE";
827
- ownerId: string;
828
- name: string;
829
- description: string | null;
830
- deadline: string | null;
831
- parentGoalId: string | null;
832
- childOrder: number;
833
- isCompleted: boolean;
834
- completedAt: Date | null;
835
- responsibleUid: string | null;
836
- isDeleted: boolean;
837
- creatorUid: string;
838
- createdAt: Date;
839
- updatedAt: Date;
840
- progress?: {
841
- [x: string]: unknown;
842
- totalTaskCount: number;
843
- completedTaskCount: number;
844
- percentage: number;
845
- } | undefined;
846
- }, validateGoalArray: (input: unknown) => {
847
- [x: string]: unknown;
848
- id: string;
849
- ownerType: "USER" | "WORKSPACE";
850
- ownerId: string;
851
- name: string;
852
- description: string | null;
853
- deadline: string | null;
854
- parentGoalId: string | null;
855
- childOrder: number;
856
- isCompleted: boolean;
857
- completedAt: Date | null;
858
- responsibleUid: string | null;
859
- isDeleted: boolean;
860
- creatorUid: string;
861
- createdAt: Date;
862
- updatedAt: Date;
863
- progress?: {
864
- [x: string]: unknown;
865
- totalTaskCount: number;
866
- completedTaskCount: number;
867
- percentage: number;
868
- } | undefined;
869
- }[];
870
823
  export declare const validateSubscriptionInfo: (input: unknown) => {
871
824
  status: "none" | "autorenew" | "canceled" | "expired" | "trial" | "trial_canceled";
872
825
  plan: "free" | "pro" | "pro_gifted" | "pro_legacy";
@@ -1013,41 +966,6 @@ export declare const validateWorkspaceFilter: (input: unknown) => {
1013
966
  createdAt: Date;
1014
967
  updatedAt: Date;
1015
968
  }[];
1016
- export declare const validateWorkspaceGoal: (input: unknown) => {
1017
- [x: string]: unknown;
1018
- id: string;
1019
- workspaceId: string;
1020
- title: string;
1021
- description: string | null;
1022
- deadline: string | null;
1023
- isDeleted: boolean;
1024
- projectIds: string[];
1025
- progress: {
1026
- [x: string]: unknown;
1027
- completedItems: number;
1028
- totalItems: number;
1029
- } | null;
1030
- creatorUid: string;
1031
- createdAt: Date;
1032
- updatedAt: Date;
1033
- }, validateWorkspaceGoalArray: (input: unknown) => {
1034
- [x: string]: unknown;
1035
- id: string;
1036
- workspaceId: string;
1037
- title: string;
1038
- description: string | null;
1039
- deadline: string | null;
1040
- isDeleted: boolean;
1041
- projectIds: string[];
1042
- progress: {
1043
- [x: string]: unknown;
1044
- completedItems: number;
1045
- totalItems: number;
1046
- } | null;
1047
- creatorUid: string;
1048
- createdAt: Date;
1049
- updatedAt: Date;
1050
- }[];
1051
969
  export declare const validateCalendar: (input: unknown) => {
1052
970
  [x: string]: unknown;
1053
971
  id: string;
@@ -1247,29 +1165,29 @@ export declare const validateViewOptions: (input: unknown) => {
1247
1165
  [x: string]: unknown;
1248
1166
  viewType: "PROJECT" | "TODAY" | "UPCOMING" | "LABEL" | "FILTER" | "WORKSPACE_FILTER" | "SEARCH" | "TEMPLATE_PREVIEW" | "TASK_DETAIL" | "AUTOMATION" | "ASSIGNED" | "OVERDUE" | "WORKSPACE_OVERVIEW";
1249
1167
  objectId?: string | undefined;
1250
- groupedBy?: "WORKSPACE" | "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
1168
+ groupedBy?: "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | null | undefined;
1251
1169
  filteredBy?: string | null | undefined;
1252
1170
  viewMode?: "LIST" | "BOARD" | "CALENDAR" | undefined;
1253
1171
  showCompletedTasks?: boolean | undefined;
1254
- sortedBy?: "WORKSPACE" | "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1172
+ sortedBy?: "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1255
1173
  sortOrder?: "ASC" | "DESC" | null | undefined;
1256
1174
  }, validateViewOptionsArray: (input: unknown) => {
1257
1175
  [x: string]: unknown;
1258
1176
  viewType: "PROJECT" | "TODAY" | "UPCOMING" | "LABEL" | "FILTER" | "WORKSPACE_FILTER" | "SEARCH" | "TEMPLATE_PREVIEW" | "TASK_DETAIL" | "AUTOMATION" | "ASSIGNED" | "OVERDUE" | "WORKSPACE_OVERVIEW";
1259
1177
  objectId?: string | undefined;
1260
- groupedBy?: "WORKSPACE" | "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
1178
+ groupedBy?: "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | null | undefined;
1261
1179
  filteredBy?: string | null | undefined;
1262
1180
  viewMode?: "LIST" | "BOARD" | "CALENDAR" | undefined;
1263
1181
  showCompletedTasks?: boolean | undefined;
1264
- sortedBy?: "WORKSPACE" | "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1182
+ sortedBy?: "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1265
1183
  sortOrder?: "ASC" | "DESC" | null | undefined;
1266
1184
  }[];
1267
1185
  export declare const validateProjectViewOptionsDefaults: (input: unknown) => {
1268
1186
  [x: string]: unknown;
1269
1187
  projectId: string;
1270
1188
  viewMode?: "LIST" | "BOARD" | "CALENDAR" | null | undefined;
1271
- groupedBy?: "WORKSPACE" | "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
1272
- sortedBy?: "WORKSPACE" | "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1189
+ groupedBy?: "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | null | undefined;
1190
+ sortedBy?: "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1273
1191
  sortOrder?: "ASC" | "DESC" | null | undefined;
1274
1192
  showCompletedTasks?: boolean | undefined;
1275
1193
  filteredBy?: string | null | undefined;
@@ -1281,8 +1199,8 @@ export declare const validateProjectViewOptionsDefaults: (input: unknown) => {
1281
1199
  [x: string]: unknown;
1282
1200
  projectId: string;
1283
1201
  viewMode?: "LIST" | "BOARD" | "CALENDAR" | null | undefined;
1284
- groupedBy?: "WORKSPACE" | "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
1285
- sortedBy?: "WORKSPACE" | "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1202
+ groupedBy?: "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | null | undefined;
1203
+ sortedBy?: "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1286
1204
  sortOrder?: "ASC" | "DESC" | null | undefined;
1287
1205
  showCompletedTasks?: boolean | undefined;
1288
1206
  filteredBy?: string | null | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doist/todoist-sdk",
3
- "version": "10.5.0",
3
+ "version": "11.0.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",