@doist/todoist-sdk 8.5.0-next.1 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/consts/endpoints.js +1 -6
- package/dist/cjs/test-utils/test-defaults.js +15 -12
- package/dist/cjs/todoist-api.js +0 -128
- package/dist/cjs/types/activity/types.js +1 -1
- package/dist/cjs/types/comments/types.js +1 -1
- package/dist/cjs/types/index.js +0 -1
- package/dist/cjs/types/insights/types.js +6 -4
- package/dist/cjs/types/projects/types.js +2 -2
- package/dist/cjs/types/sections/types.js +3 -3
- package/dist/cjs/types/sync/commands/index.js +0 -1
- package/dist/cjs/types/sync/resource-types.js +0 -1
- package/dist/cjs/types/sync/resources/live-notifications.js +1 -1
- package/dist/cjs/types/sync/resources/notes.js +1 -1
- package/dist/cjs/types/sync/resources/user.js +4 -4
- package/dist/cjs/types/sync/resources/workspace-filters.js +2 -2
- package/dist/cjs/types/sync/resources/workspace-goals.js +2 -2
- package/dist/cjs/types/sync/resources/workspaces.js +3 -3
- package/dist/cjs/types/sync/response.js +10 -12
- package/dist/cjs/types/tasks/types.js +3 -3
- package/dist/cjs/types/workspaces/types.js +3 -3
- package/dist/cjs/utils/validators.js +46 -48
- package/dist/esm/consts/endpoints.js +0 -5
- package/dist/esm/test-utils/test-defaults.js +15 -12
- package/dist/esm/todoist-api.js +2 -130
- package/dist/esm/types/activity/types.js +1 -1
- package/dist/esm/types/comments/types.js +1 -1
- package/dist/esm/types/index.js +0 -1
- package/dist/esm/types/insights/types.js +6 -4
- package/dist/esm/types/projects/types.js +2 -2
- package/dist/esm/types/sections/types.js +3 -3
- package/dist/esm/types/sync/commands/index.js +0 -1
- package/dist/esm/types/sync/resource-types.js +0 -1
- package/dist/esm/types/sync/resources/live-notifications.js +1 -1
- package/dist/esm/types/sync/resources/notes.js +1 -1
- package/dist/esm/types/sync/resources/user.js +4 -4
- package/dist/esm/types/sync/resources/workspace-filters.js +2 -2
- package/dist/esm/types/sync/resources/workspace-goals.js +2 -2
- package/dist/esm/types/sync/resources/workspaces.js +3 -3
- package/dist/esm/types/sync/response.js +0 -2
- package/dist/esm/types/tasks/types.js +3 -3
- package/dist/esm/types/workspaces/types.js +3 -3
- package/dist/esm/utils/validators.js +0 -2
- package/dist/types/consts/endpoints.d.ts +2 -7
- package/dist/types/test-utils/test-defaults.d.ts +13 -13
- package/dist/types/todoist-api.d.ts +1 -12
- package/dist/types/types/activity/types.d.ts +1 -1
- package/dist/types/types/comments/types.d.ts +4 -4
- package/dist/types/types/folders/requests.d.ts +2 -2
- package/dist/types/types/index.d.ts +0 -1
- package/dist/types/types/insights/types.d.ts +9 -9
- package/dist/types/types/projects/requests.d.ts +1 -1
- package/dist/types/types/projects/types.d.ts +18 -18
- package/dist/types/types/sections/types.d.ts +9 -9
- package/dist/types/types/sync/commands/index.d.ts +0 -9
- package/dist/types/types/sync/commands/workspaces.d.ts +1 -1
- package/dist/types/types/sync/resource-types.d.ts +1 -1
- package/dist/types/types/sync/resources/live-notifications.d.ts +1 -1
- package/dist/types/types/sync/resources/notes.d.ts +1 -1
- package/dist/types/types/sync/resources/user.d.ts +4 -4
- package/dist/types/types/sync/resources/view-options.d.ts +6 -6
- package/dist/types/types/sync/resources/workspace-filters.d.ts +2 -2
- package/dist/types/types/sync/resources/workspace-goals.d.ts +2 -2
- package/dist/types/types/sync/resources/workspaces.d.ts +8 -8
- package/dist/types/types/sync/response.d.ts +45 -70
- package/dist/types/types/tasks/requests.d.ts +0 -1
- package/dist/types/types/tasks/types.d.ts +9 -9
- package/dist/types/types/workspaces/requests.d.ts +7 -7
- package/dist/types/types/workspaces/types.d.ts +6 -6
- package/dist/types/utils/validators.d.ts +64 -111
- package/package.json +1 -1
- package/dist/cjs/types/goals/index.js +0 -18
- package/dist/cjs/types/goals/requests.js +0 -2
- package/dist/cjs/types/goals/types.js +0 -29
- package/dist/cjs/types/sync/commands/goals.js +0 -2
- package/dist/esm/types/goals/index.js +0 -2
- package/dist/esm/types/goals/requests.js +0 -1
- package/dist/esm/types/goals/types.js +0 -26
- package/dist/esm/types/sync/commands/goals.js +0 -1
- package/dist/types/types/goals/index.d.ts +0 -2
- package/dist/types/types/goals/requests.d.ts +0 -33
- package/dist/types/types/goals/types.d.ts +0 -41
- package/dist/types/types/sync/commands/goals.d.ts +0 -33
|
@@ -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.
|
|
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;
|
|
5
5
|
exports.getSyncBaseUri = getSyncBaseUri;
|
|
6
6
|
exports.getAuthBaseUri = getAuthBaseUri;
|
|
7
7
|
exports.getWorkspaceInvitationAcceptEndpoint = getWorkspaceInvitationAcceptEndpoint;
|
|
@@ -86,11 +86,6 @@ 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';
|
|
94
89
|
// Workspace endpoints
|
|
95
90
|
exports.ENDPOINT_REST_WORKSPACES = 'workspaces';
|
|
96
91
|
exports.ENDPOINT_WORKSPACE_INVITATIONS = 'workspaces/invitations';
|
|
@@ -18,6 +18,9 @@ const DEFAULT_PARENT_ID = '5678';
|
|
|
18
18
|
const DEFAULT_ASSIGNEE = '1234';
|
|
19
19
|
const DEFAULT_CREATOR = '1234';
|
|
20
20
|
const DEFAULT_DATE = '2020-09-08T12:00:00Z';
|
|
21
|
+
function defaultDate() {
|
|
22
|
+
return new Date(DEFAULT_DATE);
|
|
23
|
+
}
|
|
21
24
|
const DEFAULT_ENTITY_COLOR = 'berry_red';
|
|
22
25
|
const DEFAULT_LABELS = ['personal', 'work', 'hobby'];
|
|
23
26
|
const DEFAULT_USER_ID = '5';
|
|
@@ -67,9 +70,9 @@ exports.DEFAULT_TASK = {
|
|
|
67
70
|
duration: exports.DEFAULT_DURATION,
|
|
68
71
|
checked: false,
|
|
69
72
|
isDeleted: DEFAULT_IS_DELETED,
|
|
70
|
-
addedAt:
|
|
73
|
+
addedAt: defaultDate(),
|
|
71
74
|
completedAt: null,
|
|
72
|
-
updatedAt:
|
|
75
|
+
updatedAt: defaultDate(),
|
|
73
76
|
due: exports.DEFAULT_DUE_DATE,
|
|
74
77
|
priority: exports.DEFAULT_TASK_PRIORITY,
|
|
75
78
|
childOrder: exports.DEFAULT_ORDER,
|
|
@@ -95,9 +98,9 @@ exports.TASK_WITH_OPTIONALS_AS_NULL = {
|
|
|
95
98
|
duration: null,
|
|
96
99
|
checked: false,
|
|
97
100
|
isDeleted: DEFAULT_IS_DELETED,
|
|
98
|
-
addedAt:
|
|
101
|
+
addedAt: defaultDate(),
|
|
99
102
|
completedAt: null,
|
|
100
|
-
updatedAt:
|
|
103
|
+
updatedAt: defaultDate(),
|
|
101
104
|
due: null,
|
|
102
105
|
priority: exports.DEFAULT_TASK_PRIORITY,
|
|
103
106
|
childOrder: exports.DEFAULT_ORDER,
|
|
@@ -122,8 +125,8 @@ exports.DEFAULT_PROJECT = {
|
|
|
122
125
|
isArchived: DEFAULT_IS_ARCHIVED,
|
|
123
126
|
isDeleted: DEFAULT_IS_DELETED,
|
|
124
127
|
isFrozen: DEFAULT_IS_FROZEN,
|
|
125
|
-
createdAt:
|
|
126
|
-
updatedAt:
|
|
128
|
+
createdAt: defaultDate(),
|
|
129
|
+
updatedAt: defaultDate(),
|
|
127
130
|
defaultOrder: exports.DEFAULT_ORDER,
|
|
128
131
|
description: '',
|
|
129
132
|
isCollapsed: DEFAULT_IS_COLLAPSED,
|
|
@@ -143,8 +146,8 @@ exports.DEFAULT_WORKSPACE_PROJECT = {
|
|
|
143
146
|
isArchived: DEFAULT_IS_ARCHIVED,
|
|
144
147
|
isDeleted: DEFAULT_IS_DELETED,
|
|
145
148
|
isFrozen: DEFAULT_IS_FROZEN,
|
|
146
|
-
createdAt:
|
|
147
|
-
updatedAt:
|
|
149
|
+
createdAt: defaultDate(),
|
|
150
|
+
updatedAt: defaultDate(),
|
|
148
151
|
defaultOrder: exports.DEFAULT_ORDER,
|
|
149
152
|
description: '',
|
|
150
153
|
isCollapsed: DEFAULT_IS_COLLAPSED,
|
|
@@ -161,8 +164,8 @@ exports.DEFAULT_SECTION = {
|
|
|
161
164
|
id: DEFAULT_SECTION_ID,
|
|
162
165
|
userId: DEFAULT_USER_ID,
|
|
163
166
|
projectId: exports.DEFAULT_PROJECT_ID,
|
|
164
|
-
addedAt: '2025-03-28T14:01:23.334881Z',
|
|
165
|
-
updatedAt: '2025-03-28T14:01:23.334885Z',
|
|
167
|
+
addedAt: new Date('2025-03-28T14:01:23.334881Z'),
|
|
168
|
+
updatedAt: new Date('2025-03-28T14:01:23.334885Z'),
|
|
166
169
|
archivedAt: null,
|
|
167
170
|
name: DEFAULT_SECTION_NAME,
|
|
168
171
|
sectionOrder: exports.DEFAULT_ORDER,
|
|
@@ -200,7 +203,7 @@ exports.DEFAULT_RAW_COMMENT = {
|
|
|
200
203
|
fileAttachment: exports.DEFAULT_ATTACHMENT,
|
|
201
204
|
uidsToNotify: null,
|
|
202
205
|
isDeleted: false,
|
|
203
|
-
postedAt:
|
|
206
|
+
postedAt: defaultDate(),
|
|
204
207
|
reactions: DEFAULT_COMMENT_REACTIONS,
|
|
205
208
|
itemId: exports.DEFAULT_TASK_ID,
|
|
206
209
|
};
|
|
@@ -281,7 +284,7 @@ exports.DEFAULT_NOTE = {
|
|
|
281
284
|
id: DEFAULT_COMMENT_ID,
|
|
282
285
|
projectId: exports.DEFAULT_PROJECT_ID,
|
|
283
286
|
content: DEFAULT_COMMENT_CONTENT,
|
|
284
|
-
postedAt:
|
|
287
|
+
postedAt: defaultDate(),
|
|
285
288
|
fileAttachment: exports.DEFAULT_ATTACHMENT,
|
|
286
289
|
postedUid: DEFAULT_USER_ID,
|
|
287
290
|
uidsToNotify: null,
|
package/dist/cjs/todoist-api.js
CHANGED
|
@@ -1919,134 +1919,6 @@ class TodoistApi {
|
|
|
1919
1919
|
});
|
|
1920
1920
|
return (0, http_client_1.isSuccess)(response);
|
|
1921
1921
|
}
|
|
1922
|
-
// ── Goals ──
|
|
1923
|
-
async getGoals(args) {
|
|
1924
|
-
const { data: { results, nextCursor }, } = await (0, http_client_1.request)({
|
|
1925
|
-
httpMethod: 'GET',
|
|
1926
|
-
baseUri: this.syncApiBase,
|
|
1927
|
-
relativePath: endpoints_1.ENDPOINT_REST_GOALS,
|
|
1928
|
-
apiToken: this.authToken,
|
|
1929
|
-
customFetch: this.customFetch,
|
|
1930
|
-
payload: args,
|
|
1931
|
-
});
|
|
1932
|
-
return {
|
|
1933
|
-
results: (0, validators_1.validateGoalArray)(results),
|
|
1934
|
-
nextCursor,
|
|
1935
|
-
};
|
|
1936
|
-
}
|
|
1937
|
-
async searchGoals(args) {
|
|
1938
|
-
const { data: { results, nextCursor }, } = await (0, http_client_1.request)({
|
|
1939
|
-
httpMethod: 'GET',
|
|
1940
|
-
baseUri: this.syncApiBase,
|
|
1941
|
-
relativePath: endpoints_1.ENDPOINT_REST_GOALS_SEARCH,
|
|
1942
|
-
apiToken: this.authToken,
|
|
1943
|
-
customFetch: this.customFetch,
|
|
1944
|
-
payload: args,
|
|
1945
|
-
});
|
|
1946
|
-
return {
|
|
1947
|
-
results: (0, validators_1.validateGoalArray)(results),
|
|
1948
|
-
nextCursor,
|
|
1949
|
-
};
|
|
1950
|
-
}
|
|
1951
|
-
async getGoal(id) {
|
|
1952
|
-
zod_1.z.string().parse(id);
|
|
1953
|
-
const response = await (0, http_client_1.request)({
|
|
1954
|
-
httpMethod: 'GET',
|
|
1955
|
-
baseUri: this.syncApiBase,
|
|
1956
|
-
relativePath: generatePath(endpoints_1.ENDPOINT_REST_GOALS, id),
|
|
1957
|
-
apiToken: this.authToken,
|
|
1958
|
-
customFetch: this.customFetch,
|
|
1959
|
-
});
|
|
1960
|
-
return (0, validators_1.validateGoal)(response.data);
|
|
1961
|
-
}
|
|
1962
|
-
async addGoal(args, requestId) {
|
|
1963
|
-
const response = await (0, http_client_1.request)({
|
|
1964
|
-
httpMethod: 'POST',
|
|
1965
|
-
baseUri: this.syncApiBase,
|
|
1966
|
-
relativePath: endpoints_1.ENDPOINT_REST_GOALS,
|
|
1967
|
-
apiToken: this.authToken,
|
|
1968
|
-
customFetch: this.customFetch,
|
|
1969
|
-
payload: args,
|
|
1970
|
-
requestId: requestId,
|
|
1971
|
-
});
|
|
1972
|
-
return (0, validators_1.validateGoal)(response.data);
|
|
1973
|
-
}
|
|
1974
|
-
async updateGoal(id, args, requestId) {
|
|
1975
|
-
zod_1.z.string().parse(id);
|
|
1976
|
-
const response = await (0, http_client_1.request)({
|
|
1977
|
-
httpMethod: 'POST',
|
|
1978
|
-
baseUri: this.syncApiBase,
|
|
1979
|
-
relativePath: generatePath(endpoints_1.ENDPOINT_REST_GOALS, id),
|
|
1980
|
-
apiToken: this.authToken,
|
|
1981
|
-
customFetch: this.customFetch,
|
|
1982
|
-
payload: args,
|
|
1983
|
-
requestId: requestId,
|
|
1984
|
-
});
|
|
1985
|
-
return (0, validators_1.validateGoal)(response.data);
|
|
1986
|
-
}
|
|
1987
|
-
async deleteGoal(id, requestId) {
|
|
1988
|
-
zod_1.z.string().parse(id);
|
|
1989
|
-
const response = await (0, http_client_1.request)({
|
|
1990
|
-
httpMethod: 'DELETE',
|
|
1991
|
-
baseUri: this.syncApiBase,
|
|
1992
|
-
relativePath: generatePath(endpoints_1.ENDPOINT_REST_GOALS, id),
|
|
1993
|
-
apiToken: this.authToken,
|
|
1994
|
-
customFetch: this.customFetch,
|
|
1995
|
-
requestId: requestId,
|
|
1996
|
-
});
|
|
1997
|
-
return (0, http_client_1.isSuccess)(response);
|
|
1998
|
-
}
|
|
1999
|
-
async completeGoal(id, requestId) {
|
|
2000
|
-
zod_1.z.string().parse(id);
|
|
2001
|
-
const response = await (0, http_client_1.request)({
|
|
2002
|
-
httpMethod: 'POST',
|
|
2003
|
-
baseUri: this.syncApiBase,
|
|
2004
|
-
relativePath: generatePath(endpoints_1.ENDPOINT_REST_GOALS, id, endpoints_1.GOAL_COMPLETE),
|
|
2005
|
-
apiToken: this.authToken,
|
|
2006
|
-
customFetch: this.customFetch,
|
|
2007
|
-
requestId: requestId,
|
|
2008
|
-
});
|
|
2009
|
-
return (0, validators_1.validateGoal)(response.data);
|
|
2010
|
-
}
|
|
2011
|
-
async uncompleteGoal(id, requestId) {
|
|
2012
|
-
zod_1.z.string().parse(id);
|
|
2013
|
-
const response = await (0, http_client_1.request)({
|
|
2014
|
-
httpMethod: 'POST',
|
|
2015
|
-
baseUri: this.syncApiBase,
|
|
2016
|
-
relativePath: generatePath(endpoints_1.ENDPOINT_REST_GOALS, id, endpoints_1.GOAL_UNCOMPLETE),
|
|
2017
|
-
apiToken: this.authToken,
|
|
2018
|
-
customFetch: this.customFetch,
|
|
2019
|
-
requestId: requestId,
|
|
2020
|
-
});
|
|
2021
|
-
return (0, validators_1.validateGoal)(response.data);
|
|
2022
|
-
}
|
|
2023
|
-
async linkTaskToGoal({ goalId, taskId }, requestId) {
|
|
2024
|
-
zod_1.z.string().parse(goalId);
|
|
2025
|
-
zod_1.z.string().parse(taskId);
|
|
2026
|
-
const response = await (0, http_client_1.request)({
|
|
2027
|
-
httpMethod: 'POST',
|
|
2028
|
-
baseUri: this.syncApiBase,
|
|
2029
|
-
relativePath: generatePath(endpoints_1.ENDPOINT_REST_GOALS, goalId, endpoints_1.GOAL_TASKS),
|
|
2030
|
-
apiToken: this.authToken,
|
|
2031
|
-
customFetch: this.customFetch,
|
|
2032
|
-
payload: { itemId: taskId },
|
|
2033
|
-
requestId: requestId,
|
|
2034
|
-
});
|
|
2035
|
-
return (0, validators_1.validateGoal)(response.data);
|
|
2036
|
-
}
|
|
2037
|
-
async unlinkTaskFromGoal({ goalId, taskId }, requestId) {
|
|
2038
|
-
zod_1.z.string().parse(goalId);
|
|
2039
|
-
zod_1.z.string().parse(taskId);
|
|
2040
|
-
const response = await (0, http_client_1.request)({
|
|
2041
|
-
httpMethod: 'DELETE',
|
|
2042
|
-
baseUri: this.syncApiBase,
|
|
2043
|
-
relativePath: generatePath(endpoints_1.ENDPOINT_REST_GOALS, goalId, endpoints_1.GOAL_TASKS, taskId),
|
|
2044
|
-
apiToken: this.authToken,
|
|
2045
|
-
customFetch: this.customFetch,
|
|
2046
|
-
requestId: requestId,
|
|
2047
|
-
});
|
|
2048
|
-
return (0, http_client_1.isSuccess)(response);
|
|
2049
|
-
}
|
|
2050
1922
|
// ── Backups ──
|
|
2051
1923
|
/**
|
|
2052
1924
|
* Retrieves a list of available backups.
|
|
@@ -15,7 +15,7 @@ exports.ActivityEventSchema = zod_1.z
|
|
|
15
15
|
objectType: zod_1.z.string(),
|
|
16
16
|
objectId: zod_1.z.string(),
|
|
17
17
|
eventType: zod_1.z.string(),
|
|
18
|
-
eventDate: zod_1.z.
|
|
18
|
+
eventDate: zod_1.z.coerce.date(),
|
|
19
19
|
id: zod_1.z
|
|
20
20
|
.union([zod_1.z.string(), zod_1.z.number()])
|
|
21
21
|
.transform((val) => { var _a; return (_a = val === null || val === void 0 ? void 0 : val.toString()) !== null && _a !== void 0 ? _a : null; })
|
|
@@ -38,7 +38,7 @@ exports.RawCommentSchema = zod_1.z
|
|
|
38
38
|
itemId: zod_1.z.string().optional(),
|
|
39
39
|
projectId: zod_1.z.string().optional(),
|
|
40
40
|
content: zod_1.z.string(),
|
|
41
|
-
postedAt: zod_1.z.
|
|
41
|
+
postedAt: zod_1.z.coerce.date(),
|
|
42
42
|
fileAttachment: exports.AttachmentSchema.nullable(),
|
|
43
43
|
postedUid: zod_1.z.string(),
|
|
44
44
|
uidsToNotify: zod_1.z.array(zod_1.z.string()).nullable(),
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -25,7 +25,6 @@ __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);
|
|
29
28
|
__exportStar(require("./insights"), exports);
|
|
30
29
|
__exportStar(require("./backups"), exports);
|
|
31
30
|
__exportStar(require("./id-mappings"), exports);
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.WorkspaceInsightsSchema = exports.ProjectInsightSchema = exports.ProjectProgressSchema = exports.ProjectHealthContextSchema = exports.TaskContextSchema = exports.ProjectMetricsSchema = exports.ProjectHealthSchema = exports.TaskRecommendationSchema = exports.HEALTH_STATUSES = exports.ProjectActivityStatsSchema = exports.WeekRollupSchema = exports.DayActivitySchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.DayActivitySchema = zod_1.z.object({
|
|
6
|
+
// Kept as string: this is a calendar-day bucket (e.g. '2025-01-13'), not a timestamp.
|
|
7
|
+
// Coercing to Date would create UTC midnight, causing day-shift for non-UTC consumers.
|
|
6
8
|
date: zod_1.z.string(),
|
|
7
9
|
totalCount: zod_1.z.number().int(),
|
|
8
10
|
});
|
|
@@ -34,7 +36,7 @@ exports.ProjectHealthSchema = zod_1.z.object({
|
|
|
34
36
|
descriptionSummary: zod_1.z.string().nullable().optional(),
|
|
35
37
|
taskRecommendations: zod_1.z.array(exports.TaskRecommendationSchema).nullable().optional(),
|
|
36
38
|
projectId: zod_1.z.string().nullable().optional(),
|
|
37
|
-
updatedAt: zod_1.z.
|
|
39
|
+
updatedAt: zod_1.z.coerce.date().nullable().optional(),
|
|
38
40
|
isStale: zod_1.z.boolean().default(false),
|
|
39
41
|
updateInProgress: zod_1.z.boolean().default(false),
|
|
40
42
|
});
|
|
@@ -53,9 +55,9 @@ exports.TaskContextSchema = zod_1.z.object({
|
|
|
53
55
|
deadline: zod_1.z.string().nullable().optional(),
|
|
54
56
|
priority: zod_1.z.string(),
|
|
55
57
|
isCompleted: zod_1.z.boolean(),
|
|
56
|
-
createdAt: zod_1.z.
|
|
57
|
-
updatedAt: zod_1.z.
|
|
58
|
-
completedAt: zod_1.z.
|
|
58
|
+
createdAt: zod_1.z.coerce.date(),
|
|
59
|
+
updatedAt: zod_1.z.coerce.date(),
|
|
60
|
+
completedAt: zod_1.z.coerce.date().nullable(),
|
|
59
61
|
completedByUid: zod_1.z.string().nullable(),
|
|
60
62
|
labels: zod_1.z.array(zod_1.z.string()),
|
|
61
63
|
});
|
|
@@ -12,13 +12,13 @@ exports.BaseProjectSchema = zod_1.z.object({
|
|
|
12
12
|
canAssignTasks: zod_1.z.boolean(),
|
|
13
13
|
childOrder: zod_1.z.number().int(),
|
|
14
14
|
color: zod_1.z.string(),
|
|
15
|
-
createdAt: zod_1.z.
|
|
15
|
+
createdAt: zod_1.z.coerce.date().nullable(),
|
|
16
16
|
isArchived: zod_1.z.boolean(),
|
|
17
17
|
isDeleted: zod_1.z.boolean(),
|
|
18
18
|
isFavorite: zod_1.z.boolean(),
|
|
19
19
|
isFrozen: zod_1.z.boolean(),
|
|
20
20
|
name: zod_1.z.string(),
|
|
21
|
-
updatedAt: zod_1.z.
|
|
21
|
+
updatedAt: zod_1.z.coerce.date().nullable(),
|
|
22
22
|
viewStyle: zod_1.z.string(),
|
|
23
23
|
defaultOrder: zod_1.z.number().int(),
|
|
24
24
|
description: zod_1.z.string(),
|
|
@@ -8,9 +8,9 @@ exports.SectionSchema = zod_1.z
|
|
|
8
8
|
id: zod_1.z.string(),
|
|
9
9
|
userId: zod_1.z.string(),
|
|
10
10
|
projectId: zod_1.z.string(),
|
|
11
|
-
addedAt: zod_1.z.
|
|
12
|
-
updatedAt: zod_1.z.
|
|
13
|
-
archivedAt: zod_1.z.
|
|
11
|
+
addedAt: zod_1.z.coerce.date(),
|
|
12
|
+
updatedAt: zod_1.z.coerce.date(),
|
|
13
|
+
archivedAt: zod_1.z.coerce.date().nullable(),
|
|
14
14
|
name: zod_1.z.string(),
|
|
15
15
|
sectionOrder: zod_1.z.number().int(),
|
|
16
16
|
isArchived: zod_1.z.boolean(),
|
|
@@ -27,7 +27,6 @@ __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);
|
|
31
30
|
__exportStar(require("./notifications"), exports);
|
|
32
31
|
__exportStar(require("./sharing"), exports);
|
|
33
32
|
__exportStar(require("./view-options"), exports);
|
|
@@ -12,7 +12,7 @@ const zod_1 = require("zod");
|
|
|
12
12
|
*/
|
|
13
13
|
exports.LiveNotificationSchema = zod_1.z.looseObject({
|
|
14
14
|
id: zod_1.z.string(),
|
|
15
|
-
createdAt: zod_1.z.
|
|
15
|
+
createdAt: zod_1.z.coerce.date(),
|
|
16
16
|
fromUid: zod_1.z.string(),
|
|
17
17
|
notificationType: zod_1.z.string(),
|
|
18
18
|
isUnread: zod_1.z.boolean(),
|
|
@@ -12,7 +12,7 @@ exports.NoteSchema = zod_1.z.looseObject({
|
|
|
12
12
|
itemId: zod_1.z.string().optional(),
|
|
13
13
|
projectId: zod_1.z.string().optional(),
|
|
14
14
|
content: zod_1.z.string(),
|
|
15
|
-
postedAt: zod_1.z.
|
|
15
|
+
postedAt: zod_1.z.coerce.date(),
|
|
16
16
|
fileAttachment: types_1.AttachmentSchema.nullable(),
|
|
17
17
|
postedUid: zod_1.z.string(),
|
|
18
18
|
uidsToNotify: zod_1.z.array(zod_1.z.string()).nullable(),
|
|
@@ -57,7 +57,7 @@ exports.SyncUserSchema = zod_1.z.looseObject({
|
|
|
57
57
|
daysOff: zod_1.z.array(zod_1.z.number().int()),
|
|
58
58
|
featureIdentifier: zod_1.z.string(),
|
|
59
59
|
features: exports.FeaturesSchema,
|
|
60
|
-
freeTrailExpires: zod_1.z.
|
|
60
|
+
freeTrailExpires: zod_1.z.coerce.date().optional(),
|
|
61
61
|
hasMagicNumber: zod_1.z.boolean(),
|
|
62
62
|
hasPassword: zod_1.z.boolean(),
|
|
63
63
|
hasStartedATrial: zod_1.z.boolean().optional(),
|
|
@@ -66,7 +66,7 @@ exports.SyncUserSchema = zod_1.z.looseObject({
|
|
|
66
66
|
isCelebrationsEnabled: zod_1.z.boolean(),
|
|
67
67
|
isPremium: zod_1.z.boolean(),
|
|
68
68
|
joinableWorkspace: exports.JoinableWorkspaceSchema.nullable(),
|
|
69
|
-
joinedAt: zod_1.z.
|
|
69
|
+
joinedAt: zod_1.z.coerce.date(),
|
|
70
70
|
gettingStartedGuideProjects: zod_1.z.array(exports.GettingStartedGuideProjectSchema).nullable(),
|
|
71
71
|
karma: zod_1.z.number(),
|
|
72
72
|
karmaTrend: zod_1.z.string(),
|
|
@@ -84,13 +84,13 @@ exports.SyncUserSchema = zod_1.z.looseObject({
|
|
|
84
84
|
onboardingTeamMode: zod_1.z.boolean().nullable().optional(),
|
|
85
85
|
onboardingUseCases: zod_1.z.array(zod_1.z.string()).nullable().optional(),
|
|
86
86
|
premiumStatus: zod_1.z.enum(types_1.PREMIUM_STATUSES),
|
|
87
|
-
premiumUntil: zod_1.z.
|
|
87
|
+
premiumUntil: zod_1.z.coerce.date().nullable(),
|
|
88
88
|
rambleSessionsUsage: zod_1.z
|
|
89
89
|
.object({
|
|
90
90
|
currentCount: zod_1.z.number().int(),
|
|
91
91
|
limit: zod_1.z.number().int(),
|
|
92
92
|
remaining: zod_1.z.number().int(),
|
|
93
|
-
resetDate: zod_1.z.
|
|
93
|
+
resetDate: zod_1.z.coerce.date(),
|
|
94
94
|
})
|
|
95
95
|
.nullable()
|
|
96
96
|
.optional(),
|
|
@@ -14,6 +14,6 @@ exports.WorkspaceFilterSchema = zod_1.z.looseObject({
|
|
|
14
14
|
isFrozen: zod_1.z.boolean(),
|
|
15
15
|
creatorUid: zod_1.z.string(),
|
|
16
16
|
updaterUid: zod_1.z.string(),
|
|
17
|
-
createdAt: zod_1.z.
|
|
18
|
-
updatedAt: zod_1.z.
|
|
17
|
+
createdAt: zod_1.z.coerce.date(),
|
|
18
|
+
updatedAt: zod_1.z.coerce.date(),
|
|
19
19
|
});
|
|
@@ -21,6 +21,6 @@ exports.WorkspaceGoalSchema = zod_1.z.looseObject({
|
|
|
21
21
|
projectIds: zod_1.z.array(zod_1.z.string()),
|
|
22
22
|
progress: exports.WorkspaceGoalProgressSchema.nullable(),
|
|
23
23
|
creatorUid: zod_1.z.string(),
|
|
24
|
-
createdAt: zod_1.z.
|
|
25
|
-
updatedAt: zod_1.z.
|
|
24
|
+
createdAt: zod_1.z.coerce.date(),
|
|
25
|
+
updatedAt: zod_1.z.coerce.date(),
|
|
26
26
|
});
|
|
@@ -32,8 +32,8 @@ exports.SyncWorkspaceSchema = zod_1.z
|
|
|
32
32
|
logoSmall: zod_1.z.string().optional(),
|
|
33
33
|
logoS640: zod_1.z.string().optional(),
|
|
34
34
|
creatorId: common_1.StringOrNumberSchema,
|
|
35
|
-
createdAt: zod_1.z.
|
|
36
|
-
dateCreated: zod_1.z.
|
|
35
|
+
createdAt: zod_1.z.coerce.date().optional(),
|
|
36
|
+
dateCreated: zod_1.z.coerce.date().optional(),
|
|
37
37
|
isDeleted: zod_1.z.boolean(),
|
|
38
38
|
isCollapsed: zod_1.z.boolean(),
|
|
39
39
|
role: types_1.WorkspaceRoleSchema.optional(),
|
|
@@ -61,7 +61,7 @@ exports.SyncWorkspaceSchema = zod_1.z
|
|
|
61
61
|
defaultCollaborators: zod_1.z
|
|
62
62
|
.object({
|
|
63
63
|
predefinedGroupIds: zod_1.z.array(zod_1.z.string()),
|
|
64
|
-
userIds: zod_1.z.array(
|
|
64
|
+
userIds: zod_1.z.array(common_1.StringOrNumberSchema),
|
|
65
65
|
})
|
|
66
66
|
.optional(),
|
|
67
67
|
properties: types_1.WorkspacePropertiesSchema.optional(),
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SyncResponseSchema = exports.SyncErrorSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const types_1 = require("../
|
|
6
|
-
const types_2 = require("../
|
|
7
|
-
const types_3 = require("../
|
|
8
|
-
const types_4 = require("../
|
|
9
|
-
const types_5 = require("../
|
|
10
|
-
const types_6 = require("../workspaces/types");
|
|
5
|
+
const types_1 = require("../labels/types");
|
|
6
|
+
const types_2 = require("../projects/types");
|
|
7
|
+
const types_3 = require("../sections/types");
|
|
8
|
+
const types_4 = require("../tasks/types");
|
|
9
|
+
const types_5 = require("../workspaces/types");
|
|
11
10
|
const resources_1 = require("./resources");
|
|
12
11
|
exports.SyncErrorSchema = zod_1.z.object({
|
|
13
12
|
error: zod_1.z.string(),
|
|
@@ -21,10 +20,10 @@ exports.SyncResponseSchema = zod_1.z.looseObject({
|
|
|
21
20
|
fullSync: zod_1.z.boolean().optional(),
|
|
22
21
|
syncStatus: zod_1.z.record(zod_1.z.string(), zod_1.z.union([zod_1.z.literal('ok'), exports.SyncErrorSchema])).optional(),
|
|
23
22
|
tempIdMapping: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
|
|
24
|
-
items: zod_1.z.array(
|
|
25
|
-
projects: zod_1.z.array(
|
|
26
|
-
sections: zod_1.z.array(
|
|
27
|
-
labels: zod_1.z.array(
|
|
23
|
+
items: zod_1.z.array(types_4.TaskSchema).optional(),
|
|
24
|
+
projects: zod_1.z.array(types_2.ProjectSchema).optional(),
|
|
25
|
+
sections: zod_1.z.array(types_3.SectionSchema).optional(),
|
|
26
|
+
labels: zod_1.z.array(types_1.LabelSchema).optional(),
|
|
28
27
|
notes: zod_1.z.array(resources_1.NoteSchema).optional(),
|
|
29
28
|
projectNotes: zod_1.z.array(resources_1.NoteSchema).optional(),
|
|
30
29
|
filters: zod_1.z.array(resources_1.FilterSchema).optional(),
|
|
@@ -41,13 +40,12 @@ exports.SyncResponseSchema = zod_1.z.looseObject({
|
|
|
41
40
|
completedInfo: zod_1.z.array(resources_1.CompletedInfoSchema).optional(),
|
|
42
41
|
stats: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
|
|
43
42
|
workspaces: zod_1.z.array(resources_1.SyncWorkspaceSchema).optional(),
|
|
44
|
-
workspaceUsers: zod_1.z.array(
|
|
43
|
+
workspaceUsers: zod_1.z.array(types_5.WorkspaceUserSchema).optional(),
|
|
45
44
|
workspaceFilters: zod_1.z.array(resources_1.WorkspaceFilterSchema).optional(),
|
|
46
45
|
viewOptions: zod_1.z.array(resources_1.ViewOptionsSchema).optional(),
|
|
47
46
|
projectViewOptionsDefaults: zod_1.z.array(resources_1.ProjectViewOptionsDefaultsSchema).optional(),
|
|
48
47
|
roleActions: zod_1.z.array(zod_1.z.record(zod_1.z.string(), zod_1.z.unknown())).optional(),
|
|
49
48
|
folders: zod_1.z.array(resources_1.FolderSchema).optional(),
|
|
50
|
-
goals: zod_1.z.array(types_1.GoalSchema).optional(),
|
|
51
49
|
workspaceGoals: zod_1.z.array(resources_1.WorkspaceGoalSchema).optional(),
|
|
52
50
|
dayOrders: zod_1.z.record(zod_1.z.string(), zod_1.z.number()).optional(),
|
|
53
51
|
calendars: zod_1.z.array(resources_1.CalendarSchema).optional(),
|
|
@@ -40,9 +40,9 @@ exports.TaskSchema = zod_1.z
|
|
|
40
40
|
duration: exports.DurationSchema.nullable(),
|
|
41
41
|
checked: zod_1.z.boolean(),
|
|
42
42
|
isDeleted: zod_1.z.boolean(),
|
|
43
|
-
addedAt: zod_1.z.
|
|
44
|
-
completedAt: zod_1.z.
|
|
45
|
-
updatedAt: zod_1.z.
|
|
43
|
+
addedAt: zod_1.z.coerce.date().nullable(),
|
|
44
|
+
completedAt: zod_1.z.coerce.date().nullable(),
|
|
45
|
+
updatedAt: zod_1.z.coerce.date().nullable(),
|
|
46
46
|
due: exports.DueDateSchema.nullable(),
|
|
47
47
|
priority: zod_1.z.number().int(),
|
|
48
48
|
childOrder: zod_1.z.number().int(),
|
|
@@ -74,7 +74,7 @@ exports.WorkspacePlanDetailsSchema = zod_1.z.object({
|
|
|
74
74
|
currentActiveProjects: zod_1.z.number(),
|
|
75
75
|
maximumActiveProjects: zod_1.z.number(),
|
|
76
76
|
priceList: zod_1.z.array(exports.FormattedPriceListingSchema),
|
|
77
|
-
workspaceId:
|
|
77
|
+
workspaceId: common_1.StringOrNumberSchema,
|
|
78
78
|
isTrialing: zod_1.z.boolean(),
|
|
79
79
|
trialEndsAt: zod_1.z.string().nullable(),
|
|
80
80
|
cancelAtPeriodEnd: zod_1.z.boolean(),
|
|
@@ -125,8 +125,8 @@ exports.WorkspaceSchema = zod_1.z
|
|
|
125
125
|
logoMedium: zod_1.z.string().nullish(),
|
|
126
126
|
logoSmall: zod_1.z.string().nullish(),
|
|
127
127
|
logoS640: zod_1.z.string().nullish(),
|
|
128
|
-
createdAt: zod_1.z.
|
|
129
|
-
dateCreated: zod_1.z.
|
|
128
|
+
createdAt: zod_1.z.coerce.date().optional(),
|
|
129
|
+
dateCreated: zod_1.z.coerce.date().optional(),
|
|
130
130
|
creatorId: common_1.StringOrNumberSchema,
|
|
131
131
|
properties: exports.WorkspacePropertiesSchema,
|
|
132
132
|
})
|