@doist/todoist-sdk 9.4.0 → 9.6.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/test-utils/webhook-fixtures.js +32 -0
- package/dist/cjs/types/sections/types.js +8 -6
- package/dist/cjs/types/webhooks/comments.js +96 -0
- package/dist/cjs/types/webhooks/index.js +4 -0
- package/dist/cjs/types/webhooks/labels.js +54 -0
- package/dist/cjs/types/webhooks/projects.js +36 -0
- package/dist/cjs/types/webhooks/sections.js +48 -0
- package/dist/cjs/types/webhooks/types.js +40 -5
- package/dist/esm/test-utils/webhook-fixtures.js +26 -0
- package/dist/esm/types/sections/types.js +7 -5
- package/dist/esm/types/webhooks/comments.js +93 -0
- package/dist/esm/types/webhooks/index.js +4 -0
- package/dist/esm/types/webhooks/labels.js +51 -0
- package/dist/esm/types/webhooks/projects.js +33 -0
- package/dist/esm/types/webhooks/sections.js +45 -0
- package/dist/esm/types/webhooks/types.js +40 -5
- package/dist/types/test-utils/webhook-fixtures.d.ts +13 -0
- package/dist/types/types/sections/types.d.ts +18 -0
- package/dist/types/types/webhooks/comments.d.ts +1600 -0
- package/dist/types/types/webhooks/index.d.ts +4 -0
- package/dist/types/types/webhooks/labels.d.ts +160 -0
- package/dist/types/types/webhooks/projects.d.ts +345 -0
- package/dist/types/types/webhooks/sections.d.ts +335 -0
- package/dist/types/types/webhooks/types.d.ts +1635 -36
- package/package.json +1 -1
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Enum-like object of section (`section:*`) webhook event names. Single
|
|
4
|
+
* source of truth for the discriminator values — `SECTION_WEBHOOK_EVENTS`
|
|
5
|
+
* and every `z.literal()` below derive from it.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SectionWebhookEventEnum: {
|
|
8
|
+
readonly Added: "section:added";
|
|
9
|
+
readonly Updated: "section:updated";
|
|
10
|
+
readonly Deleted: "section:deleted";
|
|
11
|
+
readonly Archived: "section:archived";
|
|
12
|
+
readonly Unarchived: "section:unarchived";
|
|
13
|
+
};
|
|
14
|
+
/** Webhook events that carry a section as their `eventData`. */
|
|
15
|
+
export declare const SECTION_WEBHOOK_EVENTS: readonly ["section:added", "section:updated", "section:deleted", "section:archived", "section:unarchived"];
|
|
16
|
+
/**
|
|
17
|
+
* A section as delivered in a webhook payload.
|
|
18
|
+
*
|
|
19
|
+
* Reuses {@link SectionBaseSchema} and overrides `updatedAt` to tolerate
|
|
20
|
+
* payloads that deliver it as `null` or omit the key entirely — tombstones
|
|
21
|
+
* and never-updated sections come through without an `updated_at` value.
|
|
22
|
+
* The result is normalised to `Date | null` so consumers don't have to
|
|
23
|
+
* handle three shapes. Surfaces the computed `url` so the exposed shape
|
|
24
|
+
* matches {@link Section}.
|
|
25
|
+
*/
|
|
26
|
+
export declare const WebhookSectionSchema: z.ZodPipe<z.ZodObject<{
|
|
27
|
+
id: z.ZodString;
|
|
28
|
+
userId: z.ZodString;
|
|
29
|
+
projectId: z.ZodString;
|
|
30
|
+
addedAt: z.ZodCoercedDate<unknown>;
|
|
31
|
+
archivedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
32
|
+
name: z.ZodString;
|
|
33
|
+
sectionOrder: z.ZodNumber;
|
|
34
|
+
isArchived: z.ZodBoolean;
|
|
35
|
+
isDeleted: z.ZodBoolean;
|
|
36
|
+
isCollapsed: z.ZodBoolean;
|
|
37
|
+
updatedAt: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>, z.ZodTransform<Date | null, Date | null | undefined>>;
|
|
38
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
39
|
+
url: string;
|
|
40
|
+
id: string;
|
|
41
|
+
userId: string;
|
|
42
|
+
projectId: string;
|
|
43
|
+
addedAt: Date;
|
|
44
|
+
archivedAt: Date | null;
|
|
45
|
+
name: string;
|
|
46
|
+
sectionOrder: number;
|
|
47
|
+
isArchived: boolean;
|
|
48
|
+
isDeleted: boolean;
|
|
49
|
+
isCollapsed: boolean;
|
|
50
|
+
updatedAt: Date | null;
|
|
51
|
+
}, {
|
|
52
|
+
id: string;
|
|
53
|
+
userId: string;
|
|
54
|
+
projectId: string;
|
|
55
|
+
addedAt: Date;
|
|
56
|
+
archivedAt: Date | null;
|
|
57
|
+
name: string;
|
|
58
|
+
sectionOrder: number;
|
|
59
|
+
isArchived: boolean;
|
|
60
|
+
isDeleted: boolean;
|
|
61
|
+
isCollapsed: boolean;
|
|
62
|
+
updatedAt: Date | null;
|
|
63
|
+
}>>;
|
|
64
|
+
/** A section delivered in a webhook payload. */
|
|
65
|
+
export type WebhookSection = z.infer<typeof WebhookSectionSchema>;
|
|
66
|
+
export declare const SectionAddedPayloadSchema: z.ZodObject<{
|
|
67
|
+
eventName: z.ZodLiteral<"section:added">;
|
|
68
|
+
eventData: z.ZodPipe<z.ZodObject<{
|
|
69
|
+
id: z.ZodString;
|
|
70
|
+
userId: z.ZodString;
|
|
71
|
+
projectId: z.ZodString;
|
|
72
|
+
addedAt: z.ZodCoercedDate<unknown>;
|
|
73
|
+
archivedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
74
|
+
name: z.ZodString;
|
|
75
|
+
sectionOrder: z.ZodNumber;
|
|
76
|
+
isArchived: z.ZodBoolean;
|
|
77
|
+
isDeleted: z.ZodBoolean;
|
|
78
|
+
isCollapsed: z.ZodBoolean;
|
|
79
|
+
updatedAt: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>, z.ZodTransform<Date | null, Date | null | undefined>>;
|
|
80
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
81
|
+
url: string;
|
|
82
|
+
id: string;
|
|
83
|
+
userId: string;
|
|
84
|
+
projectId: string;
|
|
85
|
+
addedAt: Date;
|
|
86
|
+
archivedAt: Date | null;
|
|
87
|
+
name: string;
|
|
88
|
+
sectionOrder: number;
|
|
89
|
+
isArchived: boolean;
|
|
90
|
+
isDeleted: boolean;
|
|
91
|
+
isCollapsed: boolean;
|
|
92
|
+
updatedAt: Date | null;
|
|
93
|
+
}, {
|
|
94
|
+
id: string;
|
|
95
|
+
userId: string;
|
|
96
|
+
projectId: string;
|
|
97
|
+
addedAt: Date;
|
|
98
|
+
archivedAt: Date | null;
|
|
99
|
+
name: string;
|
|
100
|
+
sectionOrder: number;
|
|
101
|
+
isArchived: boolean;
|
|
102
|
+
isDeleted: boolean;
|
|
103
|
+
isCollapsed: boolean;
|
|
104
|
+
updatedAt: Date | null;
|
|
105
|
+
}>>;
|
|
106
|
+
version: z.ZodEnum<{
|
|
107
|
+
1: "1";
|
|
108
|
+
}>;
|
|
109
|
+
userId: z.ZodString;
|
|
110
|
+
initiator: z.ZodObject<{
|
|
111
|
+
id: z.ZodString;
|
|
112
|
+
fullName: z.ZodString;
|
|
113
|
+
email: z.ZodString;
|
|
114
|
+
imageId: z.ZodNullable<z.ZodString>;
|
|
115
|
+
isPremium: z.ZodBoolean;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
triggeredAt: z.ZodCoercedDate<unknown>;
|
|
118
|
+
}, z.core.$strip>;
|
|
119
|
+
export type SectionAddedPayload = z.infer<typeof SectionAddedPayloadSchema>;
|
|
120
|
+
export declare const SectionUpdatedPayloadSchema: z.ZodObject<{
|
|
121
|
+
eventName: z.ZodLiteral<"section:updated">;
|
|
122
|
+
eventData: z.ZodPipe<z.ZodObject<{
|
|
123
|
+
id: z.ZodString;
|
|
124
|
+
userId: z.ZodString;
|
|
125
|
+
projectId: z.ZodString;
|
|
126
|
+
addedAt: z.ZodCoercedDate<unknown>;
|
|
127
|
+
archivedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
128
|
+
name: z.ZodString;
|
|
129
|
+
sectionOrder: z.ZodNumber;
|
|
130
|
+
isArchived: z.ZodBoolean;
|
|
131
|
+
isDeleted: z.ZodBoolean;
|
|
132
|
+
isCollapsed: z.ZodBoolean;
|
|
133
|
+
updatedAt: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>, z.ZodTransform<Date | null, Date | null | undefined>>;
|
|
134
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
135
|
+
url: string;
|
|
136
|
+
id: string;
|
|
137
|
+
userId: string;
|
|
138
|
+
projectId: string;
|
|
139
|
+
addedAt: Date;
|
|
140
|
+
archivedAt: Date | null;
|
|
141
|
+
name: string;
|
|
142
|
+
sectionOrder: number;
|
|
143
|
+
isArchived: boolean;
|
|
144
|
+
isDeleted: boolean;
|
|
145
|
+
isCollapsed: boolean;
|
|
146
|
+
updatedAt: Date | null;
|
|
147
|
+
}, {
|
|
148
|
+
id: string;
|
|
149
|
+
userId: string;
|
|
150
|
+
projectId: string;
|
|
151
|
+
addedAt: Date;
|
|
152
|
+
archivedAt: Date | null;
|
|
153
|
+
name: string;
|
|
154
|
+
sectionOrder: number;
|
|
155
|
+
isArchived: boolean;
|
|
156
|
+
isDeleted: boolean;
|
|
157
|
+
isCollapsed: boolean;
|
|
158
|
+
updatedAt: Date | null;
|
|
159
|
+
}>>;
|
|
160
|
+
version: z.ZodEnum<{
|
|
161
|
+
1: "1";
|
|
162
|
+
}>;
|
|
163
|
+
userId: z.ZodString;
|
|
164
|
+
initiator: z.ZodObject<{
|
|
165
|
+
id: z.ZodString;
|
|
166
|
+
fullName: z.ZodString;
|
|
167
|
+
email: z.ZodString;
|
|
168
|
+
imageId: z.ZodNullable<z.ZodString>;
|
|
169
|
+
isPremium: z.ZodBoolean;
|
|
170
|
+
}, z.core.$strip>;
|
|
171
|
+
triggeredAt: z.ZodCoercedDate<unknown>;
|
|
172
|
+
}, z.core.$strip>;
|
|
173
|
+
export type SectionUpdatedPayload = z.infer<typeof SectionUpdatedPayloadSchema>;
|
|
174
|
+
export declare const SectionDeletedPayloadSchema: z.ZodObject<{
|
|
175
|
+
eventName: z.ZodLiteral<"section:deleted">;
|
|
176
|
+
eventData: z.ZodPipe<z.ZodObject<{
|
|
177
|
+
id: z.ZodString;
|
|
178
|
+
userId: z.ZodString;
|
|
179
|
+
projectId: z.ZodString;
|
|
180
|
+
addedAt: z.ZodCoercedDate<unknown>;
|
|
181
|
+
archivedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
182
|
+
name: z.ZodString;
|
|
183
|
+
sectionOrder: z.ZodNumber;
|
|
184
|
+
isArchived: z.ZodBoolean;
|
|
185
|
+
isDeleted: z.ZodBoolean;
|
|
186
|
+
isCollapsed: z.ZodBoolean;
|
|
187
|
+
updatedAt: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>, z.ZodTransform<Date | null, Date | null | undefined>>;
|
|
188
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
189
|
+
url: string;
|
|
190
|
+
id: string;
|
|
191
|
+
userId: string;
|
|
192
|
+
projectId: string;
|
|
193
|
+
addedAt: Date;
|
|
194
|
+
archivedAt: Date | null;
|
|
195
|
+
name: string;
|
|
196
|
+
sectionOrder: number;
|
|
197
|
+
isArchived: boolean;
|
|
198
|
+
isDeleted: boolean;
|
|
199
|
+
isCollapsed: boolean;
|
|
200
|
+
updatedAt: Date | null;
|
|
201
|
+
}, {
|
|
202
|
+
id: string;
|
|
203
|
+
userId: string;
|
|
204
|
+
projectId: string;
|
|
205
|
+
addedAt: Date;
|
|
206
|
+
archivedAt: Date | null;
|
|
207
|
+
name: string;
|
|
208
|
+
sectionOrder: number;
|
|
209
|
+
isArchived: boolean;
|
|
210
|
+
isDeleted: boolean;
|
|
211
|
+
isCollapsed: boolean;
|
|
212
|
+
updatedAt: Date | null;
|
|
213
|
+
}>>;
|
|
214
|
+
version: z.ZodEnum<{
|
|
215
|
+
1: "1";
|
|
216
|
+
}>;
|
|
217
|
+
userId: z.ZodString;
|
|
218
|
+
initiator: z.ZodObject<{
|
|
219
|
+
id: z.ZodString;
|
|
220
|
+
fullName: z.ZodString;
|
|
221
|
+
email: z.ZodString;
|
|
222
|
+
imageId: z.ZodNullable<z.ZodString>;
|
|
223
|
+
isPremium: z.ZodBoolean;
|
|
224
|
+
}, z.core.$strip>;
|
|
225
|
+
triggeredAt: z.ZodCoercedDate<unknown>;
|
|
226
|
+
}, z.core.$strip>;
|
|
227
|
+
export type SectionDeletedPayload = z.infer<typeof SectionDeletedPayloadSchema>;
|
|
228
|
+
export declare const SectionArchivedPayloadSchema: z.ZodObject<{
|
|
229
|
+
eventName: z.ZodLiteral<"section:archived">;
|
|
230
|
+
eventData: z.ZodPipe<z.ZodObject<{
|
|
231
|
+
id: z.ZodString;
|
|
232
|
+
userId: z.ZodString;
|
|
233
|
+
projectId: z.ZodString;
|
|
234
|
+
addedAt: z.ZodCoercedDate<unknown>;
|
|
235
|
+
archivedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
236
|
+
name: z.ZodString;
|
|
237
|
+
sectionOrder: z.ZodNumber;
|
|
238
|
+
isArchived: z.ZodBoolean;
|
|
239
|
+
isDeleted: z.ZodBoolean;
|
|
240
|
+
isCollapsed: z.ZodBoolean;
|
|
241
|
+
updatedAt: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>, z.ZodTransform<Date | null, Date | null | undefined>>;
|
|
242
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
243
|
+
url: string;
|
|
244
|
+
id: string;
|
|
245
|
+
userId: string;
|
|
246
|
+
projectId: string;
|
|
247
|
+
addedAt: Date;
|
|
248
|
+
archivedAt: Date | null;
|
|
249
|
+
name: string;
|
|
250
|
+
sectionOrder: number;
|
|
251
|
+
isArchived: boolean;
|
|
252
|
+
isDeleted: boolean;
|
|
253
|
+
isCollapsed: boolean;
|
|
254
|
+
updatedAt: Date | null;
|
|
255
|
+
}, {
|
|
256
|
+
id: string;
|
|
257
|
+
userId: string;
|
|
258
|
+
projectId: string;
|
|
259
|
+
addedAt: Date;
|
|
260
|
+
archivedAt: Date | null;
|
|
261
|
+
name: string;
|
|
262
|
+
sectionOrder: number;
|
|
263
|
+
isArchived: boolean;
|
|
264
|
+
isDeleted: boolean;
|
|
265
|
+
isCollapsed: boolean;
|
|
266
|
+
updatedAt: Date | null;
|
|
267
|
+
}>>;
|
|
268
|
+
version: z.ZodEnum<{
|
|
269
|
+
1: "1";
|
|
270
|
+
}>;
|
|
271
|
+
userId: z.ZodString;
|
|
272
|
+
initiator: z.ZodObject<{
|
|
273
|
+
id: z.ZodString;
|
|
274
|
+
fullName: z.ZodString;
|
|
275
|
+
email: z.ZodString;
|
|
276
|
+
imageId: z.ZodNullable<z.ZodString>;
|
|
277
|
+
isPremium: z.ZodBoolean;
|
|
278
|
+
}, z.core.$strip>;
|
|
279
|
+
triggeredAt: z.ZodCoercedDate<unknown>;
|
|
280
|
+
}, z.core.$strip>;
|
|
281
|
+
export type SectionArchivedPayload = z.infer<typeof SectionArchivedPayloadSchema>;
|
|
282
|
+
export declare const SectionUnarchivedPayloadSchema: z.ZodObject<{
|
|
283
|
+
eventName: z.ZodLiteral<"section:unarchived">;
|
|
284
|
+
eventData: z.ZodPipe<z.ZodObject<{
|
|
285
|
+
id: z.ZodString;
|
|
286
|
+
userId: z.ZodString;
|
|
287
|
+
projectId: z.ZodString;
|
|
288
|
+
addedAt: z.ZodCoercedDate<unknown>;
|
|
289
|
+
archivedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
290
|
+
name: z.ZodString;
|
|
291
|
+
sectionOrder: z.ZodNumber;
|
|
292
|
+
isArchived: z.ZodBoolean;
|
|
293
|
+
isDeleted: z.ZodBoolean;
|
|
294
|
+
isCollapsed: z.ZodBoolean;
|
|
295
|
+
updatedAt: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>, z.ZodTransform<Date | null, Date | null | undefined>>;
|
|
296
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
297
|
+
url: string;
|
|
298
|
+
id: string;
|
|
299
|
+
userId: string;
|
|
300
|
+
projectId: string;
|
|
301
|
+
addedAt: Date;
|
|
302
|
+
archivedAt: Date | null;
|
|
303
|
+
name: string;
|
|
304
|
+
sectionOrder: number;
|
|
305
|
+
isArchived: boolean;
|
|
306
|
+
isDeleted: boolean;
|
|
307
|
+
isCollapsed: boolean;
|
|
308
|
+
updatedAt: Date | null;
|
|
309
|
+
}, {
|
|
310
|
+
id: string;
|
|
311
|
+
userId: string;
|
|
312
|
+
projectId: string;
|
|
313
|
+
addedAt: Date;
|
|
314
|
+
archivedAt: Date | null;
|
|
315
|
+
name: string;
|
|
316
|
+
sectionOrder: number;
|
|
317
|
+
isArchived: boolean;
|
|
318
|
+
isDeleted: boolean;
|
|
319
|
+
isCollapsed: boolean;
|
|
320
|
+
updatedAt: Date | null;
|
|
321
|
+
}>>;
|
|
322
|
+
version: z.ZodEnum<{
|
|
323
|
+
1: "1";
|
|
324
|
+
}>;
|
|
325
|
+
userId: z.ZodString;
|
|
326
|
+
initiator: z.ZodObject<{
|
|
327
|
+
id: z.ZodString;
|
|
328
|
+
fullName: z.ZodString;
|
|
329
|
+
email: z.ZodString;
|
|
330
|
+
imageId: z.ZodNullable<z.ZodString>;
|
|
331
|
+
isPremium: z.ZodBoolean;
|
|
332
|
+
}, z.core.$strip>;
|
|
333
|
+
triggeredAt: z.ZodCoercedDate<unknown>;
|
|
334
|
+
}, z.core.$strip>;
|
|
335
|
+
export type SectionUnarchivedPayload = z.infer<typeof SectionUnarchivedPayloadSchema>;
|