@workwae/sdk 0.0.0-stage → 0.1.0-alpha.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.
Files changed (56) hide show
  1. package/README.md +233 -2
  2. package/client.d.ts +36 -0
  3. package/contract/accounts/models.d.ts +726 -0
  4. package/contract/accounts/routes.d.ts +1318 -0
  5. package/contract/ai/models.d.ts +30 -0
  6. package/contract/ai/routes.d.ts +89 -0
  7. package/contract/audit-log/models.d.ts +107 -0
  8. package/contract/audit-log/routes.d.ts +72 -0
  9. package/contract/calendar/models.d.ts +837 -0
  10. package/contract/calendar/routes.d.ts +1299 -0
  11. package/contract/connect/models.d.ts +272 -0
  12. package/contract/connect/routes.d.ts +531 -0
  13. package/contract/contacts/models.d.ts +269 -0
  14. package/contract/contacts/routes.d.ts +634 -0
  15. package/contract/errors.d.ts +108 -0
  16. package/contract/events/models.d.ts +2364 -0
  17. package/contract/events/routes.d.ts +107 -0
  18. package/contract/exports/models.d.ts +67 -0
  19. package/contract/exports/routes.d.ts +196 -0
  20. package/contract/identities/models.d.ts +100 -0
  21. package/contract/identities/routes.d.ts +249 -0
  22. package/contract/limits.d.ts +170 -0
  23. package/contract/mail/models.d.ts +528 -0
  24. package/contract/mail/routes.d.ts +749 -0
  25. package/contract/meetings/models.d.ts +232 -0
  26. package/contract/meetings/routes.d.ts +386 -0
  27. package/contract/oauth-apps/models.d.ts +92 -0
  28. package/contract/oauth-apps/routes.d.ts +187 -0
  29. package/contract/org-connections/models.d.ts +383 -0
  30. package/contract/org-connections/routes.d.ts +830 -0
  31. package/contract/primitives.d.ts +140 -0
  32. package/contract/public.d.ts +26 -0
  33. package/contract/reasons.d.ts +711 -0
  34. package/contract/router.d.ts +9773 -0
  35. package/contract/send/models.d.ts +750 -0
  36. package/contract/send/routes.d.ts +1239 -0
  37. package/contract/settings/models.d.ts +103 -0
  38. package/contract/settings/routes.d.ts +110 -0
  39. package/contract/suppressions/models.d.ts +231 -0
  40. package/contract/suppressions/routes.d.ts +317 -0
  41. package/contract/templates/models.d.ts +169 -0
  42. package/contract/templates/routes.d.ts +281 -0
  43. package/contract/threads/models.d.ts +117 -0
  44. package/contract/threads/routes.d.ts +336 -0
  45. package/contract/usage/models.d.ts +213 -0
  46. package/contract/usage/routes.d.ts +81 -0
  47. package/contract/webhooks/models.d.ts +879 -0
  48. package/contract/webhooks/routes.d.ts +839 -0
  49. package/contract/webhooks/signing.d.ts +35 -0
  50. package/errors.d.ts +15 -0
  51. package/index.d.ts +6 -0
  52. package/index.js +4334 -0
  53. package/index.js.map +59 -0
  54. package/package.json +45 -4
  55. package/pagination.d.ts +40 -0
  56. package/webhooks.d.ts +28 -0
@@ -0,0 +1,879 @@
1
+ import * as z from "zod";
2
+ /** Standard Webhooks (https://www.standardwebhooks.com/) headers every delivery carries. */
3
+ export declare const WEBHOOK_HEADERS: {
4
+ readonly id: "webhook-id";
5
+ readonly timestamp: "webhook-timestamp";
6
+ readonly signature: "webhook-signature";
7
+ };
8
+ /** What a signing secret starts with; the base64 key follows. */
9
+ export declare const WEBHOOK_SECRET_PREFIX = "whsec_";
10
+ /**
11
+ * Criteria about the message an event concerns, applied to message.* and send.* events. Unset
12
+ * criteria (empty lists, null) match everything; every set criterion must match, and any one
13
+ * value of a list is enough. A set criterion the event's data cannot answer does not match.
14
+ */
15
+ export declare const WebhookMessageFilters: z.ZodObject<{
16
+ mailboxIds: z.ZodArray<z.ZodUUID>;
17
+ mailboxRoles: z.ZodArray<z.ZodEnum<{
18
+ custom: "custom";
19
+ inbox: "inbox";
20
+ sent: "sent";
21
+ drafts: "drafts";
22
+ trash: "trash";
23
+ junk: "junk";
24
+ archive: "archive";
25
+ all: "all";
26
+ important: "important";
27
+ }>>;
28
+ from: z.ZodArray<z.ZodString>;
29
+ to: z.ZodArray<z.ZodString>;
30
+ subjectContains: z.ZodArray<z.ZodString>;
31
+ hasAttachments: z.ZodNullable<z.ZodBoolean>;
32
+ direction: z.ZodNullable<z.ZodEnum<{
33
+ inbound: "inbound";
34
+ outbound: "outbound";
35
+ }>>;
36
+ }, z.core.$strip>;
37
+ export type WebhookMessageFilters = z.infer<typeof WebhookMessageFilters>;
38
+ /** Which events an endpoint receives. Test events and replays of one picked event ignore them. */
39
+ export declare const WebhookFilters: z.ZodObject<{
40
+ eventTypes: z.ZodArray<z.ZodEnum<{
41
+ "account.connected": "account.connected";
42
+ "account.updated": "account.updated";
43
+ "account.deleted": "account.deleted";
44
+ "account.reauth_required": "account.reauth_required";
45
+ "account.initialized": "account.initialized";
46
+ "account.purged": "account.purged";
47
+ "mailbox.created": "mailbox.created";
48
+ "mailbox.updated": "mailbox.updated";
49
+ "mailbox.deleted": "mailbox.deleted";
50
+ "message.created": "message.created";
51
+ "message.updated": "message.updated";
52
+ "message.deleted": "message.deleted";
53
+ "message.bounced": "message.bounced";
54
+ "message.classified": "message.classified";
55
+ "message.opened": "message.opened";
56
+ "message.clicked": "message.clicked";
57
+ "send.sent": "send.sent";
58
+ "send.retrying": "send.retrying";
59
+ "send.failed": "send.failed";
60
+ "send.rescheduled": "send.rescheduled";
61
+ "suppression.created": "suppression.created";
62
+ "calendar.initialized": "calendar.initialized";
63
+ "calendar.created": "calendar.created";
64
+ "calendar.updated": "calendar.updated";
65
+ "calendar.deleted": "calendar.deleted";
66
+ "calendar_event.created": "calendar_event.created";
67
+ "calendar_event.updated": "calendar_event.updated";
68
+ "calendar_event.deleted": "calendar_event.deleted";
69
+ "contacts.initialized": "contacts.initialized";
70
+ "contact.created": "contact.created";
71
+ "contact.updated": "contact.updated";
72
+ "contact.deleted": "contact.deleted";
73
+ "export.completed": "export.completed";
74
+ "export.failed": "export.failed";
75
+ "meeting_connection.connected": "meeting_connection.connected";
76
+ "meeting_connection.reauth_required": "meeting_connection.reauth_required";
77
+ "webhook.test": "webhook.test";
78
+ }>>;
79
+ accountIds: z.ZodArray<z.ZodUUID>;
80
+ message: z.ZodObject<{
81
+ mailboxIds: z.ZodArray<z.ZodUUID>;
82
+ mailboxRoles: z.ZodArray<z.ZodEnum<{
83
+ custom: "custom";
84
+ inbox: "inbox";
85
+ sent: "sent";
86
+ drafts: "drafts";
87
+ trash: "trash";
88
+ junk: "junk";
89
+ archive: "archive";
90
+ all: "all";
91
+ important: "important";
92
+ }>>;
93
+ from: z.ZodArray<z.ZodString>;
94
+ to: z.ZodArray<z.ZodString>;
95
+ subjectContains: z.ZodArray<z.ZodString>;
96
+ hasAttachments: z.ZodNullable<z.ZodBoolean>;
97
+ direction: z.ZodNullable<z.ZodEnum<{
98
+ inbound: "inbound";
99
+ outbound: "outbound";
100
+ }>>;
101
+ }, z.core.$strip>;
102
+ }, z.core.$strip>;
103
+ export type WebhookFilters = z.infer<typeof WebhookFilters>;
104
+ /** Message criteria as create and update take them: an omitted one is unset on create and left as
105
+ * it is on update; null clears hasAttachments and direction. */
106
+ export declare const WebhookMessageFiltersInput: z.ZodObject<{
107
+ mailboxIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
108
+ mailboxRoles: z.ZodOptional<z.ZodArray<z.ZodEnum<{
109
+ custom: "custom";
110
+ inbox: "inbox";
111
+ sent: "sent";
112
+ drafts: "drafts";
113
+ trash: "trash";
114
+ junk: "junk";
115
+ archive: "archive";
116
+ all: "all";
117
+ important: "important";
118
+ }>>>;
119
+ from: z.ZodOptional<z.ZodArray<z.ZodString>>;
120
+ to: z.ZodOptional<z.ZodArray<z.ZodString>>;
121
+ subjectContains: z.ZodOptional<z.ZodArray<z.ZodString>>;
122
+ hasAttachments: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
123
+ direction: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
124
+ inbound: "inbound";
125
+ outbound: "outbound";
126
+ }>>>;
127
+ }, z.core.$strip>;
128
+ export type WebhookMessageFiltersInput = z.infer<typeof WebhookMessageFiltersInput>;
129
+ /** Filters as create and update take them: an omitted one is unset on create and left as it is
130
+ * on update. */
131
+ export declare const WebhookFiltersInput: z.ZodObject<{
132
+ eventTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
133
+ "account.connected": "account.connected";
134
+ "account.updated": "account.updated";
135
+ "account.deleted": "account.deleted";
136
+ "account.reauth_required": "account.reauth_required";
137
+ "account.initialized": "account.initialized";
138
+ "account.purged": "account.purged";
139
+ "mailbox.created": "mailbox.created";
140
+ "mailbox.updated": "mailbox.updated";
141
+ "mailbox.deleted": "mailbox.deleted";
142
+ "message.created": "message.created";
143
+ "message.updated": "message.updated";
144
+ "message.deleted": "message.deleted";
145
+ "message.bounced": "message.bounced";
146
+ "message.classified": "message.classified";
147
+ "message.opened": "message.opened";
148
+ "message.clicked": "message.clicked";
149
+ "send.sent": "send.sent";
150
+ "send.retrying": "send.retrying";
151
+ "send.failed": "send.failed";
152
+ "send.rescheduled": "send.rescheduled";
153
+ "suppression.created": "suppression.created";
154
+ "calendar.initialized": "calendar.initialized";
155
+ "calendar.created": "calendar.created";
156
+ "calendar.updated": "calendar.updated";
157
+ "calendar.deleted": "calendar.deleted";
158
+ "calendar_event.created": "calendar_event.created";
159
+ "calendar_event.updated": "calendar_event.updated";
160
+ "calendar_event.deleted": "calendar_event.deleted";
161
+ "contacts.initialized": "contacts.initialized";
162
+ "contact.created": "contact.created";
163
+ "contact.updated": "contact.updated";
164
+ "contact.deleted": "contact.deleted";
165
+ "export.completed": "export.completed";
166
+ "export.failed": "export.failed";
167
+ "meeting_connection.connected": "meeting_connection.connected";
168
+ "meeting_connection.reauth_required": "meeting_connection.reauth_required";
169
+ "webhook.test": "webhook.test";
170
+ }>>>;
171
+ accountIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
172
+ message: z.ZodOptional<z.ZodObject<{
173
+ mailboxIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
174
+ mailboxRoles: z.ZodOptional<z.ZodArray<z.ZodEnum<{
175
+ custom: "custom";
176
+ inbox: "inbox";
177
+ sent: "sent";
178
+ drafts: "drafts";
179
+ trash: "trash";
180
+ junk: "junk";
181
+ archive: "archive";
182
+ all: "all";
183
+ important: "important";
184
+ }>>>;
185
+ from: z.ZodOptional<z.ZodArray<z.ZodString>>;
186
+ to: z.ZodOptional<z.ZodArray<z.ZodString>>;
187
+ subjectContains: z.ZodOptional<z.ZodArray<z.ZodString>>;
188
+ hasAttachments: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
189
+ direction: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
190
+ inbound: "inbound";
191
+ outbound: "outbound";
192
+ }>>>;
193
+ }, z.core.$strip>>;
194
+ }, z.core.$strip>;
195
+ export type WebhookFiltersInput = z.infer<typeof WebhookFiltersInput>;
196
+ export declare const WebhookEndpoint: z.ZodObject<{
197
+ id: z.ZodUUID;
198
+ url: z.ZodURL;
199
+ description: z.ZodNullable<z.ZodString>;
200
+ filters: z.ZodObject<{
201
+ eventTypes: z.ZodArray<z.ZodEnum<{
202
+ "account.connected": "account.connected";
203
+ "account.updated": "account.updated";
204
+ "account.deleted": "account.deleted";
205
+ "account.reauth_required": "account.reauth_required";
206
+ "account.initialized": "account.initialized";
207
+ "account.purged": "account.purged";
208
+ "mailbox.created": "mailbox.created";
209
+ "mailbox.updated": "mailbox.updated";
210
+ "mailbox.deleted": "mailbox.deleted";
211
+ "message.created": "message.created";
212
+ "message.updated": "message.updated";
213
+ "message.deleted": "message.deleted";
214
+ "message.bounced": "message.bounced";
215
+ "message.classified": "message.classified";
216
+ "message.opened": "message.opened";
217
+ "message.clicked": "message.clicked";
218
+ "send.sent": "send.sent";
219
+ "send.retrying": "send.retrying";
220
+ "send.failed": "send.failed";
221
+ "send.rescheduled": "send.rescheduled";
222
+ "suppression.created": "suppression.created";
223
+ "calendar.initialized": "calendar.initialized";
224
+ "calendar.created": "calendar.created";
225
+ "calendar.updated": "calendar.updated";
226
+ "calendar.deleted": "calendar.deleted";
227
+ "calendar_event.created": "calendar_event.created";
228
+ "calendar_event.updated": "calendar_event.updated";
229
+ "calendar_event.deleted": "calendar_event.deleted";
230
+ "contacts.initialized": "contacts.initialized";
231
+ "contact.created": "contact.created";
232
+ "contact.updated": "contact.updated";
233
+ "contact.deleted": "contact.deleted";
234
+ "export.completed": "export.completed";
235
+ "export.failed": "export.failed";
236
+ "meeting_connection.connected": "meeting_connection.connected";
237
+ "meeting_connection.reauth_required": "meeting_connection.reauth_required";
238
+ "webhook.test": "webhook.test";
239
+ }>>;
240
+ accountIds: z.ZodArray<z.ZodUUID>;
241
+ message: z.ZodObject<{
242
+ mailboxIds: z.ZodArray<z.ZodUUID>;
243
+ mailboxRoles: z.ZodArray<z.ZodEnum<{
244
+ custom: "custom";
245
+ inbox: "inbox";
246
+ sent: "sent";
247
+ drafts: "drafts";
248
+ trash: "trash";
249
+ junk: "junk";
250
+ archive: "archive";
251
+ all: "all";
252
+ important: "important";
253
+ }>>;
254
+ from: z.ZodArray<z.ZodString>;
255
+ to: z.ZodArray<z.ZodString>;
256
+ subjectContains: z.ZodArray<z.ZodString>;
257
+ hasAttachments: z.ZodNullable<z.ZodBoolean>;
258
+ direction: z.ZodNullable<z.ZodEnum<{
259
+ inbound: "inbound";
260
+ outbound: "outbound";
261
+ }>>;
262
+ }, z.core.$strip>;
263
+ }, z.core.$strip>;
264
+ isEnabled: z.ZodBoolean;
265
+ disabledReason: z.ZodNullable<z.ZodString>;
266
+ lastSuccessAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
267
+ failingSince: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
268
+ previousSecretExpiresAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
269
+ createdAt: z.ZodPreprocess<z.ZodDate, Date>;
270
+ }, z.core.$strip>;
271
+ export type WebhookEndpoint = z.infer<typeof WebhookEndpoint>;
272
+ export declare const WebhookEndpointList: z.ZodObject<{
273
+ items: z.ZodArray<z.ZodObject<{
274
+ id: z.ZodUUID;
275
+ url: z.ZodURL;
276
+ description: z.ZodNullable<z.ZodString>;
277
+ filters: z.ZodObject<{
278
+ eventTypes: z.ZodArray<z.ZodEnum<{
279
+ "account.connected": "account.connected";
280
+ "account.updated": "account.updated";
281
+ "account.deleted": "account.deleted";
282
+ "account.reauth_required": "account.reauth_required";
283
+ "account.initialized": "account.initialized";
284
+ "account.purged": "account.purged";
285
+ "mailbox.created": "mailbox.created";
286
+ "mailbox.updated": "mailbox.updated";
287
+ "mailbox.deleted": "mailbox.deleted";
288
+ "message.created": "message.created";
289
+ "message.updated": "message.updated";
290
+ "message.deleted": "message.deleted";
291
+ "message.bounced": "message.bounced";
292
+ "message.classified": "message.classified";
293
+ "message.opened": "message.opened";
294
+ "message.clicked": "message.clicked";
295
+ "send.sent": "send.sent";
296
+ "send.retrying": "send.retrying";
297
+ "send.failed": "send.failed";
298
+ "send.rescheduled": "send.rescheduled";
299
+ "suppression.created": "suppression.created";
300
+ "calendar.initialized": "calendar.initialized";
301
+ "calendar.created": "calendar.created";
302
+ "calendar.updated": "calendar.updated";
303
+ "calendar.deleted": "calendar.deleted";
304
+ "calendar_event.created": "calendar_event.created";
305
+ "calendar_event.updated": "calendar_event.updated";
306
+ "calendar_event.deleted": "calendar_event.deleted";
307
+ "contacts.initialized": "contacts.initialized";
308
+ "contact.created": "contact.created";
309
+ "contact.updated": "contact.updated";
310
+ "contact.deleted": "contact.deleted";
311
+ "export.completed": "export.completed";
312
+ "export.failed": "export.failed";
313
+ "meeting_connection.connected": "meeting_connection.connected";
314
+ "meeting_connection.reauth_required": "meeting_connection.reauth_required";
315
+ "webhook.test": "webhook.test";
316
+ }>>;
317
+ accountIds: z.ZodArray<z.ZodUUID>;
318
+ message: z.ZodObject<{
319
+ mailboxIds: z.ZodArray<z.ZodUUID>;
320
+ mailboxRoles: z.ZodArray<z.ZodEnum<{
321
+ custom: "custom";
322
+ inbox: "inbox";
323
+ sent: "sent";
324
+ drafts: "drafts";
325
+ trash: "trash";
326
+ junk: "junk";
327
+ archive: "archive";
328
+ all: "all";
329
+ important: "important";
330
+ }>>;
331
+ from: z.ZodArray<z.ZodString>;
332
+ to: z.ZodArray<z.ZodString>;
333
+ subjectContains: z.ZodArray<z.ZodString>;
334
+ hasAttachments: z.ZodNullable<z.ZodBoolean>;
335
+ direction: z.ZodNullable<z.ZodEnum<{
336
+ inbound: "inbound";
337
+ outbound: "outbound";
338
+ }>>;
339
+ }, z.core.$strip>;
340
+ }, z.core.$strip>;
341
+ isEnabled: z.ZodBoolean;
342
+ disabledReason: z.ZodNullable<z.ZodString>;
343
+ lastSuccessAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
344
+ failingSince: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
345
+ previousSecretExpiresAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
346
+ createdAt: z.ZodPreprocess<z.ZodDate, Date>;
347
+ }, z.core.$strip>>;
348
+ }, z.core.$strip>;
349
+ export type WebhookEndpointList = z.infer<typeof WebhookEndpointList>;
350
+ /** A new endpoint with its signing secret, which is returned only this once. */
351
+ export declare const WebhookEndpointWithSecret: z.ZodObject<{
352
+ endpoint: z.ZodObject<{
353
+ id: z.ZodUUID;
354
+ url: z.ZodURL;
355
+ description: z.ZodNullable<z.ZodString>;
356
+ filters: z.ZodObject<{
357
+ eventTypes: z.ZodArray<z.ZodEnum<{
358
+ "account.connected": "account.connected";
359
+ "account.updated": "account.updated";
360
+ "account.deleted": "account.deleted";
361
+ "account.reauth_required": "account.reauth_required";
362
+ "account.initialized": "account.initialized";
363
+ "account.purged": "account.purged";
364
+ "mailbox.created": "mailbox.created";
365
+ "mailbox.updated": "mailbox.updated";
366
+ "mailbox.deleted": "mailbox.deleted";
367
+ "message.created": "message.created";
368
+ "message.updated": "message.updated";
369
+ "message.deleted": "message.deleted";
370
+ "message.bounced": "message.bounced";
371
+ "message.classified": "message.classified";
372
+ "message.opened": "message.opened";
373
+ "message.clicked": "message.clicked";
374
+ "send.sent": "send.sent";
375
+ "send.retrying": "send.retrying";
376
+ "send.failed": "send.failed";
377
+ "send.rescheduled": "send.rescheduled";
378
+ "suppression.created": "suppression.created";
379
+ "calendar.initialized": "calendar.initialized";
380
+ "calendar.created": "calendar.created";
381
+ "calendar.updated": "calendar.updated";
382
+ "calendar.deleted": "calendar.deleted";
383
+ "calendar_event.created": "calendar_event.created";
384
+ "calendar_event.updated": "calendar_event.updated";
385
+ "calendar_event.deleted": "calendar_event.deleted";
386
+ "contacts.initialized": "contacts.initialized";
387
+ "contact.created": "contact.created";
388
+ "contact.updated": "contact.updated";
389
+ "contact.deleted": "contact.deleted";
390
+ "export.completed": "export.completed";
391
+ "export.failed": "export.failed";
392
+ "meeting_connection.connected": "meeting_connection.connected";
393
+ "meeting_connection.reauth_required": "meeting_connection.reauth_required";
394
+ "webhook.test": "webhook.test";
395
+ }>>;
396
+ accountIds: z.ZodArray<z.ZodUUID>;
397
+ message: z.ZodObject<{
398
+ mailboxIds: z.ZodArray<z.ZodUUID>;
399
+ mailboxRoles: z.ZodArray<z.ZodEnum<{
400
+ custom: "custom";
401
+ inbox: "inbox";
402
+ sent: "sent";
403
+ drafts: "drafts";
404
+ trash: "trash";
405
+ junk: "junk";
406
+ archive: "archive";
407
+ all: "all";
408
+ important: "important";
409
+ }>>;
410
+ from: z.ZodArray<z.ZodString>;
411
+ to: z.ZodArray<z.ZodString>;
412
+ subjectContains: z.ZodArray<z.ZodString>;
413
+ hasAttachments: z.ZodNullable<z.ZodBoolean>;
414
+ direction: z.ZodNullable<z.ZodEnum<{
415
+ inbound: "inbound";
416
+ outbound: "outbound";
417
+ }>>;
418
+ }, z.core.$strip>;
419
+ }, z.core.$strip>;
420
+ isEnabled: z.ZodBoolean;
421
+ disabledReason: z.ZodNullable<z.ZodString>;
422
+ lastSuccessAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
423
+ failingSince: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
424
+ previousSecretExpiresAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
425
+ createdAt: z.ZodPreprocess<z.ZodDate, Date>;
426
+ }, z.core.$strip>;
427
+ secret: z.ZodString;
428
+ }, z.core.$strip>;
429
+ export type WebhookEndpointWithSecret = z.infer<typeof WebhookEndpointWithSecret>;
430
+ export declare const WebhookSecret: z.ZodObject<{
431
+ secret: z.ZodString;
432
+ previousSecretExpiresAt: z.ZodNullable<z.ZodPreprocess<z.ZodDate, Date>>;
433
+ }, z.core.$strip>;
434
+ export type WebhookSecret = z.infer<typeof WebhookSecret>;
435
+ /** How long the replaced secret keeps signing deliveries alongside the new one; 0 = not at all. */
436
+ export declare const RotateWebhookSecretRequest: z.ZodObject<{
437
+ graceSeconds: z.ZodDefault<z.ZodNumber>;
438
+ }, z.core.$strip>;
439
+ export type RotateWebhookSecretRequest = z.infer<typeof RotateWebhookSecretRequest>;
440
+ export declare const WebhookEndpointIdInput: z.ZodObject<{
441
+ endpointId: z.ZodUUID;
442
+ }, z.core.$strip>;
443
+ export type WebhookEndpointIdInput = z.infer<typeof WebhookEndpointIdInput>;
444
+ export declare const CreateWebhookEndpoint: z.ZodObject<{
445
+ url: z.ZodURL;
446
+ description: z.ZodOptional<z.ZodString>;
447
+ filters: z.ZodOptional<z.ZodObject<{
448
+ eventTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
449
+ "account.connected": "account.connected";
450
+ "account.updated": "account.updated";
451
+ "account.deleted": "account.deleted";
452
+ "account.reauth_required": "account.reauth_required";
453
+ "account.initialized": "account.initialized";
454
+ "account.purged": "account.purged";
455
+ "mailbox.created": "mailbox.created";
456
+ "mailbox.updated": "mailbox.updated";
457
+ "mailbox.deleted": "mailbox.deleted";
458
+ "message.created": "message.created";
459
+ "message.updated": "message.updated";
460
+ "message.deleted": "message.deleted";
461
+ "message.bounced": "message.bounced";
462
+ "message.classified": "message.classified";
463
+ "message.opened": "message.opened";
464
+ "message.clicked": "message.clicked";
465
+ "send.sent": "send.sent";
466
+ "send.retrying": "send.retrying";
467
+ "send.failed": "send.failed";
468
+ "send.rescheduled": "send.rescheduled";
469
+ "suppression.created": "suppression.created";
470
+ "calendar.initialized": "calendar.initialized";
471
+ "calendar.created": "calendar.created";
472
+ "calendar.updated": "calendar.updated";
473
+ "calendar.deleted": "calendar.deleted";
474
+ "calendar_event.created": "calendar_event.created";
475
+ "calendar_event.updated": "calendar_event.updated";
476
+ "calendar_event.deleted": "calendar_event.deleted";
477
+ "contacts.initialized": "contacts.initialized";
478
+ "contact.created": "contact.created";
479
+ "contact.updated": "contact.updated";
480
+ "contact.deleted": "contact.deleted";
481
+ "export.completed": "export.completed";
482
+ "export.failed": "export.failed";
483
+ "meeting_connection.connected": "meeting_connection.connected";
484
+ "meeting_connection.reauth_required": "meeting_connection.reauth_required";
485
+ "webhook.test": "webhook.test";
486
+ }>>>;
487
+ accountIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
488
+ message: z.ZodOptional<z.ZodObject<{
489
+ mailboxIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
490
+ mailboxRoles: z.ZodOptional<z.ZodArray<z.ZodEnum<{
491
+ custom: "custom";
492
+ inbox: "inbox";
493
+ sent: "sent";
494
+ drafts: "drafts";
495
+ trash: "trash";
496
+ junk: "junk";
497
+ archive: "archive";
498
+ all: "all";
499
+ important: "important";
500
+ }>>>;
501
+ from: z.ZodOptional<z.ZodArray<z.ZodString>>;
502
+ to: z.ZodOptional<z.ZodArray<z.ZodString>>;
503
+ subjectContains: z.ZodOptional<z.ZodArray<z.ZodString>>;
504
+ hasAttachments: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
505
+ direction: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
506
+ inbound: "inbound";
507
+ outbound: "outbound";
508
+ }>>>;
509
+ }, z.core.$strip>>;
510
+ }, z.core.$strip>>;
511
+ }, z.core.$strip>;
512
+ export type CreateWebhookEndpoint = z.infer<typeof CreateWebhookEndpoint>;
513
+ export declare const UpdateWebhookEndpoint: z.ZodObject<{
514
+ url: z.ZodOptional<z.ZodURL>;
515
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
516
+ filters: z.ZodOptional<z.ZodObject<{
517
+ eventTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
518
+ "account.connected": "account.connected";
519
+ "account.updated": "account.updated";
520
+ "account.deleted": "account.deleted";
521
+ "account.reauth_required": "account.reauth_required";
522
+ "account.initialized": "account.initialized";
523
+ "account.purged": "account.purged";
524
+ "mailbox.created": "mailbox.created";
525
+ "mailbox.updated": "mailbox.updated";
526
+ "mailbox.deleted": "mailbox.deleted";
527
+ "message.created": "message.created";
528
+ "message.updated": "message.updated";
529
+ "message.deleted": "message.deleted";
530
+ "message.bounced": "message.bounced";
531
+ "message.classified": "message.classified";
532
+ "message.opened": "message.opened";
533
+ "message.clicked": "message.clicked";
534
+ "send.sent": "send.sent";
535
+ "send.retrying": "send.retrying";
536
+ "send.failed": "send.failed";
537
+ "send.rescheduled": "send.rescheduled";
538
+ "suppression.created": "suppression.created";
539
+ "calendar.initialized": "calendar.initialized";
540
+ "calendar.created": "calendar.created";
541
+ "calendar.updated": "calendar.updated";
542
+ "calendar.deleted": "calendar.deleted";
543
+ "calendar_event.created": "calendar_event.created";
544
+ "calendar_event.updated": "calendar_event.updated";
545
+ "calendar_event.deleted": "calendar_event.deleted";
546
+ "contacts.initialized": "contacts.initialized";
547
+ "contact.created": "contact.created";
548
+ "contact.updated": "contact.updated";
549
+ "contact.deleted": "contact.deleted";
550
+ "export.completed": "export.completed";
551
+ "export.failed": "export.failed";
552
+ "meeting_connection.connected": "meeting_connection.connected";
553
+ "meeting_connection.reauth_required": "meeting_connection.reauth_required";
554
+ "webhook.test": "webhook.test";
555
+ }>>>;
556
+ accountIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
557
+ message: z.ZodOptional<z.ZodObject<{
558
+ mailboxIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
559
+ mailboxRoles: z.ZodOptional<z.ZodArray<z.ZodEnum<{
560
+ custom: "custom";
561
+ inbox: "inbox";
562
+ sent: "sent";
563
+ drafts: "drafts";
564
+ trash: "trash";
565
+ junk: "junk";
566
+ archive: "archive";
567
+ all: "all";
568
+ important: "important";
569
+ }>>>;
570
+ from: z.ZodOptional<z.ZodArray<z.ZodString>>;
571
+ to: z.ZodOptional<z.ZodArray<z.ZodString>>;
572
+ subjectContains: z.ZodOptional<z.ZodArray<z.ZodString>>;
573
+ hasAttachments: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
574
+ direction: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
575
+ inbound: "inbound";
576
+ outbound: "outbound";
577
+ }>>>;
578
+ }, z.core.$strip>>;
579
+ }, z.core.$strip>>;
580
+ isEnabled: z.ZodOptional<z.ZodBoolean>;
581
+ }, z.core.$strip>;
582
+ export type UpdateWebhookEndpoint = z.infer<typeof UpdateWebhookEndpoint>;
583
+ export declare const SendTestEventRequest: z.ZodObject<{
584
+ eventType: z.ZodDefault<z.ZodEnum<{
585
+ "account.connected": "account.connected";
586
+ "account.updated": "account.updated";
587
+ "account.deleted": "account.deleted";
588
+ "account.reauth_required": "account.reauth_required";
589
+ "account.initialized": "account.initialized";
590
+ "account.purged": "account.purged";
591
+ "mailbox.created": "mailbox.created";
592
+ "mailbox.updated": "mailbox.updated";
593
+ "mailbox.deleted": "mailbox.deleted";
594
+ "message.created": "message.created";
595
+ "message.updated": "message.updated";
596
+ "message.deleted": "message.deleted";
597
+ "message.bounced": "message.bounced";
598
+ "message.classified": "message.classified";
599
+ "message.opened": "message.opened";
600
+ "message.clicked": "message.clicked";
601
+ "send.sent": "send.sent";
602
+ "send.retrying": "send.retrying";
603
+ "send.failed": "send.failed";
604
+ "send.rescheduled": "send.rescheduled";
605
+ "suppression.created": "suppression.created";
606
+ "calendar.initialized": "calendar.initialized";
607
+ "calendar.created": "calendar.created";
608
+ "calendar.updated": "calendar.updated";
609
+ "calendar.deleted": "calendar.deleted";
610
+ "calendar_event.created": "calendar_event.created";
611
+ "calendar_event.updated": "calendar_event.updated";
612
+ "calendar_event.deleted": "calendar_event.deleted";
613
+ "contacts.initialized": "contacts.initialized";
614
+ "contact.created": "contact.created";
615
+ "contact.updated": "contact.updated";
616
+ "contact.deleted": "contact.deleted";
617
+ "export.completed": "export.completed";
618
+ "export.failed": "export.failed";
619
+ "meeting_connection.connected": "meeting_connection.connected";
620
+ "meeting_connection.reauth_required": "meeting_connection.reauth_required";
621
+ "webhook.test": "webhook.test";
622
+ }>>;
623
+ accountId: z.ZodOptional<z.ZodUUID>;
624
+ data: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
625
+ }, z.core.$strip>;
626
+ export type SendTestEventRequest = z.infer<typeof SendTestEventRequest>;
627
+ export declare const TestEventSent: z.ZodObject<{
628
+ eventId: z.ZodString;
629
+ }, z.core.$strip>;
630
+ export type TestEventSent = z.infer<typeof TestEventSent>;
631
+ export declare const WebhookAttemptResult: z.ZodEnum<{
632
+ failed: "failed";
633
+ succeeded: "succeeded";
634
+ }>;
635
+ export type WebhookAttemptResult = z.infer<typeof WebhookAttemptResult>;
636
+ /** One delivery attempt, newest first in the endpoint's delivery log. */
637
+ export declare const WebhookAttempt: z.ZodObject<{
638
+ id: z.ZodUUID;
639
+ eventId: z.ZodString;
640
+ eventType: z.ZodEnum<{
641
+ "account.connected": "account.connected";
642
+ "account.updated": "account.updated";
643
+ "account.deleted": "account.deleted";
644
+ "account.reauth_required": "account.reauth_required";
645
+ "account.initialized": "account.initialized";
646
+ "account.purged": "account.purged";
647
+ "mailbox.created": "mailbox.created";
648
+ "mailbox.updated": "mailbox.updated";
649
+ "mailbox.deleted": "mailbox.deleted";
650
+ "message.created": "message.created";
651
+ "message.updated": "message.updated";
652
+ "message.deleted": "message.deleted";
653
+ "message.bounced": "message.bounced";
654
+ "message.classified": "message.classified";
655
+ "message.opened": "message.opened";
656
+ "message.clicked": "message.clicked";
657
+ "send.sent": "send.sent";
658
+ "send.retrying": "send.retrying";
659
+ "send.failed": "send.failed";
660
+ "send.rescheduled": "send.rescheduled";
661
+ "suppression.created": "suppression.created";
662
+ "calendar.initialized": "calendar.initialized";
663
+ "calendar.created": "calendar.created";
664
+ "calendar.updated": "calendar.updated";
665
+ "calendar.deleted": "calendar.deleted";
666
+ "calendar_event.created": "calendar_event.created";
667
+ "calendar_event.updated": "calendar_event.updated";
668
+ "calendar_event.deleted": "calendar_event.deleted";
669
+ "contacts.initialized": "contacts.initialized";
670
+ "contact.created": "contact.created";
671
+ "contact.updated": "contact.updated";
672
+ "contact.deleted": "contact.deleted";
673
+ "export.completed": "export.completed";
674
+ "export.failed": "export.failed";
675
+ "meeting_connection.connected": "meeting_connection.connected";
676
+ "meeting_connection.reauth_required": "meeting_connection.reauth_required";
677
+ "webhook.test": "webhook.test";
678
+ }>;
679
+ accountId: z.ZodNullable<z.ZodUUID>;
680
+ attempt: z.ZodNumber;
681
+ statusCode: z.ZodNullable<z.ZodNumber>;
682
+ error: z.ZodNullable<z.ZodString>;
683
+ responseExcerpt: z.ZodNullable<z.ZodString>;
684
+ durationMs: z.ZodNumber;
685
+ isReplay: z.ZodBoolean;
686
+ isTest: z.ZodBoolean;
687
+ occurredAt: z.ZodPreprocess<z.ZodDate, Date>;
688
+ }, z.core.$strip>;
689
+ export type WebhookAttempt = z.infer<typeof WebhookAttempt>;
690
+ export declare const WebhookAttemptPage: z.ZodObject<{
691
+ items: z.ZodArray<z.ZodObject<{
692
+ id: z.ZodUUID;
693
+ eventId: z.ZodString;
694
+ eventType: z.ZodEnum<{
695
+ "account.connected": "account.connected";
696
+ "account.updated": "account.updated";
697
+ "account.deleted": "account.deleted";
698
+ "account.reauth_required": "account.reauth_required";
699
+ "account.initialized": "account.initialized";
700
+ "account.purged": "account.purged";
701
+ "mailbox.created": "mailbox.created";
702
+ "mailbox.updated": "mailbox.updated";
703
+ "mailbox.deleted": "mailbox.deleted";
704
+ "message.created": "message.created";
705
+ "message.updated": "message.updated";
706
+ "message.deleted": "message.deleted";
707
+ "message.bounced": "message.bounced";
708
+ "message.classified": "message.classified";
709
+ "message.opened": "message.opened";
710
+ "message.clicked": "message.clicked";
711
+ "send.sent": "send.sent";
712
+ "send.retrying": "send.retrying";
713
+ "send.failed": "send.failed";
714
+ "send.rescheduled": "send.rescheduled";
715
+ "suppression.created": "suppression.created";
716
+ "calendar.initialized": "calendar.initialized";
717
+ "calendar.created": "calendar.created";
718
+ "calendar.updated": "calendar.updated";
719
+ "calendar.deleted": "calendar.deleted";
720
+ "calendar_event.created": "calendar_event.created";
721
+ "calendar_event.updated": "calendar_event.updated";
722
+ "calendar_event.deleted": "calendar_event.deleted";
723
+ "contacts.initialized": "contacts.initialized";
724
+ "contact.created": "contact.created";
725
+ "contact.updated": "contact.updated";
726
+ "contact.deleted": "contact.deleted";
727
+ "export.completed": "export.completed";
728
+ "export.failed": "export.failed";
729
+ "meeting_connection.connected": "meeting_connection.connected";
730
+ "meeting_connection.reauth_required": "meeting_connection.reauth_required";
731
+ "webhook.test": "webhook.test";
732
+ }>;
733
+ accountId: z.ZodNullable<z.ZodUUID>;
734
+ attempt: z.ZodNumber;
735
+ statusCode: z.ZodNullable<z.ZodNumber>;
736
+ error: z.ZodNullable<z.ZodString>;
737
+ responseExcerpt: z.ZodNullable<z.ZodString>;
738
+ durationMs: z.ZodNumber;
739
+ isReplay: z.ZodBoolean;
740
+ isTest: z.ZodBoolean;
741
+ occurredAt: z.ZodPreprocess<z.ZodDate, Date>;
742
+ }, z.core.$strip>>;
743
+ nextCursor: z.ZodNullable<z.ZodString>;
744
+ }, z.core.$strip>;
745
+ export type WebhookAttemptPage = z.infer<typeof WebhookAttemptPage>;
746
+ export declare const ListWebhookAttemptsQuery: z.ZodObject<{
747
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
748
+ cursor: z.ZodOptional<z.ZodString>;
749
+ eventType: z.ZodOptional<z.ZodEnum<{
750
+ "account.connected": "account.connected";
751
+ "account.updated": "account.updated";
752
+ "account.deleted": "account.deleted";
753
+ "account.reauth_required": "account.reauth_required";
754
+ "account.initialized": "account.initialized";
755
+ "account.purged": "account.purged";
756
+ "mailbox.created": "mailbox.created";
757
+ "mailbox.updated": "mailbox.updated";
758
+ "mailbox.deleted": "mailbox.deleted";
759
+ "message.created": "message.created";
760
+ "message.updated": "message.updated";
761
+ "message.deleted": "message.deleted";
762
+ "message.bounced": "message.bounced";
763
+ "message.classified": "message.classified";
764
+ "message.opened": "message.opened";
765
+ "message.clicked": "message.clicked";
766
+ "send.sent": "send.sent";
767
+ "send.retrying": "send.retrying";
768
+ "send.failed": "send.failed";
769
+ "send.rescheduled": "send.rescheduled";
770
+ "suppression.created": "suppression.created";
771
+ "calendar.initialized": "calendar.initialized";
772
+ "calendar.created": "calendar.created";
773
+ "calendar.updated": "calendar.updated";
774
+ "calendar.deleted": "calendar.deleted";
775
+ "calendar_event.created": "calendar_event.created";
776
+ "calendar_event.updated": "calendar_event.updated";
777
+ "calendar_event.deleted": "calendar_event.deleted";
778
+ "contacts.initialized": "contacts.initialized";
779
+ "contact.created": "contact.created";
780
+ "contact.updated": "contact.updated";
781
+ "contact.deleted": "contact.deleted";
782
+ "export.completed": "export.completed";
783
+ "export.failed": "export.failed";
784
+ "meeting_connection.connected": "meeting_connection.connected";
785
+ "meeting_connection.reauth_required": "meeting_connection.reauth_required";
786
+ "webhook.test": "webhook.test";
787
+ }>>;
788
+ eventId: z.ZodOptional<z.ZodString>;
789
+ accountId: z.ZodOptional<z.ZodUUID>;
790
+ result: z.ZodOptional<z.ZodEnum<{
791
+ failed: "failed";
792
+ succeeded: "succeeded";
793
+ }>>;
794
+ since: z.ZodOptional<z.ZodPreprocess<z.ZodDate, string | Date>>;
795
+ until: z.ZodOptional<z.ZodPreprocess<z.ZodDate, string | Date>>;
796
+ }, z.core.$strip>;
797
+ export type ListWebhookAttemptsQuery = z.infer<typeof ListWebhookAttemptsQuery>;
798
+ /** attempts' input: the endpoint, and a window whose until (when given with since) comes after
799
+ * since (invalid_range). */
800
+ export declare const ListWebhookAttemptsInput: z.ZodObject<{
801
+ endpointId: z.ZodUUID;
802
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
803
+ cursor: z.ZodOptional<z.ZodString>;
804
+ eventType: z.ZodOptional<z.ZodEnum<{
805
+ "account.connected": "account.connected";
806
+ "account.updated": "account.updated";
807
+ "account.deleted": "account.deleted";
808
+ "account.reauth_required": "account.reauth_required";
809
+ "account.initialized": "account.initialized";
810
+ "account.purged": "account.purged";
811
+ "mailbox.created": "mailbox.created";
812
+ "mailbox.updated": "mailbox.updated";
813
+ "mailbox.deleted": "mailbox.deleted";
814
+ "message.created": "message.created";
815
+ "message.updated": "message.updated";
816
+ "message.deleted": "message.deleted";
817
+ "message.bounced": "message.bounced";
818
+ "message.classified": "message.classified";
819
+ "message.opened": "message.opened";
820
+ "message.clicked": "message.clicked";
821
+ "send.sent": "send.sent";
822
+ "send.retrying": "send.retrying";
823
+ "send.failed": "send.failed";
824
+ "send.rescheduled": "send.rescheduled";
825
+ "suppression.created": "suppression.created";
826
+ "calendar.initialized": "calendar.initialized";
827
+ "calendar.created": "calendar.created";
828
+ "calendar.updated": "calendar.updated";
829
+ "calendar.deleted": "calendar.deleted";
830
+ "calendar_event.created": "calendar_event.created";
831
+ "calendar_event.updated": "calendar_event.updated";
832
+ "calendar_event.deleted": "calendar_event.deleted";
833
+ "contacts.initialized": "contacts.initialized";
834
+ "contact.created": "contact.created";
835
+ "contact.updated": "contact.updated";
836
+ "contact.deleted": "contact.deleted";
837
+ "export.completed": "export.completed";
838
+ "export.failed": "export.failed";
839
+ "meeting_connection.connected": "meeting_connection.connected";
840
+ "meeting_connection.reauth_required": "meeting_connection.reauth_required";
841
+ "webhook.test": "webhook.test";
842
+ }>>;
843
+ eventId: z.ZodOptional<z.ZodString>;
844
+ accountId: z.ZodOptional<z.ZodUUID>;
845
+ result: z.ZodOptional<z.ZodEnum<{
846
+ failed: "failed";
847
+ succeeded: "succeeded";
848
+ }>>;
849
+ since: z.ZodOptional<z.ZodPreprocess<z.ZodDate, string | Date>>;
850
+ until: z.ZodOptional<z.ZodPreprocess<z.ZodDate, string | Date>>;
851
+ }, z.core.$strip>;
852
+ /** The event to replay, whatever the endpoint's filters. */
853
+ export declare const ReplayEventInput: z.ZodObject<{
854
+ endpointId: z.ZodUUID;
855
+ eventId: z.ZodString;
856
+ }, z.core.$strip>;
857
+ export type ReplayEventInput = z.infer<typeof ReplayEventInput>;
858
+ /** Every event in [since, until) the endpoint receives with its current filters; until after
859
+ * since (invalid_range). */
860
+ export declare const ReplayRangeRequest: z.ZodObject<{
861
+ since: z.ZodPreprocess<z.ZodDate, string | Date>;
862
+ until: z.ZodPreprocess<z.ZodDate, string | Date>;
863
+ }, z.core.$strip>;
864
+ export type ReplayRangeRequest = z.infer<typeof ReplayRangeRequest>;
865
+ export declare const ReplayResult: z.ZodObject<{
866
+ queued: z.ZodNumber;
867
+ alreadyQueued: z.ZodNumber;
868
+ }, z.core.$strip>;
869
+ export type ReplayResult = z.infer<typeof ReplayResult>;
870
+ /** The failed deliveries to replay: those of events created in [since, until), either end open. */
871
+ export declare const FailedDeliveriesQuery: z.ZodObject<{
872
+ since: z.ZodOptional<z.ZodPreprocess<z.ZodDate, string | Date>>;
873
+ until: z.ZodOptional<z.ZodPreprocess<z.ZodDate, string | Date>>;
874
+ }, z.core.$strip>;
875
+ export type FailedDeliveriesQuery = z.infer<typeof FailedDeliveriesQuery>;
876
+ export declare const FailedDeliveryCount: z.ZodObject<{
877
+ count: z.ZodNumber;
878
+ }, z.core.$strip>;
879
+ export type FailedDeliveryCount = z.infer<typeof FailedDeliveryCount>;