@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/entities.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare const DueDateSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
24
24
|
}>;
|
|
25
25
|
/**
|
|
26
26
|
* Represents a due date for a task.
|
|
27
|
-
* @see https://
|
|
27
|
+
* @see https://todoist.com/api/v1/docs#tag/Tasks/operation/get_tasks_api_v1_tasks_get
|
|
28
28
|
*/
|
|
29
29
|
export interface DueDate extends z.infer<typeof DueDateSchema> {
|
|
30
30
|
}
|
|
@@ -39,8 +39,8 @@ export declare const DurationSchema: z.ZodObject<{
|
|
|
39
39
|
unit: "minute" | "day";
|
|
40
40
|
}>;
|
|
41
41
|
/**
|
|
42
|
-
* Represents
|
|
43
|
-
* @see https://
|
|
42
|
+
* Represents a duration for a task deadline.
|
|
43
|
+
* @see https://todoist.com/api/v1/docs#tag/Tasks
|
|
44
44
|
*/
|
|
45
45
|
export interface Duration extends z.infer<typeof DurationSchema> {
|
|
46
46
|
}
|
|
@@ -59,6 +59,147 @@ export declare const DeadlineSchema: z.ZodObject<{
|
|
|
59
59
|
*/
|
|
60
60
|
export interface Deadline extends z.infer<typeof DeadlineSchema> {
|
|
61
61
|
}
|
|
62
|
+
export declare const RawTaskSchema: z.ZodObject<{
|
|
63
|
+
userId: z.ZodString;
|
|
64
|
+
id: z.ZodString;
|
|
65
|
+
projectId: z.ZodString;
|
|
66
|
+
sectionId: z.ZodNullable<z.ZodString>;
|
|
67
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
68
|
+
addedByUid: z.ZodString;
|
|
69
|
+
assignedByUid: z.ZodNullable<z.ZodString>;
|
|
70
|
+
responsibleUid: z.ZodNullable<z.ZodString>;
|
|
71
|
+
labels: z.ZodArray<z.ZodString, "many">;
|
|
72
|
+
deadline: z.ZodNullable<z.ZodObject<{
|
|
73
|
+
date: z.ZodString;
|
|
74
|
+
lang: z.ZodString;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
date: string;
|
|
77
|
+
lang: string;
|
|
78
|
+
}, {
|
|
79
|
+
date: string;
|
|
80
|
+
lang: string;
|
|
81
|
+
}>>;
|
|
82
|
+
duration: z.ZodNullable<z.ZodObject<{
|
|
83
|
+
amount: z.ZodNumber;
|
|
84
|
+
unit: z.ZodEnum<["minute", "day"]>;
|
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
|
86
|
+
amount: number;
|
|
87
|
+
unit: "minute" | "day";
|
|
88
|
+
}, {
|
|
89
|
+
amount: number;
|
|
90
|
+
unit: "minute" | "day";
|
|
91
|
+
}>>;
|
|
92
|
+
checked: z.ZodBoolean;
|
|
93
|
+
isDeleted: z.ZodBoolean;
|
|
94
|
+
addedAt: z.ZodString;
|
|
95
|
+
completedAt: z.ZodNullable<z.ZodString>;
|
|
96
|
+
updatedAt: z.ZodString;
|
|
97
|
+
due: z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
|
|
98
|
+
isRecurring: z.ZodBoolean;
|
|
99
|
+
string: z.ZodString;
|
|
100
|
+
date: z.ZodString;
|
|
101
|
+
}, {
|
|
102
|
+
datetime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
103
|
+
timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
104
|
+
lang: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
105
|
+
}>, "strip", z.ZodTypeAny, {
|
|
106
|
+
string: string;
|
|
107
|
+
isRecurring: boolean;
|
|
108
|
+
date: string;
|
|
109
|
+
datetime?: string | null | undefined;
|
|
110
|
+
timezone?: string | null | undefined;
|
|
111
|
+
lang?: string | null | undefined;
|
|
112
|
+
}, {
|
|
113
|
+
string: string;
|
|
114
|
+
isRecurring: boolean;
|
|
115
|
+
date: string;
|
|
116
|
+
datetime?: string | null | undefined;
|
|
117
|
+
timezone?: string | null | undefined;
|
|
118
|
+
lang?: string | null | undefined;
|
|
119
|
+
}>>;
|
|
120
|
+
priority: z.ZodNumber;
|
|
121
|
+
childOrder: z.ZodNumber;
|
|
122
|
+
content: z.ZodString;
|
|
123
|
+
description: z.ZodString;
|
|
124
|
+
dayOrder: z.ZodNumber;
|
|
125
|
+
isCollapsed: z.ZodBoolean;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
userId: string;
|
|
128
|
+
id: string;
|
|
129
|
+
projectId: string;
|
|
130
|
+
sectionId: string | null;
|
|
131
|
+
parentId: string | null;
|
|
132
|
+
addedByUid: string;
|
|
133
|
+
assignedByUid: string | null;
|
|
134
|
+
responsibleUid: string | null;
|
|
135
|
+
labels: string[];
|
|
136
|
+
deadline: {
|
|
137
|
+
date: string;
|
|
138
|
+
lang: string;
|
|
139
|
+
} | null;
|
|
140
|
+
duration: {
|
|
141
|
+
amount: number;
|
|
142
|
+
unit: "minute" | "day";
|
|
143
|
+
} | null;
|
|
144
|
+
checked: boolean;
|
|
145
|
+
isDeleted: boolean;
|
|
146
|
+
addedAt: string;
|
|
147
|
+
completedAt: string | null;
|
|
148
|
+
updatedAt: string;
|
|
149
|
+
due: {
|
|
150
|
+
string: string;
|
|
151
|
+
isRecurring: boolean;
|
|
152
|
+
date: string;
|
|
153
|
+
datetime?: string | null | undefined;
|
|
154
|
+
timezone?: string | null | undefined;
|
|
155
|
+
lang?: string | null | undefined;
|
|
156
|
+
} | null;
|
|
157
|
+
priority: number;
|
|
158
|
+
childOrder: number;
|
|
159
|
+
content: string;
|
|
160
|
+
description: string;
|
|
161
|
+
dayOrder: number;
|
|
162
|
+
isCollapsed: boolean;
|
|
163
|
+
}, {
|
|
164
|
+
userId: string;
|
|
165
|
+
id: string;
|
|
166
|
+
projectId: string;
|
|
167
|
+
sectionId: string | null;
|
|
168
|
+
parentId: string | null;
|
|
169
|
+
addedByUid: string;
|
|
170
|
+
assignedByUid: string | null;
|
|
171
|
+
responsibleUid: string | null;
|
|
172
|
+
labels: string[];
|
|
173
|
+
deadline: {
|
|
174
|
+
date: string;
|
|
175
|
+
lang: string;
|
|
176
|
+
} | null;
|
|
177
|
+
duration: {
|
|
178
|
+
amount: number;
|
|
179
|
+
unit: "minute" | "day";
|
|
180
|
+
} | null;
|
|
181
|
+
checked: boolean;
|
|
182
|
+
isDeleted: boolean;
|
|
183
|
+
addedAt: string;
|
|
184
|
+
completedAt: string | null;
|
|
185
|
+
updatedAt: string;
|
|
186
|
+
due: {
|
|
187
|
+
string: string;
|
|
188
|
+
isRecurring: boolean;
|
|
189
|
+
date: string;
|
|
190
|
+
datetime?: string | null | undefined;
|
|
191
|
+
timezone?: string | null | undefined;
|
|
192
|
+
lang?: string | null | undefined;
|
|
193
|
+
} | null;
|
|
194
|
+
priority: number;
|
|
195
|
+
childOrder: number;
|
|
196
|
+
content: string;
|
|
197
|
+
description: string;
|
|
198
|
+
dayOrder: number;
|
|
199
|
+
isCollapsed: boolean;
|
|
200
|
+
}>;
|
|
201
|
+
export interface RawTask extends z.infer<typeof RawTaskSchema> {
|
|
202
|
+
}
|
|
62
203
|
export declare const TaskSchema: z.ZodObject<{
|
|
63
204
|
id: z.ZodString;
|
|
64
205
|
assignerId: z.ZodNullable<z.ZodString>;
|
|
@@ -120,19 +261,18 @@ export declare const TaskSchema: z.ZodObject<{
|
|
|
120
261
|
}>>;
|
|
121
262
|
}, "strip", z.ZodTypeAny, {
|
|
122
263
|
id: string;
|
|
123
|
-
assignerId: string | null;
|
|
124
|
-
assigneeId: string | null;
|
|
125
264
|
projectId: string;
|
|
126
265
|
sectionId: string | null;
|
|
127
266
|
parentId: string | null;
|
|
128
|
-
order: number;
|
|
129
|
-
content: string;
|
|
130
|
-
description: string;
|
|
131
|
-
isCompleted: boolean;
|
|
132
267
|
labels: string[];
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
268
|
+
deadline: {
|
|
269
|
+
date: string;
|
|
270
|
+
lang: string;
|
|
271
|
+
} | null;
|
|
272
|
+
duration: {
|
|
273
|
+
amount: number;
|
|
274
|
+
unit: "minute" | "day";
|
|
275
|
+
} | null;
|
|
136
276
|
due: {
|
|
137
277
|
string: string;
|
|
138
278
|
isRecurring: boolean;
|
|
@@ -141,30 +281,30 @@ export declare const TaskSchema: z.ZodObject<{
|
|
|
141
281
|
timezone?: string | null | undefined;
|
|
142
282
|
lang?: string | null | undefined;
|
|
143
283
|
} | null;
|
|
284
|
+
priority: number;
|
|
285
|
+
content: string;
|
|
286
|
+
description: string;
|
|
287
|
+
assignerId: string | null;
|
|
288
|
+
assigneeId: string | null;
|
|
289
|
+
order: number;
|
|
290
|
+
isCompleted: boolean;
|
|
291
|
+
creatorId: string;
|
|
292
|
+
createdAt: string;
|
|
144
293
|
url: string;
|
|
145
|
-
duration: {
|
|
146
|
-
amount: number;
|
|
147
|
-
unit: "minute" | "day";
|
|
148
|
-
} | null;
|
|
149
|
-
deadline: {
|
|
150
|
-
date: string;
|
|
151
|
-
lang: string;
|
|
152
|
-
} | null;
|
|
153
294
|
}, {
|
|
154
295
|
id: string;
|
|
155
|
-
assignerId: string | null;
|
|
156
|
-
assigneeId: string | null;
|
|
157
296
|
projectId: string;
|
|
158
297
|
sectionId: string | null;
|
|
159
298
|
parentId: string | null;
|
|
160
|
-
order: number;
|
|
161
|
-
content: string;
|
|
162
|
-
description: string;
|
|
163
|
-
isCompleted: boolean;
|
|
164
299
|
labels: string[];
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
300
|
+
deadline: {
|
|
301
|
+
date: string;
|
|
302
|
+
lang: string;
|
|
303
|
+
} | null;
|
|
304
|
+
duration: {
|
|
305
|
+
amount: number;
|
|
306
|
+
unit: "minute" | "day";
|
|
307
|
+
} | null;
|
|
168
308
|
due: {
|
|
169
309
|
string: string;
|
|
170
310
|
isRecurring: boolean;
|
|
@@ -173,22 +313,86 @@ export declare const TaskSchema: z.ZodObject<{
|
|
|
173
313
|
timezone?: string | null | undefined;
|
|
174
314
|
lang?: string | null | undefined;
|
|
175
315
|
} | null;
|
|
316
|
+
priority: number;
|
|
317
|
+
content: string;
|
|
318
|
+
description: string;
|
|
319
|
+
assignerId: string | null;
|
|
320
|
+
assigneeId: string | null;
|
|
321
|
+
order: number;
|
|
322
|
+
isCompleted: boolean;
|
|
323
|
+
creatorId: string;
|
|
324
|
+
createdAt: string;
|
|
176
325
|
url: string;
|
|
177
|
-
duration: {
|
|
178
|
-
amount: number;
|
|
179
|
-
unit: "minute" | "day";
|
|
180
|
-
} | null;
|
|
181
|
-
deadline: {
|
|
182
|
-
date: string;
|
|
183
|
-
lang: string;
|
|
184
|
-
} | null;
|
|
185
326
|
}>;
|
|
186
327
|
/**
|
|
187
|
-
*
|
|
188
|
-
* @see https://
|
|
328
|
+
* Represents a task in Todoist.
|
|
329
|
+
* @see https://todoist.com/api/v1/docs#tag/Tasks
|
|
189
330
|
*/
|
|
190
331
|
export interface Task extends z.infer<typeof TaskSchema> {
|
|
191
332
|
}
|
|
333
|
+
export declare const RawProjectSchema: z.ZodObject<{
|
|
334
|
+
id: z.ZodString;
|
|
335
|
+
canAssignTasks: z.ZodBoolean;
|
|
336
|
+
childOrder: z.ZodNullable<z.ZodNumber>;
|
|
337
|
+
color: z.ZodString;
|
|
338
|
+
createdAt: z.ZodString;
|
|
339
|
+
isArchived: z.ZodBoolean;
|
|
340
|
+
isDeleted: z.ZodBoolean;
|
|
341
|
+
isFavorite: z.ZodBoolean;
|
|
342
|
+
isFrozen: z.ZodBoolean;
|
|
343
|
+
name: z.ZodString;
|
|
344
|
+
updatedAt: z.ZodString;
|
|
345
|
+
viewStyle: z.ZodString;
|
|
346
|
+
defaultOrder: z.ZodNullable<z.ZodNumber>;
|
|
347
|
+
description: z.ZodString;
|
|
348
|
+
publicAccess: z.ZodBoolean;
|
|
349
|
+
parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
350
|
+
inboxProject: z.ZodOptional<z.ZodBoolean>;
|
|
351
|
+
isCollapsed: z.ZodBoolean;
|
|
352
|
+
isShared: z.ZodBoolean;
|
|
353
|
+
}, "strip", z.ZodTypeAny, {
|
|
354
|
+
id: string;
|
|
355
|
+
isDeleted: boolean;
|
|
356
|
+
updatedAt: string;
|
|
357
|
+
childOrder: number | null;
|
|
358
|
+
description: string;
|
|
359
|
+
isCollapsed: boolean;
|
|
360
|
+
createdAt: string;
|
|
361
|
+
canAssignTasks: boolean;
|
|
362
|
+
color: string;
|
|
363
|
+
isArchived: boolean;
|
|
364
|
+
isFavorite: boolean;
|
|
365
|
+
isFrozen: boolean;
|
|
366
|
+
name: string;
|
|
367
|
+
viewStyle: string;
|
|
368
|
+
defaultOrder: number | null;
|
|
369
|
+
publicAccess: boolean;
|
|
370
|
+
isShared: boolean;
|
|
371
|
+
parentId?: string | null | undefined;
|
|
372
|
+
inboxProject?: boolean | undefined;
|
|
373
|
+
}, {
|
|
374
|
+
id: string;
|
|
375
|
+
isDeleted: boolean;
|
|
376
|
+
updatedAt: string;
|
|
377
|
+
childOrder: number | null;
|
|
378
|
+
description: string;
|
|
379
|
+
isCollapsed: boolean;
|
|
380
|
+
createdAt: string;
|
|
381
|
+
canAssignTasks: boolean;
|
|
382
|
+
color: string;
|
|
383
|
+
isArchived: boolean;
|
|
384
|
+
isFavorite: boolean;
|
|
385
|
+
isFrozen: boolean;
|
|
386
|
+
name: string;
|
|
387
|
+
viewStyle: string;
|
|
388
|
+
defaultOrder: number | null;
|
|
389
|
+
publicAccess: boolean;
|
|
390
|
+
isShared: boolean;
|
|
391
|
+
parentId?: string | null | undefined;
|
|
392
|
+
inboxProject?: boolean | undefined;
|
|
393
|
+
}>;
|
|
394
|
+
export interface RawProject extends z.infer<typeof RawProjectSchema> {
|
|
395
|
+
}
|
|
192
396
|
export declare const ProjectSchema: z.ZodObject<{
|
|
193
397
|
id: z.ZodString;
|
|
194
398
|
parentId: z.ZodNullable<z.ZodString>;
|
|
@@ -207,33 +411,33 @@ export declare const ProjectSchema: z.ZodObject<{
|
|
|
207
411
|
order: number | null;
|
|
208
412
|
url: string;
|
|
209
413
|
color: string;
|
|
414
|
+
isFavorite: boolean;
|
|
210
415
|
name: string;
|
|
416
|
+
viewStyle: string;
|
|
211
417
|
isShared: boolean;
|
|
212
|
-
isFavorite: boolean;
|
|
213
418
|
isInboxProject: boolean;
|
|
214
419
|
isTeamInbox: boolean;
|
|
215
|
-
viewStyle: string;
|
|
216
420
|
}, {
|
|
217
421
|
id: string;
|
|
218
422
|
parentId: string | null;
|
|
219
423
|
order: number | null;
|
|
220
424
|
url: string;
|
|
221
425
|
color: string;
|
|
426
|
+
isFavorite: boolean;
|
|
222
427
|
name: string;
|
|
428
|
+
viewStyle: string;
|
|
223
429
|
isShared: boolean;
|
|
224
|
-
isFavorite: boolean;
|
|
225
430
|
isInboxProject: boolean;
|
|
226
431
|
isTeamInbox: boolean;
|
|
227
|
-
viewStyle: string;
|
|
228
432
|
}>;
|
|
229
433
|
/**
|
|
230
|
-
* Represents a project in Todoist
|
|
231
|
-
* @see https://
|
|
434
|
+
* Represents a project in Todoist.
|
|
435
|
+
* @see https://todoist.com/api/v1/docs#tag/Projects
|
|
232
436
|
*/
|
|
233
437
|
export interface Project extends z.infer<typeof ProjectSchema> {
|
|
234
438
|
}
|
|
235
439
|
/**
|
|
236
|
-
* @see https://
|
|
440
|
+
* @see https://todoist.com/api/v1/docs#tag/Projects
|
|
237
441
|
*/
|
|
238
442
|
export type ProjectViewStyle = 'list' | 'board' | 'calendar';
|
|
239
443
|
export declare const SectionSchema: z.ZodObject<{
|
|
@@ -249,33 +453,33 @@ export declare const SectionSchema: z.ZodObject<{
|
|
|
249
453
|
isDeleted: z.ZodBoolean;
|
|
250
454
|
isCollapsed: z.ZodBoolean;
|
|
251
455
|
}, "strip", z.ZodTypeAny, {
|
|
456
|
+
userId: string;
|
|
252
457
|
id: string;
|
|
253
458
|
projectId: string;
|
|
254
|
-
|
|
255
|
-
userId: string;
|
|
459
|
+
isDeleted: boolean;
|
|
256
460
|
addedAt: string;
|
|
257
461
|
updatedAt: string;
|
|
462
|
+
isCollapsed: boolean;
|
|
463
|
+
isArchived: boolean;
|
|
464
|
+
name: string;
|
|
258
465
|
archivedAt: string | null;
|
|
259
466
|
sectionOrder: number;
|
|
260
|
-
isArchived: boolean;
|
|
261
|
-
isDeleted: boolean;
|
|
262
|
-
isCollapsed: boolean;
|
|
263
467
|
}, {
|
|
468
|
+
userId: string;
|
|
264
469
|
id: string;
|
|
265
470
|
projectId: string;
|
|
266
|
-
|
|
267
|
-
userId: string;
|
|
471
|
+
isDeleted: boolean;
|
|
268
472
|
addedAt: string;
|
|
269
473
|
updatedAt: string;
|
|
474
|
+
isCollapsed: boolean;
|
|
475
|
+
isArchived: boolean;
|
|
476
|
+
name: string;
|
|
270
477
|
archivedAt: string | null;
|
|
271
478
|
sectionOrder: number;
|
|
272
|
-
isArchived: boolean;
|
|
273
|
-
isDeleted: boolean;
|
|
274
|
-
isCollapsed: boolean;
|
|
275
479
|
}>;
|
|
276
480
|
/**
|
|
277
|
-
* Represents a section
|
|
278
|
-
* @see https://
|
|
481
|
+
* Represents a section in a Todoist project.
|
|
482
|
+
* @see https://todoist.com/api/v1/docs#tag/Sections
|
|
279
483
|
*/
|
|
280
484
|
export interface Section extends z.infer<typeof SectionSchema> {
|
|
281
485
|
}
|
|
@@ -289,18 +493,18 @@ export declare const LabelSchema: z.ZodObject<{
|
|
|
289
493
|
id: string;
|
|
290
494
|
order: number | null;
|
|
291
495
|
color: string;
|
|
292
|
-
name: string;
|
|
293
496
|
isFavorite: boolean;
|
|
497
|
+
name: string;
|
|
294
498
|
}, {
|
|
295
499
|
id: string;
|
|
296
500
|
order: number | null;
|
|
297
501
|
color: string;
|
|
298
|
-
name: string;
|
|
299
502
|
isFavorite: boolean;
|
|
503
|
+
name: string;
|
|
300
504
|
}>;
|
|
301
505
|
/**
|
|
302
|
-
* Represents a label in Todoist
|
|
303
|
-
* @see https://
|
|
506
|
+
* Represents a label in Todoist.
|
|
507
|
+
* @see https://todoist.com/api/v1/docs#tag/Labels
|
|
304
508
|
*/
|
|
305
509
|
export interface Label extends z.infer<typeof LabelSchema> {
|
|
306
510
|
}
|
|
@@ -346,8 +550,8 @@ export declare const AttachmentSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
346
550
|
title?: string | null | undefined;
|
|
347
551
|
}>;
|
|
348
552
|
/**
|
|
349
|
-
* Represents
|
|
350
|
-
* @see https://
|
|
553
|
+
* Represents a file attachment in a comment.
|
|
554
|
+
* @see https://todoist.com/api/v1/docs#tag/Sync/Comments/File-Attachments
|
|
351
555
|
*/
|
|
352
556
|
export interface Attachment extends z.infer<typeof AttachmentSchema> {
|
|
353
557
|
}
|
|
@@ -404,8 +608,8 @@ export declare const RawCommentSchema: z.ZodEffects<z.ZodObject<{
|
|
|
404
608
|
isDeleted: z.ZodBoolean;
|
|
405
609
|
}, "strip", z.ZodTypeAny, {
|
|
406
610
|
id: string;
|
|
407
|
-
content: string;
|
|
408
611
|
isDeleted: boolean;
|
|
612
|
+
content: string;
|
|
409
613
|
postedAt: string;
|
|
410
614
|
fileAttachment: {
|
|
411
615
|
resourceType: string;
|
|
@@ -428,8 +632,8 @@ export declare const RawCommentSchema: z.ZodEffects<z.ZodObject<{
|
|
|
428
632
|
itemId?: string | undefined;
|
|
429
633
|
}, {
|
|
430
634
|
id: string;
|
|
431
|
-
content: string;
|
|
432
635
|
isDeleted: boolean;
|
|
636
|
+
content: string;
|
|
433
637
|
postedAt: string;
|
|
434
638
|
fileAttachment: {
|
|
435
639
|
resourceType: string;
|
|
@@ -452,8 +656,8 @@ export declare const RawCommentSchema: z.ZodEffects<z.ZodObject<{
|
|
|
452
656
|
itemId?: string | undefined;
|
|
453
657
|
}>, {
|
|
454
658
|
id: string;
|
|
455
|
-
content: string;
|
|
456
659
|
isDeleted: boolean;
|
|
660
|
+
content: string;
|
|
457
661
|
postedAt: string;
|
|
458
662
|
fileAttachment: {
|
|
459
663
|
resourceType: string;
|
|
@@ -476,8 +680,8 @@ export declare const RawCommentSchema: z.ZodEffects<z.ZodObject<{
|
|
|
476
680
|
itemId?: string | undefined;
|
|
477
681
|
}, {
|
|
478
682
|
id: string;
|
|
479
|
-
content: string;
|
|
480
683
|
isDeleted: boolean;
|
|
684
|
+
content: string;
|
|
481
685
|
postedAt: string;
|
|
482
686
|
fileAttachment: {
|
|
483
687
|
resourceType: string;
|
|
@@ -500,8 +704,8 @@ export declare const RawCommentSchema: z.ZodEffects<z.ZodObject<{
|
|
|
500
704
|
itemId?: string | undefined;
|
|
501
705
|
}>;
|
|
502
706
|
/**
|
|
503
|
-
* Represents
|
|
504
|
-
* @see https://
|
|
707
|
+
* Represents a raw comment response from the API.
|
|
708
|
+
* @see https://todoist.com/api/v1/docs#tag/Comments
|
|
505
709
|
*/
|
|
506
710
|
export interface RawComment extends z.infer<typeof RawCommentSchema> {
|
|
507
711
|
}
|
|
@@ -558,8 +762,8 @@ export declare const CommentSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
|
558
762
|
isDeleted: z.ZodBoolean;
|
|
559
763
|
}, "strip", z.ZodTypeAny, {
|
|
560
764
|
id: string;
|
|
561
|
-
content: string;
|
|
562
765
|
isDeleted: boolean;
|
|
766
|
+
content: string;
|
|
563
767
|
postedAt: string;
|
|
564
768
|
fileAttachment: {
|
|
565
769
|
resourceType: string;
|
|
@@ -582,8 +786,8 @@ export declare const CommentSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
|
582
786
|
itemId?: string | undefined;
|
|
583
787
|
}, {
|
|
584
788
|
id: string;
|
|
585
|
-
content: string;
|
|
586
789
|
isDeleted: boolean;
|
|
790
|
+
content: string;
|
|
587
791
|
postedAt: string;
|
|
588
792
|
fileAttachment: {
|
|
589
793
|
resourceType: string;
|
|
@@ -606,8 +810,8 @@ export declare const CommentSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
|
606
810
|
itemId?: string | undefined;
|
|
607
811
|
}>, {
|
|
608
812
|
id: string;
|
|
609
|
-
content: string;
|
|
610
813
|
isDeleted: boolean;
|
|
814
|
+
content: string;
|
|
611
815
|
postedAt: string;
|
|
612
816
|
fileAttachment: {
|
|
613
817
|
resourceType: string;
|
|
@@ -630,8 +834,8 @@ export declare const CommentSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
|
630
834
|
itemId?: string | undefined;
|
|
631
835
|
}, {
|
|
632
836
|
id: string;
|
|
633
|
-
content: string;
|
|
634
837
|
isDeleted: boolean;
|
|
838
|
+
content: string;
|
|
635
839
|
postedAt: string;
|
|
636
840
|
fileAttachment: {
|
|
637
841
|
resourceType: string;
|
|
@@ -655,8 +859,8 @@ export declare const CommentSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
|
655
859
|
}>, {
|
|
656
860
|
taskId: string | undefined;
|
|
657
861
|
id: string;
|
|
658
|
-
content: string;
|
|
659
862
|
isDeleted: boolean;
|
|
863
|
+
content: string;
|
|
660
864
|
postedAt: string;
|
|
661
865
|
fileAttachment: {
|
|
662
866
|
resourceType: string;
|
|
@@ -678,8 +882,8 @@ export declare const CommentSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
|
678
882
|
projectId?: string | undefined;
|
|
679
883
|
}, {
|
|
680
884
|
id: string;
|
|
681
|
-
content: string;
|
|
682
885
|
isDeleted: boolean;
|
|
886
|
+
content: string;
|
|
683
887
|
postedAt: string;
|
|
684
888
|
fileAttachment: {
|
|
685
889
|
resourceType: string;
|
|
@@ -702,8 +906,8 @@ export declare const CommentSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
|
702
906
|
itemId?: string | undefined;
|
|
703
907
|
}>;
|
|
704
908
|
/**
|
|
705
|
-
* Represents a comment
|
|
706
|
-
* @see https://
|
|
909
|
+
* Represents a comment in Todoist.
|
|
910
|
+
* @see https://todoist.com/api/v1/docs#tag/Comments
|
|
707
911
|
*/
|
|
708
912
|
export interface Comment extends z.infer<typeof CommentSchema> {
|
|
709
913
|
}
|
|
@@ -722,7 +926,7 @@ export declare const UserSchema: z.ZodObject<{
|
|
|
722
926
|
}>;
|
|
723
927
|
/**
|
|
724
928
|
* Represents a user in Todoist.
|
|
725
|
-
* @see https://
|
|
929
|
+
* @see https://todoist.com/api/v1/docs#tag/User
|
|
726
930
|
*/
|
|
727
931
|
export interface User extends z.infer<typeof UserSchema> {
|
|
728
932
|
}
|
|
@@ -757,8 +961,8 @@ export declare const ColorSchema: z.ZodObject<{
|
|
|
757
961
|
hexValue: string;
|
|
758
962
|
}>;
|
|
759
963
|
/**
|
|
760
|
-
* Represents a color in Todoist
|
|
761
|
-
* @see https://
|
|
964
|
+
* Represents a color in Todoist.
|
|
965
|
+
* @see https://todoist.com/api/v1/docs#tag/Colors
|
|
762
966
|
*/
|
|
763
967
|
export interface Color extends z.infer<typeof ColorSchema> {
|
|
764
968
|
}
|
package/dist/types/entities.js
CHANGED
|
@@ -22,7 +22,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
return t;
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.ColorSchema = exports.UserSchema = exports.CommentSchema = exports.RawCommentSchema = exports.AttachmentSchema = exports.LabelSchema = exports.SectionSchema = exports.ProjectSchema = exports.TaskSchema = exports.DeadlineSchema = exports.DurationSchema = exports.DueDateSchema = void 0;
|
|
25
|
+
exports.ColorSchema = exports.UserSchema = exports.CommentSchema = exports.RawCommentSchema = exports.AttachmentSchema = exports.LabelSchema = exports.SectionSchema = exports.ProjectSchema = exports.RawProjectSchema = exports.TaskSchema = exports.RawTaskSchema = exports.DeadlineSchema = exports.DurationSchema = exports.DueDateSchema = void 0;
|
|
26
26
|
var zod_1 = require("zod");
|
|
27
27
|
exports.DueDateSchema = zod_1.z
|
|
28
28
|
.object({
|
|
@@ -43,6 +43,31 @@ exports.DeadlineSchema = zod_1.z.object({
|
|
|
43
43
|
date: zod_1.z.string(),
|
|
44
44
|
lang: zod_1.z.string(),
|
|
45
45
|
});
|
|
46
|
+
exports.RawTaskSchema = zod_1.z.object({
|
|
47
|
+
userId: zod_1.z.string(),
|
|
48
|
+
id: zod_1.z.string(),
|
|
49
|
+
projectId: zod_1.z.string(),
|
|
50
|
+
sectionId: zod_1.z.string().nullable(),
|
|
51
|
+
parentId: zod_1.z.string().nullable(),
|
|
52
|
+
addedByUid: zod_1.z.string(),
|
|
53
|
+
assignedByUid: zod_1.z.string().nullable(),
|
|
54
|
+
responsibleUid: zod_1.z.string().nullable(),
|
|
55
|
+
labels: zod_1.z.array(zod_1.z.string()),
|
|
56
|
+
deadline: exports.DeadlineSchema.nullable(),
|
|
57
|
+
duration: exports.DurationSchema.nullable(),
|
|
58
|
+
checked: zod_1.z.boolean(),
|
|
59
|
+
isDeleted: zod_1.z.boolean(),
|
|
60
|
+
addedAt: zod_1.z.string(),
|
|
61
|
+
completedAt: zod_1.z.string().nullable(),
|
|
62
|
+
updatedAt: zod_1.z.string(),
|
|
63
|
+
due: exports.DueDateSchema.nullable(),
|
|
64
|
+
priority: zod_1.z.number().int(),
|
|
65
|
+
childOrder: zod_1.z.number().int(),
|
|
66
|
+
content: zod_1.z.string(),
|
|
67
|
+
description: zod_1.z.string(),
|
|
68
|
+
dayOrder: zod_1.z.number().int(),
|
|
69
|
+
isCollapsed: zod_1.z.boolean(),
|
|
70
|
+
});
|
|
46
71
|
exports.TaskSchema = zod_1.z.object({
|
|
47
72
|
id: zod_1.z.string(),
|
|
48
73
|
assignerId: zod_1.z.string().nullable(),
|
|
@@ -63,6 +88,27 @@ exports.TaskSchema = zod_1.z.object({
|
|
|
63
88
|
duration: exports.DurationSchema.nullable(),
|
|
64
89
|
deadline: exports.DeadlineSchema.nullable(),
|
|
65
90
|
});
|
|
91
|
+
exports.RawProjectSchema = zod_1.z.object({
|
|
92
|
+
id: zod_1.z.string(),
|
|
93
|
+
canAssignTasks: zod_1.z.boolean(),
|
|
94
|
+
childOrder: zod_1.z.number().int().nullable(),
|
|
95
|
+
color: zod_1.z.string(),
|
|
96
|
+
createdAt: zod_1.z.string(),
|
|
97
|
+
isArchived: zod_1.z.boolean(),
|
|
98
|
+
isDeleted: zod_1.z.boolean(),
|
|
99
|
+
isFavorite: zod_1.z.boolean(),
|
|
100
|
+
isFrozen: zod_1.z.boolean(),
|
|
101
|
+
name: zod_1.z.string(),
|
|
102
|
+
updatedAt: zod_1.z.string(),
|
|
103
|
+
viewStyle: zod_1.z.string(),
|
|
104
|
+
defaultOrder: zod_1.z.number().int().nullable(),
|
|
105
|
+
description: zod_1.z.string(),
|
|
106
|
+
publicAccess: zod_1.z.boolean(),
|
|
107
|
+
parentId: zod_1.z.string().nullable().optional(),
|
|
108
|
+
inboxProject: zod_1.z.boolean().optional(),
|
|
109
|
+
isCollapsed: zod_1.z.boolean(),
|
|
110
|
+
isShared: zod_1.z.boolean(),
|
|
111
|
+
});
|
|
66
112
|
exports.ProjectSchema = zod_1.z.object({
|
|
67
113
|
id: zod_1.z.string(),
|
|
68
114
|
parentId: zod_1.z.string().nullable(),
|