@primitivedotdev/sdk 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,6 +16,7 @@ export const operationManifest = [
16
16
  "path": "/account",
17
17
  "pathParams": [],
18
18
  "queryParams": [],
19
+ "requestSchema": null,
19
20
  "sdkName": "getAccount",
20
21
  "summary": "Get account info",
21
22
  "tag": "Account",
@@ -32,6 +33,7 @@ export const operationManifest = [
32
33
  "path": "/account/storage",
33
34
  "pathParams": [],
34
35
  "queryParams": [],
36
+ "requestSchema": null,
35
37
  "sdkName": "getStorageStats",
36
38
  "summary": "Get storage usage",
37
39
  "tag": "Account",
@@ -48,6 +50,7 @@ export const operationManifest = [
48
50
  "path": "/account/webhook-secret",
49
51
  "pathParams": [],
50
52
  "queryParams": [],
53
+ "requestSchema": null,
51
54
  "sdkName": "getWebhookSecret",
52
55
  "summary": "Get webhook signing secret",
53
56
  "tag": "Account",
@@ -64,6 +67,7 @@ export const operationManifest = [
64
67
  "path": "/account/webhook-secret/rotate",
65
68
  "pathParams": [],
66
69
  "queryParams": [],
70
+ "requestSchema": null,
67
71
  "sdkName": "rotateWebhookSecret",
68
72
  "summary": "Rotate webhook signing secret",
69
73
  "tag": "Account",
@@ -80,6 +84,26 @@ export const operationManifest = [
80
84
  "path": "/account",
81
85
  "pathParams": [],
82
86
  "queryParams": [],
87
+ "requestSchema": {
88
+ "type": "object",
89
+ "additionalProperties": false,
90
+ "properties": {
91
+ "spam_threshold": {
92
+ "type": [
93
+ "number",
94
+ "null"
95
+ ],
96
+ "minimum": 0,
97
+ "maximum": 15,
98
+ "description": "Global spam score threshold (0-15). Emails scoring above this are rejected. Set to null to disable."
99
+ },
100
+ "discard_content_on_webhook_confirmed": {
101
+ "type": "boolean",
102
+ "description": "Whether to discard email content after the webhook endpoint confirms receipt."
103
+ }
104
+ },
105
+ "minProperties": 1
106
+ },
83
107
  "sdkName": "updateAccount",
84
108
  "summary": "Update account settings",
85
109
  "tag": "Account",
@@ -96,6 +120,21 @@ export const operationManifest = [
96
120
  "path": "/domains",
97
121
  "pathParams": [],
98
122
  "queryParams": [],
123
+ "requestSchema": {
124
+ "type": "object",
125
+ "additionalProperties": false,
126
+ "properties": {
127
+ "domain": {
128
+ "type": "string",
129
+ "minLength": 1,
130
+ "maxLength": 253,
131
+ "description": "The domain name to claim (e.g. \"example.com\")"
132
+ }
133
+ },
134
+ "required": [
135
+ "domain"
136
+ ]
137
+ },
99
138
  "sdkName": "addDomain",
100
139
  "summary": "Claim a new domain",
101
140
  "tag": "Domains",
@@ -120,6 +159,7 @@ export const operationManifest = [
120
159
  }
121
160
  ],
122
161
  "queryParams": [],
162
+ "requestSchema": null,
123
163
  "sdkName": "deleteDomain",
124
164
  "summary": "Delete a domain",
125
165
  "tag": "Domains",
@@ -136,6 +176,7 @@ export const operationManifest = [
136
176
  "path": "/domains",
137
177
  "pathParams": [],
138
178
  "queryParams": [],
179
+ "requestSchema": null,
139
180
  "sdkName": "listDomains",
140
181
  "summary": "List all domains",
141
182
  "tag": "Domains",
@@ -160,6 +201,26 @@ export const operationManifest = [
160
201
  }
161
202
  ],
162
203
  "queryParams": [],
204
+ "requestSchema": {
205
+ "type": "object",
206
+ "additionalProperties": false,
207
+ "properties": {
208
+ "is_active": {
209
+ "type": "boolean",
210
+ "description": "Whether the domain accepts incoming emails"
211
+ },
212
+ "spam_threshold": {
213
+ "type": [
214
+ "number",
215
+ "null"
216
+ ],
217
+ "minimum": 0,
218
+ "maximum": 15,
219
+ "description": "Per-domain spam threshold override (Pro plan required)"
220
+ }
221
+ },
222
+ "minProperties": 1
223
+ },
163
224
  "sdkName": "updateDomain",
164
225
  "summary": "Update domain settings",
165
226
  "tag": "Domains",
@@ -184,6 +245,7 @@ export const operationManifest = [
184
245
  }
185
246
  ],
186
247
  "queryParams": [],
248
+ "requestSchema": null,
187
249
  "sdkName": "verifyDomain",
188
250
  "summary": "Verify domain ownership",
189
251
  "tag": "Domains",
@@ -208,6 +270,7 @@ export const operationManifest = [
208
270
  }
209
271
  ],
210
272
  "queryParams": [],
273
+ "requestSchema": null,
211
274
  "sdkName": "deleteEmail",
212
275
  "summary": "Delete an email",
213
276
  "tag": "Emails",
@@ -240,6 +303,7 @@ export const operationManifest = [
240
303
  "type": "string"
241
304
  }
242
305
  ],
306
+ "requestSchema": null,
243
307
  "sdkName": "downloadAttachments",
244
308
  "summary": "Download email attachments",
245
309
  "tag": "Emails",
@@ -272,6 +336,7 @@ export const operationManifest = [
272
336
  "type": "string"
273
337
  }
274
338
  ],
339
+ "requestSchema": null,
275
340
  "sdkName": "downloadRawEmail",
276
341
  "summary": "Download raw email",
277
342
  "tag": "Emails",
@@ -296,6 +361,7 @@ export const operationManifest = [
296
361
  }
297
362
  ],
298
363
  "queryParams": [],
364
+ "requestSchema": null,
299
365
  "sdkName": "getEmail",
300
366
  "summary": "Get email details",
301
367
  "tag": "Emails",
@@ -367,6 +433,7 @@ export const operationManifest = [
367
433
  "type": "string"
368
434
  }
369
435
  ],
436
+ "requestSchema": null,
370
437
  "sdkName": "listEmails",
371
438
  "summary": "List emails",
372
439
  "tag": "Emails",
@@ -391,6 +458,7 @@ export const operationManifest = [
391
458
  }
392
459
  ],
393
460
  "queryParams": [],
461
+ "requestSchema": null,
394
462
  "sdkName": "replayEmailWebhooks",
395
463
  "summary": "Replay email webhooks",
396
464
  "tag": "Emails",
@@ -407,6 +475,37 @@ export const operationManifest = [
407
475
  "path": "/endpoints",
408
476
  "pathParams": [],
409
477
  "queryParams": [],
478
+ "requestSchema": {
479
+ "type": "object",
480
+ "additionalProperties": false,
481
+ "properties": {
482
+ "url": {
483
+ "type": "string",
484
+ "minLength": 1,
485
+ "description": "The webhook URL to deliver events to"
486
+ },
487
+ "enabled": {
488
+ "type": "boolean",
489
+ "default": true,
490
+ "description": "Whether the endpoint is active"
491
+ },
492
+ "domain_id": {
493
+ "type": [
494
+ "string",
495
+ "null"
496
+ ],
497
+ "format": "uuid",
498
+ "description": "Restrict to emails from a specific domain"
499
+ },
500
+ "rules": {
501
+ "type": "object",
502
+ "description": "Endpoint-specific filtering rules"
503
+ }
504
+ },
505
+ "required": [
506
+ "url"
507
+ ]
508
+ },
410
509
  "sdkName": "createEndpoint",
411
510
  "summary": "Create a webhook endpoint",
412
511
  "tag": "Endpoints",
@@ -431,6 +530,7 @@ export const operationManifest = [
431
530
  }
432
531
  ],
433
532
  "queryParams": [],
533
+ "requestSchema": null,
434
534
  "sdkName": "deleteEndpoint",
435
535
  "summary": "Delete a webhook endpoint",
436
536
  "tag": "Endpoints",
@@ -447,6 +547,7 @@ export const operationManifest = [
447
547
  "path": "/endpoints",
448
548
  "pathParams": [],
449
549
  "queryParams": [],
550
+ "requestSchema": null,
450
551
  "sdkName": "listEndpoints",
451
552
  "summary": "List webhook endpoints",
452
553
  "tag": "Endpoints",
@@ -471,6 +572,7 @@ export const operationManifest = [
471
572
  }
472
573
  ],
473
574
  "queryParams": [],
575
+ "requestSchema": null,
474
576
  "sdkName": "testEndpoint",
475
577
  "summary": "Send a test webhook",
476
578
  "tag": "Endpoints",
@@ -495,6 +597,31 @@ export const operationManifest = [
495
597
  }
496
598
  ],
497
599
  "queryParams": [],
600
+ "requestSchema": {
601
+ "type": "object",
602
+ "additionalProperties": false,
603
+ "properties": {
604
+ "url": {
605
+ "type": "string",
606
+ "minLength": 1,
607
+ "description": "New webhook URL (triggers endpoint rotation)"
608
+ },
609
+ "enabled": {
610
+ "type": "boolean"
611
+ },
612
+ "domain_id": {
613
+ "type": [
614
+ "string",
615
+ "null"
616
+ ],
617
+ "format": "uuid"
618
+ },
619
+ "rules": {
620
+ "type": "object"
621
+ }
622
+ },
623
+ "minProperties": 1
624
+ },
498
625
  "sdkName": "updateEndpoint",
499
626
  "summary": "Update a webhook endpoint",
500
627
  "tag": "Endpoints",
@@ -511,6 +638,37 @@ export const operationManifest = [
511
638
  "path": "/filters",
512
639
  "pathParams": [],
513
640
  "queryParams": [],
641
+ "requestSchema": {
642
+ "type": "object",
643
+ "additionalProperties": false,
644
+ "properties": {
645
+ "type": {
646
+ "type": "string",
647
+ "enum": [
648
+ "whitelist",
649
+ "blocklist"
650
+ ]
651
+ },
652
+ "pattern": {
653
+ "type": "string",
654
+ "minLength": 1,
655
+ "maxLength": 500,
656
+ "description": "Email address or pattern to filter"
657
+ },
658
+ "domain_id": {
659
+ "type": [
660
+ "string",
661
+ "null"
662
+ ],
663
+ "format": "uuid",
664
+ "description": "Restrict filter to a specific domain (Pro plan required)"
665
+ }
666
+ },
667
+ "required": [
668
+ "type",
669
+ "pattern"
670
+ ]
671
+ },
514
672
  "sdkName": "createFilter",
515
673
  "summary": "Create a filter rule",
516
674
  "tag": "Filters",
@@ -535,6 +693,7 @@ export const operationManifest = [
535
693
  }
536
694
  ],
537
695
  "queryParams": [],
696
+ "requestSchema": null,
538
697
  "sdkName": "deleteFilter",
539
698
  "summary": "Delete a filter rule",
540
699
  "tag": "Filters",
@@ -551,6 +710,7 @@ export const operationManifest = [
551
710
  "path": "/filters",
552
711
  "pathParams": [],
553
712
  "queryParams": [],
713
+ "requestSchema": null,
554
714
  "sdkName": "listFilters",
555
715
  "summary": "List filter rules",
556
716
  "tag": "Filters",
@@ -575,6 +735,18 @@ export const operationManifest = [
575
735
  }
576
736
  ],
577
737
  "queryParams": [],
738
+ "requestSchema": {
739
+ "type": "object",
740
+ "additionalProperties": false,
741
+ "properties": {
742
+ "enabled": {
743
+ "type": "boolean"
744
+ }
745
+ },
746
+ "required": [
747
+ "enabled"
748
+ ]
749
+ },
578
750
  "sdkName": "updateFilter",
579
751
  "summary": "Update a filter rule",
580
752
  "tag": "Filters",
@@ -591,6 +763,71 @@ export const operationManifest = [
591
763
  "path": "/send-mail",
592
764
  "pathParams": [],
593
765
  "queryParams": [],
766
+ "requestSchema": {
767
+ "type": "object",
768
+ "additionalProperties": false,
769
+ "properties": {
770
+ "from": {
771
+ "type": "string",
772
+ "minLength": 3,
773
+ "maxLength": 998,
774
+ "description": "RFC 5322 From header. The sender domain must be a verified outbound domain for your organization."
775
+ },
776
+ "to": {
777
+ "type": "string",
778
+ "minLength": 3,
779
+ "maxLength": 320,
780
+ "description": "Recipient address. Recipient eligibility depends on your account's outbound entitlements."
781
+ },
782
+ "subject": {
783
+ "type": "string",
784
+ "minLength": 1,
785
+ "maxLength": 998,
786
+ "description": "Subject line for the outbound message"
787
+ },
788
+ "body_text": {
789
+ "type": "string",
790
+ "description": "Plain-text message body. At least one of body_text or body_html is required. The combined UTF-8 byte length of body_text and body_html must be at most 262144 bytes."
791
+ },
792
+ "body_html": {
793
+ "type": "string",
794
+ "description": "HTML message body. At least one of body_text or body_html is required. The combined UTF-8 byte length of body_text and body_html must be at most 262144 bytes."
795
+ },
796
+ "in_reply_to": {
797
+ "type": "string",
798
+ "minLength": 1,
799
+ "maxLength": 998,
800
+ "pattern": "^[^\\x00-\\x1F\\x7F]+$",
801
+ "description": "Message-ID of the direct parent email when sending a threaded reply."
802
+ },
803
+ "references": {
804
+ "type": "array",
805
+ "maxItems": 100,
806
+ "description": "Full ordered message-id chain for the thread.",
807
+ "items": {
808
+ "type": "string",
809
+ "minLength": 1,
810
+ "maxLength": 998,
811
+ "pattern": "^[^\\x00-\\x1F\\x7F]+$"
812
+ }
813
+ },
814
+ "wait": {
815
+ "type": "boolean",
816
+ "description": "When true, wait for the first downstream SMTP delivery outcome before returning."
817
+ },
818
+ "wait_timeout_ms": {
819
+ "type": "integer",
820
+ "minimum": 1000,
821
+ "maximum": 30000,
822
+ "description": "Maximum time to wait for a delivery outcome when wait is true. Defaults to 30000."
823
+ }
824
+ },
825
+ "required": [
826
+ "from",
827
+ "to",
828
+ "subject"
829
+ ]
830
+ },
594
831
  "sdkName": "sendEmail",
595
832
  "summary": "Send outbound email",
596
833
  "tag": "Sending",
@@ -655,6 +892,7 @@ export const operationManifest = [
655
892
  "type": "string"
656
893
  }
657
894
  ],
895
+ "requestSchema": null,
658
896
  "sdkName": "listDeliveries",
659
897
  "summary": "List webhook deliveries",
660
898
  "tag": "Webhook Deliveries",
@@ -679,6 +917,7 @@ export const operationManifest = [
679
917
  }
680
918
  ],
681
919
  "queryParams": [],
920
+ "requestSchema": null,
682
921
  "sdkName": "replayDelivery",
683
922
  "summary": "Replay a webhook delivery",
684
923
  "tag": "Webhook Deliveries",
@@ -1,17 +1,6 @@
1
- import { EmailAddress, ParsedDataComplete, WebhookAttachment } from "../types-CIOzt1FY.js";
1
+ import { M as WebhookAttachment, S as ParsedDataComplete, s as EmailAddress } from "../types-9vXGZjPd.js";
2
2
 
3
3
  //#region src/parser/address-parser.d.ts
4
- /**
5
- * A validated RFC 5322 address. Returned by the strict parser, which
6
- * deliberately does not expose a display name.
7
- *
8
- * `address` is normalized to lowercase. Both the local-part and the
9
- * domain are lowercased: RFC 5321 §2.4 permits case-sensitive local-
10
- * parts, but every consumer mailbox in practice treats them as
11
- * case-insensitive, and a case-sensitive grant key would split
12
- * `Bob@x.com` from `bob@x.com` into separate rows and defeat the
13
- * primary-key index on lookup.
14
- */
15
4
  /**
16
5
  * A validated RFC 5322 address. Returned by the strict parser, which
17
6
  * deliberately does not expose a display name.
@@ -99,7 +88,8 @@ declare function parseFromHeader(header: string | null | undefined): ParseFromHe
99
88
  * include addressparser's recovery output (trailing tokens, garbage
100
89
  * before the address); treat as opaque text for display.
101
90
  */
102
- declare function parseFromHeaderLoose(header: string | null | undefined): ParsedAddress | null; //#endregion
91
+ declare function parseFromHeaderLoose(header: string | null | undefined): ParsedAddress | null;
92
+ //#endregion
103
93
  //#region src/parser/attachment-parser.d.ts
104
94
  interface ParsedAttachment {
105
95
  id: string;
@@ -162,7 +152,6 @@ declare function sha256Hex(buffer: Buffer): string;
162
152
  * Prevents path traversal, removes control characters, enforces length limits.
163
153
  */
164
154
  declare function sanitizeFilename(filename: string | null, partIndex: number): string;
165
-
166
155
  //#endregion
167
156
  //#region src/parser/attachment-bundler.d.ts
168
157
  /**
@@ -216,7 +205,6 @@ declare function extractAttachmentMetadata(attachments: ParsedAttachment[]): Att
216
205
  * @returns Storage key in format: attachments/{email_id}_{hash8}.tar.gz
217
206
  */
218
207
  declare function getAttachmentsStorageKey(emailId: string, sha256: string): string;
219
-
220
208
  //#endregion
221
209
  //#region src/parser/email-parser.d.ts
222
210
  interface ParsedEmail {
@@ -234,7 +222,6 @@ interface ParsedEmail {
234
222
  * Uses mailparser library for robust email parsing
235
223
  */
236
224
  declare function parseEmail(emlRaw: string): Promise<ParsedEmail>;
237
-
238
225
  //#endregion
239
226
  //#region src/parser/mapping.d.ts
240
227
  /**
@@ -283,10 +270,8 @@ declare function toCanonicalHeaders(parsed: ParsedEmailWithAttachments): {
283
270
  to: string;
284
271
  date: string | null;
285
272
  };
286
-
287
273
  //#endregion
288
274
  //#region src/parser/sanitize-html.d.ts
289
275
  declare function sanitizeHtml(html: string): string;
290
-
291
276
  //#endregion
292
- export { AttachmentMetadata, BundleResult, ParseFromHeaderFailureReason, ParseFromHeaderResult, ParsedAddress, ParsedAttachment, ParsedEmail, ParsedEmailWithAttachments, ValidatedAddress, attachmentMetadataToWebhookAttachments, bundleAttachments, extractAttachmentMetadata, getAttachmentsStorageKey, normalizeContentType, parseEmail, parseEmailWithAttachments, parseFromHeader, parseFromHeaderLoose, sanitizeFilename, sanitizeHtml, sha256Hex, toCanonicalHeaders, toParsedDataComplete, toWebhookAttachments };
277
+ export { type AttachmentMetadata, type BundleResult, type ParseFromHeaderFailureReason, type ParseFromHeaderResult, type ParsedAddress, type ParsedAttachment, type ParsedEmail, type ParsedEmailWithAttachments, type ValidatedAddress, attachmentMetadataToWebhookAttachments, bundleAttachments, extractAttachmentMetadata, getAttachmentsStorageKey, normalizeContentType, parseEmail, parseEmailWithAttachments, parseFromHeader, parseFromHeaderLoose, sanitizeFilename, sanitizeHtml, sha256Hex, toCanonicalHeaders, toParsedDataComplete, toWebhookAttachments };
@@ -1,10 +1,9 @@
1
- import { parseFromHeader, parseFromHeaderLoose } from "../address-parser-CfPHs3mE.js";
1
+ import { n as parseFromHeaderLoose, t as parseFromHeader } from "../address-parser-BYn8oW5r.js";
2
2
  import { createHash } from "node:crypto";
3
3
  import { createGzip } from "node:zlib";
4
4
  import { pack } from "tar-stream";
5
5
  import { simpleParser } from "mailparser";
6
6
  import DOMPurify from "isomorphic-dompurify";
7
-
8
7
  //#region src/parser/attachment-bundler.ts
9
8
  function appendTarEntry(archive, name, content) {
10
9
  return new Promise((resolve, reject) => {
@@ -81,10 +80,9 @@ async function bundleAttachments(attachments) {
81
80
  }
82
81
  })();
83
82
  });
84
- const sha256 = createHash("sha256").update(tarGzBuffer).digest("hex");
85
83
  return {
86
84
  tarGzBuffer,
87
- sha256,
85
+ sha256: createHash("sha256").update(tarGzBuffer).digest("hex"),
88
86
  attachmentCount: downloadable.length,
89
87
  totalAttachmentBytes
90
88
  };
@@ -114,10 +112,8 @@ function extractAttachmentMetadata(attachments) {
114
112
  * @returns Storage key in format: attachments/{email_id}_{hash8}.tar.gz
115
113
  */
116
114
  function getAttachmentsStorageKey(emailId, sha256) {
117
- const hash8 = sha256.substring(0, 8);
118
- return `attachments/${emailId}_${hash8}.tar.gz`;
115
+ return `attachments/${emailId}_${sha256.substring(0, 8)}.tar.gz`;
119
116
  }
120
-
121
117
  //#endregion
122
118
  //#region src/parser/sanitize-html.ts
123
119
  const ALLOWED_TAGS = [
@@ -203,8 +199,7 @@ DOMPurify.addHook("uponSanitizeAttribute", (_node, data) => {
203
199
  });
204
200
  DOMPurify.addHook("afterSanitizeAttributes", (node) => {
205
201
  if (node.tagName === "A") {
206
- const target = node.getAttribute("target");
207
- if (target === "_blank") node.setAttribute("rel", "noopener noreferrer");
202
+ if (node.getAttribute("target") === "_blank") node.setAttribute("rel", "noopener noreferrer");
208
203
  }
209
204
  });
210
205
  const SANITIZE_OPTIONS = {
@@ -234,7 +229,6 @@ const SANITIZE_OPTIONS = {
234
229
  function sanitizeHtml(html) {
235
230
  return DOMPurify.sanitize(html, SANITIZE_OPTIONS);
236
231
  }
237
-
238
232
  //#endregion
239
233
  //#region src/parser/attachment-parser.ts
240
234
  const SIGNATURE_ARTIFACTS = new Set([
@@ -345,8 +339,7 @@ function normalizeReferences(refs) {
345
339
  */
346
340
  function normalizeContentType(contentType) {
347
341
  if (!contentType?.trim()) return "application/octet-stream";
348
- const mediaType = contentType.split(";")[0].trim().toLowerCase();
349
- return mediaType || "application/octet-stream";
342
+ return contentType.split(";")[0].trim().toLowerCase() || "application/octet-stream";
350
343
  }
351
344
  /**
352
345
  * Parse disposition string to typed value.
@@ -375,8 +368,7 @@ function getHeaderString(value) {
375
368
  return String(value);
376
369
  }
377
370
  function getOriginalHeaderValue(parsed, key) {
378
- const headerLines = parsed.headerLines;
379
- const original = headerLines?.find((header) => header.key?.toLowerCase() === key.toLowerCase())?.line;
371
+ const original = parsed.headerLines?.find((header) => header.key?.toLowerCase() === key.toLowerCase())?.line;
380
372
  if (!original) return null;
381
373
  const separator = original.indexOf(":");
382
374
  return separator === -1 ? original : original.slice(separator + 1).trimStart();
@@ -406,7 +398,6 @@ function sanitizeFilename(filename, partIndex) {
406
398
  if (!safe) return `attachment_${partIndex}`;
407
399
  return safe;
408
400
  }
409
-
410
401
  //#endregion
411
402
  //#region src/parser/email-parser.ts
412
403
  /**
@@ -466,7 +457,6 @@ function structuredHeaderToString(value) {
466
457
  }
467
458
  return JSON.stringify(value);
468
459
  }
469
-
470
460
  //#endregion
471
461
  //#region src/parser/mapping.ts
472
462
  /**
@@ -556,6 +546,5 @@ function requireNonEmptyHeader(value, headerName) {
556
546
  if (typeof value !== "string" || value.trim() === "") throw new Error(`Parsed email is missing a usable ${headerName} header value`);
557
547
  return value;
558
548
  }
559
-
560
549
  //#endregion
561
- export { attachmentMetadataToWebhookAttachments, bundleAttachments, extractAttachmentMetadata, getAttachmentsStorageKey, normalizeContentType, parseEmail, parseEmailWithAttachments, parseFromHeader, parseFromHeaderLoose, sanitizeFilename, sanitizeHtml, sha256Hex, toCanonicalHeaders, toParsedDataComplete, toWebhookAttachments };
550
+ export { attachmentMetadataToWebhookAttachments, bundleAttachments, extractAttachmentMetadata, getAttachmentsStorageKey, normalizeContentType, parseEmail, parseEmailWithAttachments, parseFromHeader, parseFromHeaderLoose, sanitizeFilename, sanitizeHtml, sha256Hex, toCanonicalHeaders, toParsedDataComplete, toWebhookAttachments };
@@ -1,5 +1,4 @@
1
- import { parseFromHeaderLoose } from "./address-parser-CfPHs3mE.js";
2
-
1
+ import { n as parseFromHeaderLoose } from "./address-parser-BYn8oW5r.js";
3
2
  //#region src/webhook/received-email.ts
4
3
  const REPLY_PREFIX_RE = /^re\s*:/i;
5
4
  const FORWARD_PREFIX_RE = /^(fwd?|fw)\s*:/i;
@@ -66,6 +65,5 @@ function parseHeaderAddress(value) {
66
65
  name: parsed.name?.trim() || null
67
66
  };
68
67
  }
69
-
70
68
  //#endregion
71
- export { buildForwardSubject, buildReplySubject, formatAddress, normalizeReceivedEmail, parseHeaderAddress };
69
+ export { parseHeaderAddress as a, normalizeReceivedEmail as i, buildReplySubject as n, formatAddress as r, buildForwardSubject as t };
@@ -1,4 +1,4 @@
1
- import { EmailAnalysis, EmailAuth, EmailReceivedEvent, WebhookAttachment } from "./types-CIOzt1FY.js";
1
+ import { M as WebhookAttachment, c as EmailAnalysis, l as EmailAuth, u as EmailReceivedEvent } from "./types-9vXGZjPd.js";
2
2
 
3
3
  //#region src/webhook/received-email.d.ts
4
4
  interface ReceivedEmailAddress {
@@ -32,5 +32,6 @@ declare function normalizeReceivedEmail(event: EmailReceivedEvent): ReceivedEmai
32
32
  declare function buildReplySubject(subject: string | null | undefined): string;
33
33
  declare function buildForwardSubject(subject: string | null | undefined): string;
34
34
  declare function formatAddress(address: ReceivedEmailAddress): string;
35
- declare function parseHeaderAddress(value: string | null | undefined): ReceivedEmailAddress | null; //#endregion
36
- export { ReceivedEmail, ReceivedEmailAddress, ReceivedEmailThread, buildForwardSubject as buildForwardSubject$1, buildReplySubject as buildReplySubject$1, formatAddress as formatAddress$1, normalizeReceivedEmail as normalizeReceivedEmail$1, parseHeaderAddress as parseHeaderAddress$1 };
35
+ declare function parseHeaderAddress(value: string | null | undefined): ReceivedEmailAddress | null;
36
+ //#endregion
37
+ export { buildReplySubject as a, parseHeaderAddress as c, buildForwardSubject as i, ReceivedEmailAddress as n, formatAddress as o, ReceivedEmailThread as r, normalizeReceivedEmail as s, ReceivedEmail as t };
@@ -17,13 +17,6 @@
17
17
  * via the `definition` "ForwardResult".
18
18
  */
19
19
  type ForwardResult$1 = (ForwardResultInline$1 | ForwardResultAttachmentAnalyzed$1 | ForwardResultAttachmentSkipped$1);
20
- /**
21
- * Valid webhook version format (YYYY-MM-DD date string). The SDK accepts any valid date-formatted version, not just the current one, for forward and backward compatibility.
22
- *
23
- * This interface was referenced by `EmailReceivedEvent`'s JSON-Schema
24
- * via the `definition` "WebhookVersion".
25
- */
26
-
27
20
  /**
28
21
  * Webhook payload for the `email.received` event.
29
22
  *
@@ -693,17 +686,9 @@ interface DkimSignature$1 {
693
686
  * Optional in self-hosted environments.
694
687
  */
695
688
  algo: (string | null);
696
- } //#endregion
689
+ }
690
+ //#endregion
697
691
  //#region src/types.d.ts
698
-
699
- /**
700
- * Webhook payload for the `email.received` event.
701
- *
702
- * This is delivered to your webhook endpoint when Primitive receives an email matching your domain configuration.
703
- *
704
- * This interface was referenced by `EmailReceivedEvent`'s JSON-Schema
705
- * via the `definition` "EmailReceivedEvent".
706
- */
707
692
  type EmailReceivedEvent = EmailReceivedEvent$1;
708
693
  type EventType = EmailReceivedEvent["event"];
709
694
  declare const EventType: {
@@ -814,6 +799,5 @@ interface UnknownEvent {
814
799
  }
815
800
  type KnownWebhookEvent = EmailReceivedEvent;
816
801
  type WebhookEvent = KnownWebhookEvent | UnknownEvent;
817
-
818
802
  //#endregion
819
- export { AuthConfidence as AuthConfidence$1, AuthVerdict as AuthVerdict$1, DkimResult as DkimResult$1, DkimSignature, DmarcPolicy as DmarcPolicy$1, DmarcResult as DmarcResult$1, EmailAddress, EmailAnalysis, EmailAuth, EmailReceivedEvent, EventType as EventType$1, ForwardAnalysis, ForwardOriginalSender, ForwardResult, ForwardResultAttachmentAnalyzed, ForwardResultAttachmentSkipped, ForwardResultInline, ForwardVerdict as ForwardVerdict$1, ForwardVerification, KnownWebhookEvent, ParsedData, ParsedDataComplete, ParsedDataFailed, ParsedError, ParsedStatus as ParsedStatus$1, RawContent, RawContentDownloadOnly, RawContentInline, SpfResult as SpfResult$1, UnknownEvent, ValidateEmailAuthResult, WebhookAttachment, WebhookEvent };
803
+ export { UnknownEvent as A, ParsedDataFailed as C, RawContentDownloadOnly as D, RawContent as E, WebhookAttachment as M, WebhookEvent as N, RawContentInline as O, ParsedDataComplete as S, ParsedStatus as T, ForwardResultInline as _, DmarcPolicy as a, KnownWebhookEvent as b, EmailAnalysis as c, EventType as d, ForwardAnalysis as f, ForwardResultAttachmentSkipped as g, ForwardResultAttachmentAnalyzed as h, DkimSignature as i, ValidateEmailAuthResult as j, SpfResult as k, EmailAuth as l, ForwardResult as m, AuthVerdict as n, DmarcResult as o, ForwardOriginalSender as p, DkimResult as r, EmailAddress as s, AuthConfidence as t, EmailReceivedEvent as u, ForwardVerdict as v, ParsedError as w, ParsedData as x, ForwardVerification as y };