@doist/todoist-sdk 9.5.0 → 9.7.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.
@@ -0,0 +1,345 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Enum-like object of project (`project:*`) webhook event names. Single
4
+ * source of truth for the discriminator values — `PROJECT_WEBHOOK_EVENTS`
5
+ * and every `z.literal()` below derive from it.
6
+ */
7
+ export declare const ProjectWebhookEventEnum: {
8
+ readonly Added: "project:added";
9
+ readonly Updated: "project:updated";
10
+ readonly Deleted: "project:deleted";
11
+ readonly Archived: "project:archived";
12
+ readonly Unarchived: "project:unarchived";
13
+ };
14
+ /** Webhook events that carry a project as their `eventData`. */
15
+ export declare const PROJECT_WEBHOOK_EVENTS: readonly ["project:added", "project:updated", "project:deleted", "project:archived", "project:unarchived"];
16
+ /**
17
+ * Webhook project payloads match the shape of the shared {@link Project}
18
+ * resource — either a personal or a workspace project. No webhook-specific
19
+ * schema is needed; `ProjectSchema` already dispatches on `workspaceId`.
20
+ */
21
+ export declare const ProjectAddedPayloadSchema: z.ZodObject<{
22
+ eventName: z.ZodLiteral<"project:added">;
23
+ eventData: z.ZodPipe<z.ZodUnknown, z.ZodTransform<{
24
+ url: string;
25
+ id: string;
26
+ canAssignTasks: boolean;
27
+ childOrder: number;
28
+ color: string;
29
+ createdAt: Date | null;
30
+ isArchived: boolean;
31
+ isDeleted: boolean;
32
+ isFavorite: boolean;
33
+ isFrozen: boolean;
34
+ name: string;
35
+ updatedAt: Date | null;
36
+ viewStyle: string;
37
+ defaultOrder: number;
38
+ description: string;
39
+ isCollapsed: boolean;
40
+ isShared: boolean;
41
+ parentId: string | null;
42
+ inboxProject: boolean;
43
+ } | {
44
+ url: string;
45
+ id: string;
46
+ canAssignTasks: boolean;
47
+ childOrder: number;
48
+ color: string;
49
+ createdAt: Date | null;
50
+ isArchived: boolean;
51
+ isDeleted: boolean;
52
+ isFavorite: boolean;
53
+ isFrozen: boolean;
54
+ name: string;
55
+ updatedAt: Date | null;
56
+ viewStyle: string;
57
+ defaultOrder: number;
58
+ description: string;
59
+ isCollapsed: boolean;
60
+ isShared: boolean;
61
+ collaboratorRoleDefault: string;
62
+ folderId: string | null;
63
+ isInviteOnly: boolean | null;
64
+ isLinkSharingEnabled: boolean;
65
+ role: string | null;
66
+ status: string;
67
+ workspaceId: string;
68
+ access?: {
69
+ visibility: "restricted" | "team" | "public";
70
+ } | undefined;
71
+ }, unknown>>;
72
+ version: z.ZodEnum<{
73
+ 1: "1";
74
+ }>;
75
+ userId: z.ZodString;
76
+ initiator: z.ZodObject<{
77
+ id: z.ZodString;
78
+ fullName: z.ZodString;
79
+ email: z.ZodString;
80
+ imageId: z.ZodNullable<z.ZodString>;
81
+ isPremium: z.ZodBoolean;
82
+ }, z.core.$strip>;
83
+ triggeredAt: z.ZodCoercedDate<unknown>;
84
+ }, z.core.$strip>;
85
+ export type ProjectAddedPayload = z.infer<typeof ProjectAddedPayloadSchema>;
86
+ export declare const ProjectUpdatedPayloadSchema: z.ZodObject<{
87
+ eventName: z.ZodLiteral<"project:updated">;
88
+ eventData: z.ZodPipe<z.ZodUnknown, z.ZodTransform<{
89
+ url: string;
90
+ id: string;
91
+ canAssignTasks: boolean;
92
+ childOrder: number;
93
+ color: string;
94
+ createdAt: Date | null;
95
+ isArchived: boolean;
96
+ isDeleted: boolean;
97
+ isFavorite: boolean;
98
+ isFrozen: boolean;
99
+ name: string;
100
+ updatedAt: Date | null;
101
+ viewStyle: string;
102
+ defaultOrder: number;
103
+ description: string;
104
+ isCollapsed: boolean;
105
+ isShared: boolean;
106
+ parentId: string | null;
107
+ inboxProject: boolean;
108
+ } | {
109
+ url: string;
110
+ id: string;
111
+ canAssignTasks: boolean;
112
+ childOrder: number;
113
+ color: string;
114
+ createdAt: Date | null;
115
+ isArchived: boolean;
116
+ isDeleted: boolean;
117
+ isFavorite: boolean;
118
+ isFrozen: boolean;
119
+ name: string;
120
+ updatedAt: Date | null;
121
+ viewStyle: string;
122
+ defaultOrder: number;
123
+ description: string;
124
+ isCollapsed: boolean;
125
+ isShared: boolean;
126
+ collaboratorRoleDefault: string;
127
+ folderId: string | null;
128
+ isInviteOnly: boolean | null;
129
+ isLinkSharingEnabled: boolean;
130
+ role: string | null;
131
+ status: string;
132
+ workspaceId: string;
133
+ access?: {
134
+ visibility: "restricted" | "team" | "public";
135
+ } | undefined;
136
+ }, unknown>>;
137
+ version: z.ZodEnum<{
138
+ 1: "1";
139
+ }>;
140
+ userId: z.ZodString;
141
+ initiator: z.ZodObject<{
142
+ id: z.ZodString;
143
+ fullName: z.ZodString;
144
+ email: z.ZodString;
145
+ imageId: z.ZodNullable<z.ZodString>;
146
+ isPremium: z.ZodBoolean;
147
+ }, z.core.$strip>;
148
+ triggeredAt: z.ZodCoercedDate<unknown>;
149
+ }, z.core.$strip>;
150
+ export type ProjectUpdatedPayload = z.infer<typeof ProjectUpdatedPayloadSchema>;
151
+ export declare const ProjectDeletedPayloadSchema: z.ZodObject<{
152
+ eventName: z.ZodLiteral<"project:deleted">;
153
+ eventData: z.ZodPipe<z.ZodUnknown, z.ZodTransform<{
154
+ url: string;
155
+ id: string;
156
+ canAssignTasks: boolean;
157
+ childOrder: number;
158
+ color: string;
159
+ createdAt: Date | null;
160
+ isArchived: boolean;
161
+ isDeleted: boolean;
162
+ isFavorite: boolean;
163
+ isFrozen: boolean;
164
+ name: string;
165
+ updatedAt: Date | null;
166
+ viewStyle: string;
167
+ defaultOrder: number;
168
+ description: string;
169
+ isCollapsed: boolean;
170
+ isShared: boolean;
171
+ parentId: string | null;
172
+ inboxProject: boolean;
173
+ } | {
174
+ url: string;
175
+ id: string;
176
+ canAssignTasks: boolean;
177
+ childOrder: number;
178
+ color: string;
179
+ createdAt: Date | null;
180
+ isArchived: boolean;
181
+ isDeleted: boolean;
182
+ isFavorite: boolean;
183
+ isFrozen: boolean;
184
+ name: string;
185
+ updatedAt: Date | null;
186
+ viewStyle: string;
187
+ defaultOrder: number;
188
+ description: string;
189
+ isCollapsed: boolean;
190
+ isShared: boolean;
191
+ collaboratorRoleDefault: string;
192
+ folderId: string | null;
193
+ isInviteOnly: boolean | null;
194
+ isLinkSharingEnabled: boolean;
195
+ role: string | null;
196
+ status: string;
197
+ workspaceId: string;
198
+ access?: {
199
+ visibility: "restricted" | "team" | "public";
200
+ } | undefined;
201
+ }, unknown>>;
202
+ version: z.ZodEnum<{
203
+ 1: "1";
204
+ }>;
205
+ userId: z.ZodString;
206
+ initiator: z.ZodObject<{
207
+ id: z.ZodString;
208
+ fullName: z.ZodString;
209
+ email: z.ZodString;
210
+ imageId: z.ZodNullable<z.ZodString>;
211
+ isPremium: z.ZodBoolean;
212
+ }, z.core.$strip>;
213
+ triggeredAt: z.ZodCoercedDate<unknown>;
214
+ }, z.core.$strip>;
215
+ export type ProjectDeletedPayload = z.infer<typeof ProjectDeletedPayloadSchema>;
216
+ export declare const ProjectArchivedPayloadSchema: z.ZodObject<{
217
+ eventName: z.ZodLiteral<"project:archived">;
218
+ eventData: z.ZodPipe<z.ZodUnknown, z.ZodTransform<{
219
+ url: string;
220
+ id: string;
221
+ canAssignTasks: boolean;
222
+ childOrder: number;
223
+ color: string;
224
+ createdAt: Date | null;
225
+ isArchived: boolean;
226
+ isDeleted: boolean;
227
+ isFavorite: boolean;
228
+ isFrozen: boolean;
229
+ name: string;
230
+ updatedAt: Date | null;
231
+ viewStyle: string;
232
+ defaultOrder: number;
233
+ description: string;
234
+ isCollapsed: boolean;
235
+ isShared: boolean;
236
+ parentId: string | null;
237
+ inboxProject: boolean;
238
+ } | {
239
+ url: string;
240
+ id: string;
241
+ canAssignTasks: boolean;
242
+ childOrder: number;
243
+ color: string;
244
+ createdAt: Date | null;
245
+ isArchived: boolean;
246
+ isDeleted: boolean;
247
+ isFavorite: boolean;
248
+ isFrozen: boolean;
249
+ name: string;
250
+ updatedAt: Date | null;
251
+ viewStyle: string;
252
+ defaultOrder: number;
253
+ description: string;
254
+ isCollapsed: boolean;
255
+ isShared: boolean;
256
+ collaboratorRoleDefault: string;
257
+ folderId: string | null;
258
+ isInviteOnly: boolean | null;
259
+ isLinkSharingEnabled: boolean;
260
+ role: string | null;
261
+ status: string;
262
+ workspaceId: string;
263
+ access?: {
264
+ visibility: "restricted" | "team" | "public";
265
+ } | undefined;
266
+ }, unknown>>;
267
+ version: z.ZodEnum<{
268
+ 1: "1";
269
+ }>;
270
+ userId: z.ZodString;
271
+ initiator: z.ZodObject<{
272
+ id: z.ZodString;
273
+ fullName: z.ZodString;
274
+ email: z.ZodString;
275
+ imageId: z.ZodNullable<z.ZodString>;
276
+ isPremium: z.ZodBoolean;
277
+ }, z.core.$strip>;
278
+ triggeredAt: z.ZodCoercedDate<unknown>;
279
+ }, z.core.$strip>;
280
+ export type ProjectArchivedPayload = z.infer<typeof ProjectArchivedPayloadSchema>;
281
+ export declare const ProjectUnarchivedPayloadSchema: z.ZodObject<{
282
+ eventName: z.ZodLiteral<"project:unarchived">;
283
+ eventData: z.ZodPipe<z.ZodUnknown, z.ZodTransform<{
284
+ url: string;
285
+ id: string;
286
+ canAssignTasks: boolean;
287
+ childOrder: number;
288
+ color: string;
289
+ createdAt: Date | null;
290
+ isArchived: boolean;
291
+ isDeleted: boolean;
292
+ isFavorite: boolean;
293
+ isFrozen: boolean;
294
+ name: string;
295
+ updatedAt: Date | null;
296
+ viewStyle: string;
297
+ defaultOrder: number;
298
+ description: string;
299
+ isCollapsed: boolean;
300
+ isShared: boolean;
301
+ parentId: string | null;
302
+ inboxProject: boolean;
303
+ } | {
304
+ url: string;
305
+ id: string;
306
+ canAssignTasks: boolean;
307
+ childOrder: number;
308
+ color: string;
309
+ createdAt: Date | null;
310
+ isArchived: boolean;
311
+ isDeleted: boolean;
312
+ isFavorite: boolean;
313
+ isFrozen: boolean;
314
+ name: string;
315
+ updatedAt: Date | null;
316
+ viewStyle: string;
317
+ defaultOrder: number;
318
+ description: string;
319
+ isCollapsed: boolean;
320
+ isShared: boolean;
321
+ collaboratorRoleDefault: string;
322
+ folderId: string | null;
323
+ isInviteOnly: boolean | null;
324
+ isLinkSharingEnabled: boolean;
325
+ role: string | null;
326
+ status: string;
327
+ workspaceId: string;
328
+ access?: {
329
+ visibility: "restricted" | "team" | "public";
330
+ } | undefined;
331
+ }, unknown>>;
332
+ version: z.ZodEnum<{
333
+ 1: "1";
334
+ }>;
335
+ userId: z.ZodString;
336
+ initiator: z.ZodObject<{
337
+ id: z.ZodString;
338
+ fullName: z.ZodString;
339
+ email: z.ZodString;
340
+ imageId: z.ZodNullable<z.ZodString>;
341
+ isPremium: z.ZodBoolean;
342
+ }, z.core.$strip>;
343
+ triggeredAt: z.ZodCoercedDate<unknown>;
344
+ }, z.core.$strip>;
345
+ export type ProjectUnarchivedPayload = z.infer<typeof ProjectUnarchivedPayloadSchema>;
@@ -0,0 +1,82 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Enum-like object of reminder (`reminder:*`) webhook event names. Single
4
+ * source of truth for the discriminator values — `REMINDER_WEBHOOK_EVENTS`
5
+ * and every `z.literal()` below derive from it.
6
+ */
7
+ export declare const ReminderWebhookEventEnum: {
8
+ readonly Fired: "reminder:fired";
9
+ };
10
+ /** Webhook events that carry a fired-reminder as their `eventData`. */
11
+ export declare const REMINDER_WEBHOOK_EVENTS: readonly ["reminder:fired"];
12
+ /**
13
+ * A fired-reminder notification as delivered in a webhook payload.
14
+ *
15
+ * `reminder:fired` carries a subset of the full Reminder record (closer
16
+ * to a fired-notification projection), so it doesn't line up with any of
17
+ * the {@link Reminder} discriminated variants directly. This schema
18
+ * reuses {@link ReminderBaseSchema} for the common identity fields and
19
+ * adds the fields always present on a fired notification.
20
+ */
21
+ export declare const WebhookFiredReminderSchema: z.ZodObject<{
22
+ id: z.ZodString;
23
+ notifyUid: z.ZodString;
24
+ itemId: z.ZodString;
25
+ projectId: z.ZodOptional<z.ZodString>;
26
+ isDeleted: z.ZodBoolean;
27
+ type: z.ZodEnum<{
28
+ relative: "relative";
29
+ absolute: "absolute";
30
+ location: "location";
31
+ }>;
32
+ isUrgent: z.ZodBoolean;
33
+ minuteOffset: z.ZodNullable<z.ZodNumber>;
34
+ due: z.ZodNullable<z.ZodObject<{
35
+ isRecurring: z.ZodBoolean;
36
+ string: z.ZodString;
37
+ date: z.ZodString;
38
+ datetime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
39
+ timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
40
+ lang: z.ZodOptional<z.ZodNullable<z.ZodString>>;
41
+ }, z.core.$strip>>;
42
+ }, z.core.$loose>;
43
+ /** A fired-reminder notification delivered in a webhook payload. */
44
+ export type WebhookFiredReminder = z.infer<typeof WebhookFiredReminderSchema>;
45
+ export declare const ReminderFiredPayloadSchema: z.ZodObject<{
46
+ eventName: z.ZodLiteral<"reminder:fired">;
47
+ eventData: z.ZodObject<{
48
+ id: z.ZodString;
49
+ notifyUid: z.ZodString;
50
+ itemId: z.ZodString;
51
+ projectId: z.ZodOptional<z.ZodString>;
52
+ isDeleted: z.ZodBoolean;
53
+ type: z.ZodEnum<{
54
+ relative: "relative";
55
+ absolute: "absolute";
56
+ location: "location";
57
+ }>;
58
+ isUrgent: z.ZodBoolean;
59
+ minuteOffset: z.ZodNullable<z.ZodNumber>;
60
+ due: z.ZodNullable<z.ZodObject<{
61
+ isRecurring: z.ZodBoolean;
62
+ string: z.ZodString;
63
+ date: z.ZodString;
64
+ datetime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
65
+ timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
66
+ lang: z.ZodOptional<z.ZodNullable<z.ZodString>>;
67
+ }, z.core.$strip>>;
68
+ }, z.core.$loose>;
69
+ version: z.ZodEnum<{
70
+ 1: "1";
71
+ }>;
72
+ userId: z.ZodString;
73
+ initiator: z.ZodObject<{
74
+ id: z.ZodString;
75
+ fullName: z.ZodString;
76
+ email: z.ZodString;
77
+ imageId: z.ZodNullable<z.ZodString>;
78
+ isPremium: z.ZodBoolean;
79
+ }, z.core.$strip>;
80
+ triggeredAt: z.ZodCoercedDate<unknown>;
81
+ }, z.core.$strip>;
82
+ export type ReminderFiredPayload = z.infer<typeof ReminderFiredPayloadSchema>;