@doist/todoist-sdk 8.3.0 → 8.4.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.
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -27,6 +27,7 @@ __exportStar(require("./workspaces"), exports);
27
27
  __exportStar(require("./folders"), exports);
28
28
  __exportStar(require("./workspace-filters"), exports);
29
29
  __exportStar(require("./workspace-goals"), exports);
30
+ __exportStar(require("./goals"), exports);
30
31
  __exportStar(require("./notifications"), exports);
31
32
  __exportStar(require("./sharing"), exports);
32
33
  __exportStar(require("./view-options"), exports);
@@ -32,6 +32,7 @@ exports.SYNC_RESOURCE_TYPES = [
32
32
  'role_actions',
33
33
  'folders',
34
34
  'workspace_goals',
35
+ 'goals',
35
36
  'day_orders',
36
37
  'calendars',
37
38
  'calendar_accounts',
@@ -0,0 +1,33 @@
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();
@@ -21,6 +21,7 @@ __exportStar(require("./tooltips"), exports);
21
21
  __exportStar(require("./notes"), exports);
22
22
  __exportStar(require("./workspace-filters"), exports);
23
23
  __exportStar(require("./workspace-goals"), exports);
24
+ __exportStar(require("./goals"), exports);
24
25
  __exportStar(require("./calendars"), exports);
25
26
  __exportStar(require("./reminders"), exports);
26
27
  __exportStar(require("./completed-info"), exports);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.validateTooltips = exports.validateNoteArray = exports.validateNote = exports.validateFolderArray = exports.validateFolder = exports.validateCollaboratorStateArray = exports.validateCollaboratorState = exports.validateCollaboratorArray = exports.validateCollaborator = exports.validateFilterArray = exports.validateFilter = exports.validateMovedIdArray = exports.validateMovedId = exports.validateIdMappingArray = exports.validateIdMapping = exports.validateBackupArray = exports.validateBackup = exports.validateWorkspaceInsights = exports.validateProjectProgress = exports.validateProjectHealthContext = exports.validateProjectHealth = exports.validateProjectActivityStats = exports.validateWorkspaceUserTaskArray = exports.validateWorkspaceUserTask = exports.validateMemberActivityInfoArray = exports.validateMemberActivityInfo = exports.validateWorkspaceArray = exports.validateWorkspace = exports.validateJoinWorkspaceResult = exports.validateWorkspacePlanDetails = exports.validateWorkspaceInvitationArray = exports.validateWorkspaceInvitation = exports.validateWorkspaceUser = exports.validateAttachment = exports.validateActivityEventArray = exports.validateActivityEvent = exports.validateCurrentUser = exports.validateProductivityStats = exports.validateUserArray = exports.validateUser = exports.validateCommentArray = exports.validateComment = exports.validateLabelArray = exports.validateLabel = exports.validateSectionArray = exports.validateSection = exports.validateWorkspaceProjectArray = exports.validateWorkspaceProject = exports.validateTaskArray = exports.validateTask = void 0;
4
- exports.validateSuggestionArray = exports.validateSuggestion = exports.validateUserSettings = exports.validateSyncUser = exports.validateSyncWorkspaceArray = exports.validateSyncWorkspace = exports.validateLiveNotificationArray = exports.validateLiveNotification = exports.validateUserPlanLimits = exports.validateProjectViewOptionsDefaultsArray = exports.validateProjectViewOptionsDefaults = exports.validateViewOptionsArray = exports.validateViewOptions = exports.validateCompletedInfoArray = exports.validateCompletedInfo = exports.validateLocationReminderArray = exports.validateLocationReminder = exports.validateReminderArray = exports.validateReminder = exports.validateCalendarAccountArray = exports.validateCalendarAccount = exports.validateCalendarArray = exports.validateCalendar = exports.validateWorkspaceGoalArray = exports.validateWorkspaceGoal = exports.validateWorkspaceFilterArray = exports.validateWorkspaceFilter = void 0;
4
+ exports.validateSuggestionArray = exports.validateSuggestion = exports.validateUserSettings = exports.validateSyncUser = exports.validateSyncWorkspaceArray = exports.validateSyncWorkspace = exports.validateLiveNotificationArray = exports.validateLiveNotification = exports.validateUserPlanLimits = exports.validateProjectViewOptionsDefaultsArray = exports.validateProjectViewOptionsDefaults = exports.validateViewOptionsArray = exports.validateViewOptions = exports.validateCompletedInfoArray = exports.validateCompletedInfo = exports.validateLocationReminderArray = exports.validateLocationReminder = exports.validateReminderArray = exports.validateReminder = exports.validateCalendarAccountArray = exports.validateCalendarAccount = exports.validateCalendarArray = exports.validateCalendar = exports.validateWorkspaceGoalArray = exports.validateWorkspaceGoal = exports.validateGoalArray = exports.validateGoal = exports.validateWorkspaceFilterArray = exports.validateWorkspaceFilter = void 0;
5
5
  exports.isWorkspaceProject = isWorkspaceProject;
6
6
  exports.isPersonalProject = isPersonalProject;
7
7
  exports.validateProject = validateProject;
@@ -125,6 +125,8 @@ exports.validateNoteArray = createArrayValidator(exports.validateNote);
125
125
  exports.validateTooltips = createValidator(resources_1.TooltipsSchema);
126
126
  exports.validateWorkspaceFilter = createValidator(resources_1.WorkspaceFilterSchema);
127
127
  exports.validateWorkspaceFilterArray = createArrayValidator(exports.validateWorkspaceFilter);
128
+ exports.validateGoal = createValidator(resources_1.GoalSchema);
129
+ exports.validateGoalArray = createArrayValidator(exports.validateGoal);
128
130
  exports.validateWorkspaceGoal = createValidator(resources_1.WorkspaceGoalSchema);
129
131
  exports.validateWorkspaceGoalArray = createArrayValidator(exports.validateWorkspaceGoal);
130
132
  exports.validateCalendar = createValidator(resources_1.CalendarSchema);
@@ -151,7 +153,7 @@ exports.validateUserSettings = createValidator(resources_1.UserSettingsSchema);
151
153
  exports.validateSuggestion = createValidator(resources_1.SuggestionSchema);
152
154
  exports.validateSuggestionArray = createArrayValidator(exports.validateSuggestion);
153
155
  function parseSyncResponse(raw) {
154
- return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, raw), ('items' in raw ? { items: (0, exports.validateTaskArray)(raw.items) } : {})), ('projects' in raw ? { projects: validateProjectArray(raw.projects) } : {})), ('sections' in raw ? { sections: (0, exports.validateSectionArray)(raw.sections) } : {})), ('labels' in raw ? { labels: (0, exports.validateLabelArray)(raw.labels) } : {})), ('notes' in raw ? { notes: (0, exports.validateNoteArray)(raw.notes) } : {})), ('projectNotes' in raw ? { projectNotes: (0, exports.validateNoteArray)(raw.projectNotes) } : {})), ('filters' in raw ? { filters: (0, exports.validateFilterArray)(raw.filters) } : {})), ('reminders' in raw ? { reminders: (0, exports.validateReminderArray)(raw.reminders) } : {})), ('remindersLocation' in raw
156
+ return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, raw), ('items' in raw ? { items: (0, exports.validateTaskArray)(raw.items) } : {})), ('projects' in raw ? { projects: validateProjectArray(raw.projects) } : {})), ('sections' in raw ? { sections: (0, exports.validateSectionArray)(raw.sections) } : {})), ('labels' in raw ? { labels: (0, exports.validateLabelArray)(raw.labels) } : {})), ('notes' in raw ? { notes: (0, exports.validateNoteArray)(raw.notes) } : {})), ('projectNotes' in raw ? { projectNotes: (0, exports.validateNoteArray)(raw.projectNotes) } : {})), ('filters' in raw ? { filters: (0, exports.validateFilterArray)(raw.filters) } : {})), ('reminders' in raw ? { reminders: (0, exports.validateReminderArray)(raw.reminders) } : {})), ('remindersLocation' in raw
155
157
  ? { remindersLocation: (0, exports.validateLocationReminderArray)(raw.remindersLocation) }
156
158
  : {})), ('user' in raw ? { user: (0, exports.validateSyncUser)(raw.user) } : {})), ('liveNotifications' in raw
157
159
  ? { liveNotifications: (0, exports.validateLiveNotificationArray)(raw.liveNotifications) }
@@ -171,7 +173,7 @@ function parseSyncResponse(raw) {
171
173
  ? {
172
174
  projectViewOptionsDefaults: (0, exports.validateProjectViewOptionsDefaultsArray)(raw.projectViewOptionsDefaults),
173
175
  }
174
- : {})), ('folders' in raw ? { folders: (0, exports.validateFolderArray)(raw.folders) } : {})), ('workspaceGoals' in raw
176
+ : {})), ('folders' in raw ? { folders: (0, exports.validateFolderArray)(raw.folders) } : {})), ('goals' in raw ? { goals: (0, exports.validateGoalArray)(raw.goals) } : {})), ('workspaceGoals' in raw
175
177
  ? { workspaceGoals: (0, exports.validateWorkspaceGoalArray)(raw.workspaceGoals) }
176
178
  : {})), ('calendars' in raw ? { calendars: (0, exports.validateCalendarArray)(raw.calendars) } : {})), ('calendarAccounts' in raw
177
179
  ? { calendarAccounts: (0, exports.validateCalendarAccountArray)(raw.calendarAccounts) }
@@ -0,0 +1 @@
1
+ export {};
@@ -11,6 +11,7 @@ export * from './workspaces.js';
11
11
  export * from './folders.js';
12
12
  export * from './workspace-filters.js';
13
13
  export * from './workspace-goals.js';
14
+ export * from './goals.js';
14
15
  export * from './notifications.js';
15
16
  export * from './sharing.js';
16
17
  export * from './view-options.js';
@@ -29,6 +29,7 @@ export const SYNC_RESOURCE_TYPES = [
29
29
  'role_actions',
30
30
  'folders',
31
31
  'workspace_goals',
32
+ 'goals',
32
33
  'day_orders',
33
34
  'calendars',
34
35
  'calendar_accounts',
@@ -0,0 +1,30 @@
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();
@@ -5,6 +5,7 @@ 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';
8
9
  export * from './calendars.js';
9
10
  export * from './reminders.js';
10
11
  export * from './completed-info.js';
@@ -10,7 +10,7 @@ import { SectionSchema } from '../types/sections/types.js';
10
10
  import { TaskSchema } from '../types/tasks/types.js';
11
11
  import { UserSchema, CurrentUserSchema } from '../types/users/types.js';
12
12
  import { WorkspaceUserSchema, WorkspaceInvitationSchema, WorkspacePlanDetailsSchema, JoinWorkspaceResultSchema, WorkspaceSchema, MemberActivityInfoSchema, WorkspaceUserTaskSchema, } from '../types/workspaces/types.js';
13
- 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';
13
+ import { FilterSchema, CollaboratorSchema, CollaboratorStateSchema, FolderSchema, NoteSchema, TooltipsSchema, WorkspaceFilterSchema, GoalSchema, WorkspaceGoalSchema, CalendarSchema, CalendarAccountSchema, ReminderSchema, LocationReminderSchema, CompletedInfoSchema, ViewOptionsSchema, ProjectViewOptionsDefaultsSchema, UserPlanLimitsSchema, LiveNotificationSchema, SyncWorkspaceSchema, SyncUserSchema, UserSettingsSchema, SuggestionSchema, } from '../types/sync/resources/index.js';
14
14
  function createValidator(schema) {
15
15
  return (input) => schema.parse(input);
16
16
  }
@@ -115,6 +115,8 @@ export const validateNoteArray = createArrayValidator(validateNote);
115
115
  export const validateTooltips = createValidator(TooltipsSchema);
116
116
  export const validateWorkspaceFilter = createValidator(WorkspaceFilterSchema);
117
117
  export const validateWorkspaceFilterArray = createArrayValidator(validateWorkspaceFilter);
118
+ export const validateGoal = createValidator(GoalSchema);
119
+ export const validateGoalArray = createArrayValidator(validateGoal);
118
120
  export const validateWorkspaceGoal = createValidator(WorkspaceGoalSchema);
119
121
  export const validateWorkspaceGoalArray = createArrayValidator(validateWorkspaceGoal);
120
122
  export const validateCalendar = createValidator(CalendarSchema);
@@ -141,7 +143,7 @@ export const validateUserSettings = createValidator(UserSettingsSchema);
141
143
  export const validateSuggestion = createValidator(SuggestionSchema);
142
144
  export const validateSuggestionArray = createArrayValidator(validateSuggestion);
143
145
  export function parseSyncResponse(raw) {
144
- return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, raw), ('items' in raw ? { items: validateTaskArray(raw.items) } : {})), ('projects' in raw ? { projects: validateProjectArray(raw.projects) } : {})), ('sections' in raw ? { sections: validateSectionArray(raw.sections) } : {})), ('labels' in raw ? { labels: validateLabelArray(raw.labels) } : {})), ('notes' in raw ? { notes: validateNoteArray(raw.notes) } : {})), ('projectNotes' in raw ? { projectNotes: validateNoteArray(raw.projectNotes) } : {})), ('filters' in raw ? { filters: validateFilterArray(raw.filters) } : {})), ('reminders' in raw ? { reminders: validateReminderArray(raw.reminders) } : {})), ('remindersLocation' in raw
146
+ return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, raw), ('items' in raw ? { items: validateTaskArray(raw.items) } : {})), ('projects' in raw ? { projects: validateProjectArray(raw.projects) } : {})), ('sections' in raw ? { sections: validateSectionArray(raw.sections) } : {})), ('labels' in raw ? { labels: validateLabelArray(raw.labels) } : {})), ('notes' in raw ? { notes: validateNoteArray(raw.notes) } : {})), ('projectNotes' in raw ? { projectNotes: validateNoteArray(raw.projectNotes) } : {})), ('filters' in raw ? { filters: validateFilterArray(raw.filters) } : {})), ('reminders' in raw ? { reminders: validateReminderArray(raw.reminders) } : {})), ('remindersLocation' in raw
145
147
  ? { remindersLocation: validateLocationReminderArray(raw.remindersLocation) }
146
148
  : {})), ('user' in raw ? { user: validateSyncUser(raw.user) } : {})), ('liveNotifications' in raw
147
149
  ? { liveNotifications: validateLiveNotificationArray(raw.liveNotifications) }
@@ -161,7 +163,7 @@ export function parseSyncResponse(raw) {
161
163
  ? {
162
164
  projectViewOptionsDefaults: validateProjectViewOptionsDefaultsArray(raw.projectViewOptionsDefaults),
163
165
  }
164
- : {})), ('folders' in raw ? { folders: validateFolderArray(raw.folders) } : {})), ('workspaceGoals' in raw
166
+ : {})), ('folders' in raw ? { folders: validateFolderArray(raw.folders) } : {})), ('goals' in raw ? { goals: validateGoalArray(raw.goals) } : {})), ('workspaceGoals' in raw
165
167
  ? { workspaceGoals: validateWorkspaceGoalArray(raw.workspaceGoals) }
166
168
  : {})), ('calendars' in raw ? { calendars: validateCalendarArray(raw.calendars) } : {})), ('calendarAccounts' in raw
167
169
  ? { calendarAccounts: validateCalendarAccountArray(raw.calendarAccounts) }
@@ -0,0 +1,33 @@
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,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];
@@ -0,0 +1,37 @@
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>;
@@ -5,6 +5,7 @@ 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';
8
9
  export * from './calendars.js';
9
10
  export * from './reminders.js';
10
11
  export * from './completed-info.js';
@@ -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";
36
37
  LABEL: "LABEL";
37
38
  ASSIGNEE: "ASSIGNEE";
38
39
  ADDED_DATE: "ADDED_DATE";
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"];
@@ -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";
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
  }>>;
@@ -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";
96
97
  LABEL: "LABEL";
97
98
  ASSIGNEE: "ASSIGNEE";
98
99
  ADDED_DATE: "ADDED_DATE";
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<{
@@ -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";
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
  }>>>;
@@ -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";
137
138
  LABEL: "LABEL";
138
139
  ASSIGNEE: "ASSIGNEE";
139
140
  ADDED_DATE: "ADDED_DATE";
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
146
  PROJECT: "PROJECT";
147
+ WORKSPACE: "WORKSPACE";
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
  }>>>;
@@ -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, 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, Goal, 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,6 +43,7 @@ export type SyncResponse = {
43
43
  roleActions?: Record<string, unknown>[];
44
44
  folders?: Folder[];
45
45
  workspaceGoals?: WorkspaceGoal[];
46
+ goals?: Goal[];
46
47
  dayOrders?: Record<string, number>;
47
48
  calendars?: Calendar[];
48
49
  calendarAccounts?: CalendarAccount[];
@@ -834,6 +834,54 @@ export declare const validateWorkspaceFilterArray: (input: unknown) => {
834
834
  createdAt: string;
835
835
  updatedAt: string;
836
836
  }[];
837
+ export declare const validateGoal: (input: unknown) => {
838
+ [x: string]: unknown;
839
+ id: string;
840
+ ownerType: "USER" | "WORKSPACE";
841
+ ownerId: string;
842
+ name: string;
843
+ description: string | null;
844
+ deadline: string | null;
845
+ parentGoalId: string | null;
846
+ childOrder: number;
847
+ isCompleted: boolean;
848
+ completedAt: Date | null;
849
+ responsibleUid: string | null;
850
+ isDeleted: boolean;
851
+ creatorUid: string;
852
+ createdAt: Date;
853
+ updatedAt: Date;
854
+ progress?: {
855
+ [x: string]: unknown;
856
+ totalItemCount: number;
857
+ completedItemCount: number;
858
+ percentage: number;
859
+ } | undefined;
860
+ };
861
+ export declare const validateGoalArray: (input: unknown) => {
862
+ [x: string]: unknown;
863
+ id: string;
864
+ ownerType: "USER" | "WORKSPACE";
865
+ ownerId: string;
866
+ name: string;
867
+ description: string | null;
868
+ deadline: string | null;
869
+ parentGoalId: string | null;
870
+ childOrder: number;
871
+ isCompleted: boolean;
872
+ completedAt: Date | null;
873
+ responsibleUid: string | null;
874
+ isDeleted: boolean;
875
+ creatorUid: string;
876
+ createdAt: Date;
877
+ updatedAt: Date;
878
+ progress?: {
879
+ [x: string]: unknown;
880
+ totalItemCount: number;
881
+ completedItemCount: number;
882
+ percentage: number;
883
+ } | undefined;
884
+ }[];
837
885
  export declare const validateWorkspaceGoal: (input: unknown) => {
838
886
  [x: string]: unknown;
839
887
  id: string;
@@ -1074,30 +1122,30 @@ export declare const validateViewOptions: (input: unknown) => {
1074
1122
  [x: string]: unknown;
1075
1123
  viewType: "PROJECT" | "TODAY" | "UPCOMING" | "LABEL" | "FILTER" | "WORKSPACE_FILTER" | "SEARCH" | "TEMPLATE_PREVIEW" | "TASK_DETAIL" | "AUTOMATION" | "ASSIGNED" | "OVERDUE" | "WORKSPACE_OVERVIEW";
1076
1124
  objectId?: string | undefined;
1077
- groupedBy?: "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | null | undefined;
1125
+ groupedBy?: "PROJECT" | "WORKSPACE" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
1078
1126
  filteredBy?: string | null | undefined;
1079
1127
  viewMode?: "LIST" | "BOARD" | "CALENDAR" | undefined;
1080
1128
  showCompletedTasks?: boolean | undefined;
1081
- sortedBy?: "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1129
+ sortedBy?: "PROJECT" | "WORKSPACE" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1082
1130
  sortOrder?: "ASC" | "DESC" | null | undefined;
1083
1131
  };
1084
1132
  export declare const validateViewOptionsArray: (input: unknown) => {
1085
1133
  [x: string]: unknown;
1086
1134
  viewType: "PROJECT" | "TODAY" | "UPCOMING" | "LABEL" | "FILTER" | "WORKSPACE_FILTER" | "SEARCH" | "TEMPLATE_PREVIEW" | "TASK_DETAIL" | "AUTOMATION" | "ASSIGNED" | "OVERDUE" | "WORKSPACE_OVERVIEW";
1087
1135
  objectId?: string | undefined;
1088
- groupedBy?: "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | null | undefined;
1136
+ groupedBy?: "PROJECT" | "WORKSPACE" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
1089
1137
  filteredBy?: string | null | undefined;
1090
1138
  viewMode?: "LIST" | "BOARD" | "CALENDAR" | undefined;
1091
1139
  showCompletedTasks?: boolean | undefined;
1092
- sortedBy?: "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1140
+ sortedBy?: "PROJECT" | "WORKSPACE" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1093
1141
  sortOrder?: "ASC" | "DESC" | null | undefined;
1094
1142
  }[];
1095
1143
  export declare const validateProjectViewOptionsDefaults: (input: unknown) => {
1096
1144
  [x: string]: unknown;
1097
1145
  projectId: string;
1098
1146
  viewMode?: "LIST" | "BOARD" | "CALENDAR" | 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;
1147
+ groupedBy?: "PROJECT" | "WORKSPACE" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
1148
+ sortedBy?: "PROJECT" | "WORKSPACE" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1101
1149
  sortOrder?: "ASC" | "DESC" | null | undefined;
1102
1150
  showCompletedTasks?: boolean | undefined;
1103
1151
  filteredBy?: string | null | undefined;
@@ -1110,8 +1158,8 @@ export declare const validateProjectViewOptionsDefaultsArray: (input: unknown) =
1110
1158
  [x: string]: unknown;
1111
1159
  projectId: string;
1112
1160
  viewMode?: "LIST" | "BOARD" | "CALENDAR" | 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;
1161
+ groupedBy?: "PROJECT" | "WORKSPACE" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
1162
+ sortedBy?: "PROJECT" | "WORKSPACE" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1115
1163
  sortOrder?: "ASC" | "DESC" | null | undefined;
1116
1164
  showCompletedTasks?: boolean | undefined;
1117
1165
  filteredBy?: string | null | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doist/todoist-sdk",
3
- "version": "8.3.0",
3
+ "version": "8.4.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",