@doist/todoist-sdk 9.2.0-next.1 → 9.2.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/clients/app-client.js +24 -25
- package/dist/cjs/clients/comment-client.js +3 -3
- package/dist/cjs/clients/folder-client.js +3 -3
- package/dist/cjs/clients/insights-client.js +6 -6
- package/dist/cjs/clients/label-client.js +3 -3
- package/dist/cjs/clients/project-client.js +8 -8
- package/dist/cjs/clients/section-client.js +5 -5
- package/dist/cjs/clients/task-client.js +6 -6
- package/dist/cjs/clients/ui-extension-client.js +4 -4
- package/dist/cjs/clients/workspace-client.js +3 -3
- package/dist/cjs/consts/endpoints.js +1 -6
- package/dist/cjs/test-utils/test-defaults.js +3 -26
- package/dist/cjs/todoist-api.js +0 -33
- package/dist/cjs/types/apps/types.js +1 -0
- package/dist/cjs/types/index.js +0 -1
- 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/response.js +10 -12
- package/dist/cjs/utils/validators.js +51 -53
- package/dist/esm/clients/app-client.js +24 -25
- package/dist/esm/clients/comment-client.js +3 -3
- package/dist/esm/clients/folder-client.js +3 -3
- package/dist/esm/clients/insights-client.js +6 -6
- package/dist/esm/clients/label-client.js +3 -3
- package/dist/esm/clients/project-client.js +8 -8
- package/dist/esm/clients/section-client.js +5 -5
- package/dist/esm/clients/task-client.js +6 -6
- package/dist/esm/clients/ui-extension-client.js +4 -4
- package/dist/esm/clients/workspace-client.js +3 -3
- package/dist/esm/consts/endpoints.js +0 -5
- package/dist/esm/test-utils/test-defaults.js +1 -24
- package/dist/esm/todoist-api.js +0 -33
- package/dist/esm/types/apps/types.js +1 -0
- package/dist/esm/types/index.js +0 -1
- 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/response.js +0 -2
- package/dist/esm/utils/validators.js +0 -2
- package/dist/types/clients/app-client.d.ts +1 -1
- package/dist/types/consts/endpoints.d.ts +0 -5
- package/dist/types/test-utils/test-defaults.d.ts +1 -4
- package/dist/types/todoist-api.d.ts +0 -12
- package/dist/types/types/apps/types.d.ts +4 -0
- package/dist/types/types/index.d.ts +0 -1
- package/dist/types/types/sync/commands/index.d.ts +0 -9
- package/dist/types/types/sync/resource-types.d.ts +1 -1
- package/dist/types/types/sync/resources/view-options.d.ts +6 -6
- package/dist/types/types/sync/response.d.ts +4 -29
- package/dist/types/types/tasks/requests.d.ts +0 -1
- package/dist/types/utils/validators.d.ts +13 -55
- package/package.json +1 -1
- package/dist/cjs/clients/goals-client.js +0 -145
- 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 -56
- package/dist/cjs/types/sync/commands/goals.js +0 -2
- package/dist/esm/clients/goals-client.js +0 -141
- 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 -53
- package/dist/esm/types/sync/commands/goals.js +0 -1
- package/dist/types/clients/goals-client.d.ts +0 -20
- 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 -51
- package/dist/types/types/sync/commands/goals.d.ts +0 -33
|
@@ -12,7 +12,7 @@ import { BaseClient } from './base-client.js';
|
|
|
12
12
|
*/
|
|
13
13
|
export class ProjectClient extends BaseClient {
|
|
14
14
|
async getProject(id) {
|
|
15
|
-
z.string().parse(id);
|
|
15
|
+
z.string().min(1).parse(id);
|
|
16
16
|
const response = await request({
|
|
17
17
|
httpMethod: 'GET',
|
|
18
18
|
baseUri: this.syncApiBase,
|
|
@@ -77,7 +77,7 @@ export class ProjectClient extends BaseClient {
|
|
|
77
77
|
return validateProject(response.data);
|
|
78
78
|
}
|
|
79
79
|
async updateProject(id, args, requestId) {
|
|
80
|
-
z.string().parse(id);
|
|
80
|
+
z.string().min(1).parse(id);
|
|
81
81
|
const response = await request({
|
|
82
82
|
httpMethod: 'POST',
|
|
83
83
|
baseUri: this.syncApiBase,
|
|
@@ -90,7 +90,7 @@ export class ProjectClient extends BaseClient {
|
|
|
90
90
|
return validateProject(response.data);
|
|
91
91
|
}
|
|
92
92
|
async deleteProject(id, requestId) {
|
|
93
|
-
z.string().parse(id);
|
|
93
|
+
z.string().min(1).parse(id);
|
|
94
94
|
const response = await request({
|
|
95
95
|
httpMethod: 'DELETE',
|
|
96
96
|
baseUri: this.syncApiBase,
|
|
@@ -102,7 +102,7 @@ export class ProjectClient extends BaseClient {
|
|
|
102
102
|
return isSuccess(response);
|
|
103
103
|
}
|
|
104
104
|
async archiveProject(id, requestId) {
|
|
105
|
-
z.string().parse(id);
|
|
105
|
+
z.string().min(1).parse(id);
|
|
106
106
|
const response = await request({
|
|
107
107
|
httpMethod: 'POST',
|
|
108
108
|
baseUri: this.syncApiBase,
|
|
@@ -114,7 +114,7 @@ export class ProjectClient extends BaseClient {
|
|
|
114
114
|
return validateProject(response.data);
|
|
115
115
|
}
|
|
116
116
|
async unarchiveProject(id, requestId) {
|
|
117
|
-
z.string().parse(id);
|
|
117
|
+
z.string().min(1).parse(id);
|
|
118
118
|
const response = await request({
|
|
119
119
|
httpMethod: 'POST',
|
|
120
120
|
baseUri: this.syncApiBase,
|
|
@@ -171,7 +171,7 @@ export class ProjectClient extends BaseClient {
|
|
|
171
171
|
return data;
|
|
172
172
|
}
|
|
173
173
|
async getFullProject(id, args = {}) {
|
|
174
|
-
z.string().parse(id);
|
|
174
|
+
z.string().min(1).parse(id);
|
|
175
175
|
const { data } = await request({
|
|
176
176
|
httpMethod: 'GET',
|
|
177
177
|
baseUri: this.syncApiBase,
|
|
@@ -190,7 +190,7 @@ export class ProjectClient extends BaseClient {
|
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
192
|
async joinProject(id, requestId) {
|
|
193
|
-
z.string().parse(id);
|
|
193
|
+
z.string().min(1).parse(id);
|
|
194
194
|
const { data } = await request({
|
|
195
195
|
httpMethod: 'POST',
|
|
196
196
|
baseUri: this.syncApiBase,
|
|
@@ -211,7 +211,7 @@ export class ProjectClient extends BaseClient {
|
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
213
|
async getProjectCollaborators(projectId, args = {}) {
|
|
214
|
-
z.string().parse(projectId);
|
|
214
|
+
z.string().min(1).parse(projectId);
|
|
215
215
|
const { data: { results, nextCursor }, } = await request({
|
|
216
216
|
httpMethod: 'GET',
|
|
217
217
|
baseUri: this.syncApiBase,
|
|
@@ -40,7 +40,7 @@ export class SectionClient extends BaseClient {
|
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
async getSection(id) {
|
|
43
|
-
z.string().parse(id);
|
|
43
|
+
z.string().min(1).parse(id);
|
|
44
44
|
const response = await request({
|
|
45
45
|
httpMethod: 'GET',
|
|
46
46
|
baseUri: this.syncApiBase,
|
|
@@ -63,7 +63,7 @@ export class SectionClient extends BaseClient {
|
|
|
63
63
|
return validateSection(response.data);
|
|
64
64
|
}
|
|
65
65
|
async updateSection(id, args, requestId) {
|
|
66
|
-
z.string().parse(id);
|
|
66
|
+
z.string().min(1).parse(id);
|
|
67
67
|
const response = await request({
|
|
68
68
|
httpMethod: 'POST',
|
|
69
69
|
baseUri: this.syncApiBase,
|
|
@@ -76,7 +76,7 @@ export class SectionClient extends BaseClient {
|
|
|
76
76
|
return validateSection(response.data);
|
|
77
77
|
}
|
|
78
78
|
async deleteSection(id, requestId) {
|
|
79
|
-
z.string().parse(id);
|
|
79
|
+
z.string().min(1).parse(id);
|
|
80
80
|
const response = await request({
|
|
81
81
|
httpMethod: 'DELETE',
|
|
82
82
|
baseUri: this.syncApiBase,
|
|
@@ -88,7 +88,7 @@ export class SectionClient extends BaseClient {
|
|
|
88
88
|
return isSuccess(response);
|
|
89
89
|
}
|
|
90
90
|
async archiveSection(id, requestId) {
|
|
91
|
-
z.string().parse(id);
|
|
91
|
+
z.string().min(1).parse(id);
|
|
92
92
|
const response = await request({
|
|
93
93
|
httpMethod: 'POST',
|
|
94
94
|
baseUri: this.syncApiBase,
|
|
@@ -100,7 +100,7 @@ export class SectionClient extends BaseClient {
|
|
|
100
100
|
return validateSection(response.data);
|
|
101
101
|
}
|
|
102
102
|
async unarchiveSection(id, requestId) {
|
|
103
|
-
z.string().parse(id);
|
|
103
|
+
z.string().min(1).parse(id);
|
|
104
104
|
const response = await request({
|
|
105
105
|
httpMethod: 'POST',
|
|
106
106
|
baseUri: this.syncApiBase,
|
|
@@ -28,7 +28,7 @@ const MAX_COMMAND_COUNT = 100;
|
|
|
28
28
|
*/
|
|
29
29
|
export class TaskClient extends BaseClient {
|
|
30
30
|
async getTask(id) {
|
|
31
|
-
z.string().parse(id);
|
|
31
|
+
z.string().min(1).parse(id);
|
|
32
32
|
const response = await request({
|
|
33
33
|
httpMethod: 'GET',
|
|
34
34
|
baseUri: this.syncApiBase,
|
|
@@ -152,7 +152,7 @@ export class TaskClient extends BaseClient {
|
|
|
152
152
|
return validateTask(response.data);
|
|
153
153
|
}
|
|
154
154
|
async updateTask(id, args, requestId) {
|
|
155
|
-
z.string().parse(id);
|
|
155
|
+
z.string().min(1).parse(id);
|
|
156
156
|
// Translate SDK alias for due-date clearing to Todoist's accepted payload value.
|
|
157
157
|
const normalizedArgs = args.dueString === null ? Object.assign(Object.assign({}, args), { dueString: 'no date' }) : args;
|
|
158
158
|
// Process content if both content and isUncompletable are provided
|
|
@@ -200,7 +200,7 @@ export class TaskClient extends BaseClient {
|
|
|
200
200
|
return validateTaskArray(syncTasks);
|
|
201
201
|
}
|
|
202
202
|
async moveTask(id, args, requestId) {
|
|
203
|
-
z.string().parse(id);
|
|
203
|
+
z.string().min(1).parse(id);
|
|
204
204
|
const response = await request({
|
|
205
205
|
httpMethod: 'POST',
|
|
206
206
|
baseUri: this.syncApiBase,
|
|
@@ -213,7 +213,7 @@ export class TaskClient extends BaseClient {
|
|
|
213
213
|
return validateTask(response.data);
|
|
214
214
|
}
|
|
215
215
|
async closeTask(id, requestId) {
|
|
216
|
-
z.string().parse(id);
|
|
216
|
+
z.string().min(1).parse(id);
|
|
217
217
|
const response = await request({
|
|
218
218
|
httpMethod: 'POST',
|
|
219
219
|
baseUri: this.syncApiBase,
|
|
@@ -225,7 +225,7 @@ export class TaskClient extends BaseClient {
|
|
|
225
225
|
return isSuccess(response);
|
|
226
226
|
}
|
|
227
227
|
async reopenTask(id, requestId) {
|
|
228
|
-
z.string().parse(id);
|
|
228
|
+
z.string().min(1).parse(id);
|
|
229
229
|
const response = await request({
|
|
230
230
|
httpMethod: 'POST',
|
|
231
231
|
baseUri: this.syncApiBase,
|
|
@@ -237,7 +237,7 @@ export class TaskClient extends BaseClient {
|
|
|
237
237
|
return isSuccess(response);
|
|
238
238
|
}
|
|
239
239
|
async deleteTask(id, requestId) {
|
|
240
|
-
z.string().parse(id);
|
|
240
|
+
z.string().min(1).parse(id);
|
|
241
241
|
const response = await request({
|
|
242
242
|
httpMethod: 'DELETE',
|
|
243
243
|
baseUri: this.syncApiBase,
|
|
@@ -14,7 +14,7 @@ import { BaseClient } from './base-client.js';
|
|
|
14
14
|
*/
|
|
15
15
|
export class UiExtensionClient extends BaseClient {
|
|
16
16
|
async getUiExtension(uiExtensionId, requestId) {
|
|
17
|
-
z.string().parse(uiExtensionId);
|
|
17
|
+
z.string().min(1).parse(uiExtensionId);
|
|
18
18
|
const response = await request({
|
|
19
19
|
httpMethod: 'GET',
|
|
20
20
|
baseUri: this.apiRootBase,
|
|
@@ -37,7 +37,7 @@ export class UiExtensionClient extends BaseClient {
|
|
|
37
37
|
return validateUiExtensionArray(response.data);
|
|
38
38
|
}
|
|
39
39
|
async getUiExtensionsForApp(appId, requestId) {
|
|
40
|
-
z.string().parse(appId);
|
|
40
|
+
z.string().min(1).parse(appId);
|
|
41
41
|
const response = await request({
|
|
42
42
|
httpMethod: 'GET',
|
|
43
43
|
baseUri: this.apiRootBase,
|
|
@@ -61,7 +61,7 @@ export class UiExtensionClient extends BaseClient {
|
|
|
61
61
|
return validateUiExtension(response.data);
|
|
62
62
|
}
|
|
63
63
|
async updateUiExtension(uiExtensionId, args, requestId) {
|
|
64
|
-
z.string().parse(uiExtensionId);
|
|
64
|
+
z.string().min(1).parse(uiExtensionId);
|
|
65
65
|
const response = await request({
|
|
66
66
|
httpMethod: 'PATCH',
|
|
67
67
|
baseUri: this.apiRootBase,
|
|
@@ -74,7 +74,7 @@ export class UiExtensionClient extends BaseClient {
|
|
|
74
74
|
return validateUiExtension(response.data);
|
|
75
75
|
}
|
|
76
76
|
async deleteUiExtension(uiExtensionId, requestId) {
|
|
77
|
-
z.string().parse(uiExtensionId);
|
|
77
|
+
z.string().min(1).parse(uiExtensionId);
|
|
78
78
|
const response = await request({
|
|
79
79
|
httpMethod: 'DELETE',
|
|
80
80
|
baseUri: this.apiRootBase,
|
|
@@ -196,7 +196,7 @@ export class WorkspaceClient extends BaseClient {
|
|
|
196
196
|
return validateWorkspaceArray(response.data);
|
|
197
197
|
}
|
|
198
198
|
async getWorkspace(id, requestId) {
|
|
199
|
-
z.string().parse(id);
|
|
199
|
+
z.string().min(1).parse(id);
|
|
200
200
|
const response = await request({
|
|
201
201
|
httpMethod: 'GET',
|
|
202
202
|
baseUri: this.syncApiBase,
|
|
@@ -220,7 +220,7 @@ export class WorkspaceClient extends BaseClient {
|
|
|
220
220
|
return validateWorkspace(response.data);
|
|
221
221
|
}
|
|
222
222
|
async updateWorkspace(id, args, requestId) {
|
|
223
|
-
z.string().parse(id);
|
|
223
|
+
z.string().min(1).parse(id);
|
|
224
224
|
const response = await request({
|
|
225
225
|
httpMethod: 'POST',
|
|
226
226
|
baseUri: this.syncApiBase,
|
|
@@ -233,7 +233,7 @@ export class WorkspaceClient extends BaseClient {
|
|
|
233
233
|
return validateWorkspace(response.data);
|
|
234
234
|
}
|
|
235
235
|
async deleteWorkspace(id, requestId) {
|
|
236
|
-
z.string().parse(id);
|
|
236
|
+
z.string().min(1).parse(id);
|
|
237
237
|
const response = await request({
|
|
238
238
|
httpMethod: 'DELETE',
|
|
239
239
|
baseUri: this.syncApiBase,
|
|
@@ -70,11 +70,6 @@ export const ENDPOINT_GET_TOKEN = 'access_token';
|
|
|
70
70
|
export const ENDPOINT_REVOKE = 'revoke';
|
|
71
71
|
export const ENDPOINT_REGISTER = 'register';
|
|
72
72
|
export const ENDPOINT_REST_FOLDERS = 'folders';
|
|
73
|
-
export const ENDPOINT_REST_GOALS = 'goals';
|
|
74
|
-
export const ENDPOINT_REST_GOALS_SEARCH = ENDPOINT_REST_GOALS + '/search';
|
|
75
|
-
export const GOAL_COMPLETE = 'complete';
|
|
76
|
-
export const GOAL_UNCOMPLETE = 'uncomplete';
|
|
77
|
-
export const GOAL_TASKS = 'items';
|
|
78
73
|
// Workspace endpoints
|
|
79
74
|
export const ENDPOINT_REST_WORKSPACES = 'workspaces';
|
|
80
75
|
export const ENDPOINT_WORKSPACE_INVITATIONS = 'workspaces/invitations';
|
|
@@ -277,30 +277,6 @@ export const DEFAULT_COLLABORATOR_STATE = {
|
|
|
277
277
|
state: 'active',
|
|
278
278
|
isDeleted: false,
|
|
279
279
|
};
|
|
280
|
-
export const DEFAULT_GOAL_ID = '550e8400-e29b-41d4-a716-446655440000';
|
|
281
|
-
export const DEFAULT_GOAL = {
|
|
282
|
-
id: DEFAULT_GOAL_ID,
|
|
283
|
-
ownerType: 'USER',
|
|
284
|
-
ownerId: DEFAULT_USER_ID,
|
|
285
|
-
name: 'Ship v2',
|
|
286
|
-
description: 'Launch the new version',
|
|
287
|
-
deadline: '2026-04-03',
|
|
288
|
-
parentGoalId: null,
|
|
289
|
-
childOrder: 0,
|
|
290
|
-
isCompleted: false,
|
|
291
|
-
completedAt: null,
|
|
292
|
-
responsibleUid: null,
|
|
293
|
-
isDeleted: false,
|
|
294
|
-
progress: {
|
|
295
|
-
totalTaskCount: 5,
|
|
296
|
-
completedTaskCount: 2,
|
|
297
|
-
percentage: 40,
|
|
298
|
-
},
|
|
299
|
-
creatorUid: DEFAULT_USER_ID,
|
|
300
|
-
createdAt: defaultDate(),
|
|
301
|
-
updatedAt: defaultDate(),
|
|
302
|
-
};
|
|
303
|
-
export const DEFAULT_GOAL_NO_PROGRESS = Object.assign(Object.assign({}, DEFAULT_GOAL), { id: 'e5f6g7h8-e29b-41d4-a716-446655440001', progress: undefined });
|
|
304
280
|
export const DEFAULT_APP_ID = '42';
|
|
305
281
|
export const DEFAULT_INSTALLATION_ID = '1001';
|
|
306
282
|
export const DEFAULT_UI_EXTENSION_ID = '2002';
|
|
@@ -308,6 +284,7 @@ export const DEFAULT_DISTRIBUTION_TOKEN = 'dist-token-abc';
|
|
|
308
284
|
export const DEFAULT_ACCESS_TOKEN_ID = '3003';
|
|
309
285
|
export const DEFAULT_APP = {
|
|
310
286
|
id: DEFAULT_APP_ID,
|
|
287
|
+
clientId: 'client-id-xyz',
|
|
311
288
|
status: 'public',
|
|
312
289
|
displayName: 'Sample App',
|
|
313
290
|
userId: DEFAULT_USER_ID,
|
package/dist/esm/todoist-api.js
CHANGED
|
@@ -4,7 +4,6 @@ import { BackupClient } from './clients/backup-client.js';
|
|
|
4
4
|
import { CommentClient } from './clients/comment-client.js';
|
|
5
5
|
import { EmailClient } from './clients/email-client.js';
|
|
6
6
|
import { FolderClient } from './clients/folder-client.js';
|
|
7
|
-
import { GoalsClient } from './clients/goals-client.js';
|
|
8
7
|
import { IdMappingClient } from './clients/id-mapping-client.js';
|
|
9
8
|
import { InsightsClient } from './clients/insights-client.js';
|
|
10
9
|
import { LabelClient } from './clients/label-client.js';
|
|
@@ -59,7 +58,6 @@ export class TodoistApi {
|
|
|
59
58
|
this.activityClient = new ActivityClient(clientDeps);
|
|
60
59
|
this.productivityClient = new ProductivityClient(clientDeps);
|
|
61
60
|
this.workspaceClient = new WorkspaceClient(clientDeps);
|
|
62
|
-
this.goalsClient = new GoalsClient(clientDeps);
|
|
63
61
|
this.appClient = new AppClient(clientDeps);
|
|
64
62
|
this.uiExtensionClient = new UiExtensionClient(clientDeps);
|
|
65
63
|
}
|
|
@@ -941,37 +939,6 @@ export class TodoistApi {
|
|
|
941
939
|
async deleteFolder(id, requestId) {
|
|
942
940
|
return this.folderClient.deleteFolder(id, requestId);
|
|
943
941
|
}
|
|
944
|
-
// ── Goals ──
|
|
945
|
-
async getGoals(args) {
|
|
946
|
-
return this.goalsClient.getGoals(args);
|
|
947
|
-
}
|
|
948
|
-
async searchGoals(args) {
|
|
949
|
-
return this.goalsClient.searchGoals(args);
|
|
950
|
-
}
|
|
951
|
-
async getGoal(id) {
|
|
952
|
-
return this.goalsClient.getGoal(id);
|
|
953
|
-
}
|
|
954
|
-
async addGoal(args, requestId) {
|
|
955
|
-
return this.goalsClient.addGoal(args, requestId);
|
|
956
|
-
}
|
|
957
|
-
async updateGoal(id, args, requestId) {
|
|
958
|
-
return this.goalsClient.updateGoal(id, args, requestId);
|
|
959
|
-
}
|
|
960
|
-
async deleteGoal(id, requestId) {
|
|
961
|
-
return this.goalsClient.deleteGoal(id, requestId);
|
|
962
|
-
}
|
|
963
|
-
async completeGoal(id, requestId) {
|
|
964
|
-
return this.goalsClient.completeGoal(id, requestId);
|
|
965
|
-
}
|
|
966
|
-
async uncompleteGoal(id, requestId) {
|
|
967
|
-
return this.goalsClient.uncompleteGoal(id, requestId);
|
|
968
|
-
}
|
|
969
|
-
async linkTaskToGoal(args, requestId) {
|
|
970
|
-
return this.goalsClient.linkTaskToGoal(args, requestId);
|
|
971
|
-
}
|
|
972
|
-
async unlinkTaskFromGoal(args, requestId) {
|
|
973
|
-
return this.goalsClient.unlinkTaskFromGoal(args, requestId);
|
|
974
|
-
}
|
|
975
942
|
// ── Backups ──
|
|
976
943
|
/**
|
|
977
944
|
* Retrieves a list of available backups.
|
package/dist/esm/types/index.js
CHANGED
|
@@ -9,7 +9,6 @@ export * from './productivity/index.js';
|
|
|
9
9
|
export * from './activity/index.js';
|
|
10
10
|
export * from './workspaces/index.js';
|
|
11
11
|
export * from './folders/index.js';
|
|
12
|
-
export * from './goals/index.js';
|
|
13
12
|
export * from './insights/index.js';
|
|
14
13
|
export * from './backups/index.js';
|
|
15
14
|
export * from './id-mappings/index.js';
|
|
@@ -11,7 +11,6 @@ export * from './workspaces.js';
|
|
|
11
11
|
export * from './folders.js';
|
|
12
12
|
export * from './workspace-filters.js';
|
|
13
13
|
export * from './workspace-goals.js';
|
|
14
|
-
export * from './goals.js';
|
|
15
14
|
export * from './notifications.js';
|
|
16
15
|
export * from './sharing.js';
|
|
17
16
|
export * from './view-options.js';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { GoalSchema } from '../goals/types.js';
|
|
3
2
|
import { LabelSchema } from '../labels/types.js';
|
|
4
3
|
import { ProjectSchema } from '../projects/types.js';
|
|
5
4
|
import { SectionSchema } from '../sections/types.js';
|
|
@@ -44,7 +43,6 @@ export const SyncResponseSchema = z.looseObject({
|
|
|
44
43
|
projectViewOptionsDefaults: z.array(ProjectViewOptionsDefaultsSchema).optional(),
|
|
45
44
|
roleActions: z.array(z.record(z.string(), z.unknown())).optional(),
|
|
46
45
|
folders: z.array(FolderSchema).optional(),
|
|
47
|
-
goals: z.array(GoalSchema).optional(),
|
|
48
46
|
workspaceGoals: z.array(WorkspaceGoalSchema).optional(),
|
|
49
47
|
dayOrders: z.record(z.string(), z.number()).optional(),
|
|
50
48
|
calendars: z.array(CalendarSchema).optional(),
|
|
@@ -3,7 +3,6 @@ import { ActivityEventSchema } from '../types/activity/types.js';
|
|
|
3
3
|
import { AppSchema, AppWithUserCountSchema, AppSecretsSchema, AppVerificationTokenSchema, AppTestTokenSchema, AppDistributionTokenSchema, AppByDistributionTokenSchema, AppWebhookSchema, AppInstallationSchema, UserAuthorizationSchema, } from '../types/apps/types.js';
|
|
4
4
|
import { BackupSchema } from '../types/backups/types.js';
|
|
5
5
|
import { AttachmentSchema, CommentSchema } from '../types/comments/types.js';
|
|
6
|
-
import { GoalSchema } from '../types/goals/types.js';
|
|
7
6
|
import { IdMappingSchema, MovedIdSchema } from '../types/id-mappings/types.js';
|
|
8
7
|
import { ProjectActivityStatsSchema, ProjectHealthSchema, ProjectHealthContextSchema, ProjectProgressSchema, WorkspaceInsightsSchema, } from '../types/insights/types.js';
|
|
9
8
|
import { LabelSchema } from '../types/labels/types.js';
|
|
@@ -59,7 +58,6 @@ export const { validate: validateFilter, validateArray: validateFilterArray } =
|
|
|
59
58
|
export const { validate: validateCollaborator, validateArray: validateCollaboratorArray } = createValidator(CollaboratorSchema);
|
|
60
59
|
export const { validate: validateCollaboratorState, validateArray: validateCollaboratorStateArray, } = createValidator(CollaboratorStateSchema);
|
|
61
60
|
export const { validate: validateFolder, validateArray: validateFolderArray } = createValidator(FolderSchema);
|
|
62
|
-
export const { validate: validateGoal, validateArray: validateGoalArray } = createValidator(GoalSchema);
|
|
63
61
|
export const { validate: validateNote, validateArray: validateNoteArray } = createValidator(NoteSchema);
|
|
64
62
|
export const { validate: validateTooltips } = createValidator(TooltipsSchema);
|
|
65
63
|
export const { validate: validateWorkspaceFilter, validateArray: validateWorkspaceFilterArray } = createValidator(WorkspaceFilterSchema);
|
|
@@ -17,7 +17,7 @@ export declare class AppClient extends BaseClient {
|
|
|
17
17
|
getAppSecrets(appId: string, requestId?: string): Promise<AppSecrets>;
|
|
18
18
|
resetAppClientSecret(appId: string, requestId?: string): Promise<AppWithUserCount>;
|
|
19
19
|
revokeAppTokens(appId: string, requestId?: string): Promise<AppWithUserCount>;
|
|
20
|
-
uploadAppIcon(
|
|
20
|
+
uploadAppIcon({ appId, file, fileName, size }: UploadAppIconArgs, requestId?: string): Promise<AppWithUserCount>;
|
|
21
21
|
getAppTestToken(appId: string, requestId?: string): Promise<AppTestToken>;
|
|
22
22
|
createAppTestToken(appId: string, requestId?: string): Promise<AppTestToken>;
|
|
23
23
|
getAppDistributionToken(appId: string, requestId?: string): Promise<AppDistributionToken>;
|
|
@@ -59,11 +59,6 @@ export declare const ENDPOINT_GET_TOKEN = "access_token";
|
|
|
59
59
|
export declare const ENDPOINT_REVOKE = "revoke";
|
|
60
60
|
export declare const ENDPOINT_REGISTER = "register";
|
|
61
61
|
export declare const ENDPOINT_REST_FOLDERS = "folders";
|
|
62
|
-
export declare const ENDPOINT_REST_GOALS = "goals";
|
|
63
|
-
export declare const ENDPOINT_REST_GOALS_SEARCH: string;
|
|
64
|
-
export declare const GOAL_COMPLETE = "complete";
|
|
65
|
-
export declare const GOAL_UNCOMPLETE = "uncomplete";
|
|
66
|
-
export declare const GOAL_TASKS = "items";
|
|
67
62
|
export declare const ENDPOINT_REST_WORKSPACES = "workspaces";
|
|
68
63
|
export declare const ENDPOINT_WORKSPACE_INVITATIONS = "workspaces/invitations";
|
|
69
64
|
export declare const ENDPOINT_WORKSPACE_INVITATIONS_ALL = "workspaces/invitations/all";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Label, Section, Task, User, Attachment, Duration, Deadline, RawComment, PersonalProject, WorkspaceProject, Reminder, Folder,
|
|
1
|
+
import { Label, Section, Task, User, Attachment, Duration, Deadline, RawComment, PersonalProject, WorkspaceProject, Reminder, Folder, App, AppWithUserCount, AppSecrets, AppVerificationToken, AppTestToken, AppDistributionToken, AppWebhook, AppInstallation, UserAuthorization, UiExtension } from '../types/index.js';
|
|
2
2
|
import type { Collaborator, CollaboratorState } from '../types/sync/resources/collaborators.js';
|
|
3
3
|
import type { Note } from '../types/sync/resources/notes.js';
|
|
4
4
|
export declare const DEFAULT_TASK_ID = "1234";
|
|
@@ -264,9 +264,6 @@ export declare const COMMENT_WITH_OPTIONALS_AS_NULL_PROJECT: {
|
|
|
264
264
|
export declare const DEFAULT_FOLDER: Folder;
|
|
265
265
|
export declare const DEFAULT_COLLABORATOR: Collaborator;
|
|
266
266
|
export declare const DEFAULT_COLLABORATOR_STATE: CollaboratorState;
|
|
267
|
-
export declare const DEFAULT_GOAL_ID = "550e8400-e29b-41d4-a716-446655440000";
|
|
268
|
-
export declare const DEFAULT_GOAL: Goal;
|
|
269
|
-
export declare const DEFAULT_GOAL_NO_PROGRESS: Goal;
|
|
270
267
|
export declare const DEFAULT_APP_ID = "42";
|
|
271
268
|
export declare const DEFAULT_INSTALLATION_ID = "1001";
|
|
272
269
|
export declare const DEFAULT_UI_EXTENSION_ID = "2002";
|
|
@@ -5,7 +5,6 @@ import { Backup, GetBackupsArgs, DownloadBackupArgs } from './types/backups/inde
|
|
|
5
5
|
import { Attachment, Comment, AddCommentArgs, UpdateCommentArgs, GetProjectCommentsArgs, GetTaskCommentsArgs, GetCommentsResponse } from './types/comments/index.js';
|
|
6
6
|
import { GetOrCreateEmailArgs, GetOrCreateEmailResponse, DisableEmailArgs } from './types/emails/index.js';
|
|
7
7
|
import { GetFoldersArgs, GetFoldersResponse, AddFolderArgs, UpdateFolderArgs } from './types/folders/index.js';
|
|
8
|
-
import type { AddGoalArgs, GetGoalsArgs, GetGoalsResponse, Goal, SearchGoalsArgs, TaskLinkingArgs, UpdateGoalArgs } from './types/goals/index.js';
|
|
9
8
|
import { CustomFetch, FileResponse } from './types/http.js';
|
|
10
9
|
import { IdMapping, MovedId, GetIdMappingsArgs, GetMovedIdsArgs } from './types/id-mappings/index.js';
|
|
11
10
|
import { ProjectActivityStats, ProjectHealth, ProjectHealthContext, ProjectProgress, WorkspaceInsights, GetProjectActivityStatsArgs, GetWorkspaceInsightsArgs } from './types/insights/index.js';
|
|
@@ -76,7 +75,6 @@ export declare class TodoistApi {
|
|
|
76
75
|
private readonly activityClient;
|
|
77
76
|
private readonly productivityClient;
|
|
78
77
|
private readonly workspaceClient;
|
|
79
|
-
private readonly goalsClient;
|
|
80
78
|
private readonly appClient;
|
|
81
79
|
private readonly uiExtensionClient;
|
|
82
80
|
constructor(
|
|
@@ -789,16 +787,6 @@ export declare class TodoistApi {
|
|
|
789
787
|
* @returns A promise that resolves to `true` if successful.
|
|
790
788
|
*/
|
|
791
789
|
deleteFolder(id: string, requestId?: string): Promise<boolean>;
|
|
792
|
-
getGoals(args?: GetGoalsArgs): Promise<GetGoalsResponse>;
|
|
793
|
-
searchGoals(args: SearchGoalsArgs): Promise<GetGoalsResponse>;
|
|
794
|
-
getGoal(id: string): Promise<Goal>;
|
|
795
|
-
addGoal(args: AddGoalArgs, requestId?: string): Promise<Goal>;
|
|
796
|
-
updateGoal(id: string, args: UpdateGoalArgs, requestId?: string): Promise<Goal>;
|
|
797
|
-
deleteGoal(id: string, requestId?: string): Promise<boolean>;
|
|
798
|
-
completeGoal(id: string, requestId?: string): Promise<Goal>;
|
|
799
|
-
uncompleteGoal(id: string, requestId?: string): Promise<Goal>;
|
|
800
|
-
linkTaskToGoal(args: TaskLinkingArgs, requestId?: string): Promise<Goal>;
|
|
801
|
-
unlinkTaskFromGoal(args: TaskLinkingArgs, requestId?: string): Promise<boolean>;
|
|
802
790
|
/**
|
|
803
791
|
* Retrieves a list of available backups.
|
|
804
792
|
*
|
|
@@ -152,6 +152,7 @@ export declare const AppTokenScopesSchema: z.ZodPipe<z.ZodNullable<z.ZodString>,
|
|
|
152
152
|
*/
|
|
153
153
|
export declare const AppSchema: z.ZodObject<{
|
|
154
154
|
id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
155
|
+
clientId: z.ZodString;
|
|
155
156
|
status: z.ZodEnum<{
|
|
156
157
|
public: "public";
|
|
157
158
|
}>;
|
|
@@ -176,6 +177,7 @@ export type App = z.infer<typeof AppSchema>;
|
|
|
176
177
|
*/
|
|
177
178
|
export declare const AppWithUserCountSchema: z.ZodObject<{
|
|
178
179
|
id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
180
|
+
clientId: z.ZodString;
|
|
179
181
|
status: z.ZodEnum<{
|
|
180
182
|
public: "public";
|
|
181
183
|
}>;
|
|
@@ -328,6 +330,7 @@ export type AppWebhook = z.infer<typeof AppWebhookSchema>;
|
|
|
328
330
|
*/
|
|
329
331
|
export declare const InstalledIntegrationSchema: z.ZodObject<{
|
|
330
332
|
id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
333
|
+
clientId: z.ZodString;
|
|
331
334
|
status: z.ZodEnum<{
|
|
332
335
|
public: "public";
|
|
333
336
|
}>;
|
|
@@ -359,6 +362,7 @@ export declare const AppInstallationSchema: z.ZodObject<{
|
|
|
359
362
|
appTokenScopesValidated: z.ZodBoolean;
|
|
360
363
|
integration: z.ZodNullable<z.ZodObject<{
|
|
361
364
|
id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
365
|
+
clientId: z.ZodString;
|
|
362
366
|
status: z.ZodEnum<{
|
|
363
367
|
public: "public";
|
|
364
368
|
}>;
|
|
@@ -9,7 +9,6 @@ export * from './productivity/index.js';
|
|
|
9
9
|
export * from './activity/index.js';
|
|
10
10
|
export * from './workspaces/index.js';
|
|
11
11
|
export * from './folders/index.js';
|
|
12
|
-
export * from './goals/index.js';
|
|
13
12
|
export * from './insights/index.js';
|
|
14
13
|
export * from './backups/index.js';
|
|
15
14
|
export * from './id-mappings/index.js';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { CalendarUpdateArgs, CalendarAccountUpdateArgs, CalendarAccountRestoreTaskCalendarArgs } from './calendars.js';
|
|
2
2
|
import type { FilterAddArgs, FilterUpdateArgs, FilterUpdateOrdersArgs, FilterDeleteArgs } from './filters.js';
|
|
3
3
|
import type { FolderAddArgs, FolderUpdateArgs, FolderDeleteArgs } from './folders.js';
|
|
4
|
-
import type { GoalAddArgs, GoalUpdateArgs, GoalCompleteArgs, GoalUncompleteArgs, GoalDeleteArgs, GoalLinkItemArgs, GoalUnlinkItemArgs } from './goals.js';
|
|
5
4
|
import type { LabelAddArgs, LabelRenameArgs, LabelUpdateArgs, LabelUpdateOrdersArgs, LabelDeleteArgs, LabelDeleteOccurrencesArgs } from './labels.js';
|
|
6
5
|
import type { NoteAddArgs, NoteUpdateArgs, NoteDeleteArgs, NoteReactionAddArgs, NoteReactionRemoveArgs } from './notes.js';
|
|
7
6
|
import type { LiveNotificationsMarkUnreadArgs, LiveNotificationsMarkReadArgs, LiveNotificationsMarkReadAllArgs, LiveNotificationsSetLastReadArgs } from './notifications.js';
|
|
@@ -97,13 +96,6 @@ export type SyncCommandsMap = {
|
|
|
97
96
|
workspace_goal_delete: WorkspaceGoalDeleteArgs;
|
|
98
97
|
workspace_goal_project_add: WorkspaceGoalProjectAddArgs;
|
|
99
98
|
workspace_goal_project_remove: WorkspaceGoalProjectRemoveArgs;
|
|
100
|
-
goal_add: GoalAddArgs;
|
|
101
|
-
goal_update: GoalUpdateArgs;
|
|
102
|
-
goal_complete: GoalCompleteArgs;
|
|
103
|
-
goal_uncomplete: GoalUncompleteArgs;
|
|
104
|
-
goal_delete: GoalDeleteArgs;
|
|
105
|
-
goal_link_item: GoalLinkItemArgs;
|
|
106
|
-
goal_unlink_item: GoalUnlinkItemArgs;
|
|
107
99
|
live_notifications_mark_unread: LiveNotificationsMarkUnreadArgs;
|
|
108
100
|
live_notifications_mark_read: LiveNotificationsMarkReadArgs;
|
|
109
101
|
live_notifications_mark_read_all: LiveNotificationsMarkReadAllArgs;
|
|
@@ -171,7 +163,6 @@ export * from './workspaces.js';
|
|
|
171
163
|
export * from './folders.js';
|
|
172
164
|
export * from './workspace-filters.js';
|
|
173
165
|
export * from './workspace-goals.js';
|
|
174
|
-
export * from './goals.js';
|
|
175
166
|
export * from './notifications.js';
|
|
176
167
|
export * from './sharing.js';
|
|
177
168
|
export * from './view-options.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* All available Sync API resource types.
|
|
3
3
|
*/
|
|
4
|
-
export declare const SYNC_RESOURCE_TYPES: readonly ["labels", "projects", "items", "notes", "project_notes", "sections", "filters", "reminders", "reminders_location", "locations", "user", "live_notifications", "collaborators", "collaborator_states", "user_settings", "notification_settings", "user_plan_limits", "completed_info", "stats", "workspaces", "workspace_users", "workspace_filters", "view_options", "project_view_options_defaults", "role_actions", "folders", "workspace_goals", "
|
|
4
|
+
export declare const SYNC_RESOURCE_TYPES: readonly ["labels", "projects", "items", "notes", "project_notes", "sections", "filters", "reminders", "reminders_location", "locations", "user", "live_notifications", "collaborators", "collaborator_states", "user_settings", "notification_settings", "user_plan_limits", "completed_info", "stats", "workspaces", "workspace_users", "workspace_filters", "view_options", "project_view_options_defaults", "role_actions", "folders", "workspace_goals", "day_orders", "calendars", "calendar_accounts", "suggestions", "tooltips"];
|
|
5
5
|
export type SyncResourceType = (typeof SYNC_RESOURCE_TYPES)[number];
|
|
@@ -32,7 +32,6 @@ export declare const GROUPED_BY_OPTIONS: readonly ["ASSIGNEE", "ADDED_DATE", "DU
|
|
|
32
32
|
/** Field to group tasks by. */
|
|
33
33
|
export type GroupedBy = (typeof GROUPED_BY_OPTIONS)[number];
|
|
34
34
|
export declare const GroupedBySchema: z.ZodNullable<z.ZodEnum<{
|
|
35
|
-
WORKSPACE: "WORKSPACE";
|
|
36
35
|
PROJECT: "PROJECT";
|
|
37
36
|
LABEL: "LABEL";
|
|
38
37
|
ASSIGNEE: "ASSIGNEE";
|
|
@@ -40,19 +39,20 @@ export declare const GroupedBySchema: z.ZodNullable<z.ZodEnum<{
|
|
|
40
39
|
DUE_DATE: "DUE_DATE";
|
|
41
40
|
DEADLINE: "DEADLINE";
|
|
42
41
|
PRIORITY: "PRIORITY";
|
|
42
|
+
WORKSPACE: "WORKSPACE";
|
|
43
43
|
}>>;
|
|
44
44
|
/** Available sorting options. */
|
|
45
45
|
export declare const SORTED_BY_OPTIONS: readonly ["MANUAL", "ALPHABETICALLY", "ASSIGNEE", "DUE_DATE", "DEADLINE", "ADDED_DATE", "PRIORITY", "PROJECT", "WORKSPACE"];
|
|
46
46
|
/** Field to sort tasks by. */
|
|
47
47
|
export type SortedBy = (typeof SORTED_BY_OPTIONS)[number];
|
|
48
48
|
export declare const SortedBySchema: z.ZodNullable<z.ZodEnum<{
|
|
49
|
-
WORKSPACE: "WORKSPACE";
|
|
50
49
|
PROJECT: "PROJECT";
|
|
51
50
|
ASSIGNEE: "ASSIGNEE";
|
|
52
51
|
ADDED_DATE: "ADDED_DATE";
|
|
53
52
|
DUE_DATE: "DUE_DATE";
|
|
54
53
|
DEADLINE: "DEADLINE";
|
|
55
54
|
PRIORITY: "PRIORITY";
|
|
55
|
+
WORKSPACE: "WORKSPACE";
|
|
56
56
|
MANUAL: "MANUAL";
|
|
57
57
|
ALPHABETICALLY: "ALPHABETICALLY";
|
|
58
58
|
}>>;
|
|
@@ -92,7 +92,6 @@ export declare const ViewOptionsSchema: z.ZodObject<{
|
|
|
92
92
|
}>;
|
|
93
93
|
objectId: z.ZodOptional<z.ZodString>;
|
|
94
94
|
groupedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
95
|
-
WORKSPACE: "WORKSPACE";
|
|
96
95
|
PROJECT: "PROJECT";
|
|
97
96
|
LABEL: "LABEL";
|
|
98
97
|
ASSIGNEE: "ASSIGNEE";
|
|
@@ -100,6 +99,7 @@ export declare const ViewOptionsSchema: z.ZodObject<{
|
|
|
100
99
|
DUE_DATE: "DUE_DATE";
|
|
101
100
|
DEADLINE: "DEADLINE";
|
|
102
101
|
PRIORITY: "PRIORITY";
|
|
102
|
+
WORKSPACE: "WORKSPACE";
|
|
103
103
|
}>>>;
|
|
104
104
|
filteredBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
105
105
|
viewMode: z.ZodOptional<z.ZodEnum<{
|
|
@@ -109,13 +109,13 @@ export declare const ViewOptionsSchema: z.ZodObject<{
|
|
|
109
109
|
}>>;
|
|
110
110
|
showCompletedTasks: z.ZodOptional<z.ZodBoolean>;
|
|
111
111
|
sortedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
112
|
-
WORKSPACE: "WORKSPACE";
|
|
113
112
|
PROJECT: "PROJECT";
|
|
114
113
|
ASSIGNEE: "ASSIGNEE";
|
|
115
114
|
ADDED_DATE: "ADDED_DATE";
|
|
116
115
|
DUE_DATE: "DUE_DATE";
|
|
117
116
|
DEADLINE: "DEADLINE";
|
|
118
117
|
PRIORITY: "PRIORITY";
|
|
118
|
+
WORKSPACE: "WORKSPACE";
|
|
119
119
|
MANUAL: "MANUAL";
|
|
120
120
|
ALPHABETICALLY: "ALPHABETICALLY";
|
|
121
121
|
}>>>;
|
|
@@ -133,7 +133,6 @@ export declare const ProjectViewOptionsDefaultsSchema: z.ZodObject<{
|
|
|
133
133
|
CALENDAR: "CALENDAR";
|
|
134
134
|
}>>>;
|
|
135
135
|
groupedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
136
|
-
WORKSPACE: "WORKSPACE";
|
|
137
136
|
PROJECT: "PROJECT";
|
|
138
137
|
LABEL: "LABEL";
|
|
139
138
|
ASSIGNEE: "ASSIGNEE";
|
|
@@ -141,15 +140,16 @@ export declare const ProjectViewOptionsDefaultsSchema: z.ZodObject<{
|
|
|
141
140
|
DUE_DATE: "DUE_DATE";
|
|
142
141
|
DEADLINE: "DEADLINE";
|
|
143
142
|
PRIORITY: "PRIORITY";
|
|
143
|
+
WORKSPACE: "WORKSPACE";
|
|
144
144
|
}>>>;
|
|
145
145
|
sortedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
146
|
-
WORKSPACE: "WORKSPACE";
|
|
147
146
|
PROJECT: "PROJECT";
|
|
148
147
|
ASSIGNEE: "ASSIGNEE";
|
|
149
148
|
ADDED_DATE: "ADDED_DATE";
|
|
150
149
|
DUE_DATE: "DUE_DATE";
|
|
151
150
|
DEADLINE: "DEADLINE";
|
|
152
151
|
PRIORITY: "PRIORITY";
|
|
152
|
+
WORKSPACE: "WORKSPACE";
|
|
153
153
|
MANUAL: "MANUAL";
|
|
154
154
|
ALPHABETICALLY: "ALPHABETICALLY";
|
|
155
155
|
}>>>;
|