@automate.ax/integration-contracts 0.116.0 → 0.119.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.
@@ -137,6 +137,275 @@ export declare const gmailTriggerContracts: {
137
137
  }, z.core.$strip>;
138
138
  }, z.core.$strip>;
139
139
  };
140
+ readonly "gmail.mailbox.changed": {
141
+ readonly configSchema: z.ZodObject<{}, z.core.$strip>;
142
+ readonly eventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
143
+ changeType: z.ZodLiteral<"messageAdded">;
144
+ historyId: z.ZodString;
145
+ message: z.ZodObject<{
146
+ messageId: z.ZodString;
147
+ threadId: z.ZodString;
148
+ historyId: z.ZodOptional<z.ZodString>;
149
+ labelIds: z.ZodArray<z.ZodString>;
150
+ attachments: z.ZodArray<z.ZodObject<{
151
+ contentId: z.ZodOptional<z.ZodString>;
152
+ description: z.ZodOptional<z.ZodString>;
153
+ disposition: z.ZodOptional<z.ZodEnum<{
154
+ attachment: "attachment";
155
+ inline: "inline";
156
+ }>>;
157
+ file: z.ZodCustom<File, File>;
158
+ filename: z.ZodString;
159
+ mimeType: z.ZodString;
160
+ related: z.ZodBoolean;
161
+ }, z.core.$strip>>;
162
+ bcc: z.ZodArray<z.ZodObject<{
163
+ address: z.ZodString;
164
+ name: z.ZodOptional<z.ZodString>;
165
+ }, z.core.$strip>>;
166
+ cc: z.ZodArray<z.ZodObject<{
167
+ address: z.ZodString;
168
+ name: z.ZodOptional<z.ZodString>;
169
+ }, z.core.$strip>>;
170
+ deliveredTo: z.ZodOptional<z.ZodString>;
171
+ from: z.ZodOptional<z.ZodObject<{
172
+ address: z.ZodString;
173
+ name: z.ZodOptional<z.ZodString>;
174
+ }, z.core.$strip>>;
175
+ headers: z.ZodArray<z.ZodObject<{
176
+ name: z.ZodString;
177
+ value: z.ZodString;
178
+ }, z.core.$strip>>;
179
+ html: z.ZodOptional<z.ZodString>;
180
+ inReplyTo: z.ZodOptional<z.ZodString>;
181
+ rfc822MessageId: z.ZodOptional<z.ZodString>;
182
+ receivedAt: z.ZodNullable<z.ZodDate>;
183
+ references: z.ZodArray<z.ZodString>;
184
+ replyTo: z.ZodArray<z.ZodObject<{
185
+ address: z.ZodString;
186
+ name: z.ZodOptional<z.ZodString>;
187
+ }, z.core.$strip>>;
188
+ returnPath: z.ZodOptional<z.ZodString>;
189
+ sender: z.ZodOptional<z.ZodObject<{
190
+ address: z.ZodString;
191
+ name: z.ZodOptional<z.ZodString>;
192
+ }, z.core.$strip>>;
193
+ sentAt: z.ZodOptional<z.ZodDate>;
194
+ sizeEstimate: z.ZodOptional<z.ZodNumber>;
195
+ snippet: z.ZodOptional<z.ZodString>;
196
+ subject: z.ZodString;
197
+ text: z.ZodOptional<z.ZodString>;
198
+ to: z.ZodArray<z.ZodObject<{
199
+ address: z.ZodString;
200
+ name: z.ZodOptional<z.ZodString>;
201
+ }, z.core.$strip>>;
202
+ }, z.core.$strip>;
203
+ }, z.core.$strip>, z.ZodObject<{
204
+ messageId: z.ZodString;
205
+ threadId: z.ZodString;
206
+ historyId: z.ZodString;
207
+ changeType: z.ZodLiteral<"messageDeleted">;
208
+ }, z.core.$strip>, z.ZodObject<{
209
+ labels: z.ZodArray<z.ZodObject<{
210
+ labelId: z.ZodString;
211
+ name: z.ZodOptional<z.ZodString>;
212
+ }, z.core.$strip>>;
213
+ message: z.ZodObject<{
214
+ messageId: z.ZodString;
215
+ threadId: z.ZodString;
216
+ historyId: z.ZodOptional<z.ZodString>;
217
+ labelIds: z.ZodArray<z.ZodString>;
218
+ attachments: z.ZodArray<z.ZodObject<{
219
+ contentId: z.ZodOptional<z.ZodString>;
220
+ description: z.ZodOptional<z.ZodString>;
221
+ disposition: z.ZodOptional<z.ZodEnum<{
222
+ attachment: "attachment";
223
+ inline: "inline";
224
+ }>>;
225
+ file: z.ZodCustom<File, File>;
226
+ filename: z.ZodString;
227
+ mimeType: z.ZodString;
228
+ related: z.ZodBoolean;
229
+ }, z.core.$strip>>;
230
+ bcc: z.ZodArray<z.ZodObject<{
231
+ address: z.ZodString;
232
+ name: z.ZodOptional<z.ZodString>;
233
+ }, z.core.$strip>>;
234
+ cc: z.ZodArray<z.ZodObject<{
235
+ address: z.ZodString;
236
+ name: z.ZodOptional<z.ZodString>;
237
+ }, z.core.$strip>>;
238
+ deliveredTo: z.ZodOptional<z.ZodString>;
239
+ from: z.ZodOptional<z.ZodObject<{
240
+ address: z.ZodString;
241
+ name: z.ZodOptional<z.ZodString>;
242
+ }, z.core.$strip>>;
243
+ headers: z.ZodArray<z.ZodObject<{
244
+ name: z.ZodString;
245
+ value: z.ZodString;
246
+ }, z.core.$strip>>;
247
+ html: z.ZodOptional<z.ZodString>;
248
+ inReplyTo: z.ZodOptional<z.ZodString>;
249
+ rfc822MessageId: z.ZodOptional<z.ZodString>;
250
+ receivedAt: z.ZodNullable<z.ZodDate>;
251
+ references: z.ZodArray<z.ZodString>;
252
+ replyTo: z.ZodArray<z.ZodObject<{
253
+ address: z.ZodString;
254
+ name: z.ZodOptional<z.ZodString>;
255
+ }, z.core.$strip>>;
256
+ returnPath: z.ZodOptional<z.ZodString>;
257
+ sender: z.ZodOptional<z.ZodObject<{
258
+ address: z.ZodString;
259
+ name: z.ZodOptional<z.ZodString>;
260
+ }, z.core.$strip>>;
261
+ sentAt: z.ZodOptional<z.ZodDate>;
262
+ sizeEstimate: z.ZodOptional<z.ZodNumber>;
263
+ snippet: z.ZodOptional<z.ZodString>;
264
+ subject: z.ZodString;
265
+ text: z.ZodOptional<z.ZodString>;
266
+ to: z.ZodArray<z.ZodObject<{
267
+ address: z.ZodString;
268
+ name: z.ZodOptional<z.ZodString>;
269
+ }, z.core.$strip>>;
270
+ }, z.core.$strip>;
271
+ changeType: z.ZodLiteral<"labelAdded">;
272
+ historyId: z.ZodString;
273
+ }, z.core.$strip>, z.ZodObject<{
274
+ labels: z.ZodArray<z.ZodObject<{
275
+ labelId: z.ZodString;
276
+ name: z.ZodOptional<z.ZodString>;
277
+ }, z.core.$strip>>;
278
+ message: z.ZodObject<{
279
+ messageId: z.ZodString;
280
+ threadId: z.ZodString;
281
+ historyId: z.ZodOptional<z.ZodString>;
282
+ labelIds: z.ZodArray<z.ZodString>;
283
+ attachments: z.ZodArray<z.ZodObject<{
284
+ contentId: z.ZodOptional<z.ZodString>;
285
+ description: z.ZodOptional<z.ZodString>;
286
+ disposition: z.ZodOptional<z.ZodEnum<{
287
+ attachment: "attachment";
288
+ inline: "inline";
289
+ }>>;
290
+ file: z.ZodCustom<File, File>;
291
+ filename: z.ZodString;
292
+ mimeType: z.ZodString;
293
+ related: z.ZodBoolean;
294
+ }, z.core.$strip>>;
295
+ bcc: z.ZodArray<z.ZodObject<{
296
+ address: z.ZodString;
297
+ name: z.ZodOptional<z.ZodString>;
298
+ }, z.core.$strip>>;
299
+ cc: z.ZodArray<z.ZodObject<{
300
+ address: z.ZodString;
301
+ name: z.ZodOptional<z.ZodString>;
302
+ }, z.core.$strip>>;
303
+ deliveredTo: z.ZodOptional<z.ZodString>;
304
+ from: z.ZodOptional<z.ZodObject<{
305
+ address: z.ZodString;
306
+ name: z.ZodOptional<z.ZodString>;
307
+ }, z.core.$strip>>;
308
+ headers: z.ZodArray<z.ZodObject<{
309
+ name: z.ZodString;
310
+ value: z.ZodString;
311
+ }, z.core.$strip>>;
312
+ html: z.ZodOptional<z.ZodString>;
313
+ inReplyTo: z.ZodOptional<z.ZodString>;
314
+ rfc822MessageId: z.ZodOptional<z.ZodString>;
315
+ receivedAt: z.ZodNullable<z.ZodDate>;
316
+ references: z.ZodArray<z.ZodString>;
317
+ replyTo: z.ZodArray<z.ZodObject<{
318
+ address: z.ZodString;
319
+ name: z.ZodOptional<z.ZodString>;
320
+ }, z.core.$strip>>;
321
+ returnPath: z.ZodOptional<z.ZodString>;
322
+ sender: z.ZodOptional<z.ZodObject<{
323
+ address: z.ZodString;
324
+ name: z.ZodOptional<z.ZodString>;
325
+ }, z.core.$strip>>;
326
+ sentAt: z.ZodOptional<z.ZodDate>;
327
+ sizeEstimate: z.ZodOptional<z.ZodNumber>;
328
+ snippet: z.ZodOptional<z.ZodString>;
329
+ subject: z.ZodString;
330
+ text: z.ZodOptional<z.ZodString>;
331
+ to: z.ZodArray<z.ZodObject<{
332
+ address: z.ZodString;
333
+ name: z.ZodOptional<z.ZodString>;
334
+ }, z.core.$strip>>;
335
+ }, z.core.$strip>;
336
+ changeType: z.ZodLiteral<"labelRemoved">;
337
+ historyId: z.ZodString;
338
+ }, z.core.$strip>], "changeType">;
339
+ };
340
+ readonly "gmail.message.added": {
341
+ readonly configSchema: z.ZodObject<{}, z.core.$strip>;
342
+ readonly eventSchema: z.ZodObject<{
343
+ messageId: z.ZodString;
344
+ threadId: z.ZodString;
345
+ historyId: z.ZodOptional<z.ZodString>;
346
+ labelIds: z.ZodArray<z.ZodString>;
347
+ attachments: z.ZodArray<z.ZodObject<{
348
+ contentId: z.ZodOptional<z.ZodString>;
349
+ description: z.ZodOptional<z.ZodString>;
350
+ disposition: z.ZodOptional<z.ZodEnum<{
351
+ attachment: "attachment";
352
+ inline: "inline";
353
+ }>>;
354
+ file: z.ZodCustom<File, File>;
355
+ filename: z.ZodString;
356
+ mimeType: z.ZodString;
357
+ related: z.ZodBoolean;
358
+ }, z.core.$strip>>;
359
+ bcc: z.ZodArray<z.ZodObject<{
360
+ address: z.ZodString;
361
+ name: z.ZodOptional<z.ZodString>;
362
+ }, z.core.$strip>>;
363
+ cc: z.ZodArray<z.ZodObject<{
364
+ address: z.ZodString;
365
+ name: z.ZodOptional<z.ZodString>;
366
+ }, z.core.$strip>>;
367
+ deliveredTo: z.ZodOptional<z.ZodString>;
368
+ from: z.ZodOptional<z.ZodObject<{
369
+ address: z.ZodString;
370
+ name: z.ZodOptional<z.ZodString>;
371
+ }, z.core.$strip>>;
372
+ headers: z.ZodArray<z.ZodObject<{
373
+ name: z.ZodString;
374
+ value: z.ZodString;
375
+ }, z.core.$strip>>;
376
+ html: z.ZodOptional<z.ZodString>;
377
+ inReplyTo: z.ZodOptional<z.ZodString>;
378
+ rfc822MessageId: z.ZodOptional<z.ZodString>;
379
+ receivedAt: z.ZodNullable<z.ZodDate>;
380
+ references: z.ZodArray<z.ZodString>;
381
+ replyTo: z.ZodArray<z.ZodObject<{
382
+ address: z.ZodString;
383
+ name: z.ZodOptional<z.ZodString>;
384
+ }, z.core.$strip>>;
385
+ returnPath: z.ZodOptional<z.ZodString>;
386
+ sender: z.ZodOptional<z.ZodObject<{
387
+ address: z.ZodString;
388
+ name: z.ZodOptional<z.ZodString>;
389
+ }, z.core.$strip>>;
390
+ sentAt: z.ZodOptional<z.ZodDate>;
391
+ sizeEstimate: z.ZodOptional<z.ZodNumber>;
392
+ snippet: z.ZodOptional<z.ZodString>;
393
+ subject: z.ZodString;
394
+ text: z.ZodOptional<z.ZodString>;
395
+ to: z.ZodArray<z.ZodObject<{
396
+ address: z.ZodString;
397
+ name: z.ZodOptional<z.ZodString>;
398
+ }, z.core.$strip>>;
399
+ }, z.core.$strip>;
400
+ };
401
+ readonly "gmail.message.deleted": {
402
+ readonly configSchema: z.ZodObject<{}, z.core.$strip>;
403
+ readonly eventSchema: z.ZodObject<{
404
+ messageId: z.ZodString;
405
+ threadId: z.ZodString;
406
+ historyId: z.ZodString;
407
+ }, z.core.$strip>;
408
+ };
140
409
  readonly "gmail.message.received": {
141
410
  readonly configSchema: z.ZodObject<{}, z.core.$strip>;
142
411
  readonly eventSchema: z.ZodObject<{
@@ -1,5 +1,5 @@
1
1
  import * as z from "zod";
2
- import { LABEL_CHANGE_SCHEMA, MESSAGE_SCHEMA } from "./schemas.js";
2
+ import { LABEL_CHANGE_SCHEMA, MAILBOX_CHANGE_SCHEMA, MESSAGE_DELETED_SCHEMA, MESSAGE_SCHEMA, } from "./schemas.js";
3
3
  export * from "./gmail.js";
4
4
  export * from "./schemas.js";
5
5
  export const GMAIL_TRIGGER_CONFIG_SCHEMA = z.object({});
@@ -12,6 +12,18 @@ export const gmailTriggerContracts = {
12
12
  configSchema: GMAIL_TRIGGER_CONFIG_SCHEMA,
13
13
  eventSchema: LABEL_CHANGE_SCHEMA,
14
14
  },
15
+ "gmail.mailbox.changed": {
16
+ configSchema: GMAIL_TRIGGER_CONFIG_SCHEMA,
17
+ eventSchema: MAILBOX_CHANGE_SCHEMA,
18
+ },
19
+ "gmail.message.added": {
20
+ configSchema: GMAIL_TRIGGER_CONFIG_SCHEMA,
21
+ eventSchema: MESSAGE_SCHEMA,
22
+ },
23
+ "gmail.message.deleted": {
24
+ configSchema: GMAIL_TRIGGER_CONFIG_SCHEMA,
25
+ eventSchema: MESSAGE_DELETED_SCHEMA,
26
+ },
15
27
  "gmail.message.received": {
16
28
  configSchema: GMAIL_TRIGGER_CONFIG_SCHEMA,
17
29
  eventSchema: MESSAGE_SCHEMA,
@@ -491,6 +491,210 @@ export declare const LABEL_CHANGE_SCHEMA: z.ZodObject<{
491
491
  }, z.core.$strip>>;
492
492
  }, z.core.$strip>;
493
493
  }, z.core.$strip>;
494
+ /** Stable identity retained after Gmail permanently deletes a message. */
495
+ export declare const MESSAGE_DELETED_SCHEMA: z.ZodObject<{
496
+ messageId: z.ZodString;
497
+ threadId: z.ZodString;
498
+ historyId: z.ZodString;
499
+ }, z.core.$strip>;
500
+ /** Broad normalized Gmail mailbox-history change. */
501
+ export declare const MAILBOX_CHANGE_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
502
+ changeType: z.ZodLiteral<"messageAdded">;
503
+ historyId: z.ZodString;
504
+ message: z.ZodObject<{
505
+ messageId: z.ZodString;
506
+ threadId: z.ZodString;
507
+ historyId: z.ZodOptional<z.ZodString>;
508
+ labelIds: z.ZodArray<z.ZodString>;
509
+ attachments: z.ZodArray<z.ZodObject<{
510
+ contentId: z.ZodOptional<z.ZodString>;
511
+ description: z.ZodOptional<z.ZodString>;
512
+ disposition: z.ZodOptional<z.ZodEnum<{
513
+ attachment: "attachment";
514
+ inline: "inline";
515
+ }>>;
516
+ file: z.ZodCustom<File, File>;
517
+ filename: z.ZodString;
518
+ mimeType: z.ZodString;
519
+ related: z.ZodBoolean;
520
+ }, z.core.$strip>>;
521
+ bcc: z.ZodArray<z.ZodObject<{
522
+ address: z.ZodString;
523
+ name: z.ZodOptional<z.ZodString>;
524
+ }, z.core.$strip>>;
525
+ cc: z.ZodArray<z.ZodObject<{
526
+ address: z.ZodString;
527
+ name: z.ZodOptional<z.ZodString>;
528
+ }, z.core.$strip>>;
529
+ deliveredTo: z.ZodOptional<z.ZodString>;
530
+ from: z.ZodOptional<z.ZodObject<{
531
+ address: z.ZodString;
532
+ name: z.ZodOptional<z.ZodString>;
533
+ }, z.core.$strip>>;
534
+ headers: z.ZodArray<z.ZodObject<{
535
+ name: z.ZodString;
536
+ value: z.ZodString;
537
+ }, z.core.$strip>>;
538
+ html: z.ZodOptional<z.ZodString>;
539
+ inReplyTo: z.ZodOptional<z.ZodString>;
540
+ rfc822MessageId: z.ZodOptional<z.ZodString>;
541
+ receivedAt: z.ZodNullable<z.ZodDate>;
542
+ references: z.ZodArray<z.ZodString>;
543
+ replyTo: z.ZodArray<z.ZodObject<{
544
+ address: z.ZodString;
545
+ name: z.ZodOptional<z.ZodString>;
546
+ }, z.core.$strip>>;
547
+ returnPath: z.ZodOptional<z.ZodString>;
548
+ sender: z.ZodOptional<z.ZodObject<{
549
+ address: z.ZodString;
550
+ name: z.ZodOptional<z.ZodString>;
551
+ }, z.core.$strip>>;
552
+ sentAt: z.ZodOptional<z.ZodDate>;
553
+ sizeEstimate: z.ZodOptional<z.ZodNumber>;
554
+ snippet: z.ZodOptional<z.ZodString>;
555
+ subject: z.ZodString;
556
+ text: z.ZodOptional<z.ZodString>;
557
+ to: z.ZodArray<z.ZodObject<{
558
+ address: z.ZodString;
559
+ name: z.ZodOptional<z.ZodString>;
560
+ }, z.core.$strip>>;
561
+ }, z.core.$strip>;
562
+ }, z.core.$strip>, z.ZodObject<{
563
+ messageId: z.ZodString;
564
+ threadId: z.ZodString;
565
+ historyId: z.ZodString;
566
+ changeType: z.ZodLiteral<"messageDeleted">;
567
+ }, z.core.$strip>, z.ZodObject<{
568
+ labels: z.ZodArray<z.ZodObject<{
569
+ labelId: z.ZodString;
570
+ name: z.ZodOptional<z.ZodString>;
571
+ }, z.core.$strip>>;
572
+ message: z.ZodObject<{
573
+ messageId: z.ZodString;
574
+ threadId: z.ZodString;
575
+ historyId: z.ZodOptional<z.ZodString>;
576
+ labelIds: z.ZodArray<z.ZodString>;
577
+ attachments: z.ZodArray<z.ZodObject<{
578
+ contentId: z.ZodOptional<z.ZodString>;
579
+ description: z.ZodOptional<z.ZodString>;
580
+ disposition: z.ZodOptional<z.ZodEnum<{
581
+ attachment: "attachment";
582
+ inline: "inline";
583
+ }>>;
584
+ file: z.ZodCustom<File, File>;
585
+ filename: z.ZodString;
586
+ mimeType: z.ZodString;
587
+ related: z.ZodBoolean;
588
+ }, z.core.$strip>>;
589
+ bcc: z.ZodArray<z.ZodObject<{
590
+ address: z.ZodString;
591
+ name: z.ZodOptional<z.ZodString>;
592
+ }, z.core.$strip>>;
593
+ cc: z.ZodArray<z.ZodObject<{
594
+ address: z.ZodString;
595
+ name: z.ZodOptional<z.ZodString>;
596
+ }, z.core.$strip>>;
597
+ deliveredTo: z.ZodOptional<z.ZodString>;
598
+ from: z.ZodOptional<z.ZodObject<{
599
+ address: z.ZodString;
600
+ name: z.ZodOptional<z.ZodString>;
601
+ }, z.core.$strip>>;
602
+ headers: z.ZodArray<z.ZodObject<{
603
+ name: z.ZodString;
604
+ value: z.ZodString;
605
+ }, z.core.$strip>>;
606
+ html: z.ZodOptional<z.ZodString>;
607
+ inReplyTo: z.ZodOptional<z.ZodString>;
608
+ rfc822MessageId: z.ZodOptional<z.ZodString>;
609
+ receivedAt: z.ZodNullable<z.ZodDate>;
610
+ references: z.ZodArray<z.ZodString>;
611
+ replyTo: z.ZodArray<z.ZodObject<{
612
+ address: z.ZodString;
613
+ name: z.ZodOptional<z.ZodString>;
614
+ }, z.core.$strip>>;
615
+ returnPath: z.ZodOptional<z.ZodString>;
616
+ sender: z.ZodOptional<z.ZodObject<{
617
+ address: z.ZodString;
618
+ name: z.ZodOptional<z.ZodString>;
619
+ }, z.core.$strip>>;
620
+ sentAt: z.ZodOptional<z.ZodDate>;
621
+ sizeEstimate: z.ZodOptional<z.ZodNumber>;
622
+ snippet: z.ZodOptional<z.ZodString>;
623
+ subject: z.ZodString;
624
+ text: z.ZodOptional<z.ZodString>;
625
+ to: z.ZodArray<z.ZodObject<{
626
+ address: z.ZodString;
627
+ name: z.ZodOptional<z.ZodString>;
628
+ }, z.core.$strip>>;
629
+ }, z.core.$strip>;
630
+ changeType: z.ZodLiteral<"labelAdded">;
631
+ historyId: z.ZodString;
632
+ }, z.core.$strip>, z.ZodObject<{
633
+ labels: z.ZodArray<z.ZodObject<{
634
+ labelId: z.ZodString;
635
+ name: z.ZodOptional<z.ZodString>;
636
+ }, z.core.$strip>>;
637
+ message: z.ZodObject<{
638
+ messageId: z.ZodString;
639
+ threadId: z.ZodString;
640
+ historyId: z.ZodOptional<z.ZodString>;
641
+ labelIds: z.ZodArray<z.ZodString>;
642
+ attachments: z.ZodArray<z.ZodObject<{
643
+ contentId: z.ZodOptional<z.ZodString>;
644
+ description: z.ZodOptional<z.ZodString>;
645
+ disposition: z.ZodOptional<z.ZodEnum<{
646
+ attachment: "attachment";
647
+ inline: "inline";
648
+ }>>;
649
+ file: z.ZodCustom<File, File>;
650
+ filename: z.ZodString;
651
+ mimeType: z.ZodString;
652
+ related: z.ZodBoolean;
653
+ }, z.core.$strip>>;
654
+ bcc: z.ZodArray<z.ZodObject<{
655
+ address: z.ZodString;
656
+ name: z.ZodOptional<z.ZodString>;
657
+ }, z.core.$strip>>;
658
+ cc: z.ZodArray<z.ZodObject<{
659
+ address: z.ZodString;
660
+ name: z.ZodOptional<z.ZodString>;
661
+ }, z.core.$strip>>;
662
+ deliveredTo: z.ZodOptional<z.ZodString>;
663
+ from: z.ZodOptional<z.ZodObject<{
664
+ address: z.ZodString;
665
+ name: z.ZodOptional<z.ZodString>;
666
+ }, z.core.$strip>>;
667
+ headers: z.ZodArray<z.ZodObject<{
668
+ name: z.ZodString;
669
+ value: z.ZodString;
670
+ }, z.core.$strip>>;
671
+ html: z.ZodOptional<z.ZodString>;
672
+ inReplyTo: z.ZodOptional<z.ZodString>;
673
+ rfc822MessageId: z.ZodOptional<z.ZodString>;
674
+ receivedAt: z.ZodNullable<z.ZodDate>;
675
+ references: z.ZodArray<z.ZodString>;
676
+ replyTo: z.ZodArray<z.ZodObject<{
677
+ address: z.ZodString;
678
+ name: z.ZodOptional<z.ZodString>;
679
+ }, z.core.$strip>>;
680
+ returnPath: z.ZodOptional<z.ZodString>;
681
+ sender: z.ZodOptional<z.ZodObject<{
682
+ address: z.ZodString;
683
+ name: z.ZodOptional<z.ZodString>;
684
+ }, z.core.$strip>>;
685
+ sentAt: z.ZodOptional<z.ZodDate>;
686
+ sizeEstimate: z.ZodOptional<z.ZodNumber>;
687
+ snippet: z.ZodOptional<z.ZodString>;
688
+ subject: z.ZodString;
689
+ text: z.ZodOptional<z.ZodString>;
690
+ to: z.ZodArray<z.ZodObject<{
691
+ address: z.ZodString;
692
+ name: z.ZodOptional<z.ZodString>;
693
+ }, z.core.$strip>>;
694
+ }, z.core.$strip>;
695
+ changeType: z.ZodLiteral<"labelRemoved">;
696
+ historyId: z.ZodString;
697
+ }, z.core.$strip>], "changeType">;
494
698
  export declare const THREAD_IDENTIFIER_SCHEMA: z.ZodObject<{
495
699
  threadId: z.ZodString;
496
700
  }, z.core.$strip>;
@@ -296,6 +296,30 @@ export const LABEL_CHANGE_SCHEMA = z.object({
296
296
  /** Fully parsed message affected by the label change. */
297
297
  message: MESSAGE_SCHEMA,
298
298
  });
299
+ /** Stable identity retained after Gmail permanently deletes a message. */
300
+ export const MESSAGE_DELETED_SCHEMA = MESSAGE_IDENTIFIER_SCHEMA.extend({
301
+ /** Mailbox history record that reported the deletion. */
302
+ historyId: z.string(),
303
+ });
304
+ /** Broad normalized Gmail mailbox-history change. */
305
+ export const MAILBOX_CHANGE_SCHEMA = z.discriminatedUnion("changeType", [
306
+ z.object({
307
+ changeType: z.literal("messageAdded"),
308
+ historyId: z.string(),
309
+ message: MESSAGE_SCHEMA,
310
+ }),
311
+ MESSAGE_DELETED_SCHEMA.extend({
312
+ changeType: z.literal("messageDeleted"),
313
+ }),
314
+ LABEL_CHANGE_SCHEMA.extend({
315
+ changeType: z.literal("labelAdded"),
316
+ historyId: z.string(),
317
+ }),
318
+ LABEL_CHANGE_SCHEMA.extend({
319
+ changeType: z.literal("labelRemoved"),
320
+ historyId: z.string(),
321
+ }),
322
+ ]);
299
323
  export const THREAD_IDENTIFIER_SCHEMA = z.object({
300
324
  /** Immutable Gmail thread ID. */
301
325
  threadId: z.string(),