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

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.
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ENDPOINT_REST_ID_MAPPINGS = exports.ENDPOINT_REST_EMAILS = exports.ENDPOINT_REST_BACKUPS_DOWNLOAD = exports.ENDPOINT_REST_BACKUPS = exports.ENDPOINT_REST_ACCESS_TOKENS_MIGRATE = exports.ENDPOINT_REST_TEMPLATES_IMPORT_FROM_ID = exports.ENDPOINT_REST_TEMPLATES_IMPORT_FROM_FILE = exports.ENDPOINT_REST_TEMPLATES_CREATE_FROM_FILE = exports.ENDPOINT_REST_TEMPLATES_URL = exports.ENDPOINT_REST_TEMPLATES_FILE = exports.ENDPOINT_REST_TASKS_COMPLETED = exports.ENDPOINT_REST_PROJECTS_MOVE_TO_PERSONAL = exports.ENDPOINT_REST_PROJECTS_MOVE_TO_WORKSPACE = exports.SECTION_UNARCHIVE = exports.SECTION_ARCHIVE = exports.ENDPOINT_REST_PROJECT_JOIN = exports.ENDPOINT_REST_PROJECT_FULL = exports.ENDPOINT_REST_PROJECTS_PERMISSIONS = exports.ENDPOINT_REST_PROJECTS_ARCHIVED_COUNT = exports.PROJECT_UNARCHIVE = exports.PROJECT_ARCHIVE = exports.ENDPOINT_REST_UPLOADS = exports.ENDPOINT_REST_ACTIVITIES = exports.ENDPOINT_REST_PRODUCTIVITY = exports.ENDPOINT_REST_USER = exports.ENDPOINT_REST_PROJECT_COLLABORATORS = exports.ENDPOINT_REST_PROJECTS_ARCHIVED = exports.ENDPOINT_REST_PROJECTS_SEARCH = exports.ENDPOINT_REST_PROJECTS = exports.ENDPOINT_REST_TASK_MOVE = exports.ENDPOINT_REST_TASK_REOPEN = exports.ENDPOINT_REST_TASK_CLOSE = exports.ENDPOINT_REST_LOCATION_REMINDERS = exports.ENDPOINT_REST_REMINDERS = exports.ENDPOINT_REST_COMMENTS = exports.ENDPOINT_REST_LABELS_SHARED_REMOVE = exports.ENDPOINT_REST_LABELS_SHARED_RENAME = exports.ENDPOINT_REST_LABELS_SHARED = exports.ENDPOINT_REST_LABELS_SEARCH = exports.ENDPOINT_REST_LABELS = exports.ENDPOINT_REST_SECTIONS_SEARCH = exports.ENDPOINT_REST_SECTIONS = exports.ENDPOINT_REST_TASKS_COMPLETED_SEARCH = exports.ENDPOINT_REST_TASKS_COMPLETED_BY_DUE_DATE = exports.ENDPOINT_REST_TASKS_COMPLETED_BY_COMPLETION_DATE = exports.ENDPOINT_REST_TASKS_FILTER = exports.ENDPOINT_REST_TASKS = exports.API_BASE_URI = exports.API_VERSION = exports.TODOIST_WEB_URI = void 0;
4
- exports.ENDPOINT_WORKSPACE_MEMBERS = exports.ENDPOINT_WORKSPACE_USERS = exports.ENDPOINT_WORKSPACE_PLAN_DETAILS = exports.ENDPOINT_WORKSPACE_LOGO = exports.ENDPOINT_WORKSPACE_JOIN = exports.ENDPOINT_WORKSPACE_INVITATIONS_DELETE = exports.ENDPOINT_WORKSPACE_INVITATIONS_ALL = exports.ENDPOINT_WORKSPACE_INVITATIONS = exports.ENDPOINT_REST_WORKSPACES = exports.ENDPOINT_REST_FOLDERS = exports.ENDPOINT_REGISTER = exports.ENDPOINT_REVOKE = exports.ENDPOINT_GET_TOKEN = exports.ENDPOINT_AUTHORIZATION = exports.ENDPOINT_SYNC = exports.ENDPOINT_SYNC_QUICK_ADD = exports.ENDPOINT_REST_MOVED_IDS = void 0;
4
+ exports.ENDPOINT_WORKSPACE_MEMBERS = exports.ENDPOINT_WORKSPACE_USERS = exports.ENDPOINT_WORKSPACE_PLAN_DETAILS = exports.ENDPOINT_WORKSPACE_LOGO = exports.ENDPOINT_WORKSPACE_JOIN = exports.ENDPOINT_WORKSPACE_INVITATIONS_DELETE = exports.ENDPOINT_WORKSPACE_INVITATIONS_ALL = exports.ENDPOINT_WORKSPACE_INVITATIONS = exports.ENDPOINT_REST_WORKSPACES = exports.GOAL_TASKS = exports.GOAL_UNCOMPLETE = exports.GOAL_COMPLETE = exports.ENDPOINT_REST_GOALS_SEARCH = exports.ENDPOINT_REST_GOALS = exports.ENDPOINT_REST_FOLDERS = exports.ENDPOINT_REGISTER = exports.ENDPOINT_REVOKE = exports.ENDPOINT_GET_TOKEN = exports.ENDPOINT_AUTHORIZATION = exports.ENDPOINT_SYNC = exports.ENDPOINT_SYNC_QUICK_ADD = exports.ENDPOINT_REST_MOVED_IDS = void 0;
5
5
  exports.getSyncBaseUri = getSyncBaseUri;
6
6
  exports.getAuthBaseUri = getAuthBaseUri;
7
7
  exports.getWorkspaceInvitationAcceptEndpoint = getWorkspaceInvitationAcceptEndpoint;
@@ -86,6 +86,11 @@ exports.ENDPOINT_GET_TOKEN = 'access_token';
86
86
  exports.ENDPOINT_REVOKE = 'revoke';
87
87
  exports.ENDPOINT_REGISTER = 'register';
88
88
  exports.ENDPOINT_REST_FOLDERS = 'folders';
89
+ exports.ENDPOINT_REST_GOALS = 'goals';
90
+ exports.ENDPOINT_REST_GOALS_SEARCH = exports.ENDPOINT_REST_GOALS + '/search';
91
+ exports.GOAL_COMPLETE = 'complete';
92
+ exports.GOAL_UNCOMPLETE = 'uncomplete';
93
+ exports.GOAL_TASKS = 'items';
89
94
  // Workspace endpoints
90
95
  exports.ENDPOINT_REST_WORKSPACES = 'workspaces';
91
96
  exports.ENDPOINT_WORKSPACE_INVITATIONS = 'workspaces/invitations';
@@ -1914,6 +1914,134 @@ class TodoistApi {
1914
1914
  });
1915
1915
  return (0, http_client_1.isSuccess)(response);
1916
1916
  }
1917
+ // ── Goals ──
1918
+ async getGoals(args) {
1919
+ const { data: { results, nextCursor }, } = await (0, http_client_1.request)({
1920
+ httpMethod: 'GET',
1921
+ baseUri: this.syncApiBase,
1922
+ relativePath: endpoints_1.ENDPOINT_REST_GOALS,
1923
+ apiToken: this.authToken,
1924
+ customFetch: this.customFetch,
1925
+ payload: args,
1926
+ });
1927
+ return {
1928
+ results: (0, validators_1.validateGoalArray)(results),
1929
+ nextCursor,
1930
+ };
1931
+ }
1932
+ async searchGoals(args) {
1933
+ const { data: { results, nextCursor }, } = await (0, http_client_1.request)({
1934
+ httpMethod: 'GET',
1935
+ baseUri: this.syncApiBase,
1936
+ relativePath: endpoints_1.ENDPOINT_REST_GOALS_SEARCH,
1937
+ apiToken: this.authToken,
1938
+ customFetch: this.customFetch,
1939
+ payload: args,
1940
+ });
1941
+ return {
1942
+ results: (0, validators_1.validateGoalArray)(results),
1943
+ nextCursor,
1944
+ };
1945
+ }
1946
+ async getGoal(id) {
1947
+ zod_1.z.string().parse(id);
1948
+ const response = await (0, http_client_1.request)({
1949
+ httpMethod: 'GET',
1950
+ baseUri: this.syncApiBase,
1951
+ relativePath: generatePath(endpoints_1.ENDPOINT_REST_GOALS, id),
1952
+ apiToken: this.authToken,
1953
+ customFetch: this.customFetch,
1954
+ });
1955
+ return (0, validators_1.validateGoal)(response.data);
1956
+ }
1957
+ async addGoal(args, requestId) {
1958
+ const response = await (0, http_client_1.request)({
1959
+ httpMethod: 'POST',
1960
+ baseUri: this.syncApiBase,
1961
+ relativePath: endpoints_1.ENDPOINT_REST_GOALS,
1962
+ apiToken: this.authToken,
1963
+ customFetch: this.customFetch,
1964
+ payload: args,
1965
+ requestId: requestId,
1966
+ });
1967
+ return (0, validators_1.validateGoal)(response.data);
1968
+ }
1969
+ async updateGoal(id, args, requestId) {
1970
+ zod_1.z.string().parse(id);
1971
+ const response = await (0, http_client_1.request)({
1972
+ httpMethod: 'POST',
1973
+ baseUri: this.syncApiBase,
1974
+ relativePath: generatePath(endpoints_1.ENDPOINT_REST_GOALS, id),
1975
+ apiToken: this.authToken,
1976
+ customFetch: this.customFetch,
1977
+ payload: args,
1978
+ requestId: requestId,
1979
+ });
1980
+ return (0, validators_1.validateGoal)(response.data);
1981
+ }
1982
+ async deleteGoal(id, requestId) {
1983
+ zod_1.z.string().parse(id);
1984
+ const response = await (0, http_client_1.request)({
1985
+ httpMethod: 'DELETE',
1986
+ baseUri: this.syncApiBase,
1987
+ relativePath: generatePath(endpoints_1.ENDPOINT_REST_GOALS, id),
1988
+ apiToken: this.authToken,
1989
+ customFetch: this.customFetch,
1990
+ requestId: requestId,
1991
+ });
1992
+ return (0, http_client_1.isSuccess)(response);
1993
+ }
1994
+ async completeGoal(id, requestId) {
1995
+ zod_1.z.string().parse(id);
1996
+ const response = await (0, http_client_1.request)({
1997
+ httpMethod: 'POST',
1998
+ baseUri: this.syncApiBase,
1999
+ relativePath: generatePath(endpoints_1.ENDPOINT_REST_GOALS, id, endpoints_1.GOAL_COMPLETE),
2000
+ apiToken: this.authToken,
2001
+ customFetch: this.customFetch,
2002
+ requestId: requestId,
2003
+ });
2004
+ return (0, validators_1.validateGoal)(response.data);
2005
+ }
2006
+ async uncompleteGoal(id, requestId) {
2007
+ zod_1.z.string().parse(id);
2008
+ const response = await (0, http_client_1.request)({
2009
+ httpMethod: 'POST',
2010
+ baseUri: this.syncApiBase,
2011
+ relativePath: generatePath(endpoints_1.ENDPOINT_REST_GOALS, id, endpoints_1.GOAL_UNCOMPLETE),
2012
+ apiToken: this.authToken,
2013
+ customFetch: this.customFetch,
2014
+ requestId: requestId,
2015
+ });
2016
+ return (0, validators_1.validateGoal)(response.data);
2017
+ }
2018
+ async linkTaskToGoal({ goalId, taskId }, requestId) {
2019
+ zod_1.z.string().parse(goalId);
2020
+ zod_1.z.string().parse(taskId);
2021
+ const response = await (0, http_client_1.request)({
2022
+ httpMethod: 'POST',
2023
+ baseUri: this.syncApiBase,
2024
+ relativePath: generatePath(endpoints_1.ENDPOINT_REST_GOALS, goalId, endpoints_1.GOAL_TASKS),
2025
+ apiToken: this.authToken,
2026
+ customFetch: this.customFetch,
2027
+ payload: { itemId: taskId },
2028
+ requestId: requestId,
2029
+ });
2030
+ return (0, validators_1.validateGoal)(response.data);
2031
+ }
2032
+ async unlinkTaskFromGoal({ goalId, taskId }, requestId) {
2033
+ zod_1.z.string().parse(goalId);
2034
+ zod_1.z.string().parse(taskId);
2035
+ const response = await (0, http_client_1.request)({
2036
+ httpMethod: 'DELETE',
2037
+ baseUri: this.syncApiBase,
2038
+ relativePath: generatePath(endpoints_1.ENDPOINT_REST_GOALS, goalId, endpoints_1.GOAL_TASKS, taskId),
2039
+ apiToken: this.authToken,
2040
+ customFetch: this.customFetch,
2041
+ requestId: requestId,
2042
+ });
2043
+ return (0, http_client_1.isSuccess)(response);
2044
+ }
1917
2045
  // ── Backups ──
1918
2046
  /**
1919
2047
  * Retrieves a list of available backups.
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./types"), exports);
18
+ __exportStar(require("./requests"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -4,15 +4,12 @@ exports.GoalSchema = exports.GoalProgressSchema = exports.GOAL_OWNER_TYPES = voi
4
4
  const zod_1 = require("zod");
5
5
  /** Available goal owner types. */
6
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(),
7
+ exports.GoalProgressSchema = zod_1.z.looseObject({
8
+ totalTaskCount: zod_1.z.number().int(),
9
+ completedTaskCount: zod_1.z.number().int(),
11
10
  percentage: zod_1.z.number(),
12
- })
13
- .passthrough();
14
- exports.GoalSchema = zod_1.z
15
- .object({
11
+ });
12
+ exports.GoalSchema = zod_1.z.looseObject({
16
13
  id: zod_1.z.string(),
17
14
  ownerType: zod_1.z.enum(exports.GOAL_OWNER_TYPES),
18
15
  ownerId: zod_1.z.string(),
@@ -29,5 +26,4 @@ exports.GoalSchema = zod_1.z
29
26
  creatorUid: zod_1.z.string(),
30
27
  createdAt: zod_1.z.coerce.date(),
31
28
  updatedAt: zod_1.z.coerce.date(),
32
- })
33
- .passthrough();
29
+ });
@@ -25,6 +25,7 @@ __exportStar(require("./productivity"), exports);
25
25
  __exportStar(require("./activity"), exports);
26
26
  __exportStar(require("./workspaces"), exports);
27
27
  __exportStar(require("./folders"), exports);
28
+ __exportStar(require("./goals"), exports);
28
29
  __exportStar(require("./insights"), exports);
29
30
  __exportStar(require("./backups"), exports);
30
31
  __exportStar(require("./id-mappings"), exports);
@@ -21,7 +21,6 @@ __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);
25
24
  __exportStar(require("./calendars"), exports);
26
25
  __exportStar(require("./reminders"), exports);
27
26
  __exportStar(require("./completed-info"), exports);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
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.validateGoalArray = exports.validateGoal = exports.validateWorkspaceFilterArray = exports.validateWorkspaceFilter = void 0;
3
+ exports.validateNote = exports.validateGoalArray = exports.validateGoal = 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 = exports.validateTooltips = exports.validateNoteArray = void 0;
5
5
  exports.isWorkspaceProject = isWorkspaceProject;
6
6
  exports.isPersonalProject = isPersonalProject;
7
7
  exports.validateProject = validateProject;
@@ -11,15 +11,16 @@ exports.parseSyncResponse = parseSyncResponse;
11
11
  const types_1 = require("../types/activity/types");
12
12
  const types_2 = require("../types/backups/types");
13
13
  const types_3 = require("../types/comments/types");
14
- const types_4 = require("../types/id-mappings/types");
15
- const types_5 = require("../types/insights/types");
16
- const types_6 = require("../types/labels/types");
17
- const types_7 = require("../types/productivity/types");
18
- const types_8 = require("../types/projects/types");
19
- const types_9 = require("../types/sections/types");
20
- const types_10 = require("../types/tasks/types");
21
- const types_11 = require("../types/users/types");
22
- const types_12 = require("../types/workspaces/types");
14
+ const types_4 = require("../types/goals/types");
15
+ const types_5 = require("../types/id-mappings/types");
16
+ const types_6 = require("../types/insights/types");
17
+ const types_7 = require("../types/labels/types");
18
+ const types_8 = require("../types/productivity/types");
19
+ const types_9 = require("../types/projects/types");
20
+ const types_10 = require("../types/sections/types");
21
+ const types_11 = require("../types/tasks/types");
22
+ const types_12 = require("../types/users/types");
23
+ const types_13 = require("../types/workspaces/types");
23
24
  const resources_1 = require("../types/sync/resources");
24
25
  function createValidator(schema) {
25
26
  return (input) => schema.parse(input);
@@ -33,7 +34,7 @@ function createArrayValidator(validateItem) {
33
34
  };
34
35
  }
35
36
  // Entity validators
36
- exports.validateTask = createValidator(types_10.TaskSchema);
37
+ exports.validateTask = createValidator(types_11.TaskSchema);
37
38
  exports.validateTaskArray = createArrayValidator(exports.validateTask);
38
39
  /**
39
40
  * Type guard to check if a project is a workspace project.
@@ -58,9 +59,9 @@ function isPersonalProject(project) {
58
59
  */
59
60
  function validateProject(input) {
60
61
  if ('workspaceId' in input) {
61
- return types_8.WorkspaceProjectSchema.parse(input);
62
+ return types_9.WorkspaceProjectSchema.parse(input);
62
63
  }
63
- return types_8.PersonalProjectSchema.parse(input);
64
+ return types_9.PersonalProjectSchema.parse(input);
64
65
  }
65
66
  function validateProjectArray(input) {
66
67
  if (!Array.isArray(input)) {
@@ -68,48 +69,48 @@ function validateProjectArray(input) {
68
69
  }
69
70
  return input.map(validateProject);
70
71
  }
71
- exports.validateWorkspaceProject = createValidator(types_8.WorkspaceProjectSchema);
72
+ exports.validateWorkspaceProject = createValidator(types_9.WorkspaceProjectSchema);
72
73
  exports.validateWorkspaceProjectArray = createArrayValidator(exports.validateWorkspaceProject);
73
- exports.validateSection = createValidator(types_9.SectionSchema);
74
+ exports.validateSection = createValidator(types_10.SectionSchema);
74
75
  exports.validateSectionArray = createArrayValidator(exports.validateSection);
75
- exports.validateLabel = createValidator(types_6.LabelSchema);
76
+ exports.validateLabel = createValidator(types_7.LabelSchema);
76
77
  exports.validateLabelArray = createArrayValidator(exports.validateLabel);
77
78
  exports.validateComment = createValidator(types_3.CommentSchema);
78
79
  exports.validateCommentArray = createArrayValidator(exports.validateComment);
79
- exports.validateUser = createValidator(types_11.UserSchema);
80
+ exports.validateUser = createValidator(types_12.UserSchema);
80
81
  exports.validateUserArray = createArrayValidator(exports.validateUser);
81
- exports.validateProductivityStats = createValidator(types_7.ProductivityStatsSchema);
82
- exports.validateCurrentUser = createValidator(types_11.CurrentUserSchema);
82
+ exports.validateProductivityStats = createValidator(types_8.ProductivityStatsSchema);
83
+ exports.validateCurrentUser = createValidator(types_12.CurrentUserSchema);
83
84
  exports.validateActivityEvent = createValidator(types_1.ActivityEventSchema);
84
85
  exports.validateActivityEventArray = createArrayValidator(exports.validateActivityEvent);
85
86
  exports.validateAttachment = createValidator(types_3.AttachmentSchema);
86
- exports.validateWorkspaceUser = createValidator(types_12.WorkspaceUserSchema);
87
+ exports.validateWorkspaceUser = createValidator(types_13.WorkspaceUserSchema);
87
88
  function validateWorkspaceUserArray(input) {
88
89
  if (!Array.isArray(input)) {
89
90
  throw new Error(`Expected array for workspace users, got ${typeof input}`);
90
91
  }
91
92
  return input.map(exports.validateWorkspaceUser);
92
93
  }
93
- exports.validateWorkspaceInvitation = createValidator(types_12.WorkspaceInvitationSchema);
94
+ exports.validateWorkspaceInvitation = createValidator(types_13.WorkspaceInvitationSchema);
94
95
  exports.validateWorkspaceInvitationArray = createArrayValidator(exports.validateWorkspaceInvitation);
95
- exports.validateWorkspacePlanDetails = createValidator(types_12.WorkspacePlanDetailsSchema);
96
- exports.validateJoinWorkspaceResult = createValidator(types_12.JoinWorkspaceResultSchema);
97
- exports.validateWorkspace = createValidator(types_12.WorkspaceSchema);
96
+ exports.validateWorkspacePlanDetails = createValidator(types_13.WorkspacePlanDetailsSchema);
97
+ exports.validateJoinWorkspaceResult = createValidator(types_13.JoinWorkspaceResultSchema);
98
+ exports.validateWorkspace = createValidator(types_13.WorkspaceSchema);
98
99
  exports.validateWorkspaceArray = createArrayValidator(exports.validateWorkspace);
99
- exports.validateMemberActivityInfo = createValidator(types_12.MemberActivityInfoSchema);
100
+ exports.validateMemberActivityInfo = createValidator(types_13.MemberActivityInfoSchema);
100
101
  exports.validateMemberActivityInfoArray = createArrayValidator(exports.validateMemberActivityInfo);
101
- exports.validateWorkspaceUserTask = createValidator(types_12.WorkspaceUserTaskSchema);
102
+ exports.validateWorkspaceUserTask = createValidator(types_13.WorkspaceUserTaskSchema);
102
103
  exports.validateWorkspaceUserTaskArray = createArrayValidator(exports.validateWorkspaceUserTask);
103
- exports.validateProjectActivityStats = createValidator(types_5.ProjectActivityStatsSchema);
104
- exports.validateProjectHealth = createValidator(types_5.ProjectHealthSchema);
105
- exports.validateProjectHealthContext = createValidator(types_5.ProjectHealthContextSchema);
106
- exports.validateProjectProgress = createValidator(types_5.ProjectProgressSchema);
107
- exports.validateWorkspaceInsights = createValidator(types_5.WorkspaceInsightsSchema);
104
+ exports.validateProjectActivityStats = createValidator(types_6.ProjectActivityStatsSchema);
105
+ exports.validateProjectHealth = createValidator(types_6.ProjectHealthSchema);
106
+ exports.validateProjectHealthContext = createValidator(types_6.ProjectHealthContextSchema);
107
+ exports.validateProjectProgress = createValidator(types_6.ProjectProgressSchema);
108
+ exports.validateWorkspaceInsights = createValidator(types_6.WorkspaceInsightsSchema);
108
109
  exports.validateBackup = createValidator(types_2.BackupSchema);
109
110
  exports.validateBackupArray = createArrayValidator(exports.validateBackup);
110
- exports.validateIdMapping = createValidator(types_4.IdMappingSchema);
111
+ exports.validateIdMapping = createValidator(types_5.IdMappingSchema);
111
112
  exports.validateIdMappingArray = createArrayValidator(exports.validateIdMapping);
112
- exports.validateMovedId = createValidator(types_4.MovedIdSchema);
113
+ exports.validateMovedId = createValidator(types_5.MovedIdSchema);
113
114
  exports.validateMovedIdArray = createArrayValidator(exports.validateMovedId);
114
115
  // Sync resource validators
115
116
  exports.validateFilter = createValidator(resources_1.FilterSchema);
@@ -120,13 +121,13 @@ exports.validateCollaboratorState = createValidator(resources_1.CollaboratorStat
120
121
  exports.validateCollaboratorStateArray = createArrayValidator(exports.validateCollaboratorState);
121
122
  exports.validateFolder = createValidator(resources_1.FolderSchema);
122
123
  exports.validateFolderArray = createArrayValidator(exports.validateFolder);
124
+ exports.validateGoal = createValidator(types_4.GoalSchema);
125
+ exports.validateGoalArray = createArrayValidator(exports.validateGoal);
123
126
  exports.validateNote = createValidator(resources_1.NoteSchema);
124
127
  exports.validateNoteArray = createArrayValidator(exports.validateNote);
125
128
  exports.validateTooltips = createValidator(resources_1.TooltipsSchema);
126
129
  exports.validateWorkspaceFilter = createValidator(resources_1.WorkspaceFilterSchema);
127
130
  exports.validateWorkspaceFilterArray = createArrayValidator(exports.validateWorkspaceFilter);
128
- exports.validateGoal = createValidator(resources_1.GoalSchema);
129
- exports.validateGoalArray = createArrayValidator(exports.validateGoal);
130
131
  exports.validateWorkspaceGoal = createValidator(resources_1.WorkspaceGoalSchema);
131
132
  exports.validateWorkspaceGoalArray = createArrayValidator(exports.validateWorkspaceGoal);
132
133
  exports.validateCalendar = createValidator(resources_1.CalendarSchema);
@@ -67,6 +67,11 @@ export const ENDPOINT_GET_TOKEN = 'access_token';
67
67
  export const ENDPOINT_REVOKE = 'revoke';
68
68
  export const ENDPOINT_REGISTER = 'register';
69
69
  export const ENDPOINT_REST_FOLDERS = 'folders';
70
+ export const ENDPOINT_REST_GOALS = 'goals';
71
+ export const ENDPOINT_REST_GOALS_SEARCH = ENDPOINT_REST_GOALS + '/search';
72
+ export const GOAL_COMPLETE = 'complete';
73
+ export const GOAL_UNCOMPLETE = 'uncomplete';
74
+ export const GOAL_TASKS = 'items';
70
75
  // Workspace endpoints
71
76
  export const ENDPOINT_REST_WORKSPACES = 'workspaces';
72
77
  export const ENDPOINT_WORKSPACE_INVITATIONS = 'workspaces/invitations';
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import { z } from 'zod';
13
- import { getSyncBaseUri, ENDPOINT_REST_TASKS, ENDPOINT_REST_TASKS_FILTER, ENDPOINT_REST_TASKS_COMPLETED_BY_COMPLETION_DATE, ENDPOINT_REST_TASKS_COMPLETED_BY_DUE_DATE, ENDPOINT_REST_TASKS_COMPLETED_SEARCH, ENDPOINT_REST_TASKS_COMPLETED, ENDPOINT_REST_TEMPLATES_FILE, ENDPOINT_REST_TEMPLATES_URL, ENDPOINT_REST_TEMPLATES_CREATE_FROM_FILE, ENDPOINT_REST_TEMPLATES_IMPORT_FROM_FILE, ENDPOINT_REST_TEMPLATES_IMPORT_FROM_ID, ENDPOINT_REST_PROJECTS, ENDPOINT_REST_PROJECTS_SEARCH, ENDPOINT_SYNC_QUICK_ADD, ENDPOINT_REST_TASK_CLOSE, ENDPOINT_REST_TASK_REOPEN, ENDPOINT_REST_TASK_MOVE, ENDPOINT_REST_LABELS, ENDPOINT_REST_LABELS_SEARCH, ENDPOINT_REST_PROJECT_COLLABORATORS, ENDPOINT_REST_SECTIONS, ENDPOINT_REST_SECTIONS_SEARCH, ENDPOINT_REST_COMMENTS, ENDPOINT_REST_LOCATION_REMINDERS, ENDPOINT_REST_REMINDERS, ENDPOINT_REST_LABELS_SHARED, ENDPOINT_REST_LABELS_SHARED_RENAME, ENDPOINT_REST_LABELS_SHARED_REMOVE, ENDPOINT_SYNC, PROJECT_ARCHIVE, PROJECT_UNARCHIVE, ENDPOINT_REST_PROJECTS_MOVE_TO_WORKSPACE, ENDPOINT_REST_PROJECTS_MOVE_TO_PERSONAL, ENDPOINT_REST_PROJECTS_ARCHIVED, ENDPOINT_REST_PROJECTS_ARCHIVED_COUNT, ENDPOINT_REST_PROJECTS_PERMISSIONS, ENDPOINT_REST_PROJECT_FULL, ENDPOINT_REST_PROJECT_JOIN, SECTION_ARCHIVE, SECTION_UNARCHIVE, ENDPOINT_REST_USER, ENDPOINT_REST_PRODUCTIVITY, ENDPOINT_REST_ACTIVITIES, ENDPOINT_REST_UPLOADS, getProjectInsightsActivityStatsEndpoint, getProjectInsightsHealthEndpoint, getProjectInsightsHealthContextEndpoint, getProjectInsightsProgressEndpoint, getProjectInsightsHealthAnalyzeEndpoint, getWorkspaceInsightsEndpoint, ENDPOINT_REST_BACKUPS, ENDPOINT_REST_BACKUPS_DOWNLOAD, ENDPOINT_REST_EMAILS, ENDPOINT_REST_ID_MAPPINGS, ENDPOINT_REST_MOVED_IDS, ENDPOINT_REST_WORKSPACES, ENDPOINT_WORKSPACE_MEMBERS, getWorkspaceUserTasksEndpoint, getWorkspaceInviteUsersEndpoint, getWorkspaceUserEndpoint, ENDPOINT_WORKSPACE_INVITATIONS, ENDPOINT_WORKSPACE_INVITATIONS_ALL, ENDPOINT_WORKSPACE_INVITATIONS_DELETE, getWorkspaceInvitationAcceptEndpoint, getWorkspaceInvitationRejectEndpoint, ENDPOINT_WORKSPACE_JOIN, ENDPOINT_WORKSPACE_LOGO, ENDPOINT_WORKSPACE_PLAN_DETAILS, ENDPOINT_WORKSPACE_USERS, getWorkspaceActiveProjectsEndpoint, getWorkspaceArchivedProjectsEndpoint, ENDPOINT_REST_FOLDERS, } from './consts/endpoints.js';
13
+ import { getSyncBaseUri, ENDPOINT_REST_TASKS, ENDPOINT_REST_TASKS_FILTER, ENDPOINT_REST_TASKS_COMPLETED_BY_COMPLETION_DATE, ENDPOINT_REST_TASKS_COMPLETED_BY_DUE_DATE, ENDPOINT_REST_TASKS_COMPLETED_SEARCH, ENDPOINT_REST_TASKS_COMPLETED, ENDPOINT_REST_TEMPLATES_FILE, ENDPOINT_REST_TEMPLATES_URL, ENDPOINT_REST_TEMPLATES_CREATE_FROM_FILE, ENDPOINT_REST_TEMPLATES_IMPORT_FROM_FILE, ENDPOINT_REST_TEMPLATES_IMPORT_FROM_ID, ENDPOINT_REST_PROJECTS, ENDPOINT_REST_PROJECTS_SEARCH, ENDPOINT_SYNC_QUICK_ADD, ENDPOINT_REST_TASK_CLOSE, ENDPOINT_REST_TASK_REOPEN, ENDPOINT_REST_TASK_MOVE, ENDPOINT_REST_LABELS, ENDPOINT_REST_LABELS_SEARCH, ENDPOINT_REST_PROJECT_COLLABORATORS, ENDPOINT_REST_SECTIONS, ENDPOINT_REST_SECTIONS_SEARCH, ENDPOINT_REST_COMMENTS, ENDPOINT_REST_LOCATION_REMINDERS, ENDPOINT_REST_REMINDERS, ENDPOINT_REST_LABELS_SHARED, ENDPOINT_REST_LABELS_SHARED_RENAME, ENDPOINT_REST_LABELS_SHARED_REMOVE, ENDPOINT_SYNC, PROJECT_ARCHIVE, PROJECT_UNARCHIVE, ENDPOINT_REST_PROJECTS_MOVE_TO_WORKSPACE, ENDPOINT_REST_PROJECTS_MOVE_TO_PERSONAL, ENDPOINT_REST_PROJECTS_ARCHIVED, ENDPOINT_REST_PROJECTS_ARCHIVED_COUNT, ENDPOINT_REST_PROJECTS_PERMISSIONS, ENDPOINT_REST_PROJECT_FULL, ENDPOINT_REST_PROJECT_JOIN, SECTION_ARCHIVE, SECTION_UNARCHIVE, ENDPOINT_REST_USER, ENDPOINT_REST_PRODUCTIVITY, ENDPOINT_REST_ACTIVITIES, ENDPOINT_REST_UPLOADS, getProjectInsightsActivityStatsEndpoint, getProjectInsightsHealthEndpoint, getProjectInsightsHealthContextEndpoint, getProjectInsightsProgressEndpoint, getProjectInsightsHealthAnalyzeEndpoint, getWorkspaceInsightsEndpoint, ENDPOINT_REST_BACKUPS, ENDPOINT_REST_BACKUPS_DOWNLOAD, ENDPOINT_REST_EMAILS, ENDPOINT_REST_ID_MAPPINGS, ENDPOINT_REST_MOVED_IDS, ENDPOINT_REST_WORKSPACES, ENDPOINT_WORKSPACE_MEMBERS, getWorkspaceUserTasksEndpoint, getWorkspaceInviteUsersEndpoint, getWorkspaceUserEndpoint, ENDPOINT_WORKSPACE_INVITATIONS, ENDPOINT_WORKSPACE_INVITATIONS_ALL, ENDPOINT_WORKSPACE_INVITATIONS_DELETE, getWorkspaceInvitationAcceptEndpoint, getWorkspaceInvitationRejectEndpoint, ENDPOINT_WORKSPACE_JOIN, ENDPOINT_WORKSPACE_LOGO, ENDPOINT_WORKSPACE_PLAN_DETAILS, ENDPOINT_WORKSPACE_USERS, getWorkspaceActiveProjectsEndpoint, getWorkspaceArchivedProjectsEndpoint, ENDPOINT_REST_FOLDERS, ENDPOINT_REST_GOALS, ENDPOINT_REST_GOALS_SEARCH, GOAL_COMPLETE, GOAL_UNCOMPLETE, GOAL_TASKS, } from './consts/endpoints.js';
14
14
  import { request, isSuccess } from './transport/http-client.js';
15
15
  import { UpdateReminderArgsSchema, UpdateLocationReminderArgsSchema, ReminderIdSchema, } from './types/reminders/index.js';
16
16
  import { normalizeObjectEventTypeForApi, denormalizeObjectTypeFromApi, } from './utils/activity-helpers.js';
@@ -18,7 +18,7 @@ import { camelCaseKeys } from './utils/case-conversion.js';
18
18
  import { uploadMultipartFile } from './utils/multipart-upload.js';
19
19
  import { processTaskContent } from './utils/uncompletable-helpers.js';
20
20
  import { formatDateToYYYYMMDD } from './utils/url-helpers.js';
21
- import { validateAttachment, validateComment, validateCommentArray, validateCurrentUser, validateLabel, validateLabelArray, validateProject, validateProjectArray, validateSection, validateSectionArray, validateTask, validateTaskArray, validateUserArray, validateProductivityStats, validateReminder, validateReminderArray, validateLocationReminderArray, validateActivityEventArray, validateWorkspaceUserArray, validateWorkspaceInvitation, validateWorkspaceInvitationArray, validateWorkspacePlanDetails, validateJoinWorkspaceResult, validateWorkspace, validateWorkspaceArray, validateMemberActivityInfoArray, validateWorkspaceUserTaskArray, validateProjectActivityStats, validateProjectHealth, validateProjectHealthContext, validateProjectProgress, validateWorkspaceInsights, validateBackupArray, validateIdMappingArray, validateMovedIdArray, validateFolder, validateFolderArray, validateCollaboratorArray, validateCollaboratorStateArray, validateNoteArray, validateWorkspaceProject, validateWorkspaceProjectArray, parseSyncResponse, } from './utils/validators.js';
21
+ import { validateAttachment, validateComment, validateCommentArray, validateCurrentUser, validateLabel, validateLabelArray, validateProject, validateProjectArray, validateSection, validateSectionArray, validateTask, validateTaskArray, validateUserArray, validateProductivityStats, validateReminder, validateReminderArray, validateLocationReminderArray, validateActivityEventArray, validateWorkspaceUserArray, validateWorkspaceInvitation, validateWorkspaceInvitationArray, validateWorkspacePlanDetails, validateJoinWorkspaceResult, validateWorkspace, validateWorkspaceArray, validateMemberActivityInfoArray, validateWorkspaceUserTaskArray, validateProjectActivityStats, validateProjectHealth, validateProjectHealthContext, validateProjectProgress, validateWorkspaceInsights, validateBackupArray, validateIdMappingArray, validateMovedIdArray, validateFolder, validateFolderArray, validateGoal, validateGoalArray, validateCollaboratorArray, validateCollaboratorStateArray, validateNoteArray, validateWorkspaceProject, validateWorkspaceProjectArray, parseSyncResponse, } from './utils/validators.js';
22
22
  import { v4 as uuidv4 } from 'uuid';
23
23
  import { TodoistArgumentError, TodoistRequestError } from './types/index.js';
24
24
  import { DATE_FORMAT_TO_API, TIME_FORMAT_TO_API, DAY_OF_WEEK_TO_API, } from './types/sync/index.js';
@@ -1911,6 +1911,134 @@ export class TodoistApi {
1911
1911
  });
1912
1912
  return isSuccess(response);
1913
1913
  }
1914
+ // ── Goals ──
1915
+ async getGoals(args) {
1916
+ const { data: { results, nextCursor }, } = await request({
1917
+ httpMethod: 'GET',
1918
+ baseUri: this.syncApiBase,
1919
+ relativePath: ENDPOINT_REST_GOALS,
1920
+ apiToken: this.authToken,
1921
+ customFetch: this.customFetch,
1922
+ payload: args,
1923
+ });
1924
+ return {
1925
+ results: validateGoalArray(results),
1926
+ nextCursor,
1927
+ };
1928
+ }
1929
+ async searchGoals(args) {
1930
+ const { data: { results, nextCursor }, } = await request({
1931
+ httpMethod: 'GET',
1932
+ baseUri: this.syncApiBase,
1933
+ relativePath: ENDPOINT_REST_GOALS_SEARCH,
1934
+ apiToken: this.authToken,
1935
+ customFetch: this.customFetch,
1936
+ payload: args,
1937
+ });
1938
+ return {
1939
+ results: validateGoalArray(results),
1940
+ nextCursor,
1941
+ };
1942
+ }
1943
+ async getGoal(id) {
1944
+ z.string().parse(id);
1945
+ const response = await request({
1946
+ httpMethod: 'GET',
1947
+ baseUri: this.syncApiBase,
1948
+ relativePath: generatePath(ENDPOINT_REST_GOALS, id),
1949
+ apiToken: this.authToken,
1950
+ customFetch: this.customFetch,
1951
+ });
1952
+ return validateGoal(response.data);
1953
+ }
1954
+ async addGoal(args, requestId) {
1955
+ const response = await request({
1956
+ httpMethod: 'POST',
1957
+ baseUri: this.syncApiBase,
1958
+ relativePath: ENDPOINT_REST_GOALS,
1959
+ apiToken: this.authToken,
1960
+ customFetch: this.customFetch,
1961
+ payload: args,
1962
+ requestId: requestId,
1963
+ });
1964
+ return validateGoal(response.data);
1965
+ }
1966
+ async updateGoal(id, args, requestId) {
1967
+ z.string().parse(id);
1968
+ const response = await request({
1969
+ httpMethod: 'POST',
1970
+ baseUri: this.syncApiBase,
1971
+ relativePath: generatePath(ENDPOINT_REST_GOALS, id),
1972
+ apiToken: this.authToken,
1973
+ customFetch: this.customFetch,
1974
+ payload: args,
1975
+ requestId: requestId,
1976
+ });
1977
+ return validateGoal(response.data);
1978
+ }
1979
+ async deleteGoal(id, requestId) {
1980
+ z.string().parse(id);
1981
+ const response = await request({
1982
+ httpMethod: 'DELETE',
1983
+ baseUri: this.syncApiBase,
1984
+ relativePath: generatePath(ENDPOINT_REST_GOALS, id),
1985
+ apiToken: this.authToken,
1986
+ customFetch: this.customFetch,
1987
+ requestId: requestId,
1988
+ });
1989
+ return isSuccess(response);
1990
+ }
1991
+ async completeGoal(id, requestId) {
1992
+ z.string().parse(id);
1993
+ const response = await request({
1994
+ httpMethod: 'POST',
1995
+ baseUri: this.syncApiBase,
1996
+ relativePath: generatePath(ENDPOINT_REST_GOALS, id, GOAL_COMPLETE),
1997
+ apiToken: this.authToken,
1998
+ customFetch: this.customFetch,
1999
+ requestId: requestId,
2000
+ });
2001
+ return validateGoal(response.data);
2002
+ }
2003
+ async uncompleteGoal(id, requestId) {
2004
+ z.string().parse(id);
2005
+ const response = await request({
2006
+ httpMethod: 'POST',
2007
+ baseUri: this.syncApiBase,
2008
+ relativePath: generatePath(ENDPOINT_REST_GOALS, id, GOAL_UNCOMPLETE),
2009
+ apiToken: this.authToken,
2010
+ customFetch: this.customFetch,
2011
+ requestId: requestId,
2012
+ });
2013
+ return validateGoal(response.data);
2014
+ }
2015
+ async linkTaskToGoal({ goalId, taskId }, requestId) {
2016
+ z.string().parse(goalId);
2017
+ z.string().parse(taskId);
2018
+ const response = await request({
2019
+ httpMethod: 'POST',
2020
+ baseUri: this.syncApiBase,
2021
+ relativePath: generatePath(ENDPOINT_REST_GOALS, goalId, GOAL_TASKS),
2022
+ apiToken: this.authToken,
2023
+ customFetch: this.customFetch,
2024
+ payload: { itemId: taskId },
2025
+ requestId: requestId,
2026
+ });
2027
+ return validateGoal(response.data);
2028
+ }
2029
+ async unlinkTaskFromGoal({ goalId, taskId }, requestId) {
2030
+ z.string().parse(goalId);
2031
+ z.string().parse(taskId);
2032
+ const response = await request({
2033
+ httpMethod: 'DELETE',
2034
+ baseUri: this.syncApiBase,
2035
+ relativePath: generatePath(ENDPOINT_REST_GOALS, goalId, GOAL_TASKS, taskId),
2036
+ apiToken: this.authToken,
2037
+ customFetch: this.customFetch,
2038
+ requestId: requestId,
2039
+ });
2040
+ return isSuccess(response);
2041
+ }
1914
2042
  // ── Backups ──
1915
2043
  /**
1916
2044
  * Retrieves a list of available backups.
@@ -0,0 +1,2 @@
1
+ export * from './types.js';
2
+ export * from './requests.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -1,15 +1,12 @@
1
1
  import { z } from 'zod';
2
2
  /** Available goal owner types. */
3
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(),
4
+ export const GoalProgressSchema = z.looseObject({
5
+ totalTaskCount: z.number().int(),
6
+ completedTaskCount: z.number().int(),
8
7
  percentage: z.number(),
9
- })
10
- .passthrough();
11
- export const GoalSchema = z
12
- .object({
8
+ });
9
+ export const GoalSchema = z.looseObject({
13
10
  id: z.string(),
14
11
  ownerType: z.enum(GOAL_OWNER_TYPES),
15
12
  ownerId: z.string(),
@@ -26,5 +23,4 @@ export const GoalSchema = z
26
23
  creatorUid: z.string(),
27
24
  createdAt: z.coerce.date(),
28
25
  updatedAt: z.coerce.date(),
29
- })
30
- .passthrough();
26
+ });
@@ -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';
@@ -5,7 +5,6 @@ export * from './tooltips.js';
5
5
  export * from './notes.js';
6
6
  export * from './workspace-filters.js';
7
7
  export * from './workspace-goals.js';
8
- export * from './goals.js';
9
8
  export * from './calendars.js';
10
9
  export * from './reminders.js';
11
10
  export * from './completed-info.js';
@@ -1,6 +1,7 @@
1
1
  import { ActivityEventSchema } from '../types/activity/types.js';
2
2
  import { BackupSchema } from '../types/backups/types.js';
3
3
  import { AttachmentSchema, CommentSchema } from '../types/comments/types.js';
4
+ import { GoalSchema } from '../types/goals/types.js';
4
5
  import { IdMappingSchema, MovedIdSchema } from '../types/id-mappings/types.js';
5
6
  import { ProjectActivityStatsSchema, ProjectHealthSchema, ProjectHealthContextSchema, ProjectProgressSchema, WorkspaceInsightsSchema, } from '../types/insights/types.js';
6
7
  import { LabelSchema } from '../types/labels/types.js';
@@ -10,7 +11,7 @@ import { SectionSchema } from '../types/sections/types.js';
10
11
  import { TaskSchema } from '../types/tasks/types.js';
11
12
  import { UserSchema, CurrentUserSchema } from '../types/users/types.js';
12
13
  import { WorkspaceUserSchema, WorkspaceInvitationSchema, WorkspacePlanDetailsSchema, JoinWorkspaceResultSchema, WorkspaceSchema, MemberActivityInfoSchema, WorkspaceUserTaskSchema, } from '../types/workspaces/types.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
+ 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';
14
15
  function createValidator(schema) {
15
16
  return (input) => schema.parse(input);
16
17
  }
@@ -110,13 +111,13 @@ export const validateCollaboratorState = createValidator(CollaboratorStateSchema
110
111
  export const validateCollaboratorStateArray = createArrayValidator(validateCollaboratorState);
111
112
  export const validateFolder = createValidator(FolderSchema);
112
113
  export const validateFolderArray = createArrayValidator(validateFolder);
114
+ export const validateGoal = createValidator(GoalSchema);
115
+ export const validateGoalArray = createArrayValidator(validateGoal);
113
116
  export const validateNote = createValidator(NoteSchema);
114
117
  export const validateNoteArray = createArrayValidator(validateNote);
115
118
  export const validateTooltips = createValidator(TooltipsSchema);
116
119
  export const validateWorkspaceFilter = createValidator(WorkspaceFilterSchema);
117
120
  export const validateWorkspaceFilterArray = createArrayValidator(validateWorkspaceFilter);
118
- export const validateGoal = createValidator(GoalSchema);
119
- export const validateGoalArray = createArrayValidator(validateGoal);
120
121
  export const validateWorkspaceGoal = createValidator(WorkspaceGoalSchema);
121
122
  export const validateWorkspaceGoalArray = createArrayValidator(validateWorkspaceGoal);
122
123
  export const validateCalendar = createValidator(CalendarSchema);
@@ -58,6 +58,11 @@ export declare const ENDPOINT_GET_TOKEN = "access_token";
58
58
  export declare const ENDPOINT_REVOKE = "revoke";
59
59
  export declare const ENDPOINT_REGISTER = "register";
60
60
  export declare const ENDPOINT_REST_FOLDERS = "folders";
61
+ export declare const ENDPOINT_REST_GOALS = "goals";
62
+ export declare const ENDPOINT_REST_GOALS_SEARCH: string;
63
+ export declare const GOAL_COMPLETE = "complete";
64
+ export declare const GOAL_UNCOMPLETE = "uncomplete";
65
+ export declare const GOAL_TASKS = "items";
61
66
  export declare const ENDPOINT_REST_WORKSPACES = "workspaces";
62
67
  export declare const ENDPOINT_WORKSPACE_INVITATIONS = "workspaces/invitations";
63
68
  export declare const ENDPOINT_WORKSPACE_INVITATIONS_ALL = "workspaces/invitations/all";
@@ -4,6 +4,7 @@ import { Backup, GetBackupsArgs, DownloadBackupArgs } from './types/backups/inde
4
4
  import { Attachment, Comment, AddCommentArgs, UpdateCommentArgs, GetProjectCommentsArgs, GetTaskCommentsArgs, GetCommentsResponse } from './types/comments/index.js';
5
5
  import { GetOrCreateEmailArgs, GetOrCreateEmailResponse, DisableEmailArgs } from './types/emails/index.js';
6
6
  import { GetFoldersArgs, GetFoldersResponse, AddFolderArgs, UpdateFolderArgs } from './types/folders/index.js';
7
+ import type { Goal, GetGoalsArgs, GetGoalsResponse, SearchGoalsArgs, AddGoalArgs, UpdateGoalArgs, TaskLinkingArgs } from './types/goals/index.js';
7
8
  import { CustomFetch, CustomFetchResponse } from './types/http.js';
8
9
  import { IdMapping, MovedId, GetIdMappingsArgs, GetMovedIdsArgs } from './types/id-mappings/index.js';
9
10
  import { ProjectActivityStats, ProjectHealth, ProjectHealthContext, ProjectProgress, WorkspaceInsights, GetProjectActivityStatsArgs, GetWorkspaceInsightsArgs } from './types/insights/index.js';
@@ -758,6 +759,16 @@ export declare class TodoistApi {
758
759
  * @returns A promise that resolves to `true` if successful.
759
760
  */
760
761
  deleteFolder(id: string, requestId?: string): Promise<boolean>;
762
+ getGoals(args?: GetGoalsArgs): Promise<GetGoalsResponse>;
763
+ searchGoals(args: SearchGoalsArgs): Promise<GetGoalsResponse>;
764
+ getGoal(id: string): Promise<Goal>;
765
+ addGoal(args: AddGoalArgs, requestId?: string): Promise<Goal>;
766
+ updateGoal(id: string, args: UpdateGoalArgs, requestId?: string): Promise<Goal>;
767
+ deleteGoal(id: string, requestId?: string): Promise<boolean>;
768
+ completeGoal(id: string, requestId?: string): Promise<Goal>;
769
+ uncompleteGoal(id: string, requestId?: string): Promise<Goal>;
770
+ linkTaskToGoal({ goalId, taskId }: TaskLinkingArgs, requestId?: string): Promise<Goal>;
771
+ unlinkTaskFromGoal({ goalId, taskId }: TaskLinkingArgs, requestId?: string): Promise<boolean>;
761
772
  /**
762
773
  * Retrieves a list of available backups.
763
774
  *
@@ -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
+ };
@@ -4,8 +4,8 @@ export declare const GOAL_OWNER_TYPES: readonly ["USER", "WORKSPACE"];
4
4
  /** Goal owner type. */
5
5
  export type GoalOwnerType = (typeof GOAL_OWNER_TYPES)[number];
6
6
  export declare const GoalProgressSchema: z.ZodObject<{
7
- totalItemCount: z.ZodNumber;
8
- completedItemCount: z.ZodNumber;
7
+ totalTaskCount: z.ZodNumber;
8
+ completedTaskCount: z.ZodNumber;
9
9
  percentage: z.ZodNumber;
10
10
  }, z.core.$loose>;
11
11
  export type GoalProgress = z.infer<typeof GoalProgressSchema>;
@@ -26,12 +26,16 @@ export declare const GoalSchema: z.ZodObject<{
26
26
  responsibleUid: z.ZodNullable<z.ZodString>;
27
27
  isDeleted: z.ZodBoolean;
28
28
  progress: z.ZodOptional<z.ZodObject<{
29
- totalItemCount: z.ZodNumber;
30
- completedItemCount: z.ZodNumber;
29
+ totalTaskCount: z.ZodNumber;
30
+ completedTaskCount: z.ZodNumber;
31
31
  percentage: z.ZodNumber;
32
32
  }, z.core.$loose>>;
33
33
  creatorUid: z.ZodString;
34
34
  createdAt: z.ZodCoercedDate<unknown>;
35
35
  updatedAt: z.ZodCoercedDate<unknown>;
36
36
  }, z.core.$loose>;
37
+ /**
38
+ * Represents a goal in Todoist.
39
+ * Goals support dual ownership: personal (ownerType=USER) and workspace (ownerType=WORKSPACE).
40
+ */
37
41
  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';
@@ -1,4 +1,4 @@
1
- import type { GoalOwnerType } from '../resources/goals.js';
1
+ import type { GoalOwnerType } from '../../goals/types.js';
2
2
  export type GoalAddArgs = {
3
3
  ownerType: GoalOwnerType;
4
4
  ownerId: string;
@@ -5,7 +5,6 @@ export * from './tooltips.js';
5
5
  export * from './notes.js';
6
6
  export * from './workspace-filters.js';
7
7
  export * from './workspace-goals.js';
8
- export * from './goals.js';
9
8
  export * from './calendars.js';
10
9
  export * from './reminders.js';
11
10
  export * from './completed-info.js';
@@ -32,8 +32,8 @@ 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
- PROJECT: "PROJECT";
36
35
  WORKSPACE: "WORKSPACE";
36
+ PROJECT: "PROJECT";
37
37
  LABEL: "LABEL";
38
38
  ASSIGNEE: "ASSIGNEE";
39
39
  ADDED_DATE: "ADDED_DATE";
@@ -46,8 +46,8 @@ export declare const SORTED_BY_OPTIONS: readonly ["MANUAL", "ALPHABETICALLY", "A
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
- PROJECT: "PROJECT";
50
49
  WORKSPACE: "WORKSPACE";
50
+ PROJECT: "PROJECT";
51
51
  ASSIGNEE: "ASSIGNEE";
52
52
  ADDED_DATE: "ADDED_DATE";
53
53
  DUE_DATE: "DUE_DATE";
@@ -92,8 +92,8 @@ 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
- PROJECT: "PROJECT";
96
95
  WORKSPACE: "WORKSPACE";
96
+ PROJECT: "PROJECT";
97
97
  LABEL: "LABEL";
98
98
  ASSIGNEE: "ASSIGNEE";
99
99
  ADDED_DATE: "ADDED_DATE";
@@ -109,8 +109,8 @@ 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
- PROJECT: "PROJECT";
113
112
  WORKSPACE: "WORKSPACE";
113
+ PROJECT: "PROJECT";
114
114
  ASSIGNEE: "ASSIGNEE";
115
115
  ADDED_DATE: "ADDED_DATE";
116
116
  DUE_DATE: "DUE_DATE";
@@ -133,8 +133,8 @@ export declare const ProjectViewOptionsDefaultsSchema: z.ZodObject<{
133
133
  CALENDAR: "CALENDAR";
134
134
  }>>>;
135
135
  groupedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
136
- PROJECT: "PROJECT";
137
136
  WORKSPACE: "WORKSPACE";
137
+ PROJECT: "PROJECT";
138
138
  LABEL: "LABEL";
139
139
  ASSIGNEE: "ASSIGNEE";
140
140
  ADDED_DATE: "ADDED_DATE";
@@ -143,8 +143,8 @@ export declare const ProjectViewOptionsDefaultsSchema: z.ZodObject<{
143
143
  PRIORITY: "PRIORITY";
144
144
  }>>>;
145
145
  sortedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
146
- PROJECT: "PROJECT";
147
146
  WORKSPACE: "WORKSPACE";
147
+ PROJECT: "PROJECT";
148
148
  ASSIGNEE: "ASSIGNEE";
149
149
  ADDED_DATE: "ADDED_DATE";
150
150
  DUE_DATE: "DUE_DATE";
@@ -1,9 +1,10 @@
1
+ import type { Goal } from '../goals/types.js';
1
2
  import type { Label } from '../labels/types.js';
2
3
  import type { PersonalProject, WorkspaceProject } from '../projects/types.js';
3
4
  import type { Section } from '../sections/types.js';
4
5
  import type { Task } from '../tasks/types.js';
5
6
  import type { WorkspaceUser } from '../workspaces/types.js';
6
- import type { Filter, Collaborator, CollaboratorState, Folder, Note, Tooltips, WorkspaceFilter, WorkspaceGoal, Goal, Calendar, CalendarAccount, Reminder, CompletedInfo, ViewOptions, ProjectViewOptionsDefaults, UserPlanLimits, LiveNotification, SyncWorkspace, SyncUser, UserSettings, LocationReminder, Suggestion } from './resources/index.js';
7
+ import type { Filter, Collaborator, CollaboratorState, Folder, Note, Tooltips, WorkspaceFilter, WorkspaceGoal, Calendar, CalendarAccount, Reminder, CompletedInfo, ViewOptions, ProjectViewOptionsDefaults, UserPlanLimits, LiveNotification, SyncWorkspace, SyncUser, UserSettings, LocationReminder, Suggestion } from './resources/index.js';
7
8
  export type SyncError = {
8
9
  error: string;
9
10
  errorCode: number;
@@ -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
  };
@@ -745,6 +745,54 @@ export declare const validateFolderArray: (input: unknown) => {
745
745
  defaultOrder: number;
746
746
  childOrder: number;
747
747
  }[];
748
+ export declare const validateGoal: (input: unknown) => {
749
+ [x: string]: unknown;
750
+ id: string;
751
+ ownerType: "USER" | "WORKSPACE";
752
+ ownerId: string;
753
+ name: string;
754
+ description: string | null;
755
+ deadline: string | null;
756
+ parentGoalId: string | null;
757
+ childOrder: number;
758
+ isCompleted: boolean;
759
+ completedAt: Date | null;
760
+ responsibleUid: string | null;
761
+ isDeleted: boolean;
762
+ creatorUid: string;
763
+ createdAt: Date;
764
+ updatedAt: Date;
765
+ progress?: {
766
+ [x: string]: unknown;
767
+ totalTaskCount: number;
768
+ completedTaskCount: number;
769
+ percentage: number;
770
+ } | undefined;
771
+ };
772
+ export declare const validateGoalArray: (input: unknown) => {
773
+ [x: string]: unknown;
774
+ id: string;
775
+ ownerType: "USER" | "WORKSPACE";
776
+ ownerId: string;
777
+ name: string;
778
+ description: string | null;
779
+ deadline: string | null;
780
+ parentGoalId: string | null;
781
+ childOrder: number;
782
+ isCompleted: boolean;
783
+ completedAt: Date | null;
784
+ responsibleUid: string | null;
785
+ isDeleted: boolean;
786
+ creatorUid: string;
787
+ createdAt: Date;
788
+ updatedAt: Date;
789
+ progress?: {
790
+ [x: string]: unknown;
791
+ totalTaskCount: number;
792
+ completedTaskCount: number;
793
+ percentage: number;
794
+ } | undefined;
795
+ }[];
748
796
  export declare const validateNote: (input: unknown) => {
749
797
  [x: string]: unknown;
750
798
  id: string;
@@ -834,54 +882,6 @@ export declare const validateWorkspaceFilterArray: (input: unknown) => {
834
882
  createdAt: string;
835
883
  updatedAt: string;
836
884
  }[];
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
- }[];
885
885
  export declare const validateWorkspaceGoal: (input: unknown) => {
886
886
  [x: string]: unknown;
887
887
  id: string;
@@ -1122,30 +1122,30 @@ export declare const validateViewOptions: (input: unknown) => {
1122
1122
  [x: string]: unknown;
1123
1123
  viewType: "PROJECT" | "TODAY" | "UPCOMING" | "LABEL" | "FILTER" | "WORKSPACE_FILTER" | "SEARCH" | "TEMPLATE_PREVIEW" | "TASK_DETAIL" | "AUTOMATION" | "ASSIGNED" | "OVERDUE" | "WORKSPACE_OVERVIEW";
1124
1124
  objectId?: string | undefined;
1125
- groupedBy?: "PROJECT" | "WORKSPACE" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
1125
+ groupedBy?: "WORKSPACE" | "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
1126
1126
  filteredBy?: string | null | undefined;
1127
1127
  viewMode?: "LIST" | "BOARD" | "CALENDAR" | undefined;
1128
1128
  showCompletedTasks?: boolean | undefined;
1129
- sortedBy?: "PROJECT" | "WORKSPACE" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1129
+ sortedBy?: "WORKSPACE" | "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1130
1130
  sortOrder?: "ASC" | "DESC" | null | undefined;
1131
1131
  };
1132
1132
  export declare const validateViewOptionsArray: (input: unknown) => {
1133
1133
  [x: string]: unknown;
1134
1134
  viewType: "PROJECT" | "TODAY" | "UPCOMING" | "LABEL" | "FILTER" | "WORKSPACE_FILTER" | "SEARCH" | "TEMPLATE_PREVIEW" | "TASK_DETAIL" | "AUTOMATION" | "ASSIGNED" | "OVERDUE" | "WORKSPACE_OVERVIEW";
1135
1135
  objectId?: string | undefined;
1136
- groupedBy?: "PROJECT" | "WORKSPACE" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
1136
+ groupedBy?: "WORKSPACE" | "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
1137
1137
  filteredBy?: string | null | undefined;
1138
1138
  viewMode?: "LIST" | "BOARD" | "CALENDAR" | undefined;
1139
1139
  showCompletedTasks?: boolean | undefined;
1140
- sortedBy?: "PROJECT" | "WORKSPACE" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1140
+ sortedBy?: "WORKSPACE" | "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1141
1141
  sortOrder?: "ASC" | "DESC" | null | undefined;
1142
1142
  }[];
1143
1143
  export declare const validateProjectViewOptionsDefaults: (input: unknown) => {
1144
1144
  [x: string]: unknown;
1145
1145
  projectId: string;
1146
1146
  viewMode?: "LIST" | "BOARD" | "CALENDAR" | 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;
1147
+ groupedBy?: "WORKSPACE" | "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
1148
+ sortedBy?: "WORKSPACE" | "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1149
1149
  sortOrder?: "ASC" | "DESC" | null | undefined;
1150
1150
  showCompletedTasks?: boolean | undefined;
1151
1151
  filteredBy?: string | null | undefined;
@@ -1158,8 +1158,8 @@ export declare const validateProjectViewOptionsDefaultsArray: (input: unknown) =
1158
1158
  [x: string]: unknown;
1159
1159
  projectId: string;
1160
1160
  viewMode?: "LIST" | "BOARD" | "CALENDAR" | 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;
1161
+ groupedBy?: "WORKSPACE" | "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | null | undefined;
1162
+ sortedBy?: "WORKSPACE" | "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
1163
1163
  sortOrder?: "ASC" | "DESC" | null | undefined;
1164
1164
  showCompletedTasks?: boolean | undefined;
1165
1165
  filteredBy?: string | null | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doist/todoist-sdk",
3
- "version": "8.4.0-next.1",
3
+ "version": "8.4.0-next.2",
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",