@doist/todoist-api-typescript 4.0.0-alpha.7 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -4
- package/dist/TodoistApi.d.ts +11 -2
- package/dist/TodoistApi.js +51 -17
- package/dist/authentication.d.ts +6 -5
- package/dist/authentication.js +2 -1
- package/dist/consts/endpoints.d.ts +3 -2
- package/dist/consts/endpoints.js +3 -2
- package/dist/testUtils/testDefaults.d.ts +28 -26
- package/dist/testUtils/testDefaults.js +72 -2
- package/dist/types/entities.d.ts +285 -81
- package/dist/types/entities.js +47 -1
- package/dist/types/requests.d.ts +82 -33
- package/dist/utils/projectConverter.d.ts +2 -0
- package/dist/utils/projectConverter.js +25 -0
- package/dist/utils/taskConverters.d.ts +2 -1
- package/dist/utils/taskConverters.js +28 -4
- package/dist/utils/validators.js +12 -0
- package/package.json +2 -2
package/dist/types/requests.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { RequireAllOrNone, RequireOneOrNone, RequireExactlyOne } from 'type-fest';
|
|
2
2
|
import type { Comment, Deadline, DueDate, Duration, Label, Project, ProjectViewStyle, Section, Task, User } from './entities';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Arguments for creating a new task.
|
|
5
|
+
* @see https://todoist.com/api/v1/docs#tag/Tasks/operation/create_task_api_v1_tasks_post
|
|
5
6
|
*/
|
|
6
7
|
export type AddTaskArgs = {
|
|
7
8
|
content: string;
|
|
@@ -25,27 +26,38 @@ export type AddTaskArgs = {
|
|
|
25
26
|
durationUnit?: Duration['unit'];
|
|
26
27
|
}>;
|
|
27
28
|
/**
|
|
28
|
-
*
|
|
29
|
+
* Arguments for retrieving tasks.
|
|
30
|
+
* @see https://todoist.com/api/v1/docs#tag/Tasks/operation/get_tasks_api_v1_tasks_get
|
|
29
31
|
*/
|
|
30
32
|
export type GetTasksArgs = {
|
|
31
33
|
projectId?: string;
|
|
32
34
|
sectionId?: string;
|
|
35
|
+
parentId?: string;
|
|
33
36
|
label?: string;
|
|
34
|
-
filter?: string;
|
|
35
|
-
lang?: string;
|
|
36
37
|
ids?: string[];
|
|
37
38
|
cursor?: string | null;
|
|
38
39
|
limit?: number;
|
|
39
40
|
};
|
|
40
41
|
/**
|
|
41
|
-
*
|
|
42
|
+
* Arguments for retrieving tasks by filter.
|
|
43
|
+
* @see https://todoist.com/api/v1/docs#tag/Tasks/operation/get_tasks_by_filter_api_v1_tasks_filter_get
|
|
44
|
+
*/
|
|
45
|
+
export type GetTasksByFilterArgs = {
|
|
46
|
+
query: string;
|
|
47
|
+
lang?: string;
|
|
48
|
+
cursor?: string | null;
|
|
49
|
+
limit?: number;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* @see https://todoist.com/api/v1/docs#tag/Tasks/operation/get_tasks_api_v1_tasks_get
|
|
42
53
|
*/
|
|
43
54
|
export type GetTasksResponse = {
|
|
44
55
|
results: Task[];
|
|
45
56
|
nextCursor: string | null;
|
|
46
57
|
};
|
|
47
58
|
/**
|
|
48
|
-
*
|
|
59
|
+
* Arguments for updating a task.
|
|
60
|
+
* @see https://todoist.com/api/v1/docs#tag/Tasks/operation/update_task_api_v1_tasks__task_id__post
|
|
49
61
|
*/
|
|
50
62
|
export type UpdateTaskArgs = {
|
|
51
63
|
content?: string;
|
|
@@ -65,7 +77,8 @@ export type UpdateTaskArgs = {
|
|
|
65
77
|
durationUnit?: Duration['unit'];
|
|
66
78
|
}>;
|
|
67
79
|
/**
|
|
68
|
-
*
|
|
80
|
+
* Arguments for quick adding a task.
|
|
81
|
+
* @see https://todoist.com/api/v1/docs#tag/Tasks/operation/quick_add_api_v1_tasks_quick_post
|
|
69
82
|
*/
|
|
70
83
|
export type QuickAddTaskArgs = {
|
|
71
84
|
text: string;
|
|
@@ -75,7 +88,8 @@ export type QuickAddTaskArgs = {
|
|
|
75
88
|
meta?: boolean;
|
|
76
89
|
};
|
|
77
90
|
/**
|
|
78
|
-
*
|
|
91
|
+
* Response from quick adding a task.
|
|
92
|
+
* @see https://todoist.com/api/v1/docs#tag/Tasks/operation/quick_add_api_v1_tasks_quick_post
|
|
79
93
|
*/
|
|
80
94
|
export type SyncTask = {
|
|
81
95
|
id: string;
|
|
@@ -97,11 +111,13 @@ export type SyncTask = {
|
|
|
97
111
|
deadline: Deadline | null;
|
|
98
112
|
};
|
|
99
113
|
/**
|
|
100
|
-
*
|
|
114
|
+
* Response from quick adding a task.
|
|
115
|
+
* @see https://todoist.com/api/v1/docs#tag/Tasks/operation/quick_add_api_v1_tasks_quick_post
|
|
101
116
|
*/
|
|
102
117
|
export type QuickAddTaskResponse = SyncTask;
|
|
103
118
|
/**
|
|
104
|
-
*
|
|
119
|
+
* Arguments for moving a task.
|
|
120
|
+
* @see https://todoist.com/api/v1/docs#tag/Tasks/operation/move_task_api_v1_tasks__task_id__move_post
|
|
105
121
|
*/
|
|
106
122
|
export type MoveTaskArgs = RequireExactlyOne<{
|
|
107
123
|
projectId?: string;
|
|
@@ -109,21 +125,24 @@ export type MoveTaskArgs = RequireExactlyOne<{
|
|
|
109
125
|
parentId?: string;
|
|
110
126
|
}>;
|
|
111
127
|
/**
|
|
112
|
-
*
|
|
128
|
+
* Arguments for retrieving projects.
|
|
129
|
+
* @see https://todoist.com/api/v1/docs#tag/Projects/operation/get_projects_api_v1_projects_get
|
|
113
130
|
*/
|
|
114
131
|
export type GetProjectsArgs = {
|
|
115
132
|
cursor?: string | null;
|
|
116
133
|
limit?: number;
|
|
117
134
|
};
|
|
118
135
|
/**
|
|
119
|
-
*
|
|
136
|
+
* Response from retrieving projects.
|
|
137
|
+
* @see https://todoist.com/api/v1/docs#tag/Projects/operation/get_projects_api_v1_projects_get
|
|
120
138
|
*/
|
|
121
139
|
export type GetProjectsResponse = {
|
|
122
140
|
results: Project[];
|
|
123
141
|
nextCursor: string | null;
|
|
124
142
|
};
|
|
125
143
|
/**
|
|
126
|
-
*
|
|
144
|
+
* Arguments for creating a new project.
|
|
145
|
+
* @see https://todoist.com/api/v1/docs#tag/Projects/operation/create_project_api_v1_projects_post
|
|
127
146
|
*/
|
|
128
147
|
export type AddProjectArgs = {
|
|
129
148
|
name: string;
|
|
@@ -133,7 +152,8 @@ export type AddProjectArgs = {
|
|
|
133
152
|
viewStyle?: ProjectViewStyle;
|
|
134
153
|
};
|
|
135
154
|
/**
|
|
136
|
-
*
|
|
155
|
+
* Arguments for updating a project.
|
|
156
|
+
* @see https://todoist.com/api/v1/docs#tag/Projects/operation/update_project_api_v1_projects__project_id__post
|
|
137
157
|
*/
|
|
138
158
|
export type UpdateProjectArgs = {
|
|
139
159
|
name?: string;
|
|
@@ -142,21 +162,24 @@ export type UpdateProjectArgs = {
|
|
|
142
162
|
viewStyle?: ProjectViewStyle;
|
|
143
163
|
};
|
|
144
164
|
/**
|
|
145
|
-
*
|
|
165
|
+
* Arguments for retrieving project collaborators.
|
|
166
|
+
* @see https://todoist.com/api/v1/docs#tag/Projects/operation/get_project_collaborators_api_v1_projects__project_id__collaborators_get
|
|
146
167
|
*/
|
|
147
168
|
export type GetProjectCollaboratorsArgs = {
|
|
148
169
|
cursor?: string | null;
|
|
149
170
|
limit?: number;
|
|
150
171
|
};
|
|
151
172
|
/**
|
|
152
|
-
*
|
|
173
|
+
* Response from retrieving project collaborators.
|
|
174
|
+
* @see https://todoist.com/api/v1/docs#tag/Projects/operation/get_project_collaborators_api_v1_projects__project_id__collaborators_get
|
|
153
175
|
*/
|
|
154
176
|
export type GetProjectCollaboratorsResponse = {
|
|
155
177
|
results: User[];
|
|
156
178
|
nextCursor: string | null;
|
|
157
179
|
};
|
|
158
180
|
/**
|
|
159
|
-
*
|
|
181
|
+
* Arguments for retrieving sections.
|
|
182
|
+
* @see https://todoist.com/api/v1/docs#tag/Sections/operation/get_sections_api_v1_sections_get
|
|
160
183
|
*/
|
|
161
184
|
export type GetSectionsArgs = {
|
|
162
185
|
projectId: string | null;
|
|
@@ -164,14 +187,16 @@ export type GetSectionsArgs = {
|
|
|
164
187
|
limit?: number;
|
|
165
188
|
};
|
|
166
189
|
/**
|
|
167
|
-
*
|
|
190
|
+
* Response from retrieving sections.
|
|
191
|
+
* @see https://todoist.com/api/v1/docs#tag/Sections/operation/get_sections_api_v1_sections_get
|
|
168
192
|
*/
|
|
169
193
|
export type GetSectionsResponse = {
|
|
170
194
|
results: Section[];
|
|
171
195
|
nextCursor: string | null;
|
|
172
196
|
};
|
|
173
197
|
/**
|
|
174
|
-
*
|
|
198
|
+
* Arguments for creating a new section.
|
|
199
|
+
* @see https://todoist.com/api/v1/docs#tag/Sections/operation/create_section_api_v1_sections_post
|
|
175
200
|
*/
|
|
176
201
|
export type AddSectionArgs = {
|
|
177
202
|
name: string;
|
|
@@ -179,27 +204,31 @@ export type AddSectionArgs = {
|
|
|
179
204
|
order?: number | null;
|
|
180
205
|
};
|
|
181
206
|
/**
|
|
182
|
-
*
|
|
207
|
+
* Arguments for updating a section.
|
|
208
|
+
* @see https://todoist.com/api/v1/docs#tag/Sections/operation/update_section_api_v1_sections__section_id__post
|
|
183
209
|
*/
|
|
184
210
|
export type UpdateSectionArgs = {
|
|
185
211
|
name: string;
|
|
186
212
|
};
|
|
187
213
|
/**
|
|
188
|
-
*
|
|
214
|
+
* Arguments for retrieving labels.
|
|
215
|
+
* @see https://todoist.com/api/v1/docs#tag/Labels/operation/get_labels_api_v1_labels_get
|
|
189
216
|
*/
|
|
190
217
|
export type GetLabelsArgs = {
|
|
191
218
|
cursor?: string | null;
|
|
192
219
|
limit?: number;
|
|
193
220
|
};
|
|
194
221
|
/**
|
|
195
|
-
*
|
|
222
|
+
* Response from retrieving labels.
|
|
223
|
+
* @see https://todoist.com/api/v1/docs#tag/Labels/operation/get_labels_api_v1_labels_get
|
|
196
224
|
*/
|
|
197
225
|
export type GetLabelsResponse = {
|
|
198
226
|
results: Label[];
|
|
199
227
|
nextCursor: string | null;
|
|
200
228
|
};
|
|
201
229
|
/**
|
|
202
|
-
*
|
|
230
|
+
* Arguments for creating a new label.
|
|
231
|
+
* @see https://todoist.com/api/v1/docs#tag/Labels/operation/create_label_api_v1_labels_post
|
|
203
232
|
*/
|
|
204
233
|
export type AddLabelArgs = {
|
|
205
234
|
name: string;
|
|
@@ -208,7 +237,8 @@ export type AddLabelArgs = {
|
|
|
208
237
|
isFavorite?: boolean;
|
|
209
238
|
};
|
|
210
239
|
/**
|
|
211
|
-
*
|
|
240
|
+
* Arguments for updating a label.
|
|
241
|
+
* @see https://todoist.com/api/v1/docs#tag/Labels/operation/update_label_api_v1_labels__label_id__post
|
|
212
242
|
*/
|
|
213
243
|
export type UpdateLabelArgs = {
|
|
214
244
|
name?: string;
|
|
@@ -217,7 +247,8 @@ export type UpdateLabelArgs = {
|
|
|
217
247
|
isFavorite?: boolean;
|
|
218
248
|
};
|
|
219
249
|
/**
|
|
220
|
-
*
|
|
250
|
+
* Arguments for retrieving shared labels.
|
|
251
|
+
* @see https://todoist.com/api/v1/docs#tag/Labels/operation/shared_labels_api_v1_labels_shared_get
|
|
221
252
|
*/
|
|
222
253
|
export type GetSharedLabelsArgs = {
|
|
223
254
|
omitPersonal?: boolean;
|
|
@@ -225,27 +256,41 @@ export type GetSharedLabelsArgs = {
|
|
|
225
256
|
limit?: number;
|
|
226
257
|
};
|
|
227
258
|
/**
|
|
228
|
-
*
|
|
259
|
+
* Response from retrieving shared labels.
|
|
260
|
+
* @see https://todoist.com/api/v1/docs#tag/Labels/operation/shared_labels_api_v1_labels_shared_get
|
|
229
261
|
*/
|
|
230
262
|
export type GetSharedLabelsResponse = {
|
|
231
263
|
results: string[];
|
|
232
264
|
nextCursor: string | null;
|
|
233
265
|
};
|
|
234
266
|
/**
|
|
235
|
-
*
|
|
267
|
+
* Arguments for renaming a shared label.
|
|
268
|
+
* @see https://todoist.com/api/v1/docs#tag/Labels/operation/shared_labels_rename_api_v1_labels_shared_rename_post
|
|
236
269
|
*/
|
|
237
270
|
export type RenameSharedLabelArgs = {
|
|
238
271
|
name: string;
|
|
239
272
|
newName: string;
|
|
240
273
|
};
|
|
241
274
|
/**
|
|
242
|
-
*
|
|
275
|
+
* Arguments for removing a shared label.
|
|
276
|
+
* @see https://todoist.com/api/v1/docs#tag/Labels/operation/shared_labels_remove_api_v1_labels_shared_remove_post
|
|
243
277
|
*/
|
|
244
278
|
export type RemoveSharedLabelArgs = {
|
|
245
279
|
name: string;
|
|
246
280
|
};
|
|
247
281
|
/**
|
|
248
|
-
*
|
|
282
|
+
* Arguments for retrieving comments.
|
|
283
|
+
* @see https://todoist.com/api/v1/docs#tag/Comments/operation/get_comments_api_v1_comments_get
|
|
284
|
+
*/
|
|
285
|
+
export type GetCommentsArgs = {
|
|
286
|
+
taskId: string;
|
|
287
|
+
projectId?: never;
|
|
288
|
+
cursor?: string | null;
|
|
289
|
+
limit?: number;
|
|
290
|
+
};
|
|
291
|
+
/**
|
|
292
|
+
* Arguments for retrieving task comments.
|
|
293
|
+
* @see https://todoist.com/api/v1/docs#tag/Comments/operation/get_comments_api_v1_comments_get
|
|
249
294
|
*/
|
|
250
295
|
export type GetTaskCommentsArgs = {
|
|
251
296
|
taskId: string;
|
|
@@ -254,7 +299,8 @@ export type GetTaskCommentsArgs = {
|
|
|
254
299
|
limit?: number;
|
|
255
300
|
};
|
|
256
301
|
/**
|
|
257
|
-
*
|
|
302
|
+
* Arguments for retrieving project comments.
|
|
303
|
+
* @see https://todoist.com/api/v1/docs#tag/Comments/operation/get_comments_api_v1_comments_get
|
|
258
304
|
*/
|
|
259
305
|
export type GetProjectCommentsArgs = {
|
|
260
306
|
projectId: string;
|
|
@@ -263,14 +309,16 @@ export type GetProjectCommentsArgs = {
|
|
|
263
309
|
limit?: number;
|
|
264
310
|
};
|
|
265
311
|
/**
|
|
266
|
-
*
|
|
312
|
+
* Response from retrieving comments.
|
|
313
|
+
* @see https://todoist.com/api/v1/docs#tag/Comments/operation/get_comments_api_v1_comments_get
|
|
267
314
|
*/
|
|
268
315
|
export type GetCommentsResponse = {
|
|
269
316
|
results: Comment[];
|
|
270
317
|
nextCursor: string | null;
|
|
271
318
|
};
|
|
272
319
|
/**
|
|
273
|
-
*
|
|
320
|
+
* Arguments for creating a new comment.
|
|
321
|
+
* @see https://todoist.com/api/v1/docs#tag/Comments/operation/create_comment_api_v1_comments_post
|
|
274
322
|
*/
|
|
275
323
|
export type AddCommentArgs = {
|
|
276
324
|
content: string;
|
|
@@ -285,7 +333,8 @@ export type AddCommentArgs = {
|
|
|
285
333
|
projectId?: string;
|
|
286
334
|
}>;
|
|
287
335
|
/**
|
|
288
|
-
*
|
|
336
|
+
* Arguments for updating a comment.
|
|
337
|
+
* @see https://todoist.com/api/v1/docs#tag/Comments/operation/update_comment_api_v1_comments__comment_id__post
|
|
289
338
|
*/
|
|
290
339
|
export type UpdateCommentArgs = {
|
|
291
340
|
content: string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getProjectFromRawProjectResponse = void 0;
|
|
4
|
+
var showProjectEndpoint = 'https://todoist.com/showProject';
|
|
5
|
+
function getProjectUrlFromProjectId(projectId) {
|
|
6
|
+
return "".concat(showProjectEndpoint, "?id=").concat(projectId);
|
|
7
|
+
}
|
|
8
|
+
function getProjectFromRawProjectResponse(responseData) {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
var project = {
|
|
11
|
+
id: responseData.id,
|
|
12
|
+
parentId: (_a = responseData.parentId) !== null && _a !== void 0 ? _a : null, // workspace projects do not have a parent
|
|
13
|
+
order: responseData.childOrder,
|
|
14
|
+
color: responseData.color,
|
|
15
|
+
name: responseData.name,
|
|
16
|
+
isShared: responseData.isShared,
|
|
17
|
+
isFavorite: responseData.isFavorite,
|
|
18
|
+
isInboxProject: (_b = responseData.inboxProject) !== null && _b !== void 0 ? _b : false, // workspace projects do not set this flag
|
|
19
|
+
isTeamInbox: false, // this flag is no longer used
|
|
20
|
+
url: getProjectUrlFromProjectId(responseData.id),
|
|
21
|
+
viewStyle: responseData.viewStyle,
|
|
22
|
+
};
|
|
23
|
+
return project;
|
|
24
|
+
}
|
|
25
|
+
exports.getProjectFromRawProjectResponse = getProjectFromRawProjectResponse;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { QuickAddTaskResponse, Task } from '../types';
|
|
1
|
+
import { QuickAddTaskResponse, RawTask, Task } from '../types';
|
|
2
2
|
export declare function getTaskFromQuickAddResponse(responseData: QuickAddTaskResponse): Task;
|
|
3
|
+
export declare function getTaskFromRawTaskResponse(responseData: RawTask): Task;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTaskFromQuickAddResponse = void 0;
|
|
3
|
+
exports.getTaskFromRawTaskResponse = exports.getTaskFromQuickAddResponse = void 0;
|
|
4
4
|
var showTaskEndpoint = 'https://todoist.com/showTask';
|
|
5
|
-
function
|
|
6
|
-
return "".concat(showTaskEndpoint, "?id=").concat(
|
|
5
|
+
function getTaskUrlFromTaskId(taskId) {
|
|
6
|
+
return "".concat(showTaskEndpoint, "?id=").concat(taskId);
|
|
7
7
|
}
|
|
8
8
|
function getTaskFromQuickAddResponse(responseData) {
|
|
9
9
|
var _a;
|
|
@@ -18,7 +18,7 @@ function getTaskFromQuickAddResponse(responseData) {
|
|
|
18
18
|
labels: responseData.labels,
|
|
19
19
|
priority: responseData.priority,
|
|
20
20
|
createdAt: responseData.addedAt,
|
|
21
|
-
url:
|
|
21
|
+
url: getTaskUrlFromTaskId(responseData.id),
|
|
22
22
|
creatorId: (_a = responseData.addedByUid) !== null && _a !== void 0 ? _a : '',
|
|
23
23
|
parentId: responseData.parentId,
|
|
24
24
|
duration: responseData.duration,
|
|
@@ -30,3 +30,27 @@ function getTaskFromQuickAddResponse(responseData) {
|
|
|
30
30
|
return task;
|
|
31
31
|
}
|
|
32
32
|
exports.getTaskFromQuickAddResponse = getTaskFromQuickAddResponse;
|
|
33
|
+
function getTaskFromRawTaskResponse(responseData) {
|
|
34
|
+
var task = {
|
|
35
|
+
id: responseData.id,
|
|
36
|
+
assignerId: responseData.assignedByUid,
|
|
37
|
+
assigneeId: responseData.responsibleUid,
|
|
38
|
+
projectId: responseData.projectId,
|
|
39
|
+
sectionId: responseData.sectionId,
|
|
40
|
+
parentId: responseData.parentId,
|
|
41
|
+
order: responseData.childOrder,
|
|
42
|
+
content: responseData.content,
|
|
43
|
+
description: responseData.description,
|
|
44
|
+
isCompleted: responseData.checked,
|
|
45
|
+
labels: responseData.labels,
|
|
46
|
+
priority: responseData.priority,
|
|
47
|
+
creatorId: responseData.addedByUid,
|
|
48
|
+
createdAt: responseData.addedAt,
|
|
49
|
+
due: responseData.due,
|
|
50
|
+
url: getTaskUrlFromTaskId(responseData.id),
|
|
51
|
+
duration: responseData.duration,
|
|
52
|
+
deadline: responseData.deadline,
|
|
53
|
+
};
|
|
54
|
+
return task;
|
|
55
|
+
}
|
|
56
|
+
exports.getTaskFromRawTaskResponse = getTaskFromRawTaskResponse;
|
package/dist/utils/validators.js
CHANGED
|
@@ -2,7 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validateUserArray = exports.validateUser = exports.validateCommentArray = exports.validateComment = exports.validateLabelArray = exports.validateLabel = exports.validateSectionArray = exports.validateSection = exports.validateProjectArray = exports.validateProject = exports.validateTaskArray = exports.validateTask = void 0;
|
|
4
4
|
var entities_1 = require("../types/entities");
|
|
5
|
+
var projectConverter_1 = require("./projectConverter");
|
|
6
|
+
var taskConverters_1 = require("./taskConverters");
|
|
5
7
|
function validateTask(input) {
|
|
8
|
+
var rawTaskParse = entities_1.RawTaskSchema.safeParse(input);
|
|
9
|
+
if (rawTaskParse.success) {
|
|
10
|
+
var task = (0, taskConverters_1.getTaskFromRawTaskResponse)(rawTaskParse.data);
|
|
11
|
+
return task;
|
|
12
|
+
}
|
|
6
13
|
return entities_1.TaskSchema.parse(input);
|
|
7
14
|
}
|
|
8
15
|
exports.validateTask = validateTask;
|
|
@@ -11,6 +18,11 @@ function validateTaskArray(input) {
|
|
|
11
18
|
}
|
|
12
19
|
exports.validateTaskArray = validateTaskArray;
|
|
13
20
|
function validateProject(input) {
|
|
21
|
+
var rawProjectParse = entities_1.RawProjectSchema.safeParse(input);
|
|
22
|
+
if (rawProjectParse.success) {
|
|
23
|
+
var project = (0, projectConverter_1.getProjectFromRawProjectResponse)(rawProjectParse.data);
|
|
24
|
+
return project;
|
|
25
|
+
}
|
|
14
26
|
return entities_1.ProjectSchema.parse(input);
|
|
15
27
|
}
|
|
16
28
|
exports.validateProject = validateProject;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doist/todoist-api-typescript",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "A typescript wrapper for the Todoist REST API.",
|
|
5
5
|
"author": "Doist developers",
|
|
6
6
|
"repository": "git@github.com:doist/todoist-api-typescript.git",
|
|
7
|
-
"homepage": "https://
|
|
7
|
+
"homepage": "https://doist.github.io/todoist-api-typescript/",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"main": "dist/index.js",
|
|
10
10
|
"types": "dist/index.d.ts",
|