@openemail/sdk 0.0.1 → 0.0.2

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 (6) hide show
  1. package/README.md +4 -4
  2. package/index.cjs +1223 -206
  3. package/index.d.cts +2009 -131
  4. package/index.d.ts +2009 -131
  5. package/index.js +1210 -207
  6. package/package.json +3 -3
package/index.d.cts CHANGED
@@ -19,6 +19,371 @@ type AddressBookResource = {
19
19
  domains: Array<SendableDomainResource>;
20
20
  };
21
21
 
22
+ type AddressBookPage = AddressBookResource & {
23
+ hasMore: boolean;
24
+ nextCursor: string | null;
25
+ };
26
+
27
+ type AudienceBatchAddResource = {
28
+ object: 'audience_batch';
29
+ audienceId: string;
30
+ added: number;
31
+ unchanged: number;
32
+ missing: Array<string>;
33
+ };
34
+
35
+ type AudienceBatchRemoveResource = {
36
+ object: 'audience_batch';
37
+ audienceId: string;
38
+ removed: number;
39
+ notInAudience: Array<string>;
40
+ missing: Array<string>;
41
+ };
42
+
43
+ declare const AUDIENCE_BUILTINS: {
44
+ readonly DEFAULT: "default";
45
+ };
46
+ declare const AUDIENCE_MEMBER_SORTS: {
47
+ readonly LAST_HEARD_NEWEST: "last-heard-newest";
48
+ readonly LAST_HEARD_OLDEST: "last-heard-oldest";
49
+ readonly ADDED_NEWEST: "added-newest";
50
+ readonly ADDED_OLDEST: "added-oldest";
51
+ readonly NAME: "name";
52
+ };
53
+
54
+ type AudienceBuiltin = (typeof AUDIENCE_BUILTINS)[keyof typeof AUDIENCE_BUILTINS];
55
+
56
+ type AudienceContactAdd = {
57
+ email: string;
58
+ };
59
+
60
+ type AudienceMemberSort = (typeof AUDIENCE_MEMBER_SORTS)[keyof typeof AUDIENCE_MEMBER_SORTS];
61
+
62
+ declare const CONTACT_SOURCES: {
63
+ readonly MANUAL: "manual";
64
+ readonly AUTO: "auto";
65
+ };
66
+ declare const PEOPLE_SORTS: {
67
+ readonly RECENT: "recent";
68
+ readonly NAME: "name";
69
+ readonly THREADS: "threads";
70
+ };
71
+ declare const CONTACT_THREAD_SORTS: {
72
+ readonly NEWEST: "newest";
73
+ readonly OLDEST: "oldest";
74
+ readonly SENDER: "sender";
75
+ readonly SUBJECT: "subject";
76
+ };
77
+ declare const CONTACT_BLOCK_LISTS: {
78
+ readonly BLOCKED_SENDERS: "blockedSenders";
79
+ readonly BLOCKED_DOMAINS: "blockedDomains";
80
+ };
81
+ declare const CONTACT_PHOTO_TYPES: {
82
+ readonly PNG: "image/png";
83
+ readonly JPEG: "image/jpeg";
84
+ readonly WEBP: "image/webp";
85
+ readonly GIF: "image/gif";
86
+ };
87
+
88
+ type ContactSource = (typeof CONTACT_SOURCES)[keyof typeof CONTACT_SOURCES];
89
+
90
+ type RequestScope = {
91
+ signal?: AbortSignal;
92
+ apiKey?: string;
93
+ };
94
+
95
+ type ListOptions = RequestScope & {
96
+ limit?: number;
97
+ cursor?: string;
98
+ };
99
+
100
+ type AudienceContactListOptions = ListOptions & {
101
+ q?: string;
102
+ source?: ContactSource;
103
+ sort?: AudienceMemberSort;
104
+ };
105
+
106
+ type ContactResource = {
107
+ object: 'contact';
108
+ email: string;
109
+ name: string | null;
110
+ source: ContactSource | (string & {});
111
+ notes: string | null;
112
+ photoUrl: string | null;
113
+ lastSeenAt: string | null;
114
+ createdAt: string;
115
+ updatedAt: string;
116
+ };
117
+
118
+ type AudienceContactResource = ContactResource & {
119
+ addedAt: string;
120
+ unsubscribedAt: string | null;
121
+ };
122
+
123
+ type AudienceContactsBatch = {
124
+ emails: Array<string>;
125
+ };
126
+
127
+ type AudienceCreate = {
128
+ name: string;
129
+ description?: string | null;
130
+ };
131
+
132
+ type AudienceGrowthBucket = {
133
+ bucket: string;
134
+ added: number;
135
+ };
136
+
137
+ declare const HIT_KINDS: {
138
+ readonly HUMAN: "human";
139
+ readonly PROXY: "proxy";
140
+ readonly MACHINE: "machine";
141
+ };
142
+ declare const TRACKING_GRAINS: {
143
+ readonly MINUTE: "minute";
144
+ readonly HOUR: "hour";
145
+ readonly DAY: "day";
146
+ };
147
+
148
+ type TrackingGrain = (typeof TRACKING_GRAINS)[keyof typeof TRACKING_GRAINS];
149
+
150
+ type AudienceGrowthOptions = RequestScope & {
151
+ audienceIds?: Array<string>;
152
+ days?: number;
153
+ minutes?: number;
154
+ grain?: TrackingGrain;
155
+ offsetMinutes?: number;
156
+ };
157
+
158
+ type AudienceGrowthSeries = {
159
+ id: string;
160
+ name: string;
161
+ builtin: boolean;
162
+ total: number;
163
+ before: number;
164
+ added: number;
165
+ buckets: Array<AudienceGrowthBucket>;
166
+ };
167
+
168
+ type AudienceGrowthTotals = {
169
+ contacts: number;
170
+ memberships: number;
171
+ added: number;
172
+ lists: number;
173
+ busiest: string | null;
174
+ };
175
+
176
+ type AudienceGrowthResource = {
177
+ object: 'audience_growth';
178
+ since: string;
179
+ until: string;
180
+ grain: TrackingGrain;
181
+ offsetMinutes: number;
182
+ totals: AudienceGrowthTotals;
183
+ series: Array<AudienceGrowthSeries>;
184
+ };
185
+
186
+ type AudienceImportRow = {
187
+ email: string;
188
+ name?: string | null;
189
+ };
190
+
191
+ type AudienceImport = {
192
+ contacts: Array<AudienceImportRow>;
193
+ };
194
+
195
+ type AudienceImportResource = {
196
+ object: 'audience_import';
197
+ audienceId: string;
198
+ created: number;
199
+ added: number;
200
+ skipped: number;
201
+ invalid: Array<string>;
202
+ };
203
+
204
+ type AudienceListOptions = ListOptions;
205
+
206
+ type AudienceMemberResource = {
207
+ object: 'audience_member';
208
+ audienceId: string;
209
+ addedAt: string;
210
+ contact: ContactResource;
211
+ };
212
+
213
+ type AudiencePatch = {
214
+ name?: string;
215
+ description?: string | null;
216
+ };
217
+
218
+ type AudienceResource = {
219
+ object: 'audience';
220
+ id: string;
221
+ name: string;
222
+ description: string | null;
223
+ builtin: AudienceBuiltin | (string & {}) | null;
224
+ contactCount: number;
225
+ lastContactAt: string | null;
226
+ createdAt: string;
227
+ updatedAt: string;
228
+ };
229
+
230
+ type DeletedAudienceResource = {
231
+ object: 'audience';
232
+ id: string;
233
+ deleted: true;
234
+ };
235
+
236
+ type EmptiedAudienceResource = AudienceResource & {
237
+ removed: number;
238
+ };
239
+
240
+ type RemovedAudienceContactResource = {
241
+ object: 'audience_member';
242
+ audienceId: string;
243
+ email: string;
244
+ deleted: true;
245
+ };
246
+
247
+ type BroadcastCounts = {
248
+ recipients: number;
249
+ created: number;
250
+ skipped: number;
251
+ failedToQueue: number;
252
+ queued: number;
253
+ sending: number;
254
+ sent: number;
255
+ failed: number;
256
+ cancelled: number;
257
+ };
258
+
259
+ type RecipientInput = string | {
260
+ email: string;
261
+ name?: string;
262
+ };
263
+
264
+ type TrackingRequest = {
265
+ opens?: boolean;
266
+ clicks?: boolean;
267
+ };
268
+
269
+ type BroadcastCreate = {
270
+ audienceIds: Array<string>;
271
+ from: RecipientInput;
272
+ replyTo?: RecipientInput;
273
+ subject?: string;
274
+ html?: string;
275
+ text?: string;
276
+ template?: {
277
+ id: string;
278
+ version?: number;
279
+ props?: Record<string, unknown>;
280
+ slots?: Record<string, unknown>;
281
+ };
282
+ tracking?: TrackingRequest;
283
+ tags?: Record<string, string>;
284
+ scheduledAt?: Date | string;
285
+ };
286
+
287
+ type BroadcastListOptions = ListOptions & {
288
+ audienceId?: string;
289
+ };
290
+
291
+ type BroadcastPreviewInput = {
292
+ audienceIds: Array<string>;
293
+ };
294
+
295
+ type BroadcastPreviewResource = {
296
+ object: 'broadcast_preview';
297
+ audienceIds: Array<string>;
298
+ recipients: number;
299
+ unsubscribed: number;
300
+ suppressed: number;
301
+ };
302
+
303
+ declare const API_KEY_MODES: {
304
+ readonly LIVE: "live";
305
+ readonly TEST: "test";
306
+ };
307
+
308
+ type ApiKeyMode = (typeof API_KEY_MODES)[keyof typeof API_KEY_MODES];
309
+
310
+ declare const BROADCAST_STATUSES: {
311
+ readonly SCHEDULED: "scheduled";
312
+ readonly QUEUED: "queued";
313
+ readonly SENDING: "sending";
314
+ readonly SENT: "sent";
315
+ readonly CANCELLED: "cancelled";
316
+ readonly FAILED: "failed";
317
+ };
318
+
319
+ type BroadcastStatus = (typeof BROADCAST_STATUSES)[keyof typeof BROADCAST_STATUSES];
320
+
321
+ declare const EMAIL_SOURCES: {
322
+ readonly COMPOSER: "composer";
323
+ readonly API: "api";
324
+ readonly MCP: "mcp";
325
+ readonly AI: "ai";
326
+ };
327
+ declare const EMAIL_STATUSES: {
328
+ readonly QUEUED: "queued";
329
+ readonly SCHEDULED: "scheduled";
330
+ readonly SENDING: "sending";
331
+ readonly SENT: "sent";
332
+ readonly PARTIAL: "partial";
333
+ readonly CANCELLED: "cancelled";
334
+ readonly FAILED: "failed";
335
+ };
336
+ declare const EMAIL_TRANSPORTS: {
337
+ readonly SES: "ses";
338
+ readonly RESEND: "resend";
339
+ readonly DEV: "dev";
340
+ readonly TEST: "test";
341
+ };
342
+ declare const RECIPIENT_STATUSES: {
343
+ readonly PENDING: "pending";
344
+ readonly SUPPRESSED: "suppressed";
345
+ readonly DELIVERED: "delivered";
346
+ readonly FAILED: "failed";
347
+ readonly BOUNCED: "bounced";
348
+ readonly COMPLAINED: "complained";
349
+ readonly UNCERTAIN: "uncertain";
350
+ };
351
+ declare const RECIPIENT_KINDS: {
352
+ readonly TO: "to";
353
+ readonly CC: "cc";
354
+ readonly BCC: "bcc";
355
+ };
356
+ declare const ATTACHMENT_DELIVERY_MODES: {
357
+ readonly MIME: "mime";
358
+ readonly LINK: "link";
359
+ readonly AUTO: "auto";
360
+ };
361
+
362
+ type EmailSource = (typeof EMAIL_SOURCES)[keyof typeof EMAIL_SOURCES];
363
+
364
+ type BroadcastResource = {
365
+ object: 'broadcast';
366
+ id: string;
367
+ status: BroadcastStatus;
368
+ mode: ApiKeyMode;
369
+ source: EmailSource | (string & {});
370
+ audienceIds: Array<string>;
371
+ from: string;
372
+ subject: string;
373
+ counts: BroadcastCounts;
374
+ lastError: string | null;
375
+ scheduledAt: string | null;
376
+ startedAt: string | null;
377
+ completedAt: string | null;
378
+ cancelledAt: string | null;
379
+ createdAt: string;
380
+ updatedAt: string;
381
+ };
382
+
383
+ type SentBroadcastResource = BroadcastResource & {
384
+ replayed: boolean;
385
+ };
386
+
22
387
  type CalendarAttendeeResource = {
23
388
  object: 'calendar_attendee';
24
389
  email: string;
@@ -83,28 +448,65 @@ type CalendarOccurrenceResource = {
83
448
  attendeeCount: number;
84
449
  };
85
450
 
86
- type RequestScope = {
87
- signal?: AbortSignal;
88
- apiKey?: string;
89
- };
90
-
91
- type CalendarRangeOptions = RequestScope & {
451
+ type CalendarRangeOptions = ListOptions & {
92
452
  from: Date | string;
93
453
  to: Date | string;
94
454
  timezone?: string;
95
455
  };
96
456
 
97
- type ApiKeyMode = 'live' | 'test';
98
-
99
- declare const API_SCOPES: readonly ["emails:send", "emails:read", "drafts:read", "drafts:write", "threads:read", "threads:write", "labels:read", "labels:write", "contacts:read", "calendar:read", "calendar:write", "templates:read", "templates:write", "domains:read", "domains:write", "webhooks:read", "webhooks:write", "rules:read", "rules:write", "connections:read", "members:read", "members:write", "roles:read", "roles:write", "settings:read", "settings:write"];
100
-
101
- type ApiScope = (typeof API_SCOPES)[number];
102
-
103
- type AttachmentInput = {
457
+ declare const API_SCOPES: {
458
+ readonly EMAILS_SEND: "emails:send";
459
+ readonly EMAILS_READ: "emails:read";
460
+ readonly DRAFTS_READ: "drafts:read";
461
+ readonly DRAFTS_WRITE: "drafts:write";
462
+ readonly THREADS_READ: "threads:read";
463
+ readonly THREADS_WRITE: "threads:write";
464
+ readonly LABELS_READ: "labels:read";
465
+ readonly LABELS_WRITE: "labels:write";
466
+ readonly CONTACTS_READ: "contacts:read";
467
+ readonly CONTACTS_WRITE: "contacts:write";
468
+ readonly AUDIENCES_READ: "audiences:read";
469
+ readonly AUDIENCES_WRITE: "audiences:write";
470
+ readonly CALENDAR_READ: "calendar:read";
471
+ readonly CALENDAR_WRITE: "calendar:write";
472
+ readonly TEMPLATES_READ: "templates:read";
473
+ readonly TEMPLATES_WRITE: "templates:write";
474
+ readonly DOMAINS_READ: "domains:read";
475
+ readonly DOMAINS_WRITE: "domains:write";
476
+ readonly WEBHOOKS_READ: "webhooks:read";
477
+ readonly WEBHOOKS_WRITE: "webhooks:write";
478
+ readonly RULES_READ: "rules:read";
479
+ readonly RULES_WRITE: "rules:write";
480
+ readonly CONNECTIONS_READ: "connections:read";
481
+ readonly MEMBERS_READ: "members:read";
482
+ readonly MEMBERS_WRITE: "members:write";
483
+ readonly ROLES_READ: "roles:read";
484
+ readonly ROLES_WRITE: "roles:write";
485
+ readonly SETTINGS_READ: "settings:read";
486
+ readonly SETTINGS_WRITE: "settings:write";
487
+ readonly KEYS_WRITE: "keys:write";
488
+ readonly KEYS_READ: "keys:read";
489
+ readonly KEYS_MANAGE: "keys:manage";
490
+ };
491
+ declare const CONSOLE_PERMISSIONS: {
492
+ readonly API_KEYS_READ: "api-keys:read";
493
+ readonly API_KEYS_WRITE: "api-keys:write";
494
+ readonly BILLING_READ: "billing:read";
495
+ readonly BILLING_WRITE: "billing:write";
496
+ readonly WORKSPACE_MANAGE: "workspace:manage";
497
+ };
498
+
499
+ type ApiScope = (typeof API_SCOPES)[keyof typeof API_SCOPES];
500
+
501
+ type InlineAttachmentInput = {
104
502
  filename: string;
105
503
  content: string | Uint8Array | ArrayBuffer;
106
504
  contentType?: string;
107
505
  };
506
+ type StoredAttachmentInput = {
507
+ fileId: string;
508
+ };
509
+ type AttachmentInput = InlineAttachmentInput | StoredAttachmentInput;
108
510
 
109
511
  type AttachmentResource = {
110
512
  object: 'attachment';
@@ -115,13 +517,73 @@ type AttachmentResource = {
115
517
  content: string | null;
116
518
  };
117
519
 
118
- type BuiltinRole = 'owner' | 'admin' | 'member' | 'viewer' | 'developer' | 'billing';
520
+ declare const API_KEY_STATUSES: {
521
+ readonly ACTIVE: "active";
522
+ readonly INACTIVE: "inactive";
523
+ readonly EXPIRED: "expired";
524
+ readonly REVOKED: "revoked";
525
+ };
526
+ declare const API_KEY_EVENT_TYPES: {
527
+ readonly CREATED: "created";
528
+ readonly UPDATED: "updated";
529
+ readonly ROTATED: "rotated";
530
+ readonly REVOKED: "revoked";
531
+ readonly DEACTIVATED: "deactivated";
532
+ readonly REACTIVATED: "reactivated";
533
+ readonly AUTH_FAILED: "auth_failed";
534
+ readonly DELETED: "deleted";
535
+ };
536
+ declare const AUDIT_ACTOR_KINDS: {
537
+ readonly USER: "user";
538
+ readonly API_KEY: "apiKey";
539
+ };
540
+
541
+ type AuditActorKind = (typeof AUDIT_ACTOR_KINDS)[keyof typeof AUDIT_ACTOR_KINDS];
542
+
543
+ type AuditActorResource = {
544
+ kind: AuditActorKind;
545
+ id: string;
546
+ name: string;
547
+ username: string | null;
548
+ label: string;
549
+ };
550
+
551
+ declare const BUILTIN_ROLES: {
552
+ readonly OWNER: "owner";
553
+ readonly ADMIN: "admin";
554
+ readonly MEMBER: "member";
555
+ readonly VIEWER: "viewer";
556
+ readonly DEVELOPER: "developer";
557
+ readonly BILLING: "billing";
558
+ };
119
559
 
120
- type HitKind = 'human' | 'proxy' | 'machine';
560
+ type BuiltinRole = (typeof BUILTIN_ROLES)[keyof typeof BUILTIN_ROLES];
561
+
562
+ type ConsolePermission = (typeof CONSOLE_PERMISSIONS)[keyof typeof CONSOLE_PERMISSIONS];
563
+
564
+ type HitKind = (typeof HIT_KINDS)[keyof typeof HIT_KINDS];
565
+
566
+ type LogWindow = {
567
+ since?: Date | string;
568
+ until?: Date | string;
569
+ };
570
+
571
+ declare const MESSAGE_ENCRYPTION_FORMATS: {
572
+ readonly PGP_MIME: "pgp-mime";
573
+ readonly PGP_SIGNED: "pgp-signed";
574
+ readonly PGP_INLINE: "pgp-inline";
575
+ readonly SMIME_ENCRYPTED: "smime-encrypted";
576
+ readonly SMIME_SIGNED: "smime-signed";
577
+ };
578
+ declare const MESSAGE_ENCRYPTION_PART_ROLES: {
579
+ readonly VERSION: "version";
580
+ readonly CIPHERTEXT: "ciphertext";
581
+ readonly SIGNATURE: "signature";
582
+ };
121
583
 
122
- declare const MESSAGE_ENCRYPTION_FORMATS: readonly ["pgp-mime", "pgp-signed", "pgp-inline", "smime-encrypted", "smime-signed"];
584
+ type MessageEncryptionFormat = (typeof MESSAGE_ENCRYPTION_FORMATS)[keyof typeof MESSAGE_ENCRYPTION_FORMATS];
123
585
 
124
- type MessageEncryptionFormat = (typeof MESSAGE_ENCRYPTION_FORMATS)[number];
586
+ type MessageEncryptionPartRole = (typeof MESSAGE_ENCRYPTION_PART_ROLES)[keyof typeof MESSAGE_ENCRYPTION_PART_ROLES];
125
587
 
126
588
  type MessageEncryption = {
127
589
  format: MessageEncryptionFormat;
@@ -130,7 +592,7 @@ type MessageEncryption = {
130
592
  parts?: Array<{
131
593
  index: number;
132
594
  attachmentId: string;
133
- role: 'version' | 'ciphertext' | 'signature';
595
+ role: MessageEncryptionPartRole;
134
596
  }>;
135
597
  };
136
598
 
@@ -138,12 +600,7 @@ type MessageResource = Record<string, unknown> & {
138
600
  encryption?: MessageEncryption;
139
601
  };
140
602
 
141
- type Permission = ApiScope | 'api-keys:read' | 'api-keys:write' | 'billing:read' | 'billing:write' | 'workspace:manage' | (string & {});
142
-
143
- type RecipientInput = string | {
144
- email: string;
145
- name?: string;
146
- };
603
+ type Permission = ApiScope | ConsolePermission | (string & {});
147
604
 
148
605
  type TranslateOptions = {
149
606
  to: string;
@@ -155,22 +612,172 @@ type SendTranslateOptions = TranslateOptions & {
155
612
  subject?: boolean;
156
613
  };
157
614
 
158
- type TrackingRequest = {
159
- opens?: boolean;
160
- clicks?: boolean;
615
+ type ContactActivityBucket = {
616
+ bucket: string;
617
+ received: number;
618
+ sent: number;
161
619
  };
162
620
 
163
- type ContactListOptions = RequestScope & {
164
- limit?: number;
621
+ type ContactActivityOptions = RequestScope & {
622
+ minutes?: number;
623
+ grain?: TrackingGrain;
624
+ offsetMinutes?: number;
165
625
  };
166
626
 
167
- type ContactResource = {
627
+ type ContactActivityTotals = {
628
+ received: number;
629
+ sent: number;
630
+ threads: number;
631
+ waiting: number;
632
+ lastReceivedAt: string | null;
633
+ lastSentAt: string | null;
634
+ };
635
+
636
+ type ContactReplyTime = {
637
+ yours: number | null;
638
+ theirs: number | null;
639
+ };
640
+
641
+ type ContactActivityResource = {
642
+ object: 'contact_activity';
643
+ email: string;
644
+ since: string;
645
+ until: string;
646
+ grain: TrackingGrain | (string & {});
647
+ buckets: Array<ContactActivityBucket>;
648
+ totals: ContactActivityTotals;
649
+ replyTime: ContactReplyTime;
650
+ };
651
+
652
+ type ContactAudienceResource = {
653
+ id: string;
654
+ name: string;
655
+ builtin: AudienceBuiltin | null;
656
+ };
657
+
658
+ type ContactAudiencesSet = {
659
+ audienceIds: Array<string>;
660
+ };
661
+
662
+ type ContactBatchDeleteResource = {
663
+ object: 'contact_batch_delete';
664
+ deleted: number;
665
+ saved: number;
666
+ invalid: Array<string>;
667
+ };
668
+
669
+ type ContactBlockList = (typeof CONTACT_BLOCK_LISTS)[keyof typeof CONTACT_BLOCK_LISTS];
670
+
671
+ type ContactBlockRule = {
672
+ rule: string;
673
+ list: ContactBlockList | (string & {});
674
+ };
675
+
676
+ type ContactBlockResource = {
677
+ object: 'contact_block';
678
+ email: string;
679
+ blocked: boolean;
680
+ blockedBy?: ContactBlockRule;
681
+ created?: boolean;
682
+ removed?: Array<ContactBlockRule>;
683
+ };
684
+
685
+ type ContactCreate = {
686
+ email: string;
687
+ name?: string | null;
688
+ notes?: string | null;
689
+ audienceIds?: Array<string>;
690
+ };
691
+
692
+ type ContactDetailResource = ContactResource & {
693
+ audiences: Array<ContactAudienceResource>;
694
+ };
695
+
696
+ type ContactListOptions = ListOptions & {
697
+ source?: ContactSource;
698
+ q?: string;
699
+ };
700
+
701
+ type ContactPatch = {
702
+ name?: string | null;
703
+ notes?: string | null;
704
+ };
705
+
706
+ type ContactPhotoType = (typeof CONTACT_PHOTO_TYPES)[keyof typeof CONTACT_PHOTO_TYPES];
707
+
708
+ type ContactPhotoOptions = RequestScope & {
709
+ contentType?: ContactPhotoType;
710
+ };
711
+
712
+ type ContactSave = {
713
+ name?: string;
714
+ notes?: string | null;
715
+ };
716
+
717
+ type ContactThreadSort = (typeof CONTACT_THREAD_SORTS)[keyof typeof CONTACT_THREAD_SORTS];
718
+
719
+ type ContactThreadListOptions = ListOptions & {
720
+ q?: string;
721
+ sort?: ContactThreadSort;
722
+ };
723
+
724
+ type ContactThreadResource = {
725
+ object: 'thread';
726
+ id: string;
727
+ subject: string | null;
728
+ from: {
729
+ name: string | null;
730
+ email: string;
731
+ } | null;
732
+ receivedAt: string | null;
733
+ messageCount: number;
734
+ hasUnread: boolean;
735
+ labels: Array<{
736
+ id: string;
737
+ name: string;
738
+ }>;
739
+ };
740
+
741
+ type DeletedContactResource = {
168
742
  object: 'contact';
169
743
  email: string;
744
+ deleted: true;
745
+ wasSaved: boolean;
746
+ };
747
+
748
+ type Page<T> = {
749
+ items: Array<T>;
750
+ hasMore: boolean;
751
+ nextCursor: string | null;
752
+ };
753
+
754
+ type PersonResource = {
755
+ object: 'person';
756
+ email: string;
757
+ displayEmail: string;
170
758
  name: string | null;
171
- source: 'manual' | 'auto' | (string & {});
759
+ saved: boolean;
760
+ source: ContactSource | (string & {}) | null;
172
761
  notes: string | null;
173
- lastSeenAt: string | null;
762
+ photoUrl: string | null;
763
+ threads: number | null;
764
+ lastAt: string | null;
765
+ createdAt: string | null;
766
+ updatedAt: string | null;
767
+ blockedBy: ContactBlockRule | null;
768
+ };
769
+
770
+ type PeoplePage = Page<PersonResource> & {
771
+ seen: boolean;
772
+ };
773
+
774
+ type PeopleSort = (typeof PEOPLE_SORTS)[keyof typeof PEOPLE_SORTS];
775
+
776
+ type PersonListOptions = ListOptions & {
777
+ q?: string;
778
+ email?: string;
779
+ sort?: PeopleSort;
780
+ blocked?: boolean;
174
781
  };
175
782
 
176
783
  type ApiErrorPayload = {
@@ -182,9 +789,18 @@ type ApiErrorPayload = {
182
789
  requestId?: string;
183
790
  };
184
791
 
185
- declare const ERROR_TYPES: readonly ["invalid_request_error", "authentication_error", "permission_error", "not_found_error", "conflict_error", "validation_error", "rate_limit_error", "api_error"];
792
+ declare const ERROR_TYPES: {
793
+ readonly INVALID_REQUEST_ERROR: "invalid_request_error";
794
+ readonly AUTHENTICATION_ERROR: "authentication_error";
795
+ readonly PERMISSION_ERROR: "permission_error";
796
+ readonly NOT_FOUND_ERROR: "not_found_error";
797
+ readonly CONFLICT_ERROR: "conflict_error";
798
+ readonly VALIDATION_ERROR: "validation_error";
799
+ readonly RATE_LIMIT_ERROR: "rate_limit_error";
800
+ readonly API_ERROR: "api_error";
801
+ };
186
802
 
187
- type ErrorType = (typeof ERROR_TYPES)[number];
803
+ type ErrorType = (typeof ERROR_TYPES)[keyof typeof ERROR_TYPES];
188
804
 
189
805
  type ApiErrorProps = {
190
806
  message: string;
@@ -215,23 +831,79 @@ type ClientOptions = TransportOptions & {
215
831
  };
216
832
 
217
833
  declare const Addresses: (transport: Transport) => {
218
- list: (options?: RequestScope) => Promise<AddressBookResource>;
834
+ list: (options?: ListOptions) => Promise<AddressBookPage>;
835
+ listAll: (options?: ListOptions) => Promise<AddressBookResource>;
836
+ iterate: (options?: ListOptions) => AsyncGenerator<AddressResource, void, undefined>;
837
+ };
838
+
839
+ declare const Audiences: (transport: Transport) => {
840
+ list: (options?: AudienceListOptions) => Promise<Page<AudienceResource>>;
841
+ listAll: (options?: AudienceListOptions) => Promise<Array<AudienceResource>>;
842
+ iterate: (options?: AudienceListOptions) => AsyncGenerator<AudienceResource, void, undefined>;
843
+ growth: (options?: AudienceGrowthOptions) => Promise<AudienceGrowthResource>;
844
+ get: (id: string, options?: RequestScope) => Promise<AudienceResource>;
845
+ create: (body: AudienceCreate, options?: RequestScope) => Promise<AudienceResource>;
846
+ update: (id: string, patch: AudiencePatch, options?: RequestScope) => Promise<AudienceResource>;
847
+ delete: (id: string, options?: RequestScope) => Promise<DeletedAudienceResource>;
848
+ empty: (id: string, options?: RequestScope) => Promise<EmptiedAudienceResource>;
849
+ listContacts: (id: string, options?: AudienceContactListOptions) => Promise<Page<AudienceContactResource>>;
850
+ listAllContacts: (id: string, options?: AudienceContactListOptions) => Promise<Array<AudienceContactResource>>;
851
+ iterateContacts: (id: string, options?: AudienceContactListOptions) => AsyncGenerator<AudienceContactResource, void, undefined>;
852
+ addContact: (id: string, body: AudienceContactAdd, options?: RequestScope) => Promise<AudienceMemberResource>;
853
+ removeContact: (id: string, email: string, options?: RequestScope) => Promise<RemovedAudienceContactResource>;
854
+ addContacts: (id: string, body: AudienceContactsBatch, options?: RequestScope) => Promise<AudienceBatchAddResource>;
855
+ removeContacts: (id: string, body: AudienceContactsBatch, options?: RequestScope) => Promise<AudienceBatchRemoveResource>;
856
+ importContacts: (id: string, body: AudienceImport, options?: RequestScope) => Promise<AudienceImportResource>;
857
+ };
858
+
859
+ declare const Broadcasts: (transport: Transport) => {
860
+ preview: (body: BroadcastPreviewInput, options?: RequestScope) => Promise<BroadcastPreviewResource>;
861
+ send: (body: BroadcastCreate, options?: SendScope) => Promise<SentBroadcastResource>;
862
+ list: (options?: BroadcastListOptions) => Promise<Page<BroadcastResource>>;
863
+ listAll: (options?: BroadcastListOptions) => Promise<Array<BroadcastResource>>;
864
+ iterate: (options?: BroadcastListOptions) => AsyncGenerator<BroadcastResource, void, undefined>;
865
+ get: (id: string, options?: RequestScope) => Promise<BroadcastResource>;
866
+ cancel: (id: string, options?: RequestScope) => Promise<BroadcastResource>;
219
867
  };
220
868
 
221
869
  declare const Calendar: (transport: Transport) => {
222
- listEvents: (options: CalendarRangeOptions) => Promise<Array<CalendarOccurrenceResource>>;
870
+ listEvents: (options: CalendarRangeOptions) => Promise<Page<CalendarOccurrenceResource>>;
871
+ listAllEvents: (options: CalendarRangeOptions) => Promise<Array<CalendarOccurrenceResource>>;
872
+ iterateEvents: (options: CalendarRangeOptions) => AsyncGenerator<CalendarOccurrenceResource, void, undefined>;
223
873
  getEvent: (id: string, options?: RequestScope) => Promise<CalendarEventResource>;
224
874
  getEventIcs: (id: string, options?: RequestScope) => Promise<string>;
225
875
  };
226
876
 
227
877
  declare const Contacts: (transport: Transport) => {
228
- list: (options?: ContactListOptions) => Promise<Array<ContactResource>>;
229
- get: (email: string, options?: RequestScope) => Promise<ContactResource>;
878
+ list: (options?: ContactListOptions) => Promise<Page<ContactResource>>;
879
+ listAll: (options?: ContactListOptions) => Promise<Array<ContactResource>>;
880
+ iterate: (options?: ContactListOptions) => AsyncGenerator<ContactResource, void, undefined>;
881
+ get: (email: string, options?: RequestScope) => Promise<ContactDetailResource>;
882
+ create: (body: ContactCreate, options?: RequestScope) => Promise<ContactDetailResource>;
883
+ update: (email: string, patch: ContactPatch, options?: RequestScope) => Promise<ContactDetailResource>;
884
+ delete: (email: string, options?: RequestScope) => Promise<DeletedContactResource>;
885
+ setAudiences: (email: string, body: ContactAudiencesSet, options?: RequestScope) => Promise<ContactDetailResource>;
886
+ listPeople: (options?: PersonListOptions) => Promise<PeoplePage>;
887
+ listAllPeople: (options?: PersonListOptions) => Promise<Array<PersonResource>>;
888
+ iteratePeople: (options?: PersonListOptions) => AsyncGenerator<PersonResource, void, undefined>;
889
+ save: (email: string, body?: ContactSave, options?: RequestScope) => Promise<ContactDetailResource>;
890
+ deleteMany: (emails: Array<string>, options?: RequestScope) => Promise<ContactBatchDeleteResource>;
891
+ setPhoto: (email: string, data: RawBody, options?: ContactPhotoOptions) => Promise<ContactDetailResource>;
892
+ removePhoto: (email: string, options?: RequestScope) => Promise<ContactDetailResource>;
893
+ block: (email: string, options?: RequestScope) => Promise<ContactBlockResource>;
894
+ unblock: (email: string, options?: RequestScope) => Promise<ContactBlockResource>;
895
+ listThreads: (email: string, options?: ContactThreadListOptions) => Promise<Page<ContactThreadResource>>;
896
+ listAllThreads: (email: string, options?: ContactThreadListOptions) => Promise<Array<ContactThreadResource>>;
897
+ iterateThreads: (email: string, options?: ContactThreadListOptions) => AsyncGenerator<ContactThreadResource, void, undefined>;
898
+ activity: (email: string, options?: ContactActivityOptions) => Promise<ContactActivityResource>;
230
899
  };
231
900
 
232
901
  declare const Domains: (transport: Transport) => {
233
- list: (options?: RequestScope) => Promise<Array<DomainResource>>;
902
+ list: (options?: ListOptions) => Promise<Page<DomainResource>>;
903
+ listAll: (options?: ListOptions) => Promise<Array<DomainResource>>;
904
+ iterate: (options?: ListOptions) => AsyncGenerator<DomainResource, void, undefined>;
234
905
  get: (id: string, options?: RequestScope) => Promise<DomainDetailResource>;
906
+ update: (id: string, patch: DomainPatch, options?: RequestScope) => Promise<DomainDetailResource>;
235
907
  };
236
908
 
237
909
  declare const Drafts: (transport: Transport) => {
@@ -252,17 +924,83 @@ declare const Emails: (transport: Transport) => {
252
924
  listAll: (options?: EmailListOptions) => Promise<Array<EmailResource>>;
253
925
  iterate: (options?: EmailListOptions) => AsyncGenerator<EmailResource, void, undefined>;
254
926
  get: (id: string, options?: RequestScope) => Promise<EmailResource>;
255
- listEvents: (id: string, options?: RequestScope) => Promise<Array<EmailEventResource>>;
927
+ listEvents: (id: string, options?: ListOptions) => Promise<Page<EmailEventResource>>;
928
+ listAllEvents: (id: string, options?: ListOptions) => Promise<Array<EmailEventResource>>;
929
+ iterateEvents: (id: string, options?: ListOptions) => AsyncGenerator<EmailEventResource, void, undefined>;
256
930
  getTracking: (id: string, options?: RequestScope) => Promise<TrackingResource>;
257
931
  cancel: (id: string, options?: RequestScope) => Promise<EmailResource>;
258
932
  reschedule: (id: string, scheduledAt: Date | string, options?: RequestScope) => Promise<EmailResource>;
259
933
  };
260
934
 
935
+ declare const Files: (transport: Transport) => {
936
+ list: (options?: FileListOptions) => Promise<Page<FileResource>>;
937
+ listAll: (options?: FileListOptions) => Promise<Array<FileResource>>;
938
+ iterate: (options?: FileListOptions) => AsyncGenerator<FileResource, void, undefined>;
939
+ get: (id: string, options?: RequestScope) => Promise<FileResource>;
940
+ download: (id: string, options?: RequestScope) => Promise<Uint8Array>;
941
+ listLinks: (id: string, options?: ListOptions) => Promise<Page<FileLinkResource>>;
942
+ listAllLinks: (id: string, options?: ListOptions) => Promise<Array<FileLinkResource>>;
943
+ iterateLinks: (id: string, options?: ListOptions) => AsyncGenerator<FileLinkResource, void, undefined>;
944
+ delete: (id: string, options?: RequestScope) => Promise<DeletedFileResource>;
945
+ };
946
+
947
+ declare const Imports: (transport: Transport) => {
948
+ list: (options?: ImportListOptions) => Promise<Page<ImportResource>>;
949
+ listAll: (options?: ImportListOptions) => Promise<Array<ImportResource>>;
950
+ iterate: (options?: ImportListOptions) => AsyncGenerator<ImportResource, void, undefined>;
951
+ get: (id: string, options?: RequestScope) => Promise<ImportResource>;
952
+ create: (body: ImportCreate, options?: RequestScope) => Promise<ImportResource>;
953
+ uploadState: (id: string, options?: RequestScope) => Promise<ImportUploadResource>;
954
+ uploadChunk: (id: string, file: number, chunk: number, data: RawBody, options?: RequestScope) => Promise<ImportChunkResource>;
955
+ start: (id: string, options?: RequestScope) => Promise<ImportResource>;
956
+ cancel: (id: string, options?: RequestScope) => Promise<ImportResource>;
957
+ listFailures: (id: string, options?: ImportFailuresOptions) => Promise<ImportFailurePage>;
958
+ deleteUpload: (id: string, options?: RequestScope) => Promise<ImportResource>;
959
+ importFiles: (input: ImportFilesInput, options?: RequestScope) => Promise<ImportResource>;
960
+ };
961
+
962
+ declare const Keys: (transport: Transport) => {
963
+ list: (options?: ListOptions) => Promise<Page<ApiKeyResource>>;
964
+ listAll: (options?: ListOptions) => Promise<Array<ApiKeyResource>>;
965
+ iterate: (options?: ListOptions) => AsyncGenerator<ApiKeyResource, void, undefined>;
966
+ get: (id: string, options?: RequestScope) => Promise<ApiKeyResource>;
967
+ create: (body: ApiKeyCreate, options?: RequestScope) => Promise<CreatedApiKeyResource>;
968
+ update: (id: string, patch: ApiKeyPatch, options?: RequestScope) => Promise<ApiKeyResource>;
969
+ delete: (id: string, options?: RequestScope) => Promise<DeletedApiKeyResource>;
970
+ rotate: (id: string, options?: RequestScope) => Promise<RotatedApiKeyResource>;
971
+ revoke: (id: string, body?: ApiKeyRevoke, options?: RequestScope) => Promise<ApiKeyResource>;
972
+ listRequests: (id: string, options?: ApiKeyRequestListOptions) => Promise<Page<ApiKeyRequestResource>>;
973
+ listAllRequests: (id: string, options?: ApiKeyRequestListOptions) => Promise<Array<ApiKeyRequestResource>>;
974
+ iterateRequests: (id: string, options?: ApiKeyRequestListOptions) => AsyncGenerator<ApiKeyRequestResource, void, undefined>;
975
+ listActivity: (id: string, options?: ApiKeyActivityListOptions) => Promise<Page<ApiKeyActivityResource>>;
976
+ listAllActivity: (id: string, options?: ApiKeyActivityListOptions) => Promise<Array<ApiKeyActivityResource>>;
977
+ iterateActivity: (id: string, options?: ApiKeyActivityListOptions) => AsyncGenerator<ApiKeyActivityResource, void, undefined>;
978
+ listWorkspaceRequests: (options?: ApiKeyWorkspaceRequestListOptions) => Promise<Page<ApiKeyRequestResource>>;
979
+ listAllWorkspaceRequests: (options?: ApiKeyWorkspaceRequestListOptions) => Promise<Array<ApiKeyRequestResource>>;
980
+ iterateWorkspaceRequests: (options?: ApiKeyWorkspaceRequestListOptions) => AsyncGenerator<ApiKeyRequestResource, void, undefined>;
981
+ listWorkspaceActivity: (options?: ApiKeyWorkspaceActivityListOptions) => Promise<Page<ApiKeyActivityResource>>;
982
+ listAllWorkspaceActivity: (options?: ApiKeyWorkspaceActivityListOptions) => Promise<Array<ApiKeyActivityResource>>;
983
+ iterateWorkspaceActivity: (options?: ApiKeyWorkspaceActivityListOptions) => AsyncGenerator<ApiKeyActivityResource, void, undefined>;
984
+ };
985
+
986
+ declare const ProviderImports: (transport: Transport) => {
987
+ inspect: (apiKey: string, options?: RequestScope) => Promise<ProviderInventoryResource>;
988
+ create: (body: ProviderImportCreate, options?: RequestScope) => Promise<ProviderImportResource>;
989
+ list: (options?: ProviderImportListOptions) => Promise<Page<ProviderImportResource>>;
990
+ listAll: (options?: ProviderImportListOptions) => Promise<Array<ProviderImportResource>>;
991
+ iterate: (options?: ProviderImportListOptions) => AsyncGenerator<ProviderImportResource, void, undefined>;
992
+ get: (id: string, options?: RequestScope) => Promise<ProviderImportResource>;
993
+ cancel: (id: string, options?: RequestScope) => Promise<ProviderImportResource>;
994
+ };
995
+
261
996
  declare const Labels: (transport: Transport) => {
262
- list: (options?: RequestScope) => Promise<Array<LabelResource>>;
997
+ list: (options?: ListOptions) => Promise<Page<LabelResource>>;
998
+ listAll: (options?: ListOptions) => Promise<Array<LabelResource>>;
999
+ iterate: (options?: ListOptions) => AsyncGenerator<LabelResource, void, undefined>;
1000
+ listColors: (options?: RequestScope) => Promise<Array<LabelColorResource>>;
263
1001
  get: (id: string, options?: RequestScope) => Promise<LabelResource>;
264
- create: (body: LabelInput, options?: RequestScope) => Promise<SavedLabelResource>;
265
- update: (id: string, body: LabelInput, options?: RequestScope) => Promise<SavedLabelResource>;
1002
+ create: (body: LabelInput, options?: RequestScope) => Promise<LabelResource>;
1003
+ update: (id: string, patch: LabelPatch, options?: RequestScope) => Promise<LabelResource>;
266
1004
  delete: (id: string, options?: RequestScope) => Promise<DeletedLabelResource>;
267
1005
  };
268
1006
 
@@ -273,20 +1011,30 @@ declare const Languages: (transport: Transport) => {
273
1011
  declare const Me: (transport: Transport) => {
274
1012
  get: (options?: RequestScope) => Promise<KeyResource>;
275
1013
  ping: (options?: RequestScope) => Promise<PingResource>;
1014
+ rotate: (options?: RequestScope) => Promise<RotatedKeyResource>;
276
1015
  };
277
1016
 
278
1017
  declare const Members: (transport: Transport) => {
279
- list: (options?: RequestScope) => Promise<Array<MemberResource>>;
1018
+ list: (options?: ListOptions) => Promise<Page<MemberResource>>;
1019
+ listAll: (options?: ListOptions) => Promise<Array<MemberResource>>;
1020
+ iterate: (options?: ListOptions) => AsyncGenerator<MemberResource, void, undefined>;
280
1021
  get: (userId: string, options?: RequestScope) => Promise<MemberResource>;
281
- add: (body: MemberAdd, options?: RequestScope) => Promise<MemberResource>;
1022
+ add: (body: MemberAdd, options?: RequestScope) => Promise<InvitationResource>;
282
1023
  update: (userId: string, patch: MemberPatch, options?: RequestScope) => Promise<MemberResource>;
283
1024
  remove: (userId: string, options?: RequestScope) => Promise<RemovedMemberResource>;
284
1025
  grantAddress: (userId: string, body: MemberAddressGrant, options?: RequestScope) => Promise<MemberResource>;
285
1026
  revokeAddress: (userId: string, addressId: string, options?: RequestScope) => Promise<MemberResource>;
1027
+ listInvitations: (options?: ListOptions) => Promise<Page<InvitationResource>>;
1028
+ listAllInvitations: (options?: ListOptions) => Promise<Array<InvitationResource>>;
1029
+ iterateInvitations: (options?: ListOptions) => AsyncGenerator<InvitationResource, void, undefined>;
1030
+ revokeInvitation: (invitationId: string, options?: RequestScope) => Promise<RevokedInvitationResource>;
1031
+ resendInvitation: (invitationId: string, options?: RequestScope) => Promise<InvitationResource>;
286
1032
  };
287
1033
 
288
1034
  declare const Roles: (transport: Transport) => {
289
- list: (options?: RequestScope) => Promise<Array<RoleResource>>;
1035
+ list: (options?: ListOptions) => Promise<Page<RoleResource>>;
1036
+ listAll: (options?: ListOptions) => Promise<Array<RoleResource>>;
1037
+ iterate: (options?: ListOptions) => AsyncGenerator<RoleResource, void, undefined>;
290
1038
  get: (id: string, options?: RequestScope) => Promise<RoleResource>;
291
1039
  create: (body: RoleCreate, options?: RequestScope) => Promise<RoleResource>;
292
1040
  update: (id: string, patch: RolePatch, options?: RequestScope) => Promise<RoleResource>;
@@ -310,8 +1058,17 @@ declare const Rules: (transport: Transport) => {
310
1058
  };
311
1059
 
312
1060
  declare const Settings: (transport: Transport) => {
313
- get: (options?: RequestScope) => Promise<SettingsResource>;
314
- update: (patch: SettingsPatch, options?: RequestScope) => Promise<SettingsResource>;
1061
+ get: (options?: SettingsOptions) => Promise<SettingsResource>;
1062
+ update: (patch: SettingsPatch, options?: SettingsOptions) => Promise<SettingsResource>;
1063
+ };
1064
+
1065
+ declare const Suppressions: (transport: Transport) => {
1066
+ list: (options?: SuppressionListOptions) => Promise<Page<SuppressionResource>>;
1067
+ listAll: (options?: SuppressionListOptions) => Promise<Array<SuppressionResource>>;
1068
+ iterate: (options?: SuppressionListOptions) => AsyncGenerator<SuppressionResource, void, undefined>;
1069
+ get: (id: string, options?: RequestScope) => Promise<SuppressionResource>;
1070
+ add: (body: SuppressionAdd, options?: RequestScope) => Promise<SuppressionResource>;
1071
+ remove: (id: string, options?: RequestScope) => Promise<RemovedSuppressionResource>;
315
1072
  };
316
1073
 
317
1074
  declare const TempMail: (transport: Transport) => {
@@ -321,6 +1078,8 @@ declare const TempMail: (transport: Transport) => {
321
1078
  extend: (inboxId: string, options?: InboxScope) => Promise<TempInboxResource>;
322
1079
  delete: (inboxId: string, options?: InboxScope) => Promise<DeletedTempInboxResource>;
323
1080
  listMessages: (inboxId: string, options?: TempMessageListOptions) => Promise<TempMessagesResource>;
1081
+ listAllMessages: (inboxId: string, options?: TempMessageListOptions) => Promise<Array<TempMessageResource>>;
1082
+ iterateMessages: (inboxId: string, options?: TempMessageListOptions) => AsyncGenerator<TempMessageResource, void, undefined>;
324
1083
  getMessage: (inboxId: string, messageId: string, options?: InboxScope) => Promise<TempMessageDetailResource>;
325
1084
  deleteMessage: (inboxId: string, messageId: string, options?: InboxScope) => Promise<DeletedTempMessageResource>;
326
1085
  listAttachments: (inboxId: string, messageId: string, options?: InboxScope) => Promise<Array<AttachmentResource>>;
@@ -330,13 +1089,26 @@ declare const Templates: (transport: Transport) => {
330
1089
  list: (options?: TemplateListOptions) => Promise<Page<TemplateResource>>;
331
1090
  listAll: (options?: TemplateListOptions) => Promise<Array<TemplateResource>>;
332
1091
  iterate: (options?: TemplateListOptions) => AsyncGenerator<TemplateResource, void, undefined>;
1092
+ listStarters: (options?: RequestScope) => Promise<Array<TemplateStarterResource>>;
1093
+ listFonts: (options?: RequestScope) => Promise<Array<TemplateFontResource>>;
1094
+ getStarter: (slug: string, options?: RequestScope) => Promise<TemplateStarterDetailResource>;
1095
+ render: (body: TemplateRenderInput, options?: RequestScope) => Promise<TemplateRenderResource>;
333
1096
  get: (idOrSlug: string, options?: RequestScope) => Promise<TemplateDetailResource>;
334
1097
  create: (body: TemplateCreate, options?: RequestScope) => Promise<TemplateResource>;
335
1098
  update: (idOrSlug: string, patch: TemplatePatch, options?: RequestScope) => Promise<TemplateDetailResource>;
336
1099
  delete: (idOrSlug: string, options?: RequestScope) => Promise<DeletedTemplateResource>;
337
- listVersions: (idOrSlug: string, options?: RequestScope) => Promise<Array<TemplateVersionResource>>;
1100
+ duplicate: (idOrSlug: string, body?: TemplateDuplicate, options?: RequestScope) => Promise<TemplateDetailResource>;
1101
+ replaceContent: (idOrSlug: string, body: TemplateContentSource, options?: RequestScope) => Promise<TemplateDetailResource>;
1102
+ listVersions: (idOrSlug: string, options?: ListOptions) => Promise<Page<TemplateVersionResource>>;
1103
+ listAllVersions: (idOrSlug: string, options?: ListOptions) => Promise<Array<TemplateVersionResource>>;
1104
+ iterateVersions: (idOrSlug: string, options?: ListOptions) => AsyncGenerator<TemplateVersionResource, void, undefined>;
1105
+ getVersion: (idOrSlug: string, version: number, options?: RequestScope) => Promise<TemplateVersionResource>;
1106
+ deleteVersion: (idOrSlug: string, version: number, options?: RequestScope) => Promise<DeletedTemplateVersionResource>;
1107
+ restoreVersion: (idOrSlug: string, version: number, body?: TemplateRestoreInput, options?: RequestScope) => Promise<TemplateRestoredResource>;
338
1108
  publish: (idOrSlug: string, options?: RequestScope) => Promise<TemplateVersionResource>;
339
1109
  preview: (idOrSlug: string, body?: TemplatePreviewInput, options?: RequestScope) => Promise<TemplatePreviewResource>;
1110
+ getAnalytics: (idOrSlug: string, options?: TemplateAnalyticsOptions) => Promise<TemplateAnalyticsResource>;
1111
+ listSends: (idOrSlug: string, options?: TemplateSendListOptions) => Promise<TemplateSendsResource>;
340
1112
  send: (idOrSlug: string, body: TemplateSend, options?: SendScope) => Promise<SentTemplateEmailResource>;
341
1113
  };
342
1114
 
@@ -353,28 +1125,50 @@ declare const Threads: (transport: Transport) => {
353
1125
  };
354
1126
 
355
1127
  declare const Tracking: (transport: Transport) => {
356
- list: (options?: TrackingListOptions) => Promise<Array<TrackingResource>>;
1128
+ list: (options?: TrackingListOptions) => Promise<Page<TrackingResource>>;
1129
+ listAll: (options?: TrackingListOptions) => Promise<Array<TrackingResource>>;
1130
+ iterate: (options?: TrackingListOptions) => AsyncGenerator<TrackingResource, void, undefined>;
357
1131
  getStats: (options?: TrackingStatsOptions) => Promise<TrackingStatsResource>;
358
1132
  get: (id: string, options?: RequestScope) => Promise<TrackingResource>;
359
- listOpens: (id: string, options?: TrackingHitOptions) => Promise<Array<TrackingOpenResource>>;
360
- listClicks: (id: string, options?: TrackingHitOptions) => Promise<Array<TrackingClickResource>>;
1133
+ listOpens: (id: string, options?: TrackingHitOptions) => Promise<Page<TrackingOpenResource>>;
1134
+ listAllOpens: (id: string, options?: TrackingHitOptions) => Promise<Array<TrackingOpenResource>>;
1135
+ iterateOpens: (id: string, options?: TrackingHitOptions) => AsyncGenerator<TrackingOpenResource, void, undefined>;
1136
+ listClicks: (id: string, options?: TrackingHitOptions) => Promise<Page<TrackingClickResource>>;
1137
+ listAllClicks: (id: string, options?: TrackingHitOptions) => Promise<Array<TrackingClickResource>>;
1138
+ iterateClicks: (id: string, options?: TrackingHitOptions) => AsyncGenerator<TrackingClickResource, void, undefined>;
361
1139
  };
362
1140
 
363
1141
  declare const Webhooks: (transport: Transport) => {
364
- list: (options?: RequestScope) => Promise<Array<WebhookResource>>;
1142
+ list: (options?: ListOptions) => Promise<Page<WebhookResource>>;
1143
+ listAll: (options?: ListOptions) => Promise<Array<WebhookResource>>;
1144
+ iterate: (options?: ListOptions) => AsyncGenerator<WebhookResource, void, undefined>;
365
1145
  get: (id: string, options?: RequestScope) => Promise<WebhookResource>;
366
1146
  create: (body: WebhookCreate, options?: RequestScope) => Promise<CreatedWebhookResource>;
367
1147
  update: (id: string, patch: WebhookPatch, options?: RequestScope) => Promise<WebhookResource>;
368
1148
  delete: (id: string, options?: RequestScope) => Promise<DeletedWebhookResource>;
369
1149
  rotateSecret: (id: string, options?: RequestScope) => Promise<CreatedWebhookResource>;
370
1150
  test: (id: string, options?: RequestScope) => Promise<WebhookTestResource>;
371
- listDeliveries: (id: string, options?: RequestScope) => Promise<Array<WebhookDeliveryResource>>;
1151
+ listDeliveries: (id: string, options?: WebhookDeliveryListOptions) => Promise<Page<WebhookDeliveryResource>>;
1152
+ listAllDeliveries: (id: string, options?: WebhookDeliveryListOptions) => Promise<Array<WebhookDeliveryResource>>;
1153
+ iterateDeliveries: (id: string, options?: WebhookDeliveryListOptions) => AsyncGenerator<WebhookDeliveryResource, void, undefined>;
1154
+ listWorkspaceDeliveries: (options?: WebhookWorkspaceDeliveryListOptions) => Promise<Page<WebhookDeliveryResource>>;
1155
+ listAllWorkspaceDeliveries: (options?: WebhookWorkspaceDeliveryListOptions) => Promise<Array<WebhookDeliveryResource>>;
1156
+ iterateWorkspaceDeliveries: (options?: WebhookWorkspaceDeliveryListOptions) => AsyncGenerator<WebhookDeliveryResource, void, undefined>;
1157
+ listActivity: (id: string, options?: WebhookActivityListOptions) => Promise<Page<WebhookActivityResource>>;
1158
+ listAllActivity: (id: string, options?: WebhookActivityListOptions) => Promise<Array<WebhookActivityResource>>;
1159
+ iterateActivity: (id: string, options?: WebhookActivityListOptions) => AsyncGenerator<WebhookActivityResource, void, undefined>;
1160
+ listWorkspaceActivity: (options?: WebhookWorkspaceActivityListOptions) => Promise<Page<WebhookActivityResource>>;
1161
+ listAllWorkspaceActivity: (options?: WebhookWorkspaceActivityListOptions) => Promise<Array<WebhookActivityResource>>;
1162
+ iterateWorkspaceActivity: (options?: WebhookWorkspaceActivityListOptions) => AsyncGenerator<WebhookActivityResource, void, undefined>;
1163
+ getDelivery: (id: string, deliveryId: string, options?: RequestScope) => Promise<WebhookDeliveryDetailResource>;
1164
+ replayDelivery: (id: string, deliveryId: string, options?: RequestScope) => Promise<WebhookReplayResource>;
372
1165
  };
373
1166
 
374
1167
  declare class OpenEmail {
375
1168
  private readonly transport;
376
1169
  readonly mode: ApiKeyMode;
377
1170
  readonly me: ReturnType<typeof Me>;
1171
+ readonly keys: ReturnType<typeof Keys>;
378
1172
  readonly addresses: ReturnType<typeof Addresses>;
379
1173
  readonly languages: ReturnType<typeof Languages>;
380
1174
  readonly emails: ReturnType<typeof Emails>;
@@ -384,13 +1178,19 @@ declare class OpenEmail {
384
1178
  readonly drafts: ReturnType<typeof Drafts>;
385
1179
  readonly labels: ReturnType<typeof Labels>;
386
1180
  readonly contacts: ReturnType<typeof Contacts>;
1181
+ readonly audiences: ReturnType<typeof Audiences>;
1182
+ readonly broadcasts: ReturnType<typeof Broadcasts>;
387
1183
  readonly domains: ReturnType<typeof Domains>;
388
1184
  readonly rules: ReturnType<typeof Rules>;
389
1185
  readonly webhooks: ReturnType<typeof Webhooks>;
1186
+ readonly imports: ReturnType<typeof Imports>;
1187
+ readonly providerImports: ReturnType<typeof ProviderImports>;
390
1188
  readonly calendar: ReturnType<typeof Calendar>;
391
1189
  readonly settings: ReturnType<typeof Settings>;
392
1190
  readonly roles: ReturnType<typeof Roles>;
393
1191
  readonly members: ReturnType<typeof Members>;
1192
+ readonly suppressions: ReturnType<typeof Suppressions>;
1193
+ readonly files: ReturnType<typeof Files>;
394
1194
  readonly tempMail: ReturnType<typeof TempMail>;
395
1195
  constructor(configuration: ClientOptions | string);
396
1196
  get raw(): Transport;
@@ -401,23 +1201,16 @@ type InboxScope = {
401
1201
  inboxToken?: string;
402
1202
  };
403
1203
 
404
- type ListOptions = RequestScope & {
405
- limit?: number;
406
- cursor?: string;
407
- };
408
-
409
- type Page<T> = {
410
- items: Array<T>;
411
- hasMore: boolean;
412
- nextCursor: string | null;
413
- };
414
-
415
1204
  type QueryValues = Record<string, string | number | boolean | null | undefined>;
416
1205
 
1206
+ type RawBody = Blob | ArrayBuffer | Uint8Array;
1207
+
417
1208
  type RequestOptions = {
418
1209
  method?: string;
419
1210
  query?: QueryValues;
420
1211
  body?: unknown;
1212
+ raw?: RawBody;
1213
+ contentType?: string;
421
1214
  signal?: AbortSignal;
422
1215
  apiKey?: string;
423
1216
  inboxToken?: string;
@@ -426,6 +1219,7 @@ type RequestOptions = {
426
1219
  idempotencyKey?: string;
427
1220
  repeatable?: boolean;
428
1221
  accept?: string;
1222
+ binary?: boolean;
429
1223
  };
430
1224
 
431
1225
  type SendScope = RequestScope & {
@@ -436,7 +1230,61 @@ type TempMailOptions = Omit<TransportOptions, 'apiKey'> & {
436
1230
  inboxToken?: string;
437
1231
  };
438
1232
 
439
- type DomainSendingState = 'verified' | 'pending' | 'failed' | 'no_identity' | 'unknown';
1233
+ declare const DOMAIN_SENDING_STATES: {
1234
+ readonly VERIFIED: "verified";
1235
+ readonly PENDING: "pending";
1236
+ readonly FAILED: "failed";
1237
+ readonly NO_IDENTITY: "no_identity";
1238
+ readonly UNKNOWN: "unknown";
1239
+ };
1240
+ declare const DOMAIN_TRACKING_STATES: {
1241
+ readonly NONE: "none";
1242
+ readonly PENDING: "pending";
1243
+ readonly ACTIVE: "active";
1244
+ readonly FAILED: "failed";
1245
+ };
1246
+ declare const DOMAIN_STORAGE_STATES: {
1247
+ readonly NONE: "none";
1248
+ readonly PENDING: "pending";
1249
+ readonly ACTIVE: "active";
1250
+ readonly FAILED: "failed";
1251
+ };
1252
+
1253
+ type DomainSendingState = (typeof DOMAIN_SENDING_STATES)[keyof typeof DOMAIN_SENDING_STATES];
1254
+
1255
+ type DomainStorageState = (typeof DOMAIN_STORAGE_STATES)[keyof typeof DOMAIN_STORAGE_STATES];
1256
+
1257
+ type DomainStorage = {
1258
+ host: string | null;
1259
+ status: DomainStorageState;
1260
+ active: boolean;
1261
+ target: string;
1262
+ record: {
1263
+ type: 'CNAME';
1264
+ name: string;
1265
+ value: string;
1266
+ } | null;
1267
+ checkedAt: string | null;
1268
+ verifiedAt: string | null;
1269
+ error: string | null;
1270
+ };
1271
+
1272
+ type DomainTrackingState = (typeof DOMAIN_TRACKING_STATES)[keyof typeof DOMAIN_TRACKING_STATES];
1273
+
1274
+ type DomainTracking = {
1275
+ host: string | null;
1276
+ status: DomainTrackingState;
1277
+ active: boolean;
1278
+ target: string;
1279
+ record: {
1280
+ type: 'CNAME';
1281
+ name: string;
1282
+ value: string;
1283
+ } | null;
1284
+ checkedAt: string | null;
1285
+ verifiedAt: string | null;
1286
+ error: string | null;
1287
+ };
440
1288
 
441
1289
  type DomainResource = {
442
1290
  object: 'domain';
@@ -456,6 +1304,8 @@ type DomainResource = {
456
1304
  error: string | null;
457
1305
  note: string;
458
1306
  };
1307
+ tracking: DomainTracking;
1308
+ storage: DomainStorage;
459
1309
  createdAt: string;
460
1310
  };
461
1311
 
@@ -466,6 +1316,11 @@ type DomainDetailResource = DomainResource & {
466
1316
  }>;
467
1317
  };
468
1318
 
1319
+ type DomainPatch = {
1320
+ trackingHost?: string | null;
1321
+ storageHost?: string | null;
1322
+ };
1323
+
469
1324
  type DeletedDraftResource = {
470
1325
  object: 'draft';
471
1326
  id: string;
@@ -513,20 +1368,22 @@ type SavedDraftResource = {
513
1368
  id: string | null;
514
1369
  };
515
1370
 
516
- type RecipientStatus = 'pending' | 'suppressed' | 'delivered' | 'failed' | 'bounced' | 'complained' | 'uncertain';
1371
+ type AttachmentDeliveryMode = (typeof ATTACHMENT_DELIVERY_MODES)[keyof typeof ATTACHMENT_DELIVERY_MODES];
1372
+
1373
+ type RecipientKind = (typeof RECIPIENT_KINDS)[keyof typeof RECIPIENT_KINDS];
1374
+
1375
+ type RecipientStatus = (typeof RECIPIENT_STATUSES)[keyof typeof RECIPIENT_STATUSES];
517
1376
 
518
1377
  type EmailRecipientResource = {
519
1378
  email: string;
520
1379
  name: string | null;
521
- kind: 'to' | 'cc' | 'bcc';
1380
+ kind: RecipientKind;
522
1381
  status: RecipientStatus;
523
1382
  error: string | null;
524
1383
  deliveredAt: string | null;
525
1384
  };
526
1385
 
527
- type EmailSource = 'composer' | 'api' | 'mcp' | 'ai' | 'queue';
528
-
529
- type EmailStatus = 'queued' | 'scheduled' | 'sending' | 'sent' | 'partial' | 'cancelled' | 'failed';
1386
+ type EmailStatus = (typeof EMAIL_STATUSES)[keyof typeof EMAIL_STATUSES];
530
1387
 
531
1388
  type EmailTrackingSummary = {
532
1389
  opens: boolean;
@@ -546,7 +1403,7 @@ type EmailTranslationResource = {
546
1403
  includeOriginal: boolean;
547
1404
  };
548
1405
 
549
- type EmailTransport = 'ses' | 'resend' | 'dev' | 'test';
1406
+ type EmailTransport = (typeof EMAIL_TRANSPORTS)[keyof typeof EMAIL_TRANSPORTS];
550
1407
 
551
1408
  type TrackingLinkResource = {
552
1409
  id: string;
@@ -558,7 +1415,7 @@ type TrackingLinkResource = {
558
1415
 
559
1416
  type TrackingRecipientResource = {
560
1417
  email: string | null;
561
- kind: 'to' | 'cc' | 'bcc' | null;
1418
+ kind: RecipientKind | null;
562
1419
  attributed: boolean;
563
1420
  openCount: number;
564
1421
  clickCount: number;
@@ -610,6 +1467,7 @@ type EmailResource = {
610
1467
  cancellableUntil: string | null;
611
1468
  sentAt: string | null;
612
1469
  tags: Record<string, string>;
1470
+ broadcastId: string | null;
613
1471
  source: EmailSource | (string & {});
614
1472
  createdAt: string;
615
1473
  recipients?: Array<EmailRecipientResource>;
@@ -653,6 +1511,7 @@ type EmailEventResource = {
653
1511
  type EmailListOptions = ListOptions & {
654
1512
  status?: EmailStatus | Array<EmailStatus>;
655
1513
  from?: string;
1514
+ broadcastId?: string;
656
1515
  };
657
1516
 
658
1517
  type EmailSend = {
@@ -666,6 +1525,7 @@ type EmailSend = {
666
1525
  text?: string;
667
1526
  headers?: Record<string, string>;
668
1527
  attachments?: Array<AttachmentInput>;
1528
+ attachmentDelivery?: AttachmentDeliveryMode;
669
1529
  threadId?: string;
670
1530
  draftId?: string;
671
1531
  template?: {
@@ -688,22 +1548,444 @@ type EmailTranslate = TranslateOptions & {
688
1548
  subject?: string;
689
1549
  };
690
1550
 
691
- type LanguageResource = {
692
- code: string;
693
- label: string;
694
- native: string;
695
- flag: string;
696
- rtl: boolean;
1551
+ type LanguageResource = {
1552
+ code: string;
1553
+ label: string;
1554
+ native: string;
1555
+ flag: string;
1556
+ rtl: boolean;
1557
+ };
1558
+
1559
+ type TranslationResource = {
1560
+ object: 'translation';
1561
+ language: LanguageResource;
1562
+ detectedSourceLanguage: LanguageResource | null;
1563
+ subject: string | null;
1564
+ html: string | null;
1565
+ text: string | null;
1566
+ includeOriginal: boolean;
1567
+ };
1568
+
1569
+ type DeletedFileResource = {
1570
+ object: 'file';
1571
+ id: string;
1572
+ deleted: true;
1573
+ };
1574
+
1575
+ declare const FILE_SORTS: {
1576
+ readonly NEWEST: "newest";
1577
+ readonly OLDEST: "oldest";
1578
+ readonly LARGEST: "largest";
1579
+ readonly NAME: "name";
1580
+ };
1581
+ declare const FILE_KINDS: {
1582
+ readonly IMAGE: "image";
1583
+ readonly PDF: "pdf";
1584
+ readonly AUDIO: "audio";
1585
+ readonly VIDEO: "video";
1586
+ readonly TEXT: "text";
1587
+ };
1588
+ declare const FILE_DIRECTIONS: {
1589
+ readonly INBOUND: "inbound";
1590
+ readonly OUTBOUND: "outbound";
1591
+ };
1592
+
1593
+ type FileDirection = (typeof FILE_DIRECTIONS)[keyof typeof FILE_DIRECTIONS];
1594
+
1595
+ type FileKind = (typeof FILE_KINDS)[keyof typeof FILE_KINDS];
1596
+
1597
+ type FileLinkResource = {
1598
+ object: 'file_link';
1599
+ id: string;
1600
+ fileId: string | null;
1601
+ filename: string;
1602
+ mimeType: string;
1603
+ sizeBytes: number;
1604
+ host: string | null;
1605
+ url: string;
1606
+ downloads: number;
1607
+ lastDownloadAt: string | null;
1608
+ revokedAt: string | null;
1609
+ createdAt: string;
1610
+ };
1611
+
1612
+ type FileSort = (typeof FILE_SORTS)[keyof typeof FILE_SORTS];
1613
+
1614
+ type FileListOptions = ListOptions & {
1615
+ q?: string;
1616
+ kind?: FileKind;
1617
+ sort?: FileSort;
1618
+ };
1619
+
1620
+ type FileResource = {
1621
+ object: 'file';
1622
+ id: string;
1623
+ filename: string;
1624
+ mimeType: string;
1625
+ sizeBytes: number;
1626
+ direction: FileDirection;
1627
+ threadId: string | null;
1628
+ messageId: string | null;
1629
+ deliveredTo: string | null;
1630
+ createdAt: string;
1631
+ };
1632
+
1633
+ type ImportChunkResource = {
1634
+ object: 'import_chunk';
1635
+ file: number;
1636
+ chunk: number;
1637
+ bytes: number;
1638
+ };
1639
+
1640
+ type ImportCounts = {
1641
+ seen: number;
1642
+ imported: number;
1643
+ duplicate: number;
1644
+ filtered: number;
1645
+ failed: number;
1646
+ threads: number;
1647
+ };
1648
+
1649
+ type ImportFileDescriptor = {
1650
+ name: string;
1651
+ bytes: number;
1652
+ };
1653
+
1654
+ type ImportOptions = {
1655
+ keepInbox?: boolean;
1656
+ includeSpam?: boolean;
1657
+ includeTrash?: boolean;
1658
+ };
1659
+
1660
+ type ImportCreate = {
1661
+ addressId: string;
1662
+ files: Array<ImportFileDescriptor>;
1663
+ options?: ImportOptions;
1664
+ };
1665
+
1666
+ declare const IMPORT_STATUSES: {
1667
+ readonly UPLOADING: "uploading";
1668
+ readonly QUEUED: "queued";
1669
+ readonly RUNNING: "running";
1670
+ readonly COMPLETED: "completed";
1671
+ readonly FAILED: "failed";
1672
+ readonly CANCELLED: "cancelled";
1673
+ };
1674
+ declare const IMPORT_FAILURE_REASONS: {
1675
+ readonly TOO_LARGE: "too-large";
1676
+ readonly UNPARSEABLE: "unparseable";
1677
+ readonly NO_DATE: "no-date";
1678
+ readonly STORAGE_ERROR: "storage-error";
1679
+ readonly UNREADABLE_ENTRY: "unreadable-entry";
1680
+ readonly ENCRYPTED_ENTRY: "encrypted-entry";
1681
+ readonly ARCHIVE_LIMIT: "archive-limit";
1682
+ };
1683
+ declare const IMPORT_FORMATS: {
1684
+ readonly GMAIL: "gmail";
1685
+ readonly OPENEMAIL: "openemail";
1686
+ readonly THUNDERBIRD: "thunderbird";
1687
+ readonly MBOX: "mbox";
1688
+ readonly EML: "eml";
1689
+ };
1690
+ declare const PROVIDER_IMPORT_RESOURCES: {
1691
+ readonly SUPPRESSIONS: "suppressions";
1692
+ readonly AUDIENCES: "audiences";
1693
+ readonly CONTACTS: "contacts";
1694
+ readonly TEMPLATES: "templates";
1695
+ readonly WEBHOOKS: "webhooks";
1696
+ readonly DOMAINS: "domains";
1697
+ readonly API_KEYS: "api-keys";
1698
+ };
1699
+ declare const PROVIDER_IMPORT_STATUSES: {
1700
+ readonly QUEUED: "queued";
1701
+ readonly RUNNING: "running";
1702
+ readonly COMPLETED: "completed";
1703
+ readonly FAILED: "failed";
1704
+ readonly CANCELLED: "cancelled";
1705
+ };
1706
+ declare const PROVIDER_IMPORT_DOMAIN_STATES: {
1707
+ readonly ABSENT: "absent";
1708
+ readonly ADDED: "added";
1709
+ readonly VERIFIED: "verified";
1710
+ };
1711
+
1712
+ type ImportFailureReason = (typeof IMPORT_FAILURE_REASONS)[keyof typeof IMPORT_FAILURE_REASONS];
1713
+
1714
+ type ImportFailureResource = {
1715
+ id: string;
1716
+ seq: number;
1717
+ reason: ImportFailureReason;
1718
+ subject: string | null;
1719
+ sender: string | null;
1720
+ messageId: string | null;
1721
+ source: string | null;
1722
+ bytes: number | null;
1723
+ detail: string | null;
1724
+ createdAt: string;
1725
+ };
1726
+
1727
+ type ImportFailurePage = {
1728
+ object: 'list';
1729
+ data: Array<ImportFailureResource>;
1730
+ nextCursor: number | null;
1731
+ };
1732
+
1733
+ type ImportFailuresOptions = RequestScope & {
1734
+ after?: number;
1735
+ limit?: number;
1736
+ };
1737
+
1738
+ type ImportFileInfo = {
1739
+ name: string;
1740
+ bytes: number;
1741
+ chunks: number;
1742
+ };
1743
+
1744
+ type ImportProgress = (uploadedBytes: number, totalBytes: number) => void;
1745
+
1746
+ type ImportSource = {
1747
+ name: string;
1748
+ data: RawBody;
1749
+ };
1750
+
1751
+ type ImportFilesInput = {
1752
+ addressId: string;
1753
+ files: Array<ImportSource>;
1754
+ options?: ImportOptions;
1755
+ onProgress?: ImportProgress;
1756
+ };
1757
+
1758
+ type ImportFormat = (typeof IMPORT_FORMATS)[keyof typeof IMPORT_FORMATS];
1759
+
1760
+ type ImportListOptions = ListOptions & {
1761
+ addressId?: string;
1762
+ };
1763
+
1764
+ type ImportStatus = (typeof IMPORT_STATUSES)[keyof typeof IMPORT_STATUSES];
1765
+
1766
+ type ImportResource = {
1767
+ object: 'import';
1768
+ id: string;
1769
+ addressId: string | null;
1770
+ address: string;
1771
+ status: ImportStatus;
1772
+ options: Required<ImportOptions>;
1773
+ files: Array<ImportFileInfo>;
1774
+ formats: Array<ImportFormat>;
1775
+ chunkBytes: number;
1776
+ totalBytes: number;
1777
+ processedBytes: number;
1778
+ counts: ImportCounts;
1779
+ labelsCreated: Array<string>;
1780
+ labelsSkipped: Array<string>;
1781
+ lastError: string | null;
1782
+ uploadDeleted: boolean;
1783
+ createdAt: string;
1784
+ startedAt: string | null;
1785
+ finishedAt: string | null;
1786
+ };
1787
+
1788
+ type ImportUploadResource = {
1789
+ object: 'import_upload';
1790
+ id: string;
1791
+ status: ImportStatus;
1792
+ received: Array<Array<number>>;
1793
+ };
1794
+
1795
+ type ProviderImportCount = {
1796
+ count: number;
1797
+ more: boolean;
1798
+ };
1799
+
1800
+ type ProviderImportResourceKind = (typeof PROVIDER_IMPORT_RESOURCES)[keyof typeof PROVIDER_IMPORT_RESOURCES];
1801
+
1802
+ type ProviderImportCreate = {
1803
+ apiKey: string;
1804
+ resources: Array<ProviderImportResourceKind>;
1805
+ };
1806
+
1807
+ type ProviderImportDomainState = (typeof PROVIDER_IMPORT_DOMAIN_STATES)[keyof typeof PROVIDER_IMPORT_DOMAIN_STATES];
1808
+
1809
+ type ProviderImportListOptions = ListOptions;
1810
+
1811
+ type ProviderImportReport = {
1812
+ suppressions: {
1813
+ added: number;
1814
+ skipped: number;
1815
+ };
1816
+ audiences: {
1817
+ created: number;
1818
+ reused: number;
1819
+ skipped: Array<string>;
1820
+ };
1821
+ contacts: {
1822
+ added: number;
1823
+ created: number;
1824
+ unsubscribed: number;
1825
+ };
1826
+ templates: {
1827
+ created: number;
1828
+ skipped: Array<{
1829
+ name: string;
1830
+ reason: string;
1831
+ }>;
1832
+ warnings: Array<string>;
1833
+ };
1834
+ webhooks: {
1835
+ created: number;
1836
+ skipped: Array<{
1837
+ name: string;
1838
+ reason: string;
1839
+ }>;
1840
+ droppedEvents: Array<string>;
1841
+ };
1842
+ domains: Array<{
1843
+ name: string;
1844
+ state: ProviderImportDomainState;
1845
+ records: Array<{
1846
+ type: string;
1847
+ name: string;
1848
+ value: string;
1849
+ }>;
1850
+ }>;
1851
+ apiKeys: Array<{
1852
+ name: string;
1853
+ createdAt: string | null;
1854
+ lastUsedAt: string | null;
1855
+ }>;
1856
+ };
1857
+
1858
+ type ProviderImportStatus = (typeof PROVIDER_IMPORT_STATUSES)[keyof typeof PROVIDER_IMPORT_STATUSES];
1859
+
1860
+ type ProviderImportResource = {
1861
+ object: 'provider_import';
1862
+ id: string;
1863
+ provider: 'resend';
1864
+ status: ProviderImportStatus;
1865
+ resources: Array<ProviderImportResourceKind>;
1866
+ step: ProviderImportResourceKind | null;
1867
+ report: ProviderImportReport;
1868
+ lastError: string | null;
1869
+ createdAt: string;
1870
+ startedAt: string | null;
1871
+ finishedAt: string | null;
1872
+ };
1873
+
1874
+ type ProviderInventoryResource = {
1875
+ object: 'provider_inventory';
1876
+ provider: 'resend';
1877
+ counts: Record<ProviderImportResourceKind, ProviderImportCount>;
1878
+ };
1879
+
1880
+ type ApiKeyActivityListOptions = ListOptions & LogWindow;
1881
+
1882
+ type ApiKeyEventType = (typeof API_KEY_EVENT_TYPES)[keyof typeof API_KEY_EVENT_TYPES];
1883
+
1884
+ type ApiKeyActivityResource = {
1885
+ object: 'api_key_event';
1886
+ id: string;
1887
+ keyId: string;
1888
+ keyName: string;
1889
+ type: ApiKeyEventType | (string & {});
1890
+ createdAt: string;
1891
+ actor: AuditActorResource | null;
1892
+ detail: Record<string, unknown>;
1893
+ };
1894
+
1895
+ type ApiKeyCreate = {
1896
+ name: string;
1897
+ scopes?: Array<ApiScope>;
1898
+ roleId?: string | null;
1899
+ addressAllowlist?: Array<string>;
1900
+ domainAllowlist?: Array<string>;
1901
+ expiresInMinutes?: number;
1902
+ };
1903
+
1904
+ type ApiKeyPatch = {
1905
+ name?: string;
1906
+ scopes?: Array<ApiScope>;
1907
+ addressAllowlist?: Array<string>;
1908
+ domainAllowlist?: Array<string>;
1909
+ enabled?: boolean;
1910
+ };
1911
+
1912
+ type ApiKeyRequestListOptions = ApiKeyActivityListOptions & {
1913
+ failedOnly?: boolean;
1914
+ };
1915
+
1916
+ type ApiKeyRequestResource = {
1917
+ object: 'api_key_request';
1918
+ id: string;
1919
+ keyId: string;
1920
+ keyName: string;
1921
+ requestId: string | null;
1922
+ method: string;
1923
+ path: string;
1924
+ status: number;
1925
+ errorCode: string | null;
1926
+ durationMs: number;
1927
+ ip: string | null;
1928
+ userAgent: string | null;
1929
+ createdAt: string;
1930
+ };
1931
+
1932
+ type ApiKeyStatus = (typeof API_KEY_STATUSES)[keyof typeof API_KEY_STATUSES];
1933
+
1934
+ type ApiKeyResource = {
1935
+ object: 'api_key';
1936
+ id: string;
1937
+ name: string;
1938
+ mode: ApiKeyMode;
1939
+ maskedKey: string;
1940
+ keyLast4: string;
1941
+ status: ApiKeyStatus;
1942
+ scopes: Array<ApiScope>;
1943
+ roleId: string | null;
1944
+ roleName: string | null;
1945
+ addressAllowlist: Array<string> | null;
1946
+ domainAllowlist: Array<string> | null;
1947
+ expiresAt: string | null;
1948
+ lastUsedAt: string | null;
1949
+ totalUses: number;
1950
+ rotatedAt: string | null;
1951
+ rotationCount: number;
1952
+ deactivatedAt: string | null;
1953
+ revokedAt: string | null;
1954
+ revokedReason: string | null;
1955
+ createdAt: string;
1956
+ createdBy: AuditActorResource | null;
1957
+ updatedAt: string;
1958
+ updatedBy: AuditActorResource | null;
1959
+ lastChangeAt: string | null;
1960
+ lastChangeType: ApiKeyEventType | (string & {}) | null;
1961
+ };
1962
+
1963
+ type ApiKeyRevoke = {
1964
+ reason?: string;
1965
+ };
1966
+
1967
+ type ApiKeyWorkspaceActivityListOptions = ApiKeyActivityListOptions & {
1968
+ keyIds?: Array<string>;
1969
+ };
1970
+
1971
+ type ApiKeyWorkspaceRequestListOptions = ApiKeyRequestListOptions & {
1972
+ keyIds?: Array<string>;
1973
+ };
1974
+
1975
+ type CreatedApiKeyResource = ApiKeyResource & {
1976
+ token: string;
697
1977
  };
698
1978
 
699
- type TranslationResource = {
700
- object: 'translation';
701
- language: LanguageResource;
702
- detectedSourceLanguage: LanguageResource | null;
703
- subject: string | null;
704
- html: string | null;
705
- text: string | null;
706
- includeOriginal: boolean;
1979
+ type DeletedApiKeyResource = {
1980
+ object: 'api_key';
1981
+ id: string;
1982
+ deleted: true;
1983
+ };
1984
+
1985
+ type RotatedApiKeyResource = ApiKeyResource & {
1986
+ token: string;
1987
+ rotationCount: number;
1988
+ rotatedAt: string;
707
1989
  };
708
1990
 
709
1991
  type DeletedLabelResource = {
@@ -717,9 +1999,37 @@ type LabelColor = {
717
1999
  textColor: string;
718
2000
  };
719
2001
 
2002
+ type LabelColorInput = {
2003
+ backgroundColor: string;
2004
+ textColor?: string;
2005
+ };
2006
+
2007
+ declare const LABEL_COLOR_KINDS: {
2008
+ readonly SOLID: "solid";
2009
+ readonly GRADIENT: "gradient";
2010
+ };
2011
+
2012
+ type LabelColorKind = (typeof LABEL_COLOR_KINDS)[keyof typeof LABEL_COLOR_KINDS];
2013
+
2014
+ type LabelColorResource = {
2015
+ object: 'label_color';
2016
+ kind: LabelColorKind;
2017
+ name: string;
2018
+ value: string;
2019
+ solid: string;
2020
+ from: string | null;
2021
+ to: string | null;
2022
+ textColor: string;
2023
+ };
2024
+
720
2025
  type LabelInput = {
721
2026
  name: string;
722
- color?: LabelColor;
2027
+ color?: LabelColorInput;
2028
+ };
2029
+
2030
+ type LabelPatch = {
2031
+ name?: string;
2032
+ color?: LabelColorInput | null;
723
2033
  };
724
2034
 
725
2035
  type LabelResource = {
@@ -728,12 +2038,9 @@ type LabelResource = {
728
2038
  name: string;
729
2039
  type: string;
730
2040
  color: LabelColor | null;
731
- };
732
-
733
- type SavedLabelResource = {
734
- object: 'label';
735
- id: string | null;
736
- name: string;
2041
+ threadCount: number;
2042
+ createdAt: string | null;
2043
+ updatedAt: string | null;
737
2044
  };
738
2045
 
739
2046
  type KeyResource = {
@@ -745,6 +2052,7 @@ type KeyResource = {
745
2052
  grantedScopes: Array<ApiScope>;
746
2053
  workspaceId: string;
747
2054
  addressAllowlist: Array<string> | null;
2055
+ domainAllowlist: Array<string> | null;
748
2056
  };
749
2057
 
750
2058
  type PingResource = {
@@ -757,12 +2065,24 @@ type PingResource = {
757
2065
  workspaceId: string;
758
2066
  };
759
2067
 
760
- type MemberAccess = 'member' | 'viewer';
2068
+ type RotatedKeyResource = KeyResource & {
2069
+ token: string;
2070
+ rotationCount: number;
2071
+ rotatedAt: string;
2072
+ };
2073
+
2074
+ declare const MEMBER_ACCESS_LEVELS: {
2075
+ readonly MEMBER: "member";
2076
+ readonly VIEWER: "viewer";
2077
+ };
2078
+
2079
+ type MemberAccess = (typeof MEMBER_ACCESS_LEVELS)[keyof typeof MEMBER_ACCESS_LEVELS];
761
2080
 
762
2081
  type MemberAdd = {
763
2082
  email: string;
764
2083
  roleId: string;
765
2084
  addressIds?: Array<string>;
2085
+ domainIds?: Array<string>;
766
2086
  access?: MemberAccess;
767
2087
  };
768
2088
 
@@ -777,6 +2097,31 @@ type MemberAddressResource = {
777
2097
  access: MemberAccess;
778
2098
  };
779
2099
 
2100
+ type MemberDomainResource = {
2101
+ domainId: string;
2102
+ domain: string;
2103
+ access: MemberAccess;
2104
+ };
2105
+
2106
+ type InvitationResource = {
2107
+ object: 'invitation';
2108
+ id: string;
2109
+ email: string;
2110
+ role: {
2111
+ id: string;
2112
+ name: string;
2113
+ builtin: BuiltinRole | null;
2114
+ };
2115
+ addresses: Array<MemberAddressResource>;
2116
+ domains: Array<MemberDomainResource>;
2117
+ expiresAt: string;
2118
+ expired: boolean;
2119
+ lastSentAt: string;
2120
+ delivered: boolean | null;
2121
+ deliveryError: string | null;
2122
+ createdAt: string;
2123
+ };
2124
+
780
2125
  type MemberPatch = {
781
2126
  roleId: string;
782
2127
  };
@@ -787,6 +2132,7 @@ type MemberResource = {
787
2132
  email: string;
788
2133
  name: string | null;
789
2134
  image: string | null;
2135
+ isOwner: boolean;
790
2136
  role: {
791
2137
  id: string | null;
792
2138
  name: string;
@@ -795,6 +2141,7 @@ type MemberResource = {
795
2141
  implied: boolean;
796
2142
  permissions: Array<Permission>;
797
2143
  addresses: Array<MemberAddressResource>;
2144
+ domains: Array<MemberDomainResource>;
798
2145
  createdAt: string | null;
799
2146
  };
800
2147
 
@@ -805,6 +2152,13 @@ type RemovedMemberResource = {
805
2152
  addressesRevoked: number;
806
2153
  };
807
2154
 
2155
+ type RevokedInvitationResource = {
2156
+ object: 'invitation';
2157
+ id: string;
2158
+ email: string;
2159
+ revoked: true;
2160
+ };
2161
+
808
2162
  type DeletedRoleResource = {
809
2163
  object: 'role';
810
2164
  id: string;
@@ -858,20 +2212,73 @@ type DeletedRuleResource = {
858
2212
  deleted: true;
859
2213
  };
860
2214
 
861
- declare const RULE_FIELDS: readonly ["from", "from_domain", "envelope_from", "to", "cc", "bcc", "recipient", "reply_to", "delivered_to", "subject", "body", "header", "list_id", "attachment_name", "attachment_type", "has_attachment", "attachment_size", "message_size", "spam", "hour", "weekday"];
862
- declare const RULE_OPERATORS: readonly ["matches", "contains", "equals", "starts_with", "ends_with", "gt", "lt"];
863
- declare const RULE_ACTIONS: readonly ["label", "remove_label", "archive", "mark_read", "star", "spam", "trash", "forward", "reply", "block_sender", "reject"];
864
-
865
- type RuleActionType = (typeof RULE_ACTIONS)[number];
2215
+ declare const RULE_FIELDS: {
2216
+ readonly FROM: "from";
2217
+ readonly FROM_DOMAIN: "from_domain";
2218
+ readonly ENVELOPE_FROM: "envelope_from";
2219
+ readonly TO: "to";
2220
+ readonly CC: "cc";
2221
+ readonly BCC: "bcc";
2222
+ readonly RECIPIENT: "recipient";
2223
+ readonly REPLY_TO: "reply_to";
2224
+ readonly DELIVERED_TO: "delivered_to";
2225
+ readonly SUBJECT: "subject";
2226
+ readonly BODY: "body";
2227
+ readonly HEADER: "header";
2228
+ readonly LIST_ID: "list_id";
2229
+ readonly ATTACHMENT_NAME: "attachment_name";
2230
+ readonly ATTACHMENT_TYPE: "attachment_type";
2231
+ readonly HAS_ATTACHMENT: "has_attachment";
2232
+ readonly ATTACHMENT_SIZE: "attachment_size";
2233
+ readonly MESSAGE_SIZE: "message_size";
2234
+ readonly SPAM: "spam";
2235
+ readonly HOUR: "hour";
2236
+ readonly WEEKDAY: "weekday";
2237
+ };
2238
+ declare const RULE_OPERATORS: {
2239
+ readonly MATCHES: "matches";
2240
+ readonly CONTAINS: "contains";
2241
+ readonly EQUALS: "equals";
2242
+ readonly STARTS_WITH: "starts_with";
2243
+ readonly ENDS_WITH: "ends_with";
2244
+ readonly GT: "gt";
2245
+ readonly LT: "lt";
2246
+ };
2247
+ declare const RULE_ACTIONS: {
2248
+ readonly LABEL: "label";
2249
+ readonly REMOVE_LABEL: "remove_label";
2250
+ readonly ARCHIVE: "archive";
2251
+ readonly MARK_READ: "mark_read";
2252
+ readonly STAR: "star";
2253
+ readonly SPAM: "spam";
2254
+ readonly TRASH: "trash";
2255
+ readonly FORWARD: "forward";
2256
+ readonly REPLY: "reply";
2257
+ readonly BLOCK_SENDER: "block_sender";
2258
+ readonly REJECT: "reject";
2259
+ };
2260
+ declare const RULE_MATCH_MODES: {
2261
+ readonly ALL: "all";
2262
+ readonly ANY: "any";
2263
+ };
2264
+ declare const RULE_TEST_WARNING_CODES: {
2265
+ readonly FORWARD_UNVERIFIED: "forward_unverified";
2266
+ readonly FIELD_UNEVALUABLE: "field_unevaluable";
2267
+ readonly FIELD_APPROXIMATE: "field_approximate";
2268
+ readonly FORWARD_LOOP: "forward_loop";
2269
+ readonly BODY_ENCRYPTED: "body_encrypted";
2270
+ };
2271
+
2272
+ type RuleActionType = (typeof RULE_ACTIONS)[keyof typeof RULE_ACTIONS];
866
2273
 
867
2274
  type RuleAction = {
868
2275
  type: RuleActionType;
869
2276
  value?: string;
870
2277
  };
871
2278
 
872
- type RuleField = (typeof RULE_FIELDS)[number];
2279
+ type RuleField = (typeof RULE_FIELDS)[keyof typeof RULE_FIELDS];
873
2280
 
874
- type RuleOperator = (typeof RULE_OPERATORS)[number];
2281
+ type RuleOperator = (typeof RULE_OPERATORS)[keyof typeof RULE_OPERATORS];
875
2282
 
876
2283
  type RuleCondition = {
877
2284
  field: RuleField;
@@ -887,11 +2294,13 @@ type RuleConditionInput = Partial<RuleCondition> & {
887
2294
  value: string;
888
2295
  };
889
2296
 
2297
+ type RuleMatchMode = (typeof RULE_MATCH_MODES)[keyof typeof RULE_MATCH_MODES];
2298
+
890
2299
  type RuleCreate = {
891
2300
  name: string;
892
2301
  description?: string | null;
893
2302
  enabled?: boolean;
894
- match?: 'all' | 'any';
2303
+ match?: RuleMatchMode;
895
2304
  conditions: Array<RuleConditionInput>;
896
2305
  actions: Array<RuleAction>;
897
2306
  stopProcessing?: boolean;
@@ -905,7 +2314,7 @@ type RulePatch = {
905
2314
  name?: string;
906
2315
  description?: string | null;
907
2316
  enabled?: boolean;
908
- match?: 'all' | 'any';
2317
+ match?: RuleMatchMode;
909
2318
  conditions?: Array<RuleConditionInput>;
910
2319
  actions?: Array<RuleAction>;
911
2320
  stopProcessing?: boolean;
@@ -919,7 +2328,7 @@ type RuleResource = {
919
2328
  description: string | null;
920
2329
  enabled: boolean;
921
2330
  position: number;
922
- match: 'all' | 'any';
2331
+ match: RuleMatchMode;
923
2332
  conditions: Array<RuleCondition>;
924
2333
  actions: Array<RuleAction>;
925
2334
  stopProcessing: boolean;
@@ -954,6 +2363,8 @@ type RuleTestInput = {
954
2363
  limit?: number;
955
2364
  };
956
2365
 
2366
+ type RuleTestWarningCode = (typeof RULE_TEST_WARNING_CODES)[keyof typeof RULE_TEST_WARNING_CODES];
2367
+
957
2368
  type RuleTestResource = {
958
2369
  object: 'rule_test';
959
2370
  ruleId: string;
@@ -967,11 +2378,15 @@ type RuleTestResource = {
967
2378
  receivedAt: string | null;
968
2379
  }>;
969
2380
  warnings: Array<{
970
- code: 'forward_unverified' | 'field_unevaluable' | 'field_approximate' | 'forward_loop' | 'body_encrypted' | (string & {});
2381
+ code: RuleTestWarningCode | (string & {});
971
2382
  value: string;
972
2383
  }>;
973
2384
  };
974
2385
 
2386
+ type SettingsOptions = RequestScope & {
2387
+ address?: string;
2388
+ };
2389
+
975
2390
  type SettingsPatch = {
976
2391
  signature?: string;
977
2392
  openEmailSignature?: boolean;
@@ -984,6 +2399,7 @@ type SettingsPatch = {
984
2399
 
985
2400
  type SettingsResource = {
986
2401
  object: 'settings';
2402
+ address: string | null;
987
2403
  signature: string;
988
2404
  openEmailSignature: boolean;
989
2405
  timezone: string;
@@ -994,12 +2410,53 @@ type SettingsResource = {
994
2410
  [key: string]: unknown;
995
2411
  };
996
2412
 
2413
+ type RemovedSuppressionResource = {
2414
+ object: 'suppression';
2415
+ id: string;
2416
+ email: string;
2417
+ deleted: true;
2418
+ };
2419
+
2420
+ type SuppressionAdd = {
2421
+ email: string;
2422
+ };
2423
+
2424
+ declare const SUPPRESSION_REASONS: {
2425
+ readonly BOUNCE: "bounce";
2426
+ readonly COMPLAINT: "complaint";
2427
+ readonly MANUAL: "manual";
2428
+ };
2429
+
2430
+ type SuppressionReason = (typeof SUPPRESSION_REASONS)[keyof typeof SUPPRESSION_REASONS];
2431
+
2432
+ type SuppressionListOptions = ListOptions & {
2433
+ q?: string;
2434
+ reason?: SuppressionReason;
2435
+ };
2436
+
2437
+ type SuppressionResource = {
2438
+ object: 'suppression';
2439
+ id: string;
2440
+ email: string;
2441
+ reason: SuppressionReason;
2442
+ detail: string | null;
2443
+ removable: boolean;
2444
+ createdAt: string;
2445
+ };
2446
+
997
2447
  type DeletedTemplateResource = {
998
2448
  object: 'template';
999
2449
  id: string;
1000
2450
  deleted: true;
1001
2451
  };
1002
2452
 
2453
+ type DeletedTemplateVersionResource = {
2454
+ object: 'template_version';
2455
+ templateId: string;
2456
+ version: number;
2457
+ deleted: true;
2458
+ };
2459
+
1003
2460
  type SentTemplateEmailResource = SentEmailResource & {
1004
2461
  template: {
1005
2462
  id: string;
@@ -1007,9 +2464,155 @@ type SentTemplateEmailResource = SentEmailResource & {
1007
2464
  };
1008
2465
  };
1009
2466
 
1010
- type TemplateEngine = 'blocks' | 'html';
2467
+ type TemplateAnalyticsOptions = RequestScope & {
2468
+ days?: number;
2469
+ minutes?: number;
2470
+ grain?: TrackingGrain;
2471
+ offsetMinutes?: number;
2472
+ };
2473
+
2474
+ type TemplateAnalyticsResource = {
2475
+ object: 'template_analytics';
2476
+ templateId: string;
2477
+ sends: number;
2478
+ matched: number;
2479
+ trackedForOpens: number;
2480
+ trackedForClicks: number;
2481
+ opened: number;
2482
+ clicked: number;
2483
+ openRate: number;
2484
+ clickRate: number;
2485
+ totalOpens: number;
2486
+ totalClicks: number;
2487
+ bySource: Array<{
2488
+ source: string;
2489
+ sends: number;
2490
+ }>;
2491
+ byDay: Array<{
2492
+ day: string;
2493
+ sent: number;
2494
+ trackedForOpens: number;
2495
+ trackedForClicks: number;
2496
+ opened: number;
2497
+ clicked: number;
2498
+ }>;
2499
+ byVersion: Array<{
2500
+ version: number;
2501
+ sends: number;
2502
+ trackedForOpens: number;
2503
+ trackedForClicks: number;
2504
+ opened: number;
2505
+ clicked: number;
2506
+ }>;
2507
+ recent: Array<{
2508
+ id: string;
2509
+ version: number;
2510
+ source: string;
2511
+ createdAt: string;
2512
+ matched: boolean;
2513
+ opens: boolean;
2514
+ clicks: boolean;
2515
+ openCount: number;
2516
+ clickCount: number;
2517
+ }>;
2518
+ lifetime: {
2519
+ sends: number;
2520
+ testSends: number;
2521
+ firstAt: string | null;
2522
+ lastAt: string | null;
2523
+ };
2524
+ };
2525
+
2526
+ declare const TEMPLATE_ENGINES: {
2527
+ readonly BLOCKS: "blocks";
2528
+ readonly HTML: "html";
2529
+ };
2530
+ declare const TEMPLATE_STATUSES: {
2531
+ readonly DRAFT: "draft";
2532
+ readonly ACTIVE: "active";
2533
+ readonly ARCHIVED: "archived";
2534
+ };
2535
+ declare const TEMPLATE_CATEGORIES: {
2536
+ readonly ACCOUNT: "account";
2537
+ readonly COMMERCE: "commerce";
2538
+ readonly NOTIFY: "notify";
2539
+ readonly MARKETING: "marketing";
2540
+ };
2541
+ declare const TEMPLATE_SORTS: {
2542
+ readonly UPDATED_NEWEST: "updated-newest";
2543
+ readonly UPDATED_OLDEST: "updated-oldest";
2544
+ readonly CREATED_NEWEST: "created-newest";
2545
+ readonly CREATED_OLDEST: "created-oldest";
2546
+ readonly NAME: "name";
2547
+ readonly NAME_REVERSED: "name-reversed";
2548
+ };
2549
+ declare const TEMPLATE_BLOCK_KINDS: {
2550
+ readonly SECTION: "Section";
2551
+ readonly ROW: "Row";
2552
+ readonly COLUMN: "Column";
2553
+ readonly CONTAINER: "Container";
2554
+ readonly TEXT: "Text";
2555
+ readonly HEADING: "Heading";
2556
+ readonly BUTTON: "Button";
2557
+ readonly LINK: "Link";
2558
+ readonly IMG: "Img";
2559
+ readonly HR: "Hr";
2560
+ readonly MARKDOWN: "Markdown";
2561
+ readonly CODE_BLOCK: "CodeBlock";
2562
+ readonly CODE_INLINE: "CodeInline";
2563
+ };
2564
+ declare const TEMPLATE_FONT_FORMATS: {
2565
+ readonly WOFF2: "woff2";
2566
+ readonly WOFF: "woff";
2567
+ readonly TRUETYPE: "truetype";
2568
+ readonly OPENTYPE: "opentype";
2569
+ readonly EMBEDDED_OPENTYPE: "embedded-opentype";
2570
+ readonly SVG: "svg";
2571
+ };
2572
+ declare const TEMPLATE_FONT_STYLES: {
2573
+ readonly NORMAL: "normal";
2574
+ readonly ITALIC: "italic";
2575
+ readonly OBLIQUE: "oblique";
2576
+ };
2577
+ declare const TEMPLATE_VALUE_KINDS: {
2578
+ readonly TEXT: "text";
2579
+ readonly URL: "url";
2580
+ readonly IMAGE: "image";
2581
+ };
2582
+ declare const TEMPLATE_VERSION_STATES: {
2583
+ readonly DRAFT: "draft";
2584
+ readonly PUBLISHED: "published";
2585
+ };
2586
+ declare const TEMPLATE_PREVIEW_WARNING_CODES: {
2587
+ readonly UNFILLED_PLACEHOLDER: "unfilled_placeholder";
2588
+ };
2589
+
2590
+ type TemplateBlockKind = (typeof TEMPLATE_BLOCK_KINDS)[keyof typeof TEMPLATE_BLOCK_KINDS];
2591
+
2592
+ type TemplateBlock = {
2593
+ kind: TemplateBlockKind;
2594
+ children?: Array<TemplateBlock>;
2595
+ [field: string]: unknown;
2596
+ };
2597
+
2598
+ type TemplateCategory = (typeof TEMPLATE_CATEGORIES)[keyof typeof TEMPLATE_CATEGORIES];
2599
+
2600
+ type TemplateFontFormat = (typeof TEMPLATE_FONT_FORMATS)[keyof typeof TEMPLATE_FONT_FORMATS];
2601
+
2602
+ type TemplateFontStyle = (typeof TEMPLATE_FONT_STYLES)[keyof typeof TEMPLATE_FONT_STYLES];
2603
+
2604
+ type TemplateFont = {
2605
+ fontFamily: string;
2606
+ fallbackFontFamily: string;
2607
+ webFont?: {
2608
+ url: string;
2609
+ format: TemplateFontFormat;
2610
+ };
2611
+ fontWeight?: string | number;
2612
+ fontStyle?: TemplateFontStyle;
2613
+ };
1011
2614
 
1012
- type TemplateValueKind = 'text' | 'url' | 'image';
2615
+ type TemplateValueKind = (typeof TEMPLATE_VALUE_KINDS)[keyof typeof TEMPLATE_VALUE_KINDS];
1013
2616
 
1014
2617
  type TemplateProp = {
1015
2618
  key: string;
@@ -1026,10 +2629,23 @@ type TemplateSlot = {
1026
2629
  default: string;
1027
2630
  };
1028
2631
 
2632
+ type TemplateDocument = {
2633
+ body: Array<TemplateBlock>;
2634
+ preview?: string;
2635
+ tailwind?: boolean;
2636
+ fonts?: Array<TemplateFont>;
2637
+ style?: Record<string, string | number>;
2638
+ slots?: Array<TemplateSlot>;
2639
+ props?: Array<TemplateProp>;
2640
+ [setting: string]: unknown;
2641
+ };
2642
+
2643
+ type TemplateEngine = (typeof TEMPLATE_ENGINES)[keyof typeof TEMPLATE_ENGINES];
2644
+
1029
2645
  type TemplateContent = {
1030
2646
  engine?: TemplateEngine;
1031
2647
  subject?: string;
1032
- document?: Record<string, unknown>;
2648
+ document?: TemplateDocument;
1033
2649
  html?: string;
1034
2650
  slots?: Array<Partial<TemplateSlot> & {
1035
2651
  key: string;
@@ -1039,14 +2655,21 @@ type TemplateContent = {
1039
2655
  }>;
1040
2656
  };
1041
2657
 
2658
+ type TemplateContentSource = {
2659
+ starter?: string;
2660
+ fromTemplateId?: string;
2661
+ expectedVersion?: number;
2662
+ };
2663
+
1042
2664
  type TemplateCreate = TemplateContent & {
1043
2665
  name: string;
1044
2666
  slug?: string;
1045
2667
  description?: string | null;
1046
2668
  publish?: boolean;
2669
+ starter?: string;
1047
2670
  };
1048
2671
 
1049
- type TemplateStatus = 'draft' | 'active' | 'archived';
2672
+ type TemplateStatus = (typeof TEMPLATE_STATUSES)[keyof typeof TEMPLATE_STATUSES];
1050
2673
 
1051
2674
  type TemplateResource = {
1052
2675
  object: 'template';
@@ -1065,17 +2688,19 @@ type TemplateResource = {
1065
2688
  updatedAt: string;
1066
2689
  };
1067
2690
 
2691
+ type TemplateVersionState = (typeof TEMPLATE_VERSION_STATES)[keyof typeof TEMPLATE_VERSION_STATES];
2692
+
1068
2693
  type TemplateVersionResource = {
1069
2694
  object: 'template_version';
1070
2695
  id: string;
1071
2696
  templateId: string;
1072
2697
  version: number;
1073
- state: 'draft' | 'published';
2698
+ state: TemplateVersionState;
1074
2699
  engine: TemplateEngine;
1075
2700
  subject: string;
1076
2701
  slots: Array<TemplateSlot>;
1077
2702
  props: Array<TemplateProp>;
1078
- document?: Record<string, unknown> | null;
2703
+ document?: TemplateDocument | null;
1079
2704
  html?: string | null;
1080
2705
  publishedAt: string | null;
1081
2706
  createdAt: string;
@@ -1086,14 +2711,33 @@ type TemplateDetailResource = TemplateResource & {
1086
2711
  latest: TemplateVersionResource;
1087
2712
  };
1088
2713
 
2714
+ type TemplateDuplicate = {
2715
+ name?: string;
2716
+ };
2717
+
2718
+ type TemplateFontResource = {
2719
+ object: 'template_font';
2720
+ family: string;
2721
+ fallback: string;
2722
+ stack: string;
2723
+ weight: string;
2724
+ format: TemplateFontFormat;
2725
+ url: string;
2726
+ };
2727
+
2728
+ type TemplateSort = (typeof TEMPLATE_SORTS)[keyof typeof TEMPLATE_SORTS];
2729
+
1089
2730
  type TemplateListOptions = ListOptions & {
1090
2731
  status?: TemplateStatus;
2732
+ search?: string;
2733
+ sort?: TemplateSort;
1091
2734
  };
1092
2735
 
1093
2736
  type TemplatePatch = TemplateContent & {
1094
2737
  name?: string;
2738
+ slug?: string;
1095
2739
  description?: string | null;
1096
- status?: 'active' | 'archived';
2740
+ status?: typeof TEMPLATE_STATUSES.ACTIVE | typeof TEMPLATE_STATUSES.ARCHIVED;
1097
2741
  expectedVersion?: number;
1098
2742
  };
1099
2743
 
@@ -1103,6 +2747,8 @@ type TemplatePreviewInput = {
1103
2747
  slots?: Record<string, unknown>;
1104
2748
  };
1105
2749
 
2750
+ type TemplatePreviewWarningCode = (typeof TEMPLATE_PREVIEW_WARNING_CODES)[keyof typeof TEMPLATE_PREVIEW_WARNING_CODES];
2751
+
1106
2752
  type TemplatePreviewResource = {
1107
2753
  object: 'template_preview';
1108
2754
  templateId: string;
@@ -1111,11 +2757,38 @@ type TemplatePreviewResource = {
1111
2757
  html: string;
1112
2758
  text: string;
1113
2759
  warnings: Array<{
1114
- code: 'unfilled_placeholder' | (string & {});
2760
+ code: TemplatePreviewWarningCode | (string & {});
2761
+ key: string;
2762
+ }>;
2763
+ };
2764
+
2765
+ type TemplateRenderInput = TemplateContent & {
2766
+ mark?: boolean;
2767
+ values?: {
2768
+ props?: Record<string, unknown>;
2769
+ slots?: Record<string, unknown>;
2770
+ };
2771
+ };
2772
+
2773
+ type TemplateRenderResource = {
2774
+ object: 'template_render';
2775
+ subject: string;
2776
+ html: string;
2777
+ text: string;
2778
+ warnings: Array<{
2779
+ code: TemplatePreviewWarningCode | (string & {});
1115
2780
  key: string;
1116
2781
  }>;
1117
2782
  };
1118
2783
 
2784
+ type TemplateRestoreInput = {
2785
+ expectedVersion?: number;
2786
+ };
2787
+
2788
+ type TemplateRestoredResource = TemplateDetailResource & {
2789
+ restoredFrom: number;
2790
+ };
2791
+
1119
2792
  type TemplateSend = {
1120
2793
  from: RecipientInput;
1121
2794
  to: RecipientInput | Array<RecipientInput>;
@@ -1133,6 +2806,55 @@ type TemplateSend = {
1133
2806
  translate?: SendTranslateOptions;
1134
2807
  };
1135
2808
 
2809
+ type TemplateSendListOptions = TemplateAnalyticsOptions & {
2810
+ page?: number;
2811
+ pageSize?: number;
2812
+ search?: string;
2813
+ source?: string;
2814
+ version?: number;
2815
+ opened?: boolean;
2816
+ clicked?: boolean;
2817
+ tracked?: boolean;
2818
+ };
2819
+
2820
+ type TemplateSendResource = {
2821
+ object: 'template_send';
2822
+ id: string;
2823
+ version: number;
2824
+ source: string;
2825
+ subject: string;
2826
+ createdAt: string;
2827
+ recipients: Array<string>;
2828
+ matched: boolean;
2829
+ opens: boolean;
2830
+ clicks: boolean;
2831
+ openCount: number;
2832
+ clickCount: number;
2833
+ };
2834
+
2835
+ type TemplateSendsResource = {
2836
+ items: Array<TemplateSendResource>;
2837
+ total: number;
2838
+ page: number;
2839
+ pageSize: number;
2840
+ };
2841
+
2842
+ type TemplateStarterResource = {
2843
+ object: 'template_starter';
2844
+ slug: string;
2845
+ name: string;
2846
+ description: string;
2847
+ category: TemplateCategory;
2848
+ subject: string;
2849
+ slots: Array<TemplateSlot>;
2850
+ props: Array<TemplateProp>;
2851
+ };
2852
+
2853
+ type TemplateStarterDetailResource = TemplateStarterResource & {
2854
+ document: TemplateDocument;
2855
+ preview: string;
2856
+ };
2857
+
1136
2858
  type TempInboxResource = {
1137
2859
  object: 'temp_inbox';
1138
2860
  id: string;
@@ -1197,10 +2919,13 @@ type TempMessageDetailResource = TempMessageResource & {
1197
2919
 
1198
2920
  type TempMessageListOptions = InboxScope & {
1199
2921
  limit?: number;
2922
+ cursor?: string;
1200
2923
  };
1201
2924
 
1202
2925
  type TempMessagesResource = {
1203
2926
  items: Array<TempMessageResource>;
2927
+ hasMore: boolean;
2928
+ nextCursor: string | null;
1204
2929
  expiresAt: string;
1205
2930
  };
1206
2931
 
@@ -1210,10 +2935,23 @@ type SnoozedThreadResource = {
1210
2935
  snoozedUntil: string | null;
1211
2936
  };
1212
2937
 
2938
+ declare const THREAD_SORTS: {
2939
+ readonly NEWEST: "newest";
2940
+ readonly OLDEST: "oldest";
2941
+ readonly SENDER: "sender";
2942
+ readonly SUBJECT: "subject";
2943
+ };
2944
+
2945
+ type ThreadSort = (typeof THREAD_SORTS)[keyof typeof THREAD_SORTS];
2946
+
1213
2947
  type ThreadListOptions = ListOptions & {
1214
2948
  folder?: string;
1215
2949
  query?: string;
1216
2950
  labelIds?: string | Array<string>;
2951
+ sort?: ThreadSort;
2952
+ dateFrom?: Date | string;
2953
+ dateTo?: Date | string;
2954
+ fromContacts?: boolean;
1217
2955
  };
1218
2956
 
1219
2957
  type ThreadPatch = {
@@ -1277,20 +3015,16 @@ type TrackingClickResource = Omit<TrackingOpenResource, 'object'> & {
1277
3015
  url: string;
1278
3016
  };
1279
3017
 
1280
- type TrackingGrain = 'minute' | 'hour' | 'day';
1281
-
1282
- type TrackingHitOptions = RequestScope & {
3018
+ type TrackingHitOptions = ListOptions & {
1283
3019
  includeMachine?: boolean;
1284
- limit?: number;
1285
3020
  };
1286
3021
 
1287
- type TrackingListOptions = RequestScope & {
3022
+ type TrackingListOptions = ListOptions & {
1288
3023
  opened?: boolean;
1289
3024
  clicked?: boolean;
1290
3025
  days?: number;
1291
3026
  minutes?: number;
1292
3027
  grain?: TrackingGrain;
1293
- limit?: number;
1294
3028
  };
1295
3029
 
1296
3030
  type TrackingResource = TrackingSummary & {
@@ -1323,7 +3057,6 @@ type TrackingStatsResource = {
1323
3057
  opened: number;
1324
3058
  clicked: number;
1325
3059
  }>;
1326
- hitsKnownFrom: string;
1327
3060
  topLinks: Array<{
1328
3061
  url: string;
1329
3062
  label: string | null;
@@ -1339,9 +3072,54 @@ type TrackingStatsResource = {
1339
3072
  }>;
1340
3073
  };
1341
3074
 
1342
- declare const WEBHOOK_EVENTS: readonly ["email.received", "email.sent", "email.failed", "email.cancelled", "email.scheduled", "email.queued", "email.bounced", "email.complained", "email.opened", "email.clicked"];
1343
-
1344
- type WebhookEvent = (typeof WEBHOOK_EVENTS)[number];
3075
+ declare const WEBHOOK_EVENTS: {
3076
+ readonly EMAIL_RECEIVED: "email.received";
3077
+ readonly EMAIL_REPLIED: "email.replied";
3078
+ readonly EMAIL_SENT: "email.sent";
3079
+ readonly EMAIL_FAILED: "email.failed";
3080
+ readonly EMAIL_CANCELLED: "email.cancelled";
3081
+ readonly EMAIL_SCHEDULED: "email.scheduled";
3082
+ readonly EMAIL_QUEUED: "email.queued";
3083
+ readonly EMAIL_DELIVERED: "email.delivered";
3084
+ readonly EMAIL_DELIVERY_DELAYED: "email.delivery_delayed";
3085
+ readonly EMAIL_BOUNCED: "email.bounced";
3086
+ readonly EMAIL_COMPLAINED: "email.complained";
3087
+ readonly EMAIL_SUPPRESSED: "email.suppressed";
3088
+ readonly EMAIL_OPENED: "email.opened";
3089
+ readonly EMAIL_CLICKED: "email.clicked";
3090
+ readonly EMAIL_DOWNLOADED: "email.downloaded";
3091
+ readonly DOMAIN_VERIFIED: "domain.verified";
3092
+ readonly DOMAIN_SENDING_CHANGED: "domain.sending_changed";
3093
+ readonly DOMAIN_DELETED: "domain.deleted";
3094
+ readonly SUPPRESSION_ADDED: "suppression.added";
3095
+ readonly SUPPRESSION_REMOVED: "suppression.removed";
3096
+ };
3097
+ declare const WEBHOOK_DELIVERY_STATUSES: {
3098
+ readonly DELIVERED: "delivered";
3099
+ readonly FAILED: "failed";
3100
+ };
3101
+ declare const WEBHOOK_CHANGE_TYPES: {
3102
+ readonly CREATED: "created";
3103
+ readonly UPDATED: "updated";
3104
+ readonly ENABLED: "enabled";
3105
+ readonly DISABLED: "disabled";
3106
+ readonly AUTO_DISABLED: "auto_disabled";
3107
+ readonly SECRET_ROTATED: "secret_rotated";
3108
+ readonly TESTED: "tested";
3109
+ readonly REPLAYED: "replayed";
3110
+ readonly REMOVED: "removed";
3111
+ };
3112
+ declare const WEBHOOK_REPLAY_ERROR_CODES: {
3113
+ readonly RESOURCE_NOT_FOUND: "resource_not_found";
3114
+ readonly WEBHOOK_DISABLED: "webhook_disabled";
3115
+ readonly EVENT_NOT_SUBSCRIBED: "event_not_subscribed";
3116
+ readonly EVENT_OUT_OF_SCOPE: "event_out_of_scope";
3117
+ readonly DELIVERY_NOT_REPLAYABLE: "delivery_not_replayable";
3118
+ readonly RETRY_IN_PROGRESS: "retry_in_progress";
3119
+ readonly REPLAY_IN_PROGRESS: "replay_in_progress";
3120
+ };
3121
+
3122
+ type WebhookEvent = (typeof WEBHOOK_EVENTS)[keyof typeof WEBHOOK_EVENTS];
1345
3123
 
1346
3124
  type WebhookResource = {
1347
3125
  object: 'webhook';
@@ -1353,6 +3131,8 @@ type WebhookResource = {
1353
3131
  disabledAt: string | null;
1354
3132
  disabledReason: string | null;
1355
3133
  consecutiveFailures: number;
3134
+ addressAllowlist: Array<string>;
3135
+ domainAllowlist: Array<string>;
1356
3136
  lastDeliveryAt: string | null;
1357
3137
  createdAt: string;
1358
3138
  };
@@ -1394,6 +3174,19 @@ type EmailClickedData = Omit<EmailOpenedData, 'openCount' | 'openedAt'> & {
1394
3174
  clickedAt: string;
1395
3175
  };
1396
3176
 
3177
+ type EmailDownloadedData = Omit<EmailOpenedData, 'recipient' | 'attributed' | 'openCount' | 'openedAt'> & {
3178
+ recipient: null;
3179
+ attributed: false;
3180
+ shareId: string;
3181
+ fileId: string | null;
3182
+ filename: string;
3183
+ mimeType: string;
3184
+ sizeBytes: number;
3185
+ url: string;
3186
+ downloadCount: number;
3187
+ downloadedAt: string;
3188
+ };
3189
+
1397
3190
  type WebhookSignatureHeaders = Record<string, string | Array<string> | undefined>;
1398
3191
 
1399
3192
  type VerifyWebhookProps = {
@@ -1403,21 +3196,86 @@ type VerifyWebhookProps = {
1403
3196
  toleranceSeconds?: number;
1404
3197
  };
1405
3198
 
3199
+ type WebhookActivityListOptions = ListOptions & LogWindow;
3200
+
3201
+ type WebhookChangeType = (typeof WEBHOOK_CHANGE_TYPES)[keyof typeof WEBHOOK_CHANGE_TYPES];
3202
+
3203
+ type WebhookActivityResource = {
3204
+ object: 'webhook_event';
3205
+ id: string;
3206
+ endpointId: string;
3207
+ endpointLabel: string;
3208
+ type: WebhookChangeType | (string & {});
3209
+ createdAt: string;
3210
+ actor: AuditActorResource | null;
3211
+ detail: Record<string, unknown>;
3212
+ };
3213
+
1406
3214
  type WebhookCreate = {
1407
3215
  url: string;
1408
3216
  eventTypes?: Array<WebhookEvent>;
1409
3217
  description?: string;
3218
+ addressAllowlist?: Array<string>;
3219
+ domainAllowlist?: Array<string>;
3220
+ };
3221
+
3222
+ type WebhookDeliveryStatus = (typeof WEBHOOK_DELIVERY_STATUSES)[keyof typeof WEBHOOK_DELIVERY_STATUSES];
3223
+
3224
+ type WebhookDeliveryAttempt = {
3225
+ id: string;
3226
+ attempt: number | null;
3227
+ maxAttempts: number | null;
3228
+ status: WebhookDeliveryStatus | (string & {});
3229
+ responseCode: number | null;
3230
+ durationMs: number | null;
3231
+ error: string | null;
3232
+ createdAt: string;
3233
+ };
3234
+
3235
+ type WebhookPayload<T = Record<string, unknown>> = {
3236
+ id: string;
3237
+ type: WebhookEvent | (string & {});
3238
+ createdAt: string;
3239
+ data: T;
3240
+ };
3241
+
3242
+ type WebhookReplayErrorCode = (typeof WEBHOOK_REPLAY_ERROR_CODES)[keyof typeof WEBHOOK_REPLAY_ERROR_CODES];
3243
+
3244
+ type WebhookReplayRefusal = {
3245
+ code: WebhookReplayErrorCode | (string & {});
3246
+ message: string;
3247
+ };
3248
+
3249
+ type WebhookDeliveryDetailResource = WebhookDeliveryAttempt & {
3250
+ object: 'webhook_delivery';
3251
+ endpointId: string;
3252
+ eventType: WebhookEvent | (string & {});
3253
+ eventId: string | null;
3254
+ nextAttemptAt: string | null;
3255
+ payload: WebhookPayload | null;
3256
+ responseBody: string | null;
3257
+ attempts: Array<WebhookDeliveryAttempt>;
3258
+ replayRefusal: WebhookReplayRefusal | null;
3259
+ };
3260
+
3261
+ type WebhookDeliveryListOptions = ListOptions & LogWindow & {
3262
+ status?: WebhookDeliveryStatus;
1410
3263
  };
1411
3264
 
1412
3265
  type WebhookDeliveryResource = {
1413
3266
  object: 'webhook_delivery';
1414
3267
  id: string;
3268
+ endpointId: string;
1415
3269
  eventType: WebhookEvent | (string & {});
1416
- status: 'delivered' | 'failed' | (string & {});
3270
+ eventId: string | null;
3271
+ status: WebhookDeliveryStatus | (string & {});
1417
3272
  responseCode: number | null;
1418
3273
  durationMs: number | null;
3274
+ attempt: number | null;
3275
+ maxAttempts: number | null;
1419
3276
  error: string | null;
1420
3277
  createdAt: string;
3278
+ nextAttemptAt: string | null;
1421
3279
  };
1422
3280
 
1423
3281
  type WebhookPatch = {
@@ -1425,13 +3283,23 @@ type WebhookPatch = {
1425
3283
  eventTypes?: Array<WebhookEvent>;
1426
3284
  description?: string | null;
1427
3285
  enabled?: boolean;
3286
+ addressAllowlist?: Array<string>;
3287
+ domainAllowlist?: Array<string>;
1428
3288
  };
1429
3289
 
1430
- type WebhookPayload<T = Record<string, unknown>> = {
3290
+ type WebhookReplayResource = {
3291
+ object: 'webhook_replay';
1431
3292
  id: string;
1432
- type: WebhookEvent | (string & {});
1433
- createdAt: string;
1434
- data: T;
3293
+ endpointId: string;
3294
+ replayOf: string;
3295
+ eventId: string;
3296
+ eventType: WebhookEvent | (string & {});
3297
+ delivery: {
3298
+ status: WebhookDeliveryStatus | (string & {});
3299
+ responseCode: number | null;
3300
+ durationMs: number | null;
3301
+ error: string | null;
3302
+ };
1435
3303
  };
1436
3304
 
1437
3305
  type WebhookTestResource = {
@@ -1445,6 +3313,14 @@ type WebhookTestResource = {
1445
3313
  } | null;
1446
3314
  };
1447
3315
 
3316
+ type WebhookWorkspaceActivityListOptions = WebhookActivityListOptions & {
3317
+ endpointIds?: Array<string>;
3318
+ };
3319
+
3320
+ type WebhookWorkspaceDeliveryListOptions = WebhookDeliveryListOptions & {
3321
+ endpointIds?: Array<string>;
3322
+ };
3323
+
1448
3324
  declare class Transport {
1449
3325
  #private;
1450
3326
  readonly baseUrl: string;
@@ -1515,6 +3391,8 @@ declare const createTempMail: (options?: TempMailOptions) => ReturnType<(transpo
1515
3391
  extend: (inboxId: string, options?: InboxScope) => Promise<TempInboxResource>;
1516
3392
  delete: (inboxId: string, options?: InboxScope) => Promise<DeletedTempInboxResource>;
1517
3393
  listMessages: (inboxId: string, options?: TempMessageListOptions) => Promise<TempMessagesResource>;
3394
+ listAllMessages: (inboxId: string, options?: TempMessageListOptions) => Promise<Array<TempMessageResource>>;
3395
+ iterateMessages: (inboxId: string, options?: TempMessageListOptions) => AsyncGenerator<TempMessageResource, void, undefined>;
1518
3396
  getMessage: (inboxId: string, messageId: string, options?: InboxScope) => Promise<TempMessageDetailResource>;
1519
3397
  deleteMessage: (inboxId: string, messageId: string, options?: InboxScope) => Promise<DeletedTempMessageResource>;
1520
3398
  listAttachments: (inboxId: string, messageId: string, options?: InboxScope) => Promise<Array<AttachmentResource>>;
@@ -1527,5 +3405,5 @@ declare const resolveLanguage: (input: string | null | undefined) => LanguageRes
1527
3405
  declare const languageByCode: (code: string | null | undefined) => LanguageResource | undefined;
1528
3406
  declare const isRtlLanguage: (code: string | null | undefined) => boolean;
1529
3407
 
1530
- export { API_SCOPES, ERROR_TYPES, LANGUAGES, MESSAGE_ENCRYPTION_FORMATS, OpenEmail, OpenEmailApiError, OpenEmailNetworkError, PAGE_LIMITS, RULE_ACTIONS, RULE_FIELDS, RULE_OPERATORS, VERSION, WEBHOOK_EVENTS, WEBHOOK_SIGNATURE_HEADERS, createClient, createOpenEmail, createTempMail, OpenEmail as default, getClient, init, isApiKey, isRtlLanguage, isSealed, languageByCode, openemail, resetClient, resolveLanguage, toBase64, verifyWebhookSignature };
1531
- export type { AddressBookResource, AddressResource, ApiErrorPayload, ApiErrorProps, ApiKeyMode, ApiScope, AttachmentInput, AttachmentResource, BatchItemResource, BatchResultResource, BuiltinRole, CalendarAttendeeResource, CalendarEventResource, CalendarOccurrenceResource, CalendarRangeOptions, ClientOptions, ContactListOptions, ContactResource, CreatedTempInboxResource, CreatedWebhookResource, DeletedDraftResource, DeletedLabelResource, DeletedRoleResource, DeletedRuleResource, DeletedTempInboxResource, DeletedTempMessageResource, DeletedTemplateResource, DeletedWebhookResource, DomainDetailResource, DomainResource, DomainSendingState, DraftInput, DraftListOptions, DraftResource, DraftSummaryResource, EmailClickedData, EmailEventResource, EmailListOptions, EmailOpenedData, EmailRecipientResource, EmailResource, EmailSend, EmailSource, EmailStatus, EmailTrackingSummary, EmailTranslate, EmailTranslationResource, EmailTransport, ErrorType, FetchLike, HitKind, InboxScope, KeyResource, LabelColor, LabelInput, LabelResource, LanguageResource, ListOptions, MemberAccess, MemberAdd, MemberAddressGrant, MemberAddressResource, MemberPatch, MemberResource, MessageEncryption, MessageEncryptionFormat, MessageResource, Page, Permission, PermissionResource, PingResource, RecipientInput, RecipientStatus, RemovedMemberResource, RequestOptions, RequestScope, RoleCreate, RoleDeleteOptions, RolePatch, RoleResource, RuleAction, RuleActionType, RuleCondition, RuleConditionInput, RuleCreate, RuleField, RuleListOptions, RuleOperator, RulePatch, RuleResource, RuleRunListOptions, RuleRunResource, RuleTestInput, RuleTestResource, SavedDraftResource, SavedLabelResource, SendScope, SendTranslateOptions, SendableDomainResource, SentEmailResource, SentTemplateEmailResource, SettingsPatch, SettingsResource, SnoozedThreadResource, TempDomainResource, TempInboxCreate, TempInboxResource, TempMailOptions, TempMessageDetailResource, TempMessageListOptions, TempMessageResource, TempMessagesResource, TemplateContent, TemplateCreate, TemplateDetailResource, TemplateEngine, TemplateListOptions, TemplatePatch, TemplatePreviewInput, TemplatePreviewResource, TemplateProp, TemplateResource, TemplateSend, TemplateSlot, TemplateStatus, TemplateValueKind, TemplateVersionResource, ThreadListOptions, ThreadPatch, ThreadResource, ThreadSummaryResource, TrackingClickResource, TrackingGrain, TrackingHitOptions, TrackingLinkResource, TrackingListOptions, TrackingOpenResource, TrackingRecipientResource, TrackingRequest, TrackingResource, TrackingStatsOptions, TrackingStatsResource, TrackingSummary, TranslateOptions, TranslationResource, TransportOptions, TrashedThreadResource, UpdatedThreadResource, VerifyWebhookProps, WebhookCreate, WebhookDeliveryResource, WebhookEvent, WebhookPatch, WebhookPayload, WebhookResource, WebhookSignatureHeaders, WebhookTestResource };
3408
+ export { API_SCOPES, BROADCAST_STATUSES, CONTACT_BLOCK_LISTS, CONTACT_PHOTO_TYPES, CONTACT_THREAD_SORTS, ERROR_TYPES, FILE_DIRECTIONS, FILE_KINDS, FILE_SORTS, LANGUAGES, MESSAGE_ENCRYPTION_FORMATS, OpenEmail, OpenEmailApiError, OpenEmailNetworkError, PAGE_LIMITS, PEOPLE_SORTS, PROVIDER_IMPORT_DOMAIN_STATES, PROVIDER_IMPORT_RESOURCES, PROVIDER_IMPORT_STATUSES, RULE_ACTIONS, RULE_FIELDS, RULE_OPERATORS, SUPPRESSION_REASONS, THREAD_SORTS, VERSION, WEBHOOK_EVENTS, WEBHOOK_REPLAY_ERROR_CODES, WEBHOOK_SIGNATURE_HEADERS, createClient, createOpenEmail, createTempMail, OpenEmail as default, getClient, init, isApiKey, isRtlLanguage, isSealed, languageByCode, openemail, resetClient, resolveLanguage, toBase64, verifyWebhookSignature };
3409
+ export type { AddressBookPage, AddressBookResource, AddressResource, ApiErrorPayload, ApiErrorProps, ApiKeyActivityListOptions, ApiKeyActivityResource, ApiKeyCreate, ApiKeyEventType, ApiKeyMode, ApiKeyPatch, ApiKeyRequestListOptions, ApiKeyRequestResource, ApiKeyResource, ApiKeyRevoke, ApiKeyStatus, ApiKeyWorkspaceActivityListOptions, ApiKeyWorkspaceRequestListOptions, ApiScope, AttachmentDeliveryMode, AttachmentInput, AttachmentResource, AudienceBatchAddResource, AudienceBatchRemoveResource, AudienceBuiltin, AudienceContactAdd, AudienceContactListOptions, AudienceContactResource, AudienceContactsBatch, AudienceCreate, AudienceGrowthBucket, AudienceGrowthOptions, AudienceGrowthResource, AudienceGrowthSeries, AudienceGrowthTotals, AudienceImport, AudienceImportResource, AudienceImportRow, AudienceListOptions, AudienceMemberResource, AudienceMemberSort, AudiencePatch, AudienceResource, AuditActorKind, AuditActorResource, BatchItemResource, BatchResultResource, BroadcastCounts, BroadcastCreate, BroadcastListOptions, BroadcastPreviewInput, BroadcastPreviewResource, BroadcastResource, BroadcastStatus, BuiltinRole, CalendarAttendeeResource, CalendarEventResource, CalendarOccurrenceResource, CalendarRangeOptions, ClientOptions, ConsolePermission, ContactActivityBucket, ContactActivityOptions, ContactActivityResource, ContactActivityTotals, ContactAudienceResource, ContactAudiencesSet, ContactBatchDeleteResource, ContactBlockList, ContactBlockResource, ContactBlockRule, ContactCreate, ContactDetailResource, ContactListOptions, ContactPatch, ContactPhotoOptions, ContactPhotoType, ContactReplyTime, ContactResource, ContactSave, ContactSource, ContactThreadListOptions, ContactThreadResource, ContactThreadSort, CreatedApiKeyResource, CreatedTempInboxResource, CreatedWebhookResource, DeletedApiKeyResource, DeletedAudienceResource, DeletedContactResource, DeletedDraftResource, DeletedFileResource, DeletedLabelResource, DeletedRoleResource, DeletedRuleResource, DeletedTempInboxResource, DeletedTempMessageResource, DeletedTemplateResource, DeletedTemplateVersionResource, DeletedWebhookResource, DomainDetailResource, DomainPatch, DomainResource, DomainSendingState, DomainStorage, DomainStorageState, DomainTracking, DomainTrackingState, DraftInput, DraftListOptions, DraftResource, DraftSummaryResource, EmailClickedData, EmailDownloadedData, EmailEventResource, EmailListOptions, EmailOpenedData, EmailRecipientResource, EmailResource, EmailSend, EmailSource, EmailStatus, EmailTrackingSummary, EmailTranslate, EmailTranslationResource, EmailTransport, EmptiedAudienceResource, ErrorType, FetchLike, FileDirection, FileKind, FileLinkResource, FileListOptions, FileResource, FileSort, HitKind, ImportChunkResource, ImportCounts, ImportCreate, ImportFailurePage, ImportFailureReason, ImportFailureResource, ImportFailuresOptions, ImportFileDescriptor, ImportFileInfo, ImportFilesInput, ImportFormat, ImportListOptions, ImportOptions, ImportProgress, ImportResource, ImportSource, ImportStatus, ImportUploadResource, InboxScope, InlineAttachmentInput, InvitationResource, KeyResource, LabelColor, LabelColorInput, LabelColorKind, LabelColorResource, LabelInput, LabelPatch, LabelResource, LanguageResource, ListOptions, LogWindow, MemberAccess, MemberAdd, MemberAddressGrant, MemberAddressResource, MemberDomainResource, MemberPatch, MemberResource, MessageEncryption, MessageEncryptionFormat, MessageEncryptionPartRole, MessageResource, Page, PeoplePage, PeopleSort, Permission, PermissionResource, PersonListOptions, PersonResource, PingResource, ProviderImportCount, ProviderImportCreate, ProviderImportDomainState, ProviderImportListOptions, ProviderImportReport, ProviderImportResource, ProviderImportResourceKind, ProviderImportStatus, ProviderInventoryResource, RawBody, RecipientInput, RecipientKind, RecipientStatus, RemovedAudienceContactResource, RemovedMemberResource, RemovedSuppressionResource, RequestOptions, RequestScope, RevokedInvitationResource, RoleCreate, RoleDeleteOptions, RolePatch, RoleResource, RotatedApiKeyResource, RotatedKeyResource, RuleAction, RuleActionType, RuleCondition, RuleConditionInput, RuleCreate, RuleField, RuleListOptions, RuleMatchMode, RuleOperator, RulePatch, RuleResource, RuleRunListOptions, RuleRunResource, RuleTestInput, RuleTestResource, RuleTestWarningCode, SavedDraftResource, SendScope, SendTranslateOptions, SendableDomainResource, SentBroadcastResource, SentEmailResource, SentTemplateEmailResource, SettingsOptions, SettingsPatch, SettingsResource, SnoozedThreadResource, StoredAttachmentInput, SuppressionAdd, SuppressionListOptions, SuppressionReason, SuppressionResource, TempDomainResource, TempInboxCreate, TempInboxResource, TempMailOptions, TempMessageDetailResource, TempMessageListOptions, TempMessageResource, TempMessagesResource, TemplateAnalyticsOptions, TemplateAnalyticsResource, TemplateBlock, TemplateBlockKind, TemplateCategory, TemplateContent, TemplateContentSource, TemplateCreate, TemplateDetailResource, TemplateDocument, TemplateDuplicate, TemplateEngine, TemplateFont, TemplateFontFormat, TemplateFontResource, TemplateFontStyle, TemplateListOptions, TemplatePatch, TemplatePreviewInput, TemplatePreviewResource, TemplatePreviewWarningCode, TemplateProp, TemplateRenderInput, TemplateRenderResource, TemplateResource, TemplateRestoreInput, TemplateRestoredResource, TemplateSend, TemplateSendListOptions, TemplateSendResource, TemplateSendsResource, TemplateSlot, TemplateSort, TemplateStarterDetailResource, TemplateStarterResource, TemplateStatus, TemplateValueKind, TemplateVersionResource, TemplateVersionState, ThreadListOptions, ThreadPatch, ThreadResource, ThreadSort, ThreadSummaryResource, TrackingClickResource, TrackingGrain, TrackingHitOptions, TrackingLinkResource, TrackingListOptions, TrackingOpenResource, TrackingRecipientResource, TrackingRequest, TrackingResource, TrackingStatsOptions, TrackingStatsResource, TrackingSummary, TranslateOptions, TranslationResource, TransportOptions, TrashedThreadResource, UpdatedThreadResource, VerifyWebhookProps, WebhookActivityListOptions, WebhookActivityResource, WebhookChangeType, WebhookCreate, WebhookDeliveryAttempt, WebhookDeliveryDetailResource, WebhookDeliveryListOptions, WebhookDeliveryResource, WebhookDeliveryStatus, WebhookEvent, WebhookPatch, WebhookPayload, WebhookReplayErrorCode, WebhookReplayRefusal, WebhookReplayResource, WebhookResource, WebhookSignatureHeaders, WebhookTestResource, WebhookWorkspaceActivityListOptions, WebhookWorkspaceDeliveryListOptions };