mymx 0.3.5 → 0.3.6

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/zod.d.cts DELETED
@@ -1,1356 +0,0 @@
1
- import { EmailReceivedEvent } from "./types-BRl0ogvI.cjs";
2
- import { WebhookValidationError, WebhookValidationErrorCode } from "./errors-CwKIO2XZ.cjs";
3
- import { z } from "zod";
4
-
5
- //#region src/zod.d.ts
6
-
7
- declare const emailAddressSchema: z.ZodObject<{
8
- address: z.ZodString;
9
- name: z.ZodNullable<z.ZodString>;
10
- }, "strip", z.ZodTypeAny, {
11
- address: string;
12
- name: string | null;
13
- }, {
14
- address: string;
15
- name: string | null;
16
- }>;
17
- declare const webhookAttachmentSchema: z.ZodObject<{
18
- filename: z.ZodNullable<z.ZodString>;
19
- content_type: z.ZodString;
20
- size_bytes: z.ZodNumber;
21
- sha256: z.ZodString;
22
- part_index: z.ZodNumber;
23
- tar_path: z.ZodString;
24
- }, "strip", z.ZodTypeAny, {
25
- filename: string | null;
26
- content_type: string;
27
- size_bytes: number;
28
- sha256: string;
29
- part_index: number;
30
- tar_path: string;
31
- }, {
32
- filename: string | null;
33
- content_type: string;
34
- size_bytes: number;
35
- sha256: string;
36
- part_index: number;
37
- tar_path: string;
38
- }>;
39
- declare const parsedErrorSchema: z.ZodObject<{
40
- code: z.ZodEnum<["PARSE_FAILED", "ATTACHMENT_EXTRACTION_FAILED"]>;
41
- message: z.ZodString;
42
- retryable: z.ZodBoolean;
43
- }, "strip", z.ZodTypeAny, {
44
- code: "PARSE_FAILED" | "ATTACHMENT_EXTRACTION_FAILED";
45
- message: string;
46
- retryable: boolean;
47
- }, {
48
- code: "PARSE_FAILED" | "ATTACHMENT_EXTRACTION_FAILED";
49
- message: string;
50
- retryable: boolean;
51
- }>;
52
- declare const parsedDataCompleteSchema: z.ZodObject<{
53
- status: z.ZodLiteral<"complete">;
54
- error: z.ZodNull;
55
- body_text: z.ZodNullable<z.ZodString>;
56
- body_html: z.ZodNullable<z.ZodString>;
57
- reply_to: z.ZodNullable<z.ZodArray<z.ZodObject<{
58
- address: z.ZodString;
59
- name: z.ZodNullable<z.ZodString>;
60
- }, "strip", z.ZodTypeAny, {
61
- address: string;
62
- name: string | null;
63
- }, {
64
- address: string;
65
- name: string | null;
66
- }>, "many">>;
67
- cc: z.ZodNullable<z.ZodArray<z.ZodObject<{
68
- address: z.ZodString;
69
- name: z.ZodNullable<z.ZodString>;
70
- }, "strip", z.ZodTypeAny, {
71
- address: string;
72
- name: string | null;
73
- }, {
74
- address: string;
75
- name: string | null;
76
- }>, "many">>;
77
- bcc: z.ZodNullable<z.ZodArray<z.ZodObject<{
78
- address: z.ZodString;
79
- name: z.ZodNullable<z.ZodString>;
80
- }, "strip", z.ZodTypeAny, {
81
- address: string;
82
- name: string | null;
83
- }, {
84
- address: string;
85
- name: string | null;
86
- }>, "many">>;
87
- in_reply_to: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
88
- references: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
89
- attachments: z.ZodArray<z.ZodObject<{
90
- filename: z.ZodNullable<z.ZodString>;
91
- content_type: z.ZodString;
92
- size_bytes: z.ZodNumber;
93
- sha256: z.ZodString;
94
- part_index: z.ZodNumber;
95
- tar_path: z.ZodString;
96
- }, "strip", z.ZodTypeAny, {
97
- filename: string | null;
98
- content_type: string;
99
- size_bytes: number;
100
- sha256: string;
101
- part_index: number;
102
- tar_path: string;
103
- }, {
104
- filename: string | null;
105
- content_type: string;
106
- size_bytes: number;
107
- sha256: string;
108
- part_index: number;
109
- tar_path: string;
110
- }>, "many">;
111
- attachments_download_url: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
112
- }, "strip", z.ZodTypeAny, {
113
- status: "complete";
114
- error: null;
115
- body_text: string | null;
116
- body_html: string | null;
117
- reply_to: {
118
- address: string;
119
- name: string | null;
120
- }[] | null;
121
- cc: {
122
- address: string;
123
- name: string | null;
124
- }[] | null;
125
- bcc: {
126
- address: string;
127
- name: string | null;
128
- }[] | null;
129
- in_reply_to: string[] | null;
130
- references: string[] | null;
131
- attachments: {
132
- filename: string | null;
133
- content_type: string;
134
- size_bytes: number;
135
- sha256: string;
136
- part_index: number;
137
- tar_path: string;
138
- }[];
139
- attachments_download_url: string | null;
140
- }, {
141
- status: "complete";
142
- error: null;
143
- body_text: string | null;
144
- body_html: string | null;
145
- reply_to: {
146
- address: string;
147
- name: string | null;
148
- }[] | null;
149
- cc: {
150
- address: string;
151
- name: string | null;
152
- }[] | null;
153
- bcc: {
154
- address: string;
155
- name: string | null;
156
- }[] | null;
157
- in_reply_to: string[] | null;
158
- references: string[] | null;
159
- attachments: {
160
- filename: string | null;
161
- content_type: string;
162
- size_bytes: number;
163
- sha256: string;
164
- part_index: number;
165
- tar_path: string;
166
- }[];
167
- attachments_download_url: string | null;
168
- }>;
169
- declare const parsedDataFailedSchema: z.ZodObject<{
170
- status: z.ZodLiteral<"failed">;
171
- error: z.ZodObject<{
172
- code: z.ZodEnum<["PARSE_FAILED", "ATTACHMENT_EXTRACTION_FAILED"]>;
173
- message: z.ZodString;
174
- retryable: z.ZodBoolean;
175
- }, "strip", z.ZodTypeAny, {
176
- code: "PARSE_FAILED" | "ATTACHMENT_EXTRACTION_FAILED";
177
- message: string;
178
- retryable: boolean;
179
- }, {
180
- code: "PARSE_FAILED" | "ATTACHMENT_EXTRACTION_FAILED";
181
- message: string;
182
- retryable: boolean;
183
- }>;
184
- body_text: z.ZodNull;
185
- body_html: z.ZodNull;
186
- reply_to: z.ZodNull;
187
- cc: z.ZodNull;
188
- bcc: z.ZodNull;
189
- in_reply_to: z.ZodNull;
190
- references: z.ZodNull;
191
- attachments: z.ZodArray<z.ZodObject<{
192
- filename: z.ZodNullable<z.ZodString>;
193
- content_type: z.ZodString;
194
- size_bytes: z.ZodNumber;
195
- sha256: z.ZodString;
196
- part_index: z.ZodNumber;
197
- tar_path: z.ZodString;
198
- }, "strip", z.ZodTypeAny, {
199
- filename: string | null;
200
- content_type: string;
201
- size_bytes: number;
202
- sha256: string;
203
- part_index: number;
204
- tar_path: string;
205
- }, {
206
- filename: string | null;
207
- content_type: string;
208
- size_bytes: number;
209
- sha256: string;
210
- part_index: number;
211
- tar_path: string;
212
- }>, "many">;
213
- attachments_download_url: z.ZodNull;
214
- }, "strip", z.ZodTypeAny, {
215
- status: "failed";
216
- error: {
217
- code: "PARSE_FAILED" | "ATTACHMENT_EXTRACTION_FAILED";
218
- message: string;
219
- retryable: boolean;
220
- };
221
- body_text: null;
222
- body_html: null;
223
- reply_to: null;
224
- cc: null;
225
- bcc: null;
226
- in_reply_to: null;
227
- references: null;
228
- attachments: {
229
- filename: string | null;
230
- content_type: string;
231
- size_bytes: number;
232
- sha256: string;
233
- part_index: number;
234
- tar_path: string;
235
- }[];
236
- attachments_download_url: null;
237
- }, {
238
- status: "failed";
239
- error: {
240
- code: "PARSE_FAILED" | "ATTACHMENT_EXTRACTION_FAILED";
241
- message: string;
242
- retryable: boolean;
243
- };
244
- body_text: null;
245
- body_html: null;
246
- reply_to: null;
247
- cc: null;
248
- bcc: null;
249
- in_reply_to: null;
250
- references: null;
251
- attachments: {
252
- filename: string | null;
253
- content_type: string;
254
- size_bytes: number;
255
- sha256: string;
256
- part_index: number;
257
- tar_path: string;
258
- }[];
259
- attachments_download_url: null;
260
- }>;
261
- declare const parsedDataSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
262
- status: z.ZodLiteral<"complete">;
263
- error: z.ZodNull;
264
- body_text: z.ZodNullable<z.ZodString>;
265
- body_html: z.ZodNullable<z.ZodString>;
266
- reply_to: z.ZodNullable<z.ZodArray<z.ZodObject<{
267
- address: z.ZodString;
268
- name: z.ZodNullable<z.ZodString>;
269
- }, "strip", z.ZodTypeAny, {
270
- address: string;
271
- name: string | null;
272
- }, {
273
- address: string;
274
- name: string | null;
275
- }>, "many">>;
276
- cc: z.ZodNullable<z.ZodArray<z.ZodObject<{
277
- address: z.ZodString;
278
- name: z.ZodNullable<z.ZodString>;
279
- }, "strip", z.ZodTypeAny, {
280
- address: string;
281
- name: string | null;
282
- }, {
283
- address: string;
284
- name: string | null;
285
- }>, "many">>;
286
- bcc: z.ZodNullable<z.ZodArray<z.ZodObject<{
287
- address: z.ZodString;
288
- name: z.ZodNullable<z.ZodString>;
289
- }, "strip", z.ZodTypeAny, {
290
- address: string;
291
- name: string | null;
292
- }, {
293
- address: string;
294
- name: string | null;
295
- }>, "many">>;
296
- in_reply_to: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
297
- references: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
298
- attachments: z.ZodArray<z.ZodObject<{
299
- filename: z.ZodNullable<z.ZodString>;
300
- content_type: z.ZodString;
301
- size_bytes: z.ZodNumber;
302
- sha256: z.ZodString;
303
- part_index: z.ZodNumber;
304
- tar_path: z.ZodString;
305
- }, "strip", z.ZodTypeAny, {
306
- filename: string | null;
307
- content_type: string;
308
- size_bytes: number;
309
- sha256: string;
310
- part_index: number;
311
- tar_path: string;
312
- }, {
313
- filename: string | null;
314
- content_type: string;
315
- size_bytes: number;
316
- sha256: string;
317
- part_index: number;
318
- tar_path: string;
319
- }>, "many">;
320
- attachments_download_url: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
321
- }, "strip", z.ZodTypeAny, {
322
- status: "complete";
323
- error: null;
324
- body_text: string | null;
325
- body_html: string | null;
326
- reply_to: {
327
- address: string;
328
- name: string | null;
329
- }[] | null;
330
- cc: {
331
- address: string;
332
- name: string | null;
333
- }[] | null;
334
- bcc: {
335
- address: string;
336
- name: string | null;
337
- }[] | null;
338
- in_reply_to: string[] | null;
339
- references: string[] | null;
340
- attachments: {
341
- filename: string | null;
342
- content_type: string;
343
- size_bytes: number;
344
- sha256: string;
345
- part_index: number;
346
- tar_path: string;
347
- }[];
348
- attachments_download_url: string | null;
349
- }, {
350
- status: "complete";
351
- error: null;
352
- body_text: string | null;
353
- body_html: string | null;
354
- reply_to: {
355
- address: string;
356
- name: string | null;
357
- }[] | null;
358
- cc: {
359
- address: string;
360
- name: string | null;
361
- }[] | null;
362
- bcc: {
363
- address: string;
364
- name: string | null;
365
- }[] | null;
366
- in_reply_to: string[] | null;
367
- references: string[] | null;
368
- attachments: {
369
- filename: string | null;
370
- content_type: string;
371
- size_bytes: number;
372
- sha256: string;
373
- part_index: number;
374
- tar_path: string;
375
- }[];
376
- attachments_download_url: string | null;
377
- }>, z.ZodObject<{
378
- status: z.ZodLiteral<"failed">;
379
- error: z.ZodObject<{
380
- code: z.ZodEnum<["PARSE_FAILED", "ATTACHMENT_EXTRACTION_FAILED"]>;
381
- message: z.ZodString;
382
- retryable: z.ZodBoolean;
383
- }, "strip", z.ZodTypeAny, {
384
- code: "PARSE_FAILED" | "ATTACHMENT_EXTRACTION_FAILED";
385
- message: string;
386
- retryable: boolean;
387
- }, {
388
- code: "PARSE_FAILED" | "ATTACHMENT_EXTRACTION_FAILED";
389
- message: string;
390
- retryable: boolean;
391
- }>;
392
- body_text: z.ZodNull;
393
- body_html: z.ZodNull;
394
- reply_to: z.ZodNull;
395
- cc: z.ZodNull;
396
- bcc: z.ZodNull;
397
- in_reply_to: z.ZodNull;
398
- references: z.ZodNull;
399
- attachments: z.ZodArray<z.ZodObject<{
400
- filename: z.ZodNullable<z.ZodString>;
401
- content_type: z.ZodString;
402
- size_bytes: z.ZodNumber;
403
- sha256: z.ZodString;
404
- part_index: z.ZodNumber;
405
- tar_path: z.ZodString;
406
- }, "strip", z.ZodTypeAny, {
407
- filename: string | null;
408
- content_type: string;
409
- size_bytes: number;
410
- sha256: string;
411
- part_index: number;
412
- tar_path: string;
413
- }, {
414
- filename: string | null;
415
- content_type: string;
416
- size_bytes: number;
417
- sha256: string;
418
- part_index: number;
419
- tar_path: string;
420
- }>, "many">;
421
- attachments_download_url: z.ZodNull;
422
- }, "strip", z.ZodTypeAny, {
423
- status: "failed";
424
- error: {
425
- code: "PARSE_FAILED" | "ATTACHMENT_EXTRACTION_FAILED";
426
- message: string;
427
- retryable: boolean;
428
- };
429
- body_text: null;
430
- body_html: null;
431
- reply_to: null;
432
- cc: null;
433
- bcc: null;
434
- in_reply_to: null;
435
- references: null;
436
- attachments: {
437
- filename: string | null;
438
- content_type: string;
439
- size_bytes: number;
440
- sha256: string;
441
- part_index: number;
442
- tar_path: string;
443
- }[];
444
- attachments_download_url: null;
445
- }, {
446
- status: "failed";
447
- error: {
448
- code: "PARSE_FAILED" | "ATTACHMENT_EXTRACTION_FAILED";
449
- message: string;
450
- retryable: boolean;
451
- };
452
- body_text: null;
453
- body_html: null;
454
- reply_to: null;
455
- cc: null;
456
- bcc: null;
457
- in_reply_to: null;
458
- references: null;
459
- attachments: {
460
- filename: string | null;
461
- content_type: string;
462
- size_bytes: number;
463
- sha256: string;
464
- part_index: number;
465
- tar_path: string;
466
- }[];
467
- attachments_download_url: null;
468
- }>]>;
469
- declare const rawContentInlineSchema: z.ZodObject<{
470
- included: z.ZodLiteral<true>;
471
- encoding: z.ZodLiteral<"base64">;
472
- max_inline_bytes: z.ZodNumber;
473
- size_bytes: z.ZodNumber;
474
- sha256: z.ZodString;
475
- data: z.ZodString;
476
- }, "strip", z.ZodTypeAny, {
477
- size_bytes: number;
478
- sha256: string;
479
- included: true;
480
- encoding: "base64";
481
- max_inline_bytes: number;
482
- data: string;
483
- }, {
484
- size_bytes: number;
485
- sha256: string;
486
- included: true;
487
- encoding: "base64";
488
- max_inline_bytes: number;
489
- data: string;
490
- }>;
491
- declare const rawContentDownloadOnlySchema: z.ZodObject<{
492
- included: z.ZodLiteral<false>;
493
- reason_code: z.ZodLiteral<"size_exceeded">;
494
- max_inline_bytes: z.ZodNumber;
495
- size_bytes: z.ZodNumber;
496
- sha256: z.ZodString;
497
- }, "strip", z.ZodTypeAny, {
498
- size_bytes: number;
499
- sha256: string;
500
- included: false;
501
- max_inline_bytes: number;
502
- reason_code: "size_exceeded";
503
- }, {
504
- size_bytes: number;
505
- sha256: string;
506
- included: false;
507
- max_inline_bytes: number;
508
- reason_code: "size_exceeded";
509
- }>;
510
- declare const rawContentSchema: z.ZodDiscriminatedUnion<"included", [z.ZodObject<{
511
- included: z.ZodLiteral<true>;
512
- encoding: z.ZodLiteral<"base64">;
513
- max_inline_bytes: z.ZodNumber;
514
- size_bytes: z.ZodNumber;
515
- sha256: z.ZodString;
516
- data: z.ZodString;
517
- }, "strip", z.ZodTypeAny, {
518
- size_bytes: number;
519
- sha256: string;
520
- included: true;
521
- encoding: "base64";
522
- max_inline_bytes: number;
523
- data: string;
524
- }, {
525
- size_bytes: number;
526
- sha256: string;
527
- included: true;
528
- encoding: "base64";
529
- max_inline_bytes: number;
530
- data: string;
531
- }>, z.ZodObject<{
532
- included: z.ZodLiteral<false>;
533
- reason_code: z.ZodLiteral<"size_exceeded">;
534
- max_inline_bytes: z.ZodNumber;
535
- size_bytes: z.ZodNumber;
536
- sha256: z.ZodString;
537
- }, "strip", z.ZodTypeAny, {
538
- size_bytes: number;
539
- sha256: string;
540
- included: false;
541
- max_inline_bytes: number;
542
- reason_code: "size_exceeded";
543
- }, {
544
- size_bytes: number;
545
- sha256: string;
546
- included: false;
547
- max_inline_bytes: number;
548
- reason_code: "size_exceeded";
549
- }>]>;
550
- declare const emailReceivedEventSchema: z.ZodObject<{
551
- id: z.ZodString;
552
- event: z.ZodLiteral<"email.received">;
553
- version: z.ZodString;
554
- delivery: z.ZodObject<{
555
- endpoint_id: z.ZodString;
556
- attempt: z.ZodNumber;
557
- attempted_at: z.ZodString;
558
- }, "strip", z.ZodTypeAny, {
559
- endpoint_id: string;
560
- attempt: number;
561
- attempted_at: string;
562
- }, {
563
- endpoint_id: string;
564
- attempt: number;
565
- attempted_at: string;
566
- }>;
567
- email: z.ZodObject<{
568
- id: z.ZodString;
569
- received_at: z.ZodString;
570
- smtp: z.ZodObject<{
571
- helo: z.ZodNullable<z.ZodString>;
572
- mail_from: z.ZodString;
573
- rcpt_to: z.ZodArray<z.ZodString, "many">;
574
- }, "strip", z.ZodTypeAny, {
575
- helo: string | null;
576
- mail_from: string;
577
- rcpt_to: string[];
578
- }, {
579
- helo: string | null;
580
- mail_from: string;
581
- rcpt_to: string[];
582
- }>;
583
- headers: z.ZodObject<{
584
- message_id: z.ZodNullable<z.ZodString>;
585
- subject: z.ZodNullable<z.ZodString>;
586
- from: z.ZodString;
587
- to: z.ZodString;
588
- date: z.ZodNullable<z.ZodString>;
589
- }, "strip", z.ZodTypeAny, {
590
- date: string | null;
591
- message_id: string | null;
592
- subject: string | null;
593
- from: string;
594
- to: string;
595
- }, {
596
- date: string | null;
597
- message_id: string | null;
598
- subject: string | null;
599
- from: string;
600
- to: string;
601
- }>;
602
- content: z.ZodObject<{
603
- raw: z.ZodDiscriminatedUnion<"included", [z.ZodObject<{
604
- included: z.ZodLiteral<true>;
605
- encoding: z.ZodLiteral<"base64">;
606
- max_inline_bytes: z.ZodNumber;
607
- size_bytes: z.ZodNumber;
608
- sha256: z.ZodString;
609
- data: z.ZodString;
610
- }, "strip", z.ZodTypeAny, {
611
- size_bytes: number;
612
- sha256: string;
613
- included: true;
614
- encoding: "base64";
615
- max_inline_bytes: number;
616
- data: string;
617
- }, {
618
- size_bytes: number;
619
- sha256: string;
620
- included: true;
621
- encoding: "base64";
622
- max_inline_bytes: number;
623
- data: string;
624
- }>, z.ZodObject<{
625
- included: z.ZodLiteral<false>;
626
- reason_code: z.ZodLiteral<"size_exceeded">;
627
- max_inline_bytes: z.ZodNumber;
628
- size_bytes: z.ZodNumber;
629
- sha256: z.ZodString;
630
- }, "strip", z.ZodTypeAny, {
631
- size_bytes: number;
632
- sha256: string;
633
- included: false;
634
- max_inline_bytes: number;
635
- reason_code: "size_exceeded";
636
- }, {
637
- size_bytes: number;
638
- sha256: string;
639
- included: false;
640
- max_inline_bytes: number;
641
- reason_code: "size_exceeded";
642
- }>]>;
643
- download: z.ZodObject<{
644
- url: z.ZodEffects<z.ZodString, string, string>;
645
- expires_at: z.ZodString;
646
- }, "strip", z.ZodTypeAny, {
647
- url: string;
648
- expires_at: string;
649
- }, {
650
- url: string;
651
- expires_at: string;
652
- }>;
653
- }, "strip", z.ZodTypeAny, {
654
- raw: {
655
- size_bytes: number;
656
- sha256: string;
657
- included: true;
658
- encoding: "base64";
659
- max_inline_bytes: number;
660
- data: string;
661
- } | {
662
- size_bytes: number;
663
- sha256: string;
664
- included: false;
665
- max_inline_bytes: number;
666
- reason_code: "size_exceeded";
667
- };
668
- download: {
669
- url: string;
670
- expires_at: string;
671
- };
672
- }, {
673
- raw: {
674
- size_bytes: number;
675
- sha256: string;
676
- included: true;
677
- encoding: "base64";
678
- max_inline_bytes: number;
679
- data: string;
680
- } | {
681
- size_bytes: number;
682
- sha256: string;
683
- included: false;
684
- max_inline_bytes: number;
685
- reason_code: "size_exceeded";
686
- };
687
- download: {
688
- url: string;
689
- expires_at: string;
690
- };
691
- }>;
692
- parsed: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
693
- status: z.ZodLiteral<"complete">;
694
- error: z.ZodNull;
695
- body_text: z.ZodNullable<z.ZodString>;
696
- body_html: z.ZodNullable<z.ZodString>;
697
- reply_to: z.ZodNullable<z.ZodArray<z.ZodObject<{
698
- address: z.ZodString;
699
- name: z.ZodNullable<z.ZodString>;
700
- }, "strip", z.ZodTypeAny, {
701
- address: string;
702
- name: string | null;
703
- }, {
704
- address: string;
705
- name: string | null;
706
- }>, "many">>;
707
- cc: z.ZodNullable<z.ZodArray<z.ZodObject<{
708
- address: z.ZodString;
709
- name: z.ZodNullable<z.ZodString>;
710
- }, "strip", z.ZodTypeAny, {
711
- address: string;
712
- name: string | null;
713
- }, {
714
- address: string;
715
- name: string | null;
716
- }>, "many">>;
717
- bcc: z.ZodNullable<z.ZodArray<z.ZodObject<{
718
- address: z.ZodString;
719
- name: z.ZodNullable<z.ZodString>;
720
- }, "strip", z.ZodTypeAny, {
721
- address: string;
722
- name: string | null;
723
- }, {
724
- address: string;
725
- name: string | null;
726
- }>, "many">>;
727
- in_reply_to: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
728
- references: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
729
- attachments: z.ZodArray<z.ZodObject<{
730
- filename: z.ZodNullable<z.ZodString>;
731
- content_type: z.ZodString;
732
- size_bytes: z.ZodNumber;
733
- sha256: z.ZodString;
734
- part_index: z.ZodNumber;
735
- tar_path: z.ZodString;
736
- }, "strip", z.ZodTypeAny, {
737
- filename: string | null;
738
- content_type: string;
739
- size_bytes: number;
740
- sha256: string;
741
- part_index: number;
742
- tar_path: string;
743
- }, {
744
- filename: string | null;
745
- content_type: string;
746
- size_bytes: number;
747
- sha256: string;
748
- part_index: number;
749
- tar_path: string;
750
- }>, "many">;
751
- attachments_download_url: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
752
- }, "strip", z.ZodTypeAny, {
753
- status: "complete";
754
- error: null;
755
- body_text: string | null;
756
- body_html: string | null;
757
- reply_to: {
758
- address: string;
759
- name: string | null;
760
- }[] | null;
761
- cc: {
762
- address: string;
763
- name: string | null;
764
- }[] | null;
765
- bcc: {
766
- address: string;
767
- name: string | null;
768
- }[] | null;
769
- in_reply_to: string[] | null;
770
- references: string[] | null;
771
- attachments: {
772
- filename: string | null;
773
- content_type: string;
774
- size_bytes: number;
775
- sha256: string;
776
- part_index: number;
777
- tar_path: string;
778
- }[];
779
- attachments_download_url: string | null;
780
- }, {
781
- status: "complete";
782
- error: null;
783
- body_text: string | null;
784
- body_html: string | null;
785
- reply_to: {
786
- address: string;
787
- name: string | null;
788
- }[] | null;
789
- cc: {
790
- address: string;
791
- name: string | null;
792
- }[] | null;
793
- bcc: {
794
- address: string;
795
- name: string | null;
796
- }[] | null;
797
- in_reply_to: string[] | null;
798
- references: string[] | null;
799
- attachments: {
800
- filename: string | null;
801
- content_type: string;
802
- size_bytes: number;
803
- sha256: string;
804
- part_index: number;
805
- tar_path: string;
806
- }[];
807
- attachments_download_url: string | null;
808
- }>, z.ZodObject<{
809
- status: z.ZodLiteral<"failed">;
810
- error: z.ZodObject<{
811
- code: z.ZodEnum<["PARSE_FAILED", "ATTACHMENT_EXTRACTION_FAILED"]>;
812
- message: z.ZodString;
813
- retryable: z.ZodBoolean;
814
- }, "strip", z.ZodTypeAny, {
815
- code: "PARSE_FAILED" | "ATTACHMENT_EXTRACTION_FAILED";
816
- message: string;
817
- retryable: boolean;
818
- }, {
819
- code: "PARSE_FAILED" | "ATTACHMENT_EXTRACTION_FAILED";
820
- message: string;
821
- retryable: boolean;
822
- }>;
823
- body_text: z.ZodNull;
824
- body_html: z.ZodNull;
825
- reply_to: z.ZodNull;
826
- cc: z.ZodNull;
827
- bcc: z.ZodNull;
828
- in_reply_to: z.ZodNull;
829
- references: z.ZodNull;
830
- attachments: z.ZodArray<z.ZodObject<{
831
- filename: z.ZodNullable<z.ZodString>;
832
- content_type: z.ZodString;
833
- size_bytes: z.ZodNumber;
834
- sha256: z.ZodString;
835
- part_index: z.ZodNumber;
836
- tar_path: z.ZodString;
837
- }, "strip", z.ZodTypeAny, {
838
- filename: string | null;
839
- content_type: string;
840
- size_bytes: number;
841
- sha256: string;
842
- part_index: number;
843
- tar_path: string;
844
- }, {
845
- filename: string | null;
846
- content_type: string;
847
- size_bytes: number;
848
- sha256: string;
849
- part_index: number;
850
- tar_path: string;
851
- }>, "many">;
852
- attachments_download_url: z.ZodNull;
853
- }, "strip", z.ZodTypeAny, {
854
- status: "failed";
855
- error: {
856
- code: "PARSE_FAILED" | "ATTACHMENT_EXTRACTION_FAILED";
857
- message: string;
858
- retryable: boolean;
859
- };
860
- body_text: null;
861
- body_html: null;
862
- reply_to: null;
863
- cc: null;
864
- bcc: null;
865
- in_reply_to: null;
866
- references: null;
867
- attachments: {
868
- filename: string | null;
869
- content_type: string;
870
- size_bytes: number;
871
- sha256: string;
872
- part_index: number;
873
- tar_path: string;
874
- }[];
875
- attachments_download_url: null;
876
- }, {
877
- status: "failed";
878
- error: {
879
- code: "PARSE_FAILED" | "ATTACHMENT_EXTRACTION_FAILED";
880
- message: string;
881
- retryable: boolean;
882
- };
883
- body_text: null;
884
- body_html: null;
885
- reply_to: null;
886
- cc: null;
887
- bcc: null;
888
- in_reply_to: null;
889
- references: null;
890
- attachments: {
891
- filename: string | null;
892
- content_type: string;
893
- size_bytes: number;
894
- sha256: string;
895
- part_index: number;
896
- tar_path: string;
897
- }[];
898
- attachments_download_url: null;
899
- }>]>;
900
- analysis: z.ZodOptional<z.ZodObject<{
901
- spamassassin: z.ZodObject<{
902
- score: z.ZodNumber;
903
- }, "strip", z.ZodTypeAny, {
904
- score: number;
905
- }, {
906
- score: number;
907
- }>;
908
- }, "strip", z.ZodTypeAny, {
909
- spamassassin: {
910
- score: number;
911
- };
912
- }, {
913
- spamassassin: {
914
- score: number;
915
- };
916
- }>>;
917
- }, "strip", z.ZodTypeAny, {
918
- id: string;
919
- received_at: string;
920
- smtp: {
921
- helo: string | null;
922
- mail_from: string;
923
- rcpt_to: string[];
924
- };
925
- headers: {
926
- date: string | null;
927
- message_id: string | null;
928
- subject: string | null;
929
- from: string;
930
- to: string;
931
- };
932
- content: {
933
- raw: {
934
- size_bytes: number;
935
- sha256: string;
936
- included: true;
937
- encoding: "base64";
938
- max_inline_bytes: number;
939
- data: string;
940
- } | {
941
- size_bytes: number;
942
- sha256: string;
943
- included: false;
944
- max_inline_bytes: number;
945
- reason_code: "size_exceeded";
946
- };
947
- download: {
948
- url: string;
949
- expires_at: string;
950
- };
951
- };
952
- parsed: {
953
- status: "complete";
954
- error: null;
955
- body_text: string | null;
956
- body_html: string | null;
957
- reply_to: {
958
- address: string;
959
- name: string | null;
960
- }[] | null;
961
- cc: {
962
- address: string;
963
- name: string | null;
964
- }[] | null;
965
- bcc: {
966
- address: string;
967
- name: string | null;
968
- }[] | null;
969
- in_reply_to: string[] | null;
970
- references: string[] | null;
971
- attachments: {
972
- filename: string | null;
973
- content_type: string;
974
- size_bytes: number;
975
- sha256: string;
976
- part_index: number;
977
- tar_path: string;
978
- }[];
979
- attachments_download_url: string | null;
980
- } | {
981
- status: "failed";
982
- error: {
983
- code: "PARSE_FAILED" | "ATTACHMENT_EXTRACTION_FAILED";
984
- message: string;
985
- retryable: boolean;
986
- };
987
- body_text: null;
988
- body_html: null;
989
- reply_to: null;
990
- cc: null;
991
- bcc: null;
992
- in_reply_to: null;
993
- references: null;
994
- attachments: {
995
- filename: string | null;
996
- content_type: string;
997
- size_bytes: number;
998
- sha256: string;
999
- part_index: number;
1000
- tar_path: string;
1001
- }[];
1002
- attachments_download_url: null;
1003
- };
1004
- analysis?: {
1005
- spamassassin: {
1006
- score: number;
1007
- };
1008
- } | undefined;
1009
- }, {
1010
- id: string;
1011
- received_at: string;
1012
- smtp: {
1013
- helo: string | null;
1014
- mail_from: string;
1015
- rcpt_to: string[];
1016
- };
1017
- headers: {
1018
- date: string | null;
1019
- message_id: string | null;
1020
- subject: string | null;
1021
- from: string;
1022
- to: string;
1023
- };
1024
- content: {
1025
- raw: {
1026
- size_bytes: number;
1027
- sha256: string;
1028
- included: true;
1029
- encoding: "base64";
1030
- max_inline_bytes: number;
1031
- data: string;
1032
- } | {
1033
- size_bytes: number;
1034
- sha256: string;
1035
- included: false;
1036
- max_inline_bytes: number;
1037
- reason_code: "size_exceeded";
1038
- };
1039
- download: {
1040
- url: string;
1041
- expires_at: string;
1042
- };
1043
- };
1044
- parsed: {
1045
- status: "complete";
1046
- error: null;
1047
- body_text: string | null;
1048
- body_html: string | null;
1049
- reply_to: {
1050
- address: string;
1051
- name: string | null;
1052
- }[] | null;
1053
- cc: {
1054
- address: string;
1055
- name: string | null;
1056
- }[] | null;
1057
- bcc: {
1058
- address: string;
1059
- name: string | null;
1060
- }[] | null;
1061
- in_reply_to: string[] | null;
1062
- references: string[] | null;
1063
- attachments: {
1064
- filename: string | null;
1065
- content_type: string;
1066
- size_bytes: number;
1067
- sha256: string;
1068
- part_index: number;
1069
- tar_path: string;
1070
- }[];
1071
- attachments_download_url: string | null;
1072
- } | {
1073
- status: "failed";
1074
- error: {
1075
- code: "PARSE_FAILED" | "ATTACHMENT_EXTRACTION_FAILED";
1076
- message: string;
1077
- retryable: boolean;
1078
- };
1079
- body_text: null;
1080
- body_html: null;
1081
- reply_to: null;
1082
- cc: null;
1083
- bcc: null;
1084
- in_reply_to: null;
1085
- references: null;
1086
- attachments: {
1087
- filename: string | null;
1088
- content_type: string;
1089
- size_bytes: number;
1090
- sha256: string;
1091
- part_index: number;
1092
- tar_path: string;
1093
- }[];
1094
- attachments_download_url: null;
1095
- };
1096
- analysis?: {
1097
- spamassassin: {
1098
- score: number;
1099
- };
1100
- } | undefined;
1101
- }>;
1102
- }, "strip", z.ZodTypeAny, {
1103
- id: string;
1104
- event: "email.received";
1105
- version: string;
1106
- delivery: {
1107
- endpoint_id: string;
1108
- attempt: number;
1109
- attempted_at: string;
1110
- };
1111
- email: {
1112
- id: string;
1113
- received_at: string;
1114
- smtp: {
1115
- helo: string | null;
1116
- mail_from: string;
1117
- rcpt_to: string[];
1118
- };
1119
- headers: {
1120
- date: string | null;
1121
- message_id: string | null;
1122
- subject: string | null;
1123
- from: string;
1124
- to: string;
1125
- };
1126
- content: {
1127
- raw: {
1128
- size_bytes: number;
1129
- sha256: string;
1130
- included: true;
1131
- encoding: "base64";
1132
- max_inline_bytes: number;
1133
- data: string;
1134
- } | {
1135
- size_bytes: number;
1136
- sha256: string;
1137
- included: false;
1138
- max_inline_bytes: number;
1139
- reason_code: "size_exceeded";
1140
- };
1141
- download: {
1142
- url: string;
1143
- expires_at: string;
1144
- };
1145
- };
1146
- parsed: {
1147
- status: "complete";
1148
- error: null;
1149
- body_text: string | null;
1150
- body_html: string | null;
1151
- reply_to: {
1152
- address: string;
1153
- name: string | null;
1154
- }[] | null;
1155
- cc: {
1156
- address: string;
1157
- name: string | null;
1158
- }[] | null;
1159
- bcc: {
1160
- address: string;
1161
- name: string | null;
1162
- }[] | null;
1163
- in_reply_to: string[] | null;
1164
- references: string[] | null;
1165
- attachments: {
1166
- filename: string | null;
1167
- content_type: string;
1168
- size_bytes: number;
1169
- sha256: string;
1170
- part_index: number;
1171
- tar_path: string;
1172
- }[];
1173
- attachments_download_url: string | null;
1174
- } | {
1175
- status: "failed";
1176
- error: {
1177
- code: "PARSE_FAILED" | "ATTACHMENT_EXTRACTION_FAILED";
1178
- message: string;
1179
- retryable: boolean;
1180
- };
1181
- body_text: null;
1182
- body_html: null;
1183
- reply_to: null;
1184
- cc: null;
1185
- bcc: null;
1186
- in_reply_to: null;
1187
- references: null;
1188
- attachments: {
1189
- filename: string | null;
1190
- content_type: string;
1191
- size_bytes: number;
1192
- sha256: string;
1193
- part_index: number;
1194
- tar_path: string;
1195
- }[];
1196
- attachments_download_url: null;
1197
- };
1198
- analysis?: {
1199
- spamassassin: {
1200
- score: number;
1201
- };
1202
- } | undefined;
1203
- };
1204
- }, {
1205
- id: string;
1206
- event: "email.received";
1207
- version: string;
1208
- delivery: {
1209
- endpoint_id: string;
1210
- attempt: number;
1211
- attempted_at: string;
1212
- };
1213
- email: {
1214
- id: string;
1215
- received_at: string;
1216
- smtp: {
1217
- helo: string | null;
1218
- mail_from: string;
1219
- rcpt_to: string[];
1220
- };
1221
- headers: {
1222
- date: string | null;
1223
- message_id: string | null;
1224
- subject: string | null;
1225
- from: string;
1226
- to: string;
1227
- };
1228
- content: {
1229
- raw: {
1230
- size_bytes: number;
1231
- sha256: string;
1232
- included: true;
1233
- encoding: "base64";
1234
- max_inline_bytes: number;
1235
- data: string;
1236
- } | {
1237
- size_bytes: number;
1238
- sha256: string;
1239
- included: false;
1240
- max_inline_bytes: number;
1241
- reason_code: "size_exceeded";
1242
- };
1243
- download: {
1244
- url: string;
1245
- expires_at: string;
1246
- };
1247
- };
1248
- parsed: {
1249
- status: "complete";
1250
- error: null;
1251
- body_text: string | null;
1252
- body_html: string | null;
1253
- reply_to: {
1254
- address: string;
1255
- name: string | null;
1256
- }[] | null;
1257
- cc: {
1258
- address: string;
1259
- name: string | null;
1260
- }[] | null;
1261
- bcc: {
1262
- address: string;
1263
- name: string | null;
1264
- }[] | null;
1265
- in_reply_to: string[] | null;
1266
- references: string[] | null;
1267
- attachments: {
1268
- filename: string | null;
1269
- content_type: string;
1270
- size_bytes: number;
1271
- sha256: string;
1272
- part_index: number;
1273
- tar_path: string;
1274
- }[];
1275
- attachments_download_url: string | null;
1276
- } | {
1277
- status: "failed";
1278
- error: {
1279
- code: "PARSE_FAILED" | "ATTACHMENT_EXTRACTION_FAILED";
1280
- message: string;
1281
- retryable: boolean;
1282
- };
1283
- body_text: null;
1284
- body_html: null;
1285
- reply_to: null;
1286
- cc: null;
1287
- bcc: null;
1288
- in_reply_to: null;
1289
- references: null;
1290
- attachments: {
1291
- filename: string | null;
1292
- content_type: string;
1293
- size_bytes: number;
1294
- sha256: string;
1295
- part_index: number;
1296
- tar_path: string;
1297
- }[];
1298
- attachments_download_url: null;
1299
- };
1300
- analysis?: {
1301
- spamassassin: {
1302
- score: number;
1303
- };
1304
- } | undefined;
1305
- };
1306
- }>;
1307
- /**
1308
- * Validate and parse a webhook payload as an EmailReceivedEvent.
1309
- *
1310
- * Uses Zod for comprehensive schema validation. Throws WebhookValidationError
1311
- * with human-friendly messages if validation fails.
1312
- *
1313
- * NOTE: This is the strict validation version. For lightweight parsing without
1314
- * full schema validation, use `parseWebhookEvent` from the main `mymx` export.
1315
- *
1316
- * @param input - The parsed JSON payload (use `JSON.parse(rawBody)`)
1317
- * @returns The validated and typed event
1318
- * @throws WebhookValidationError with actionable message if validation fails
1319
- *
1320
- * @example
1321
- * ```typescript
1322
- * import { validateEmailReceivedEvent, WebhookValidationError } from 'mymx/zod';
1323
- *
1324
- * try {
1325
- * const event = validateEmailReceivedEvent(JSON.parse(rawBody));
1326
- * // event is fully validated and typed
1327
- * } catch (err) {
1328
- * if (err instanceof WebhookValidationError) {
1329
- * console.error(`[${err.code}] ${err.message}`);
1330
- * console.error(`Field: ${err.field}`);
1331
- * console.error(`Suggestion: ${err.suggestion}`);
1332
- * }
1333
- * }
1334
- * ```
1335
- */
1336
- declare function validateEmailReceivedEvent(input: unknown): EmailReceivedEvent;
1337
- /**
1338
- * Safely validate a webhook payload, returning a result object instead of throwing.
1339
- *
1340
- * @param input - The parsed JSON payload
1341
- * @returns A Zod SafeParseResult with either the data or error
1342
- *
1343
- * @example
1344
- * ```typescript
1345
- * import { safeValidateEmailReceivedEvent } from 'mymx/zod';
1346
- *
1347
- * const result = safeValidateEmailReceivedEvent(payload);
1348
- * if (result.success) {
1349
- * console.log('Valid event:', result.data.id);
1350
- * } else {
1351
- * console.error('Validation failed:', result.error.issues);
1352
- * }
1353
- * ```
1354
- */
1355
- declare function safeValidateEmailReceivedEvent(input: unknown): z.SafeParseReturnType<unknown, EmailReceivedEvent>; //#endregion
1356
- export { WebhookValidationError, WebhookValidationErrorCode, emailAddressSchema, emailReceivedEventSchema, parsedDataCompleteSchema, parsedDataFailedSchema, parsedDataSchema, parsedErrorSchema, rawContentDownloadOnlySchema, rawContentInlineSchema, rawContentSchema, safeValidateEmailReceivedEvent, validateEmailReceivedEvent, webhookAttachmentSchema };